/* Content Desk. Visual language follows emilkowal.ski: Radix "sand" grays,
   Inter (cv01, ss03), hairline shadow rings instead of borders, quiet labels,
   a serif italic accent, and short ease-out motion. */
@font-face { font-family: "Inter"; src: url(/static/inter.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Serif"; src: url(/static/serif-italic.woff2) format("woff2"); font-style: italic; font-weight: 400; font-display: swap; }

:root {
  --gray-100: #fdfdfc; --gray-200: #f9f9f8; --gray-300: #f1f0ef; --gray-400: #e9e9e7; --gray-500: #e2e1de;
  --gray-600: #dad9d6; --gray-700: #cfceca; --gray-800: #bcbbb5; --gray-900: #8d8d86; --gray-1000: #82827c;
  --gray-1100: #63635e; --gray-1200: #21201c;
  --a-200: #00000006; --a-300: #0000000f; --a-400: #00000017; --a-500: #0000001f;
  --ring: 0 0 0 1px rgba(0,0,0,.08);
  --shadow-sm: var(--ring), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: var(--ring), 0 2px 2px rgba(0,0,0,.04), 0 8px 16px -4px rgba(0,0,0,.06);
  --surface: #fff;
  --blue: #0b68cb; --blue-bg: #e6f4fe; --green: #18794e; --green-bg: #e9f9ee;
  --red: #ce2c31; --red-bg: #feebec; --amber: #ab6400; --amber-bg: #fff7c2;
  --ease: cubic-bezier(.23, 1, .32, 1);
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Serif", "Iowan Old Style", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --gray-100: #111110; --gray-200: #191918; --gray-300: #222221; --gray-400: #2a2a28; --gray-500: #31312e;
    --gray-600: #3b3a37; --gray-700: #494844; --gray-800: #62605b; --gray-900: #6f6d66; --gray-1000: #7c7b74;
    --gray-1100: #b5b3ad; --gray-1200: #eeeeec;
    --a-200: #ffffff09; --a-300: #ffffff12; --a-400: #ffffff1b; --a-500: #ffffff22;
    --ring: 0 0 0 1px rgba(255,255,255,.08);
    --shadow-sm: var(--ring), 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: var(--ring), 0 2px 2px rgba(0,0,0,.32), 0 8px 16px -4px rgba(0,0,0,.4);
    --surface: #191918;
    --blue: #70b8ff; --blue-bg: #0d2847; --green: #3dd68c; --green-bg: #132d21;
    --red: #ff9592; --red-bg: #3b1219; --amber: #ffca16; --amber-bg: #302008;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--gray-100); color: var(--gray-1200);
  font: 400 15px/1.6 var(--sans); font-feature-settings: "cv01", "ss03"; font-variation-settings: "opsz" auto;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
main { max-width: 680px; margin: 0 auto; padding: 32px 20px 96px; }
a { color: inherit; text-decoration-color: var(--gray-700); text-underline-offset: 3px; transition: text-decoration-color .15s; }
a:hover { text-decoration-color: currentColor; }
h1 { font-size: 1.25rem; font-weight: 500; letter-spacing: -0.012em; line-height: 1.3; margin: 0; }
h2 { font-size: 1rem; font-weight: 500; margin: 0; }
p { margin: 0; }
b, strong { font-weight: 500; }
.serif { font-family: var(--serif); font-style: italic; font-size: 1.08em; letter-spacing: 0; color: var(--gray-1100); }
.muted { color: var(--gray-1100); }
.label { font-size: .8125rem; font-weight: 400; color: var(--gray-1100); margin: 0 0 10px; }
.hint { font-weight: 400; color: var(--gray-900); margin-left: 4px; }
.footnote { margin-top: 28px; font-size: .8125rem; color: var(--gray-900); }
.i { flex: none; }
::selection { background: var(--gray-1200); color: var(--gray-100); }
:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--gray-100), 0 0 0 4px var(--gray-1000); border-radius: 6px; }

/* nav */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 680px; margin: 0 auto; padding: 14px 20px;
  background: color-mix(in srgb, var(--gray-100) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px);
}
.brand { font-weight: 500; text-decoration: none; white-space: nowrap; }
.brand .serif { font-size: 1em; margin-left: 2px; }
.links { display: flex; align-items: center; gap: 2px; }
.links a:not(.btn) { padding: 5px 10px; border-radius: 8px; text-decoration: none; color: var(--gray-1100); font-size: .875rem; transition: color .15s, background-color .15s; }
.links a:not(.btn):hover { color: var(--gray-1200); background: var(--a-300); }
.links a.on { color: var(--gray-1200); }
.links .btn { margin-left: 8px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border: 0; border-radius: 999px; cursor: pointer;
  font: 500 .875rem/1 var(--sans); font-feature-settings: inherit; text-decoration: none; white-space: nowrap;
  background: var(--gray-1200); color: var(--gray-100);
  box-shadow: 0 0 0 1px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.12);
  transition: transform .16s var(--ease), background-color .15s, box-shadow .15s, opacity .15s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:hover { opacity: .9; }
.btn:active { transform: scale(.97); }
.btn.ghost { background: var(--surface); color: var(--gray-1200); box-shadow: var(--shadow-sm); }
.btn.ghost:hover { opacity: 1; background: var(--gray-200); }
.btn.small { height: 30px; padding: 0 12px; font-size: .8125rem; }
.btn.icon { width: 32px; height: 32px; padding: 0; }
.btn.wide { width: 100%; }
.btn.danger { background: transparent; color: var(--red); box-shadow: none; }
.btn.danger:hover { background: var(--red-bg); opacity: 1; }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn .copied-label { display: none; }

/* intro / headers */
.intro { margin-bottom: 28px; }
.intro h1 + .lede, .intro h1 + p { margin-top: 4px; }
.lede { color: var(--gray-1100); }
.warn-text { color: var(--red); }
.back { display: inline-flex; align-items: center; gap: 4px; margin: -8px 0 20px -4px; padding: 4px 6px; border-radius: 8px; color: var(--gray-1100); text-decoration: none; font-size: .875rem; transition: color .15s, background-color .15s; }
.back:hover { color: var(--gray-1200); background: var(--a-300); }

/* segmented tabs */
.tabs { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 28px; border-radius: 999px; background: var(--a-300); }
.tab { position: relative; padding: 5px 14px; border-radius: 999px; font-size: .8125rem; font-weight: 500; color: var(--gray-1100); text-decoration: none; transition: color .15s, background-color .2s var(--ease), box-shadow .2s var(--ease); }
.tab:hover { color: var(--gray-1200); }
.tab.on { color: var(--gray-1200); background: var(--surface); box-shadow: var(--shadow-sm); }

/* lists */
.day { margin-bottom: 28px; }
.list { display: flex; flex-direction: column; margin: 0 -10px; }
.post-row {
  display: grid; grid-template-columns: 64px 40px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: 12px; text-decoration: none; color: inherit;
  transition: background-color .15s;
}
.post-row:hover { background: var(--a-300); }
.post-row:active { background: var(--a-400); }
.when { font-size: .875rem; color: var(--gray-1100); font-variant-numeric: tabular-nums; white-space: nowrap; }
.thumb { width: 40px; height: 40px; border-radius: 9px; overflow: hidden; display: grid; place-items: center; background: var(--gray-300); color: var(--gray-1000); box-shadow: inset 0 0 0 1px var(--a-300); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.meta { display: flex; flex-direction: column; min-width: 0; }
.meta .title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta .sub { font-size: .8125rem; color: var(--gray-1100); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* status */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: .75rem; font-weight: 500; white-space: nowrap; text-transform: capitalize; background: var(--a-300); color: var(--gray-1100); }
.badge i, .chip i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.ready { background: var(--blue-bg); color: var(--blue); }
.badge.posted { background: var(--green-bg); color: var(--green); }
.badge.overdue { background: var(--red-bg); color: var(--red); }

/* post detail */
.post-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.post-head .label { margin-bottom: 8px; }
.post-head h1 { font-size: 1.5rem; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0 0 32px; padding: 14px 0; border-block: 1px solid var(--gray-400); }
.facts dt { font-size: .8125rem; color: var(--gray-1100); }
.facts dd { margin: 2px 0 0; font-size: .875rem; overflow-wrap: anywhere; }
.block { margin-top: 32px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.block-head .label { margin: 0; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.copyable { padding: 16px 18px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); font-size: .9375rem; line-height: 1.65; }
.note { padding: 12px 16px; border-radius: 12px; background: var(--amber-bg); color: var(--gray-1200); font-size: .875rem; }
.panel { padding: 18px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-md); }
.panel p { font-size: .9375rem; }
.panel form + details, .panel p + form { margin-top: 12px; }
details { margin-top: 12px; }
summary { cursor: pointer; font-size: .875rem; color: var(--gray-1100); width: fit-content; list-style: none; transition: color .15s; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; display: inline-block; width: 1em; transition: transform .2s var(--ease); }
details[open] summary::before { transform: rotate(45deg); }
summary:hover { color: var(--gray-1200); }
details[open] .stack { animation: reveal .25s var(--ease); }
.stack { display: grid; gap: 10px; margin-top: 10px; }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.gallery.small { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.gallery figure { margin: 0; }
.media { display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; border-radius: 12px; background: var(--gray-300); color: var(--gray-1000); box-shadow: inset 0 0 0 1px var(--a-300); }
.media img, .media video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s var(--ease); }
a.media:hover img { transform: scale(1.02); }
.media video { background: #000; object-fit: contain; }
.gallery figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 2px 0; }
.fname { display: flex; flex-direction: column; min-width: 0; font-size: .8125rem; }
.fname, .fname small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fname small { color: var(--gray-900); font-size: .75rem; }
.remove { display: inline-flex; align-items: center; gap: 6px; font-size: .8125rem; color: var(--gray-1100); font-weight: 400; cursor: pointer; }

/* forms */
.form { display: grid; gap: 18px; }
.form label { display: grid; gap: 6px; font-size: .875rem; font-weight: 500; }
.form .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
input, textarea, select {
  width: 100%; padding: 9px 12px; border: 0; border-radius: 10px;
  font: 400 .9375rem/1.5 var(--sans); font-feature-settings: inherit; color: var(--gray-1200);
  background: var(--surface); box-shadow: var(--shadow-sm);
  transition: box-shadow .15s;
}
textarea { resize: vertical; min-height: 44px; }
input::placeholder, textarea::placeholder { color: var(--gray-900); }
input:focus, textarea:focus, select:focus { outline: none; box-shadow: 0 0 0 1px var(--gray-800), 0 0 0 4px var(--a-400); }
input[type=checkbox] { width: 15px; height: 15px; padding: 0; box-shadow: none; accent-color: var(--gray-1200); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; font-size: .875rem; font-weight: 500; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { position: relative; cursor: pointer; }
.form .pill { display: inline-block; }
.pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pill span { display: inline-flex; align-items: center; height: 32px; padding: 0 13px; border-radius: 999px; font-size: .8125rem; font-weight: 500; color: var(--gray-1100); background: var(--surface); box-shadow: var(--shadow-sm); transition: background-color .15s, color .15s, transform .16s var(--ease); }
.pill:hover span { color: var(--gray-1200); }
.pill:active span { transform: scale(.96); }
.pill input:checked + span { background: var(--gray-1200); color: var(--gray-100); box-shadow: none; }
.pill input:focus-visible + span { box-shadow: 0 0 0 2px var(--gray-100), 0 0 0 4px var(--gray-1000); }
.form label.drop {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 18px; cursor: pointer;
  border-radius: 14px; background: var(--gray-200); box-shadow: inset 0 0 0 1px var(--a-400);
  background-image: linear-gradient(var(--gray-200), var(--gray-200)); color: var(--gray-1100); font-weight: 400;
  transition: background-color .15s, box-shadow .15s;
}
.drop:hover, .drop.dragging { box-shadow: inset 0 0 0 1px var(--gray-800); }
.drop .i { width: 22px; height: 22px; }
.drop b { display: block; color: var(--gray-1200); font-weight: 500; }
.drop small { display: block; font-size: .8125rem; }
.drop small.picked { color: var(--gray-1200); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row input { flex: 1 1 220px; width: auto; }
.actions-row { margin-top: 4px; }
.danger-zone { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--gray-400); }
.inline { display: inline; }

/* notices */
.flash { margin: 0 0 24px; padding: 12px 14px; border-radius: 12px; font-size: .875rem; background: var(--a-300); }
.flash.error { background: var(--red-bg); color: var(--red); }
.flash.warn { background: var(--amber-bg); color: var(--gray-1200); }
.flash.note { background: var(--surface); box-shadow: var(--shadow-md); }
.flash code { font: 500 .875rem ui-monospace, "SF Mono", Menlo, monospace; padding: 2px 6px; border-radius: 6px; background: var(--a-300); user-select: all; }
/* Sonner-style toast */
.toast {
  position: fixed; z-index: 50; left: 50%; bottom: 24px;
  display: flex; align-items: center; gap: 8px; width: max-content; max-width: calc(100vw - 32px);
  padding: 12px 16px; border-radius: 12px; font-size: .875rem; font-weight: 500;
  background: var(--surface); color: var(--gray-1200); box-shadow: var(--shadow-md);
  translate: -50% 0;
  animation: toast-in .4s var(--ease) both, toast-out .3s var(--ease) 3.6s forwards;
}
.toast .i { color: var(--green); }
.toast.leaving { animation: toast-out .2s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(100%) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.98); visibility: hidden; } }
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
main > * { animation: rise .45s var(--ease) both; }
main > *:nth-child(2) { animation-delay: 30ms; } main > *:nth-child(3) { animation-delay: 60ms; } main > *:nth-child(n+4) { animation-delay: 90ms; }
.empty-state { padding: 56px 0; text-align: center; color: var(--gray-1100); display: grid; gap: 14px; justify-items: center; }
.empty-state h1 { font-size: 1.125rem; }

/* team */
.people { margin-bottom: 8px; }
.person { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; }
.person.inactive { opacity: .5; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--gray-400); color: var(--gray-1100); font-weight: 500; font-size: .875rem; }
.person-actions { display: flex; gap: 6px; }

/* calendar */
main:has(.cal) { max-width: 1040px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.pager { display: flex; gap: 6px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; overflow: hidden; border-radius: 16px; background: var(--gray-400); box-shadow: var(--ring); }
.dow { padding: 8px 10px; font-size: .75rem; color: var(--gray-1100); background: var(--gray-200); }
.cell { min-height: 112px; padding: 8px; background: var(--surface); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cell.blank { background: var(--gray-200); }
.dnum { width: 24px; height: 24px; display: grid; place-items: center; margin: -2px 0 2px -2px; border-radius: 50%; font-size: .8125rem; color: var(--gray-1100); font-variant-numeric: tabular-nums; }
.today .dnum { background: var(--gray-1200); color: var(--gray-100); font-weight: 500; }
.chip { display: flex; align-items: center; gap: 5px; padding: 2px 6px; border-radius: 6px; font-size: .75rem; line-height: 1.5; text-decoration: none; color: var(--gray-1200); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background-color .15s; }
.chip span { color: var(--gray-1100); font-variant-numeric: tabular-nums; }
.chip:hover { background: var(--a-300); }
.chip.ready i { background: var(--blue); } .chip.posted i { background: var(--green); }
.chip.overdue i { background: var(--red); } .chip.draft i { background: var(--gray-800); }
.chip.posted { color: var(--gray-1100); }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }

/* login */
.login { max-width: 360px; margin: 12vh auto 0; }
.login .lede { margin-top: -10px; }
.mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--gray-1200); color: var(--gray-100); font-family: var(--serif); font-style: italic; font-size: 1.4rem; }

@media (max-width: 640px) {
  main { padding: 20px 16px 80px; }
  .top { padding: 10px 16px; }
  .brand .serif { display: none; }
  .links a:not(.btn) { padding: 5px 7px; }
  .form .grid2 { grid-template-columns: 1fr; }
  .post-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .post-row .when { grid-column: 2; grid-row: 1; font-size: .75rem; }
  .post-row .thumb { grid-row: 1 / 3; grid-column: 1; }
  .post-row .meta { grid-column: 2; }
  .post-row .badge { grid-column: 3; grid-row: 1 / 3; }
  .facts { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: 1fr 1fr; gap: 10px; }
  .person { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .person-actions { grid-column: 2 / -1; }
  .cal { gap: 1px; border-radius: 12px; }
  .cell { min-height: 64px; padding: 4px; }
  .chip { padding: 0; font-size: 0; gap: 0; } .chip i { width: 7px; height: 7px; }
  .cell { flex-direction: row; flex-wrap: wrap; align-content: flex-start; }
  .dnum { width: 100%; justify-content: start; }
  .today .dnum { width: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* fixes */
.lbl { display: block; }
@media (max-width: 640px) {
  .brand { display: none; }
  .top { justify-content: flex-end; }
  .links { width: 100%; justify-content: space-between; }
  .links .btn { margin-left: 4px; }
  .post-row .badge { font-size: 0; gap: 0; padding: 0; width: 22px; justify-content: center; }
  .post-row .badge i { width: 8px; height: 8px; }
}
