/* =========================================================
   Modern Writing Lab: Settings
   Loads on top of site.css and terms.css (top bar, sheets,
   hero, footer). The switches drive js/xmas.js.
   ========================================================= */
.st-title { margin: 0; font-size: clamp(56px, 14vw, 140px); font-weight: 800; letter-spacing: -.055em; line-height: .88; outline: none; }
.st-wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) 60px; display: grid; gap: 22px; }

.st-card {
  display: grid; border: 2px solid var(--ink); border-radius: var(--r-l); background: var(--card);
  box-shadow: 6px 6px 0 var(--ink); overflow: hidden; max-width: 980px;
}
.st-opts { padding: 22px 18px 20px; }
.st-h { margin: 6px 0 14px; font-size: clamp(32px, 6vw, 48px); font-weight: 800; letter-spacing: -.035em; line-height: 1; }
.st-h em { color: var(--tang); }
.st-h-s { font-size: clamp(24px, 4vw, 30px); }
.st-plain { box-shadow: none; background: transparent; }

/* ---------- switches ---------- */
.sw-row { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-top: 1.5px solid var(--hair); transition: opacity .2s; }
.sw-row.off { opacity: .45; }
.sw-text { flex: 1; min-width: 0; }
.sw-name { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.sw-desc { margin: 4px 0 0; font-size: 16px; line-height: 1.45; color: var(--ink-2); max-width: 52ch; }
.sw-desc a { color: var(--ink); text-decoration-color: var(--blue); text-underline-offset: 3px; font-weight: 600; }
.sw {
  position: relative; flex: none; width: 78px; height: 44px; padding: 0; border: 2px solid var(--ink); border-radius: 999px;
  background: var(--paper-2); box-shadow: 3px 3px 0 var(--ink); transition: background-color .2s, transform .18s var(--ease-spring);
}
.sw:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.sw[aria-checked="true"] { background: var(--lime); }
.sw-knob {
  position: absolute; top: 4px; left: 4px; width: 32px; height: 32px; border: 2px solid var(--ink); border-radius: 50%; background: #fff;
  transition: transform .28s var(--ease-spring);
}
.sw[aria-checked="true"] .sw-knob { transform: translateX(34px); }
.sw-state { position: absolute; top: 50%; right: 9px; transform: translateY(-50%); font-family: var(--f-mono); font-size: 11.5px; font-weight: 500; }
.sw[aria-checked="true"] .sw-state { right: auto; left: 10px; }
.sw:disabled { cursor: not-allowed; box-shadow: none; }
.st-note { margin: 10px 0 0; padding: 10px 12px; border: 1.5px solid var(--ink); border-radius: 12px; background: var(--sky); font-size: 15px; line-height: 1.4; max-width: 60ch; }

/* ---------- the snowman who melts when you switch the theme off ---------- */
.st-stage {
  position: relative; order: -1; min-height: 210px; border-bottom: 2px solid var(--ink); overflow: hidden;
  background: linear-gradient(#22324F, #16203A);
}
.st-ground { position: absolute; left: -10%; right: -10%; bottom: -60px; height: 100px; border-radius: 50%; background: #fff; border-top: 2px solid var(--ink); }
.st-man { position: absolute; left: 50%; bottom: 18px; width: 124px; height: 155px; margin-left: -62px; }
.st-man .sm { width: 100%; height: 100%; overflow: visible; display: block; }
.st-man .sm-melt { transform-box: view-box; transform-origin: 50% 96%; transition: transform .9s var(--ease-out), opacity .5s .4s; }
.st-man .sm-left { opacity: 0; transition: opacity .4s .5s; }
.st-man .sm-puddle { transform-box: fill-box; transform-origin: 50% 50%; transform: scale(.2); transition: transform .8s .25s var(--ease-out); }
.st-stage.melted .sm-melt { transform: scale(1.35, .06); opacity: 0; }
.st-stage.melted .sm-left { opacity: 1; }
.st-stage.melted .sm-puddle { transform: none; }
.st-sky { position: absolute; inset: 0; }
.st-flake { position: absolute; top: -10px; border-radius: 50%; background: #fff; opacity: .9; animation: st-fall linear infinite; }
@keyframes st-fall { to { transform: translate(var(--dx), 270px); } }
.st-stage.melted .st-sky { display: none; }
@media (prefers-reduced-motion: reduce) {
  .st-sky { display: none; }
  .st-man .sm-melt, .st-man .sm-left, .st-man .sm-puddle { transition: none; }
}

/* ---------- light or dark ---------- */
.th-row { display: grid; gap: 10px; margin: 4px 0 8px; }
.th-opt {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left;
  padding: 10px 14px 10px 10px; border: 2px solid var(--ink); border-radius: 16px; background: var(--card); color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink); transition: transform .18s var(--ease-spring), background-color .2s;
}
.th-opt:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.th-opt[aria-checked="true"] { background: var(--lime); color: #141414; border-color: #141414; }
.th-name { font-weight: 700; font-size: 17px; }
.th-sub { grid-column: 2; font-size: 14px; color: inherit; opacity: .72; }
.th-sw { grid-row: 1 / 3; position: relative; width: 52px; height: 40px; border: 2px solid #141414; border-radius: 10px; overflow: hidden; }
.th-sw i { position: absolute; left: 7px; height: 5px; border-radius: 3px; }
.th-sw i:first-child { top: 9px; width: 28px; } .th-sw i:last-child { top: 20px; width: 18px; }
.th-sw-light { background: #F3EFE6; } .th-sw-light i { background: #141414; }
.th-sw-dark { background: #171816; } .th-sw-dark i { background: #ECE8DF; }
.th-sw-auto { background: linear-gradient(135deg, #F3EFE6 50%, #171816 50%); } .th-sw-auto i { background: #D7F64A; border: 1px solid #141414; }
@media (min-width: 700px) {
  .th-row { grid-template-columns: repeat(3, 1fr); }
  .th-opt { grid-template-columns: 1fr; grid-template-rows: auto; row-gap: 6px; padding: 12px; }
  .th-sw { grid-row: auto; width: 100%; height: 54px; }
  .th-sub { grid-column: 1; }
}

/* the little window on the right flips with the choice */
.st-look { background: linear-gradient(#BFE3FF, #E7F4FF); transition: background .5s; display: grid; place-items: center; padding: 26px 18px; }
.st-look.dark { background: linear-gradient(#0E1424, #1B2440); }
.lk-sun { position: absolute; right: 22px; top: 18px; width: 34px; height: 34px; border: 2px solid #141414; border-radius: 50%; background: #FFD45C; transition: background .5s, box-shadow .5s; }
.st-look.dark .lk-sun { background: #F3EFE6; box-shadow: inset -9px -3px 0 #C9C5BC; }
.lk-win { position: relative; width: min(220px, 80%); border: 2px solid #141414; border-radius: 14px; background: #F3EFE6; box-shadow: 5px 5px 0 #141414; overflow: hidden; transition: background .4s; }
.lk-bar { display: flex; gap: 5px; padding: 7px 9px; border-bottom: 2px solid #141414; background: #E8E1D2; transition: background .4s; }
.lk-bar i { width: 8px; height: 8px; border: 1.5px solid #141414; border-radius: 50%; background: #fff; }
.lk-body { display: grid; gap: 6px; padding: 12px; }
.lk-h { display: block; height: 12px; width: 80%; border-radius: 4px; background: #141414; transition: background .4s; }
.lk-h2 { width: 55%; margin-bottom: 4px; }
.lk-l { display: block; height: 6px; border-radius: 3px; background: #9C988F; }
.lk-short { width: 60%; }
.lk-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.lk-c { height: 34px; border: 1.5px solid #141414; border-radius: 7px; background: #FBF9F4; transition: background .4s, border-color .4s; }
.lk-lime { background: #D7F64A !important; border-color: #141414 !important; } .lk-sky { background: #A9DBFF !important; border-color: #141414 !important; }
.st-look.dark .lk-win { background: #171816; border-color: #000; }
.st-look.dark .lk-bar { background: #232521; }
.st-look.dark .lk-h { background: #ECE8DF; }
.st-look.dark .lk-l { background: #6E6B64; }
.st-look.dark .lk-c { background: #1F211E; border-color: #ECE8DF; }

.st-reset { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 16px 0 0; }
.st-reset-note { font-family: var(--f-mono); font-size: 13px; color: var(--ink-2); }
.st-fine { font-size: 14px; }

/* ---------- iPad portrait and desktop: options left, snowman right ---------- */
@media (min-width: 700px) {
  .st-card:not(.st-plain):not(.st-changes) { grid-template-columns: 1fr 260px; }
  .st-stage { order: 0; border-bottom: 0; border-left: 2px solid var(--ink); min-height: 100%; }
  .st-man { width: 140px; height: 175px; margin-left: -70px; }
}
@media (min-width: 900px) {
  .st-card:not(.st-plain):not(.st-changes) { grid-template-columns: 1fr 320px; }
  .st-opts { padding: 30px 32px 26px; }
  .st-man { width: 160px; height: 200px; margin-left: -80px; }
}
@media (min-width: 700px) and (max-width: 899px) {
  .st-wrap { gap: 18px; }
  .st-opts { padding: 26px 24px 22px; }
  .st-h { font-size: 40px; }
  .sw-row { gap: 14px; }
}

/* the site update changelog at the top (list markup and styles shared with the first-visit box: js/prefs.js, css/dark.css) */
.st-changes .st-h { margin: 2px 0 14px; }
@media (min-width: 900px) { .st-changes .cl-list { grid-template-columns: 1fr 1fr; } }

/* the Scrooge note when the decorations go off (js/settings.js) */
.scrooge { width: min(460px, calc(100vw - 32px)); padding: 0; border: 2px solid #141414; border-radius: var(--r-l); background: #FBF9F4; color: #141414; box-shadow: 6px 6px 0 #141414; }
.scrooge::backdrop { background: rgba(20, 20, 20, .5); }
.scrooge-in { padding: 30px 24px 22px; background: repeating-linear-gradient(-45deg, #D62A2A 0 10px, #fff 10px 20px) top / 100% 12px no-repeat; }
.scrooge-in .kicker { margin-top: 4px; color: #1C7A3E; }
.scrooge-h { margin: 4px 0 10px; font-size: clamp(32px, 7vw, 42px); font-weight: 800; letter-spacing: -.04em; line-height: 1; color: #B3201F; }
.scrooge-in p:not(.kicker) { margin: 0 0 10px; font-size: 16px; line-height: 1.5; color: #2A2925; }
.scrooge-btns { display: grid; gap: 6px; margin-top: 16px; }
.scrooge-btns .btn { justify-content: center; background: #1C7A3E; color: #fff; }
.scrooge-no { min-height: 44px; border: 0; background: none; color: #514E48; font-size: 14.5px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
html[data-theme="dark"] .scrooge { box-shadow: 0 0 0 2px #3A3D37, 6px 6px 0 #000; --ink: #141414; --paper: #F3EFE6; --card: #FBF9F4; --ink-2: #514E48; }
