/* Palettes come from Stelly's output/themes.py: green by day, purple by night. */
:root {
  color-scheme: light;
  --bg: #effcf5;
  --bg-2: #e2f8ec;
  --card: #ffffff;
  --ink: #10261a;
  --ink-2: #3f5a49;
  --line: rgba(16, 38, 26, 0.12);
  --accent: #1d8f3b;
  --accent-2: #04d05f;
  --accent-ink: #ffffff;
  --shadow: 0 1px 2px rgba(16, 38, 26, 0.06), 0 8px 24px rgba(16, 38, 26, 0.08);

  --screen: #c0f9de;
  --eye: #000000;
  --stroke: #000000;
  --mouth-dark: #1d8f3b;
  --mouth-light: #04d05f;
  --teeth: #ffffff;

  /* Folders in Stelly's screen green by day */
  --folder: #c0f9de;
  --folder-2: #dcfcec;
  --folder-edge: #86dcb2;
  --folder-ink: #10261a;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b110d;
  --bg-2: #111b15;
  --card: #16211a;
  --ink: #ede9fe;
  --ink-2: #b9b2d6;
  --line: rgba(196, 181, 253, 0.16);
  --accent: #8b5cf6;
  --accent-2: #c4b5fd;
  --accent-ink: #0b110d;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);

  --screen: #111b15;
  --eye: #8b5cf6;
  --stroke: #c4b5fd;
  --mouth-dark: #4c1d95;
  --mouth-light: #7c3aed;
  --teeth: #ede9fe;

  /* Purple folders by night */
  --folder: #2e2252;
  --folder-2: #3a2b66;
  --folder-edge: #6249b0;
  --folder-ink: #ede9fe;
}
/* Before the script decides by the clock, follow the system setting. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #0b110d; --bg-2: #111b15; --card: #16211a; --ink: #ede9fe; --ink-2: #b9b2d6;
    --line: rgba(196, 181, 253, 0.16); --accent: #8b5cf6; --accent-2: #c4b5fd; --accent-ink: #0b110d;
    --screen: #111b15; --eye: #8b5cf6; --stroke: #c4b5fd; --mouth-dark: #4c1d95; --mouth-light: #7c3aed; --teeth: #ede9fe;
    --folder: #2e2252; --folder-2: #3a2b66; --folder-edge: #6249b0; --folder-ink: #ede9fe;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.6 "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  transition: background-color 0.4s, color 0.4s;
}
a { color: var(--accent); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.6rem; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; letter-spacing: -0.01em; margin-bottom: 1.6rem; }
h2 { font-size: 1.35rem; font-weight: 800; }
p { margin: 0 0 1rem; }
kbd {
  font: 700 0.85em/1 ui-monospace, Menlo, monospace;
  border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 6px; padding: 2px 6px; background: var(--bg-2);
}
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 20px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--card); padding: 8px 12px; border-radius: 8px; }

/* header */
.top { padding-block: 16px; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font-weight: 800; font-size: 1.25rem; letter-spacing: 0.01em; }
/* Same round icon button as skylerhalll.com: sun by day, moon by night. */
.theme-btn {
  width: 38px; height: 38px; display: grid; place-items: center; padding: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: 99px;
  color: var(--accent); font-size: 1rem; line-height: 1; transition: transform 0.2s;
}
.theme-btn:hover { transform: rotate(20deg); }
#soundBtn:hover { transform: none; }
.top-actions { display: flex; gap: 8px; }
#soundBtn .snd-off, #soundBtn[aria-pressed="false"] .snd-on { display: none; }
#soundBtn[aria-pressed="false"] .snd-off { display: inline; }
#soundBtn[aria-pressed="false"] { color: var(--ink-2); }

/* hero */
.hero { padding-block: 24px 48px; }
.hero-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 32px; align-items: start; }

/* left panel: the quick pitch and the stack */
.pitch { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 24px; box-shadow: var(--shadow); min-width: 0; }
.pitch h2 { font-size: 1.2rem; }
.pitch > p { color: var(--ink-2); }
.pitch h3 { font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin: 1.2rem 0 0.4rem; }
.stack { list-style: none; padding: 0; margin: 0 0 1.2rem; }
.stack li { display: grid; grid-template-columns: 5.6rem 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 0.95rem; }
.stack li:last-child { border-bottom: 1px solid var(--line); }
.stack span { font-weight: 800; color: var(--ink); }
.pitch .note { margin: 0; }
.eyebrow { font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; margin-bottom: 0.8rem; }
.lede { font-size: 1.15rem; color: var(--ink-2); }
.note { font-size: 0.9rem; color: var(--ink-2); border-left: 3px solid var(--accent-2); padding-left: 12px; }

.device {
  background: var(--card); border: 1px solid var(--line); border-radius: 28px;
  padding: 16px; box-shadow: var(--shadow); min-width: 0;
}
.screen {
  position: relative; background: var(--screen); border-radius: 18px;
  aspect-ratio: 16 / 9; overflow: hidden; transition: background-color 0.4s;
}
.face { width: 100%; height: 100%; display: block; }
.eye { fill: var(--eye); transform-box: fill-box; transform-origin: center; transition: transform 0.08s; }
.face.blink .eye { transform: scaleY(0.08); }
.mouth { display: none; }
.smile, .frown { fill: none; stroke: var(--stroke); stroke-width: 15; stroke-linecap: round; stroke-linejoin: round; }
.gulp-dark { fill: var(--mouth-dark); }
.gulp-light { fill: var(--mouth-light); }
.gulp-teeth { fill: var(--teeth); }
.gulp-outline { fill: none; stroke: var(--stroke); stroke-width: 12; }
.face[data-mouth="smile"] .smile,
.face[data-mouth="frown"] .frown,
.face[data-mouth="gulp"] .gulp { display: inline; }
.bob { animation: bob 4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-11px); } }
.face[data-mood="sleepy"] .eye { transform: scaleY(0.45); }
.face[data-mood="sleepy"].blink .eye { transform: scaleY(0.08); }

.mood-chip {
  position: absolute; left: 12px; top: 12px;
  font: 700 0.75rem/1 ui-monospace, Menlo, monospace;
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
  padding: 6px 10px; border-radius: 999px;
}
.mood-chip::before { content: "["; } .mood-chip::after { content: "]"; }

.chat { display: flex; flex-direction: column; gap: 8px; min-height: 132px; max-height: 240px; overflow-y: auto; padding: 14px 4px 10px; }
.chat-empty { color: var(--ink-2); text-align: center; margin: auto 0; font-weight: 600; }
.msg { max-width: 85%; padding: 9px 13px; border-radius: 16px; font-size: 0.95rem; overflow-wrap: anywhere; }
.msg.you { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 5px; }
.msg.stelly { align-self: flex-start; background: var(--bg-2); border-bottom-left-radius: 5px; }
.msg .tag { display: block; font: 700 0.72rem/1.4 ui-monospace, Menlo, monospace; color: var(--accent); margin-bottom: 2px; }
.tool {
  align-self: flex-start; font: 600 0.78rem/1.4 ui-monospace, Menlo, monospace; color: var(--ink-2);
  border: 1px dashed var(--line); border-radius: 999px; padding: 3px 10px;
}
.tool::before { content: "⚙ "; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.chip {
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 13px; font-size: 0.9rem; font-weight: 700; transition: background-color 0.15s, border-color 0.15s;
}
.chip:hover:not(:disabled) { border-color: var(--accent); }
.chip:disabled { opacity: 0.5; cursor: default; }

/* folders: one row of tabs, the open folder's papers show below */
.files { padding-block: 8px 56px; }
.files-hint { color: var(--ink-2); margin-bottom: 0.6rem; }
.cabinet { display: grid; grid-template-columns: repeat(4, auto) 1fr; column-gap: 4px; }
.folder { display: contents; }
.folder-h { grid-row: 1; margin: 0; display: flex; }
.folder-tab {
  position: relative; top: 1px; z-index: 1; width: 100%;
  background: var(--folder); color: var(--folder-ink);
  border: 1px solid var(--folder-edge); border-bottom: 0; border-radius: 12px 12px 0 0;
  padding: 10px 18px 8px; font-size: 1rem; font-weight: 800; text-align: left;
  transition: background-color 0.2s, filter 0.2s;
}
.folder-tab::after { content: " +"; color: var(--accent); }
.folder-tab[aria-expanded="true"]::after { content: " \2212"; }
.folder-tab:hover { filter: brightness(1.04); }
.folder.open .folder-tab { background: var(--folder-2); }
/* The folder's front edge, shown while every folder is closed */
.cabinet::after {
  content: ""; grid-row: 2; grid-column: 1 / -1;
  aspect-ratio: 5 / 2; max-height: 340px;
  box-shadow: var(--shadow);
  background: var(--folder); border: 1px solid var(--folder-edge); border-radius: 0 14px 14px 14px;
}
.cabinet:has(.folder.open)::after { display: none; }
.folder-body {
  grid-row: 2; grid-column: 1 / -1; min-width: 0;
  background: var(--folder-2); color: var(--ink);
  border: 1px solid var(--folder-edge); border-radius: 0 16px 16px 16px;
  padding: 16px 20px 22px; animation: slide 0.25s ease-out;
}
@keyframes slide { from { opacity: 0; transform: translateY(-6px); } }
.folder-body > p { color: var(--folder-ink); font-weight: 600; }
.folder-body .fine { color: var(--folder-ink); opacity: 0.8; margin-top: 14px; }

.pipeline { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: s; }
.pipeline li { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); font-size: 0.95rem; }
.pipeline .step { counter-increment: s; font-weight: 800; color: var(--ink); font-size: 1.05rem; }
.pipeline .step::before { content: counter(s) ". "; color: var(--accent); }

/* feature panels, like papers in a folder */
.panel-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); min-width: 0; }
.panel h4 { font-size: 1.15rem; font-weight: 800; }
.panel > p { color: var(--ink-2); }
.panel-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.btn { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px; padding: 9px 16px; font-weight: 800; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.fine { font-size: 0.8rem; margin: 10px 0 0; }

.memories { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.mem { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); transition: opacity 0.4s; }
.mem.new { animation: pop 0.5s ease-out; }
@keyframes pop { from { transform: scale(0.96); background: var(--accent-2); } }
.mem-text { font-weight: 700; font-size: 0.92rem; }
.mem-meta { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; font-size: 0.78rem; color: var(--ink-2); }
.bar { flex: 1; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; max-width: 140px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width 0.4s; }
.lock { font-size: 0.78rem; font-weight: 800; color: var(--accent); white-space: nowrap; }
.mem-gone { font-size: 0.85rem; color: var(--ink-2); font-style: italic; }

.phone { background: var(--bg-2); border-radius: 22px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.sms { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: start; }
.sms-head { font-size: 0.78rem; color: var(--ink-2); font-weight: 700; }
.sms-bubble { grid-column: 1 / -1; background: var(--card); border: 1px solid var(--line); border-radius: 16px 16px 16px 5px; padding: 9px 12px; font-size: 0.9rem; white-space: pre-line; transition: opacity 0.3s; }
.sms.off .sms-bubble { opacity: 0.35; text-decoration: line-through; }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 800; color: var(--ink-2); background: none; border: 0; padding: 0; }
.switch .knob { width: 30px; height: 18px; border-radius: 99px; background: var(--line); position: relative; transition: background-color 0.2s; }
.switch .knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--card); transition: transform 0.2s; }
.switch[aria-checked="true"] .knob { background: var(--accent); }
.switch[aria-checked="true"] .knob::after { transform: translateX(12px); }

.mood-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.mood-btn { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px; font: 700 0.85rem/1.2 ui-monospace, Menlo, monospace; }
.mood-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.ptt { display: flex; align-items: center; gap: 10px; width: 100%; justify-content: center; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 16px; font-weight: 800; margin-bottom: 1rem; user-select: none; -webkit-user-select: none; touch-action: none; }
.ptt[aria-pressed="true"] { border-color: var(--accent); background: var(--bg-2); }
.mic-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ink-2); opacity: 0.4; }
.ptt[aria-pressed="true"] .mic-dot { background: #e5484d; opacity: 1; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(229, 72, 77, 0.25); } }

/* timeline and plans, each on one sheet of paper */
.changelog, .upcoming { list-style: none; margin: 0.6rem 0 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px 22px 4px; box-shadow: var(--shadow); }
.changelog { padding-left: 30px; }
.changelog li { border-left: 2px solid var(--line); position: relative; padding: 0 0 22px 22px; }
.changelog li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--card); }
.changelog time { font-size: 0.8rem; font-weight: 700; color: var(--ink-2); }
.changelog strong { display: block; font-size: 1.02rem; }
.changelog p { margin: 2px 0 0; color: var(--ink-2); max-width: 64ch; }
.upcoming { counter-reset: u; }
.upcoming li { counter-increment: u; position: relative; padding: 0 0 18px 38px; }
.upcoming li::before {
  content: counter(u); position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  border: 2px dashed var(--accent); color: var(--accent); font-weight: 800; font-size: 0.85rem;
}
.upcoming strong { display: block; font-size: 1.02rem; }
.upcoming p { margin: 2px 0 0; color: var(--ink-2); }

.foot { border-top: 1px solid var(--line); padding-block: 24px; font-size: 0.9rem; color: var(--ink-2); }
.foot p { margin: 0; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 20px; }
  .device { order: -1; }
  .pipeline { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .panel-grid, .pipeline { grid-template-columns: 1fr; }
  .panel { padding: 20px; }
  .device { padding: 12px; border-radius: 22px; }
  .pitch { padding: 20px; }
  .cabinet { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 3px; }
  .folder-tab { font-size: 0.8rem; line-height: 1.25; padding: 8px 8px 7px; border-radius: 10px 10px 0 0; }
  .folder-tab::after, .folder-tab[aria-expanded="true"]::after { content: ""; }
  .folder-body { padding: 12px 12px 16px; border-radius: 0 0 16px 16px; }
  .cabinet::after { border-radius: 0 0 14px 14px; aspect-ratio: 3 / 2; max-height: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
