/* ZID UI — Apple-neutral house style, one brown accent, light only.
   Numbers come from Notes/Design/editing-like-apple.md (HIG type ladder,
   Gray 1-6 ladder, 12-16 frame moves, overshoot under 5%).
   Pair with zid-ui.js and PATTERNS.md. Start pages from one of the three
   skeletons: zid-landing.html, zid-board.html, zid-doc.html. */

/* ---------------------------------------------------------------- tokens */
:root {
  /* type */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, monospace;

  /* backgrounds — one flat neutral, never a gradient */
  --bg: #FFFFFF;
  --bg-grouped: #F2F2F7;
  --surface: #FFFFFF;
  --surface-tint: #F5EBE0;

  /* Apple Gray 1-6, light values */
  --gray1: #8E8E93;
  --gray2: #AEAEB2;
  --gray3: #C7C7CC;
  --gray4: #D1D1D6;
  --gray5: #E5E5EA;
  --gray6: #F2F2F7;

  /* labels and rules */
  --label: #000000;
  --label-body: rgba(60, 60, 67, .82);  /* running prose. AA at every size */
  --label-2: rgba(60, 60, 67, .6);      /* eyebrow, footnote, caption only  */
  --label-3: rgba(60, 60, 67, .45);     /* never running text               */
  --separator: rgba(60, 60, 67, .29);

  /* the one accent */
  --accent: #583101;
  --accent-press: #3F2301;
  --accent-tint: rgba(88, 49, 1, .10);
  --accent-tint-2: rgba(88, 49, 1, .18);
  --on-accent: #FFFFFF;

  /* shape — every rectangle is rounded */
  --r-card: 12px;
  --r-btn: 10px;
  --r-pill: 999px;

  /* 8pt spacing grid */
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 32px;
  --sp-6: 48px;
  --sp-8: 64px;
  --sp-10: 80px;
  --gutter: 16px;
  --container: 1080px;

  /* motion — 250-400ms, position and opacity only */
  --dur-fast: .25s;
  --dur: .30s;
  --dur-slow: .40s;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --stagger: 33ms;
}

/* ----------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  /* explicit light paint — ignore the viewer's theme, there is no dark mode */
  background: var(--bg-grouped);
  color: var(--label);
  font-family: var(--font);
  font-size: 17px;
  line-height: 22px;
  letter-spacing: -.026em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; height: auto; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

code, kbd, .mono { font-family: var(--mono); font-size: 15px; }

/* --------------------------------------------- type ladder (Apple / HIG) */
/* size/leading in px, tracking negative at 17 and positive at 34           */
.t-display {
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.08;
  letter-spacing: -.015em;
  font-weight: 700;
}
.t-large-title { font-size: 34px; line-height: 41px; letter-spacing: .012em; font-weight: 700; }
.t-title1      { font-size: 28px; line-height: 34px; letter-spacing: .004em; font-weight: 700; }
.t-title2      { font-size: 22px; line-height: 28px; letter-spacing: -.004em; font-weight: 600; }
.t-title3      { font-size: 20px; line-height: 25px; letter-spacing: -.012em; font-weight: 600; }
.t-headline    { font-size: 17px; line-height: 22px; letter-spacing: -.026em; font-weight: 600; }
.t-body        { font-size: 17px; line-height: 22px; letter-spacing: -.026em; font-weight: 400; }
.t-callout     { font-size: 16px; line-height: 21px; letter-spacing: -.020em; font-weight: 400; }
.t-subhead     { font-size: 15px; line-height: 20px; letter-spacing: -.010em; font-weight: 400; }
.t-footnote    { font-size: 13px; line-height: 18px; letter-spacing: -.005em; font-weight: 400; }
.t-caption     { font-size: 12px; line-height: 16px; letter-spacing: 0; font-weight: 400; }
.t-caption2    { font-size: 11px; line-height: 13px; letter-spacing: .006em; font-weight: 400; }

h1 { font-size: 34px; line-height: 41px; letter-spacing: .012em; font-weight: 700; }
h2 { font-size: 28px; line-height: 34px; letter-spacing: .004em; font-weight: 700; }
h3 { font-size: 20px; line-height: 25px; letter-spacing: -.012em; font-weight: 600; }
h4 { font-size: 17px; line-height: 22px; letter-spacing: -.026em; font-weight: 600; }

.dim { color: var(--label-body); }
.dim-2 { color: var(--label-2); }
.medium { font-weight: 500; }
.semibold { font-weight: 600; }

/* ---------------------------------------------------------------- layout */
.wrap {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  /* padding-inline, not padding: a shorthand here would wipe the vertical
     rhythm set by .hero / .section, because a class beats an element */
  padding-inline: var(--gutter);
}
.wrap--narrow { max-width: 720px; }

/* vertical rhythm. No rules between sections: space separates them */
.hero    { padding-block: var(--sp-10) var(--sp-8); text-align: center; }
.section { padding-block: var(--sp-8); }
section  { padding-block: var(--sp-8); }

.hero h1 { margin-inline: auto; max-width: 20ch; }
.hero p  { margin-inline: auto; max-width: 56ch; margin-block-start: var(--sp-2); }
.hero .row { justify-content: center; margin-block-start: var(--sp-4); }

.section__head { margin-bottom: var(--sp-4); }
.section__head p { color: var(--label-body); margin-top: var(--sp-1); }

.eyebrow {
  display: inline-block;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-1);
}

.stack   { display: flex; flex-direction: column; gap: var(--sp-2); }
.row     { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.spacer  { flex: 1 1 auto; }
.hr      { height: 1px; background: var(--separator); border: 0; margin-block: var(--sp-3); }

/* prose flow. The stylesheet owns vertical rhythm because a ZID page carries
   no inline style attributes. Put .flow on the container holding the prose */
.flow > * + *            { margin-block-start: var(--sp-2); }
.flow > * + h2           { margin-block-start: var(--sp-4); }
.flow > * + h3           { margin-block-start: var(--sp-3); }
.flow > h2 + *,
.flow > h3 + *           { margin-block-start: var(--sp-1); }
.flow > * + .panel,
.flow > * + .list,
.flow > * + .cards,
.flow > * + .card-stack  { margin-block-start: var(--sp-3); }
.flow > * + .hr,
.flow > .hr + *          { margin-block-start: var(--sp-4); }
.flow > h1 + .t-footnote { margin-block-start: 4px; }

/* ------------------------------------------------------------------- nav */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--separator);
}
.site-nav__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 10px var(--gutter);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.brand-lockup { display: flex; align-items: center; gap: 10px; }
.brand-lockup img { width: 96px; height: auto; }
.brand-lockup .name { font-size: 17px; font-weight: 600; letter-spacing: -.026em; }

.nav-links { display: flex; align-items: center; gap: var(--sp-3); margin-left: auto; }
.nav-links a {
  font-size: 15px;
  line-height: 20px;
  letter-spacing: -.010em;
  color: var(--label-body);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--label); text-decoration: none; }

/* the two badges are flattened PNGs; the wrapper only sizes them */
.logo-stack { position: relative; display: inline-block; line-height: 0; }
.logo-stack__front { display: block; width: 100%; height: auto; }
.logo-stack__shadow { display: none; }
.logo-stack--icon { width: 44px; }          /* favicon / stamp only */
.logo-stack--nav { width: 96px; }           /* the nav lockup */
.logo-stack--sig { width: 140px; }          /* the footer signature */
.logo-stack--wordmark { width: 140px; }     /* alias of --sig */

/* --------------------------------------------------------------- buttons */
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 20px;
  border: 0;
  border-radius: var(--r-btn);
  font-size: 17px;
  line-height: 22px;
  letter-spacing: -.026em;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--accent);
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease),
              opacity var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}
.btn-pill:hover { text-decoration: none; }

/* filled — one per screen, on the thing you want touched */
.btn-pill--solid { background: var(--accent); color: var(--on-accent); }
.btn-pill--solid:hover { background: var(--accent-press); }

/* tinted — the secondary */
.btn-pill--outline { background: var(--accent-tint); color: var(--accent); }
.btn-pill--outline:hover { background: var(--accent-tint-2); }

/* plain — text only */
.btn-pill--text { padding-left: 14px; padding-right: 14px; color: var(--accent); }
.btn-pill--text:hover, .btn-pill--text:focus-visible { background: var(--accent-tint); }

.btn-pill--sm { min-height: 36px; padding: 7px 14px; font-size: 15px; line-height: 20px; letter-spacing: -.010em; }
.btn-pill--round { border-radius: var(--r-pill); }

.btn-pill[disabled] { opacity: .35; pointer-events: none; }
.btn-pill.is-pressed, .btn-pill:active { transform: translateY(1px); }

summary.btn-pill { list-style: none; }
summary.btn-pill::-webkit-details-marker { display: none; }

/* ----------------------------------------------------------- pills/status */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--gray6);
  color: var(--label-2);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
}
.pill--accent { background: var(--accent); color: var(--on-accent); }
.pill--tint   { background: var(--accent-tint); color: var(--accent); }
.pill--count  { background: var(--gray5); color: var(--label-2); }
.pill--due    { background: var(--accent-tint); color: var(--accent); }
.pill--late   { background: var(--accent); color: var(--on-accent); }
.pill--quiet  { background: transparent; color: var(--label-3); box-shadow: inset 0 0 0 1px var(--separator); }
a.pill:hover  { text-decoration: none; background: var(--accent-tint); color: var(--accent); }

/* the active pill in a set */
.pill.is-active, .pill[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }

/* ----------------------------------------------------------------- cards */
.card {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: var(--sp-3);
  box-shadow: 0 0 0 1px var(--separator);
}
.card--tint { background: var(--surface-tint); }
.card h3 { margin-bottom: var(--sp-1); }
.card p { color: var(--label-body); }

.card-top, .card__top {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-1);
  margin-bottom: var(--sp-1);
}

.row + .cards, .row + .card-stack { margin-block-start: var(--sp-3); }

.cards, .card-stack {
  display: grid;
  gap: var(--sp-2);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.card-stack--single { grid-template-columns: 1fr; }

/* figure — a white rounded card around one reference image, with an optional
   caption line below it. For a screenshot, a still or any single image that
   needs to sit inside the house frame rather than bleed to the edge */
.figure {
  margin: 0;
  background: var(--surface);
  border-radius: var(--r-card);
  padding: var(--sp-1);
  box-shadow: 0 0 0 1px var(--separator);
}
.figure img { width: 100%; max-width: 100%; height: auto; border-radius: calc(var(--r-card) - 4px); }
.figure figcaption {
  padding: var(--sp-1) 4px 2px;
  font-size: 13px;
  line-height: 18px;
  letter-spacing: -.005em;
  color: var(--label-2);
}

/* card action row — used by the outreach board, names kept */
.acts {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  flex-wrap: wrap;
  margin-top: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--separator);
}
.acts__left  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acts__right { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.copy-group, .open-group { display: flex; align-items: center; gap: 6px; }

/* card field — a labelled input inside a card */
.field { display: flex; flex-direction: column; gap: 6px; margin-top: var(--sp-2); }
.field__label {
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  color: var(--label-2);
}
.field input, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--separator);
  border-radius: var(--r-btn);
  background: var(--bg);
  font-size: 15px;
  line-height: 20px;
  transition: border-color var(--dur-fast) var(--ease);
}
.field input::placeholder, .field textarea::placeholder { color: var(--label-3); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }

.saved {
  font-size: 12px;
  line-height: 16px;
  color: var(--accent);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.saved.is-on { opacity: 1; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: var(--sp-2);
  font-size: 15px;
  line-height: 20px;
  cursor: pointer;
}
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }

/* ---------------------------------------------------- panels/tables/lists */
.panel {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: 0 0 0 1px var(--separator);
  padding: var(--sp-3);
}
.panel--flush { padding: 0; overflow: hidden; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 20px;
}
table th, table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--separator);
}
table thead th {
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--label-2);
  background: var(--gray6);
}
table tbody tr:last-child td { border-bottom: 0; }
table tbody tr { transition: background-color var(--dur-fast) var(--ease); }
table tbody tr:hover { background: var(--gray6); }

.table--num td:last-child, .table--num th:last-child { text-align: right; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--separator);
}
.list li:last-child { border-bottom: 0; }

/* placeholder — the "nothing here yet" panel */
.placeholder {
  background: var(--gray5);
  border-radius: var(--r-card);
  padding: var(--sp-3);
  color: var(--label-body);
  text-align: center;
}
.placeholder--warn { background: var(--accent-tint); color: var(--accent); }
.placeholder__tag {
  display: inline-block;
  font-size: 11px;
  line-height: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--label-3);
  margin-bottom: 6px;
}
.placeholder p:last-child { margin-bottom: 0; }

/* skeleton bars inside a placeholder */
.skel { height: 10px; border-radius: var(--r-pill); background: var(--gray5); margin: 8px auto; }
.skel--w45 { width: 45%; } .skel--w70 { width: 70%; } .skel--w90 { width: 90%; }
.placeholder .skel { background: var(--gray4); }

/* ---------------------------------------------------------------- ticker */
.ticker {
  overflow: hidden;
  border-top: 1px solid var(--separator);
  border-bottom: 1px solid var(--separator);
  background: var(--bg);
  padding: 10px 0;
}
.ticker__track {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  white-space: nowrap;
  will-change: transform;
  animation: zid-ticker 40s linear infinite;
}
.ticker__group { display: flex; align-items: center; gap: var(--sp-3); }
.ticker__track span {
  font-size: 13px;
  line-height: 18px;
  color: var(--label-2);
}
.ticker__track span::after {
  content: "";
  display: inline-block;
  width: 4px; height: 4px;
  margin-left: var(--sp-3);
  border-radius: 50%;
  background: var(--label-3);
  vertical-align: middle;
}
.ticker__stamp { display: inline-flex; align-items: center; gap: 8px; }
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker--static .ticker__track { animation: none; justify-content: center; flex-wrap: wrap; white-space: normal; }
.ticker--static .ticker__track span::after { display: none; }

@keyframes zid-ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ----------------------------------------------------------------- stamp */
/* signature lockup — the wordmark small, with an optional line beside it.
   The icon is illegible under about 80px, so a signature uses the wordmark */
.stamp {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.stamp img { width: 96px; height: auto; }
.stamp span { font-size: 13px; line-height: 18px; color: var(--label-2); }

/* ---------------------------------------------------------------- footer */
footer { border-top: 1px solid var(--separator); padding-block: var(--sp-6); background: var(--bg); }
.footer-sig { margin-bottom: var(--sp-3); }
.footer-grid {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.footer-col h4 { margin-bottom: var(--sp-1); }
.footer-col ul { display: flex; flex-direction: column; gap: 6px; }
.footer-col a { font-size: 15px; line-height: 20px; color: var(--label-body); }
.footer-col a:hover { color: var(--accent); }
.footer-note { margin-top: var(--sp-4); color: var(--label-2); font-size: 13px; line-height: 18px; }

/* ---------------------------------------------------------------- motion */
/* position and opacity only, 12-16 frames, overshoot under 5% */
.rise {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}
.rise.is-in { opacity: 1; transform: none; }
.rise--1 { transition-delay: calc(var(--stagger) * 1); }
.rise--2 { transition-delay: calc(var(--stagger) * 2); }
.rise--3 { transition-delay: calc(var(--stagger) * 3); }
.rise--4 { transition-delay: calc(var(--stagger) * 4); }

/* click feedback — a dot that fades where the pointer landed */
.click-stamp {
  position: fixed;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .45;
  pointer-events: none;
  z-index: 9999;
  animation: zid-stamp var(--dur-slow) var(--ease) forwards;
}
@keyframes zid-stamp {
  from { opacity: .45; transform: translateY(0); }
  to   { opacity: 0;   transform: translateY(-14px); }
}

/* action feedback — a label swap on a button */
.is-flashing { opacity: .7; }

.tap-44 { min-width: 44px; min-height: 44px; }
.selectable { -webkit-user-select: text; user-select: text; }

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 12px);
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: var(--label);
  color: #FFFFFF;
  font-size: 15px;
  line-height: 20px;
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .rise { opacity: 1; transform: none; transition: none; }
  .ticker__track { animation: none; }
  .click-stamp { display: none; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ----------------------------------------------------------------- phone */
@media (max-width: 520px) {
  :root { --sp-8: 48px; --sp-10: 56px; }
  .t-display { font-size: 34px; line-height: 1.12; }
  .logo-stack--nav, .brand-lockup img { width: 84px; }
  h1, .t-large-title { font-size: 28px; line-height: 34px; letter-spacing: .004em; }
  h2, .t-title1 { font-size: 22px; line-height: 28px; letter-spacing: -.004em; }
  .brand-lockup .name { display: none; }
  .nav-links { gap: var(--sp-2); }
  .nav-links a { font-size: 15px; line-height: 20px; }
  .cards, .card-stack { grid-template-columns: 1fr; }
  .acts__right { margin-left: 0; }
  table th, table td { padding: 10px 12px; }
}

/* ------------------------------------------------- zidery.com additions */
/* Video card. A .card wrapper around one <video>, sized by the file's own
   aspect ratio so a vertical edit stays vertical. Used on work.html. */
.vid-card { padding: 0; overflow: hidden; }
.vid-card video {
  display: block;
  width: 100%;
  height: auto;
  background: var(--gray6);
  border-radius: 12px 12px 0 0;
}
.vid-card__body { padding: 16px; }
/* auto-fill, not auto-fit: a lone vertical cut keeps its column width
   instead of stretching to the page and growing taller than the screen. */
.cards:has(> .vid-card) { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* Todo row. A checkbox line that can be struck through and removed.
   Used on today.html. */
.todo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--separator);
}
.todo-row:last-child { border-bottom: 0; }
.todo-row label {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-height: 24px;
  cursor: pointer;
}
.todo-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex: none;
}
.todo-row.is-done span { text-decoration: line-through; opacity: .45; }
.todo-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.todo-form .field { flex: 1 1 240px; margin: 0; }
.todo-form { margin-block-end: var(--sp-3); }
.todo-form ~ .panel,
.todo-form ~ .placeholder { margin-block-end: var(--sp-3); }
