/* Greg Notes. A reporter's notebook: warm paper, deep ink, one red recording light. */

@font-face {
  font-family: "Fraunces";
  src: url("/static/fonts/fraunces-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/static/fonts/instrument-sans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --paper: oklch(97.4% 0.011 84);
  --paper-2: oklch(94.6% 0.015 82);
  --paper-3: oklch(91.5% 0.018 80);
  --rule: oklch(87.5% 0.017 80);
  --ink: oklch(24.5% 0.018 62);
  --ink-2: oklch(41% 0.02 62);
  --ink-3: oklch(52% 0.018 64);
  --rec: oklch(56.5% 0.2 27);
  --rec-ink: oklch(46% 0.17 27);
  --rec-wash: oklch(94% 0.035 30);
  --ok: oklch(52% 0.1 150);
  --mark: oklch(91% 0.1 95);
  --focus: oklch(55% 0.14 245);
  --spk-l: 47%;
  --spk-c: 0.12;
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(1rem, 0.6rem + 2vw, 2.5rem);
  --shadow: 0 1px 0 oklch(80% 0.02 80 / 0.6), 0 8px 24px -12px oklch(30% 0.03 60 / 0.25);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: oklch(19.5% 0.01 70);
    --paper-2: oklch(23% 0.012 70);
    --paper-3: oklch(27% 0.013 70);
    --rule: oklch(33% 0.012 70);
    --ink: oklch(93% 0.012 84);
    --ink-2: oklch(79% 0.014 80);
    --ink-3: oklch(66% 0.014 78);
    --rec: oklch(66% 0.19 28);
    --rec-ink: oklch(74% 0.15 30);
    --rec-wash: oklch(28% 0.05 30);
    --mark: oklch(45% 0.09 95);
    --spk-l: 77%;
    --spk-c: 0.1;
    --shadow: 0 1px 0 oklch(0% 0 0 / 0.4), 0 10px 30px -14px oklch(0% 0 0 / 0.7);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--body);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; text-decoration-color: var(--ink-3); }
a:hover { text-decoration-color: var(--rec); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
mark { background: var(--mark); color: inherit; padding: 0 0.12em; border-radius: 2px; }
.tnum { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------------------------------------------------------------- top bar */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: clamp(0.75rem, 2vw, 2rem);
  padding: 0.7rem var(--gutter);
  background: color-mix(in oklch, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.mark { display: flex; align-items: center; gap: 0.55rem; text-decoration: none; font: 600 1.15rem/1 var(--display); letter-spacing: -0.01em; white-space: nowrap; }
.dot { width: 0.62rem; height: 0.62rem; border-radius: 50%; background: var(--rec); box-shadow: 0 0 0 3px var(--rec-wash); flex: none; }
.dot.live { animation: pulse 1.6s var(--ease) infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px transparent; } }
.search { flex: 1; max-width: 34rem; position: relative; }
.search input {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  padding: 0.55rem 0.9rem 0.55rem 2.3rem; border-radius: 999px;
  border: 1px solid var(--rule); background: var(--paper-2);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.search input:focus { outline: none; border-color: var(--ink-3); background: var(--paper); }
.search svg { position: absolute; left: 0.85rem; top: 50%; translate: 0 -50%; width: 1rem; color: var(--ink-3); }
.nav { display: flex; gap: 1.1rem; font-size: 0.95rem; }
.nav a { text-decoration: none; color: var(--ink-2); white-space: nowrap; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); }

main { padding: clamp(1.25rem, 3vw, 2.75rem) var(--gutter) 6rem; max-width: 78rem; margin: 0 auto; }

.toast {
  margin: 0 0 1.5rem; padding: 0.7rem 1rem; border-radius: 10px;
  background: var(--paper-2); border: 1px solid var(--rule); font-size: 0.97rem;
  animation: rise 0.35s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.45rem; min-height: 2.6rem;
  padding: 0 1rem; border-radius: 999px; border: 1px solid var(--rule);
  background: var(--paper); color: var(--ink); font: 500 0.95rem/1 var(--body);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.15s var(--ease);
}
.btn:hover { background: var(--paper-2); border-color: var(--ink-3); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.primary:hover { background: color-mix(in oklch, var(--ink) 88%, var(--rec)); }
.btn.rec { background: var(--rec); color: oklch(99% 0.005 84); border-color: var(--rec); }
.btn.quiet { border-color: transparent; color: var(--ink-2); }
.btn.quiet:hover { color: var(--ink); background: var(--paper-2); }
.btn.danger:hover { color: var(--rec-ink); border-color: var(--rec); }
.btn svg { width: 1rem; height: 1rem; }

/* ---------------------------------------------------------------- home */
.home { display: grid; gap: clamp(2rem, 4vw, 3.5rem); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 64rem) { .home { grid-template-columns: minmax(0, 1fr) 21rem; align-items: start; } }

.eyebrow { font: 600 0.74rem/1 var(--body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.headline { font: 500 clamp(2rem, 1.3rem + 2.6vw, 3.1rem)/1.05 var(--display); letter-spacing: -0.025em; margin: 0.4rem 0 0; font-variation-settings: "opsz" 120, "SOFT" 30; }
.headline em { font-style: italic; color: var(--rec-ink); }
.lede { color: var(--ink-2); margin: 0.7rem 0 2.2rem; max-width: 40rem; }

.day { margin: 2.2rem 0 0.2rem; display: flex; align-items: baseline; gap: 0.8rem; }
.day::after { content: ""; flex: 1; border-top: 1px solid var(--rule); translate: 0 -0.25em; }
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid; grid-template-columns: 4.6rem minmax(0, 1fr) auto; gap: 0.25rem 1rem;
  padding: 0.85rem 0.6rem; margin: 0 -0.6rem; border-radius: 10px; text-decoration: none;
  transition: background 0.18s var(--ease);
  animation: rise 0.4s var(--ease) both; animation-delay: calc(var(--i, 0) * 22ms);
}
.row:hover { background: var(--paper-2); }
.row .t { color: var(--ink-3); font-size: 0.9rem; padding-top: 0.2rem; }
.row .title { font: 500 1.16rem/1.3 var(--display); letter-spacing: -0.01em; font-variation-settings: "opsz" 36; }
.row .who { color: var(--ink-2); font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; grid-column: 2; }
.row .snip { grid-column: 2 / -1; color: var(--ink-2); font-size: 0.93rem; line-height: 1.5; }
.row .len { color: var(--ink-3); font-size: 0.88rem; text-align: right; padding-top: 0.2rem; }
.tag { display: inline-block; font: 600 0.66rem/1 var(--body); letter-spacing: 0.1em; text-transform: uppercase; padding: 0.28rem 0.45rem; border-radius: 4px; border: 1px solid var(--rule); color: var(--ink-3); vertical-align: 0.2em; margin-left: 0.4rem; }
.tag.bot, .tag.upload { color: var(--rec-ink); border-color: color-mix(in oklch, var(--rec) 40%, var(--rule)); }
@media (max-width: 34rem) {
  .row { grid-template-columns: minmax(0, 1fr) auto; }
  .row .t { grid-column: 1 / -1; padding: 0; font-size: 0.82rem; }
  .row .who, .row .snip { grid-column: 1 / -1; }
}

.side { display: grid; gap: 2rem; }
@media (min-width: 64rem) { .side { position: sticky; top: 5rem; } }
.panel { border-top: 2px solid var(--ink); padding-top: 0.9rem; }
.panel h2 { font: 600 0.74rem/1 var(--body); letter-spacing: 0.14em; text-transform: uppercase; margin: 0 0 0.9rem; color: var(--ink); display: flex; justify-content: space-between; }
.joinform { display: flex; gap: 0.5rem; }
.joinform input, .field input, .field textarea, .field select {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: var(--paper);
  border: 1px solid var(--rule); border-radius: 10px; padding: 0.6rem 0.75rem;
}
.joinform input:focus, .field input:focus, .field textarea:focus { outline: none; border-color: var(--ink-3); }
.hint { color: var(--ink-3); font-size: 0.86rem; margin: 0.5rem 0 0; }
.up { list-style: none; margin: 0; padding: 0; }
.up li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.15rem 0.75rem; padding: 0.65rem 0; border-bottom: 1px solid var(--rule); }
.up .ti { font-weight: 500; }
.up .at { color: var(--ink-3); font-size: 0.86rem; grid-column: 1; }
.up form { grid-row: 1 / 3; grid-column: 2; align-self: center; }
.switch { appearance: none; width: 2.6rem; height: 1.5rem; border-radius: 999px; background: var(--paper-3); position: relative; cursor: pointer; border: 0; transition: background 0.2s var(--ease); }
.switch::after { content: ""; position: absolute; top: 0.2rem; left: 0.2rem; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--paper); box-shadow: 0 1px 2px oklch(0% 0 0 / 0.25); transition: transform 0.22s var(--ease); }
.switch[aria-pressed="true"] { background: var(--rec); }
.switch[aria-pressed="true"]::after { transform: translateX(1.1rem); }
.working li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--rule); font-size: 0.95rem; }
.state { font: 600 0.7rem/1 var(--body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--rec-ink); white-space: nowrap; }
.state.failed { color: var(--rec); }
.empty { color: var(--ink-2); padding: 2rem 0; max-width: 32rem; }
.pager { display: flex; gap: 0.6rem; margin-top: 2rem; }

/* ---------------------------------------------------------------- meeting */
.mhead { max-width: 52rem; }
.mtitle { font: 500 clamp(1.9rem, 1.2rem + 2.6vw, 3rem)/1.06 var(--display); letter-spacing: -0.025em; margin: 0.5rem 0 0.6rem; font-variation-settings: "opsz" 120, "SOFT" 30; }
.mtitle-edit summary { list-style: none; cursor: text; }
.mtitle-edit summary::-webkit-details-marker { display: none; }
.mtitle-edit[open] summary { display: none; }
.meta { color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; font-size: 0.97rem; }
.people { margin: 0.6rem 0 0; color: var(--ink-2); font-size: 0.97rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.4rem 0 0; }

.mgrid { display: grid; gap: clamp(2rem, 4vw, 4rem); margin-top: clamp(1.75rem, 3vw, 2.75rem); }
@media (min-width: 66rem) {
  .mgrid { grid-template-columns: minmax(0, 25rem) minmax(0, 1fr); align-items: start; }
  .msum { position: sticky; top: 4.6rem; max-height: calc(100dvh - 5.5rem); overflow: auto; padding-right: 0.75rem; scrollbar-width: thin; }
}
.msum h2, .tx h2 { font: 600 0.74rem/1 var(--body); letter-spacing: 0.14em; text-transform: uppercase; margin: 0 0 0.9rem; padding-top: 0.9rem; border-top: 2px solid var(--ink); display: flex; justify-content: space-between; align-items: baseline; }
.msum section + section { margin-top: 2rem; }
.prose { font-size: 1rem; line-height: 1.6; }
.prose p { margin: 0 0 0.8rem; }
.prose h3 { font: 600 1.02rem/1.3 var(--display); margin: 1.3rem 0 0.4rem; font-variation-settings: "opsz" 24; }
.prose ul { margin: 0 0 0.6rem; padding-left: 1.1rem; }
.prose li { margin: 0.28rem 0; }
.prose li::marker { color: var(--ink-3); }
.todo { list-style: none; padding: 0; margin: 0; }
.todo li { padding: 0.55rem 0; border-bottom: 1px solid var(--rule); line-height: 1.45; }
.todo b { font-weight: 600; }
.mynotes textarea { min-height: 7rem; resize: vertical; line-height: 1.5; }

.speakers { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0 0 1.4rem; }
.speakers details { position: relative; }
.speakers summary { list-style: none; cursor: pointer; }
.speakers summary::-webkit-details-marker { display: none; }
.chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.7rem; border-radius: 999px; font-size: 0.88rem; font-weight: 500; color: oklch(var(--spk-l) var(--spk-c) var(--h)); background: color-mix(in oklch, oklch(var(--spk-l) var(--spk-c) var(--h)) 10%, var(--paper)); border: 1px solid color-mix(in oklch, oklch(var(--spk-l) var(--spk-c) var(--h)) 28%, var(--paper)); }
.chip small { color: var(--ink-3); font-weight: 400; }
.rename { position: absolute; z-index: 5; top: calc(100% + 0.4rem); left: 0; width: 17rem; padding: 0.8rem; border-radius: 12px; background: var(--paper); border: 1px solid var(--rule); box-shadow: var(--shadow); display: grid; gap: 0.5rem; animation: rise 0.2s var(--ease) both; }
.rename input { font: inherit; font-size: 1rem; padding: 0.5rem 0.65rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); color: var(--ink); }

.lines { display: grid; gap: 0; }
.line { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr); gap: 0 1rem; padding: 0.7rem 0; border-bottom: 1px dashed color-mix(in oklch, var(--rule) 80%, transparent); scroll-margin-top: 6rem; }
.line:target, .line.playing { background: linear-gradient(90deg, var(--rec-wash), transparent 70%); border-radius: 6px; }
.ts { align-self: start; font-size: 0.82rem; color: var(--ink-3); padding-top: 0.22rem; background: none; border: 0; text-align: left; cursor: pointer; font-family: var(--body); font-variant-numeric: tabular-nums; }
.ts:hover { color: var(--rec-ink); }
.who-l { font-weight: 600; font-size: 0.92rem; color: oklch(var(--spk-l) var(--spk-c) var(--h)); margin-bottom: 0.1rem; }
.said { font-size: 1.03rem; line-height: 1.62; max-width: 46rem; }
@media (max-width: 34rem) { .line { grid-template-columns: minmax(0, 1fr); } .ts { order: 2; padding: 0.2rem 0 0; } }

.player {
  position: fixed; left: 50%; bottom: max(0.9rem, env(safe-area-inset-bottom)); translate: -50% 0; z-index: 30;
  width: min(44rem, calc(100% - 1.5rem)); display: flex; align-items: center; gap: 0.6rem;
  padding: 0.45rem 0.5rem 0.45rem 0.9rem; border-radius: 999px;
  background: color-mix(in oklch, var(--paper) 92%, transparent); border: 1px solid var(--rule); box-shadow: var(--shadow);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.player audio { flex: 1; height: 2.2rem; min-width: 0; }
.speed { font: 600 0.8rem/1 var(--body); border: 1px solid var(--rule); background: var(--paper); color: var(--ink); border-radius: 999px; padding: 0.45rem 0.6rem; cursor: pointer; font-variant-numeric: tabular-nums; }

.banner { display: flex; gap: 0.8rem; align-items: center; padding: 0.9rem 1.1rem; border-radius: 12px; background: var(--rec-wash); color: var(--ink); margin-top: 1.5rem; }
.banner.failed { outline: 1px solid var(--rec); }

/* ---------------------------------------------------------------- forms (send, upload, login) */
.narrow { max-width: 44rem; }
.field { display: grid; gap: 0.4rem; margin: 0 0 1.25rem; }
.field > span { font-weight: 600; font-size: 0.93rem; }
.checks { display: grid; gap: 0.15rem; }
.check { display: flex; align-items: center; gap: 0.65rem; min-height: 2.6rem; padding: 0 0.2rem; border-bottom: 1px solid var(--rule); cursor: pointer; }
.check input { width: 1.15rem; height: 1.15rem; accent-color: var(--rec); flex: none; }
.preview { border: 1px solid var(--rule); border-radius: 12px; padding: 1rem 1.2rem; background: var(--paper-2); max-height: 22rem; overflow: auto; font-size: 0.95rem; }
.row-btns { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.5rem; }
.warn { color: var(--rec-ink); }

.drop {
  display: grid; place-items: center; text-align: center; gap: 0.6rem; min-height: 15rem; padding: 2rem;
  border: 1.5px dashed var(--ink-3); border-radius: 18px; background: var(--paper-2); cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.drop.over { background: var(--rec-wash); border-color: var(--rec); transform: scale(1.01); }
.drop strong { font: 500 1.5rem/1.2 var(--display); }
.bar { height: 0.45rem; border-radius: 999px; background: var(--paper-3); overflow: hidden; margin-top: 1rem; }
.bar i { display: block; height: 100%; width: 0; background: var(--rec); transition: width 0.3s var(--ease); }

.login { min-height: 100dvh; display: grid; place-items: center; padding: var(--gutter); }
.login form { width: min(23rem, 100%); }
.login .mark { font-size: 1.6rem; margin-bottom: 2rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
