/* Quiet ink — Gavin McMahon personal site (c_zgu14f)
   Light + dark (dark default), Motion 1 + Motion 3, reduced-motion honored.
   Tokens per /workspace/pm/briefs/gavin-personal-site/gd/notes.md */

/* ---------- Theme tokens ---------- */
:root {
  --font-display: "Instrument Serif", "Newsreader", Georgia, serif;
  --font-body: "Instrument Sans", "Inter", system-ui, sans-serif;
  --accent-deep: #2F5D50; /* brand constant, both modes */
  --ex-bg: #F3E6CF;
  --ex: #9A6B2F;
  --muted: #8A847A;
  --rule-strong: #1C1B19;
  --outer: #E5E0D6;
  --accent-border: rgba(47, 93, 80, 0.45);
  --accent-glow: rgba(47, 93, 80, 0.35);
  --embed-bg: rgba(47, 93, 80, 0.06);
}
:root, :root[data-theme="light"] {
  --paper: #F6F3EE;
  --ink: #1C1B19;
  --ink-soft: #5C5852;
  --accent: #2F5D50;
  --rule: #D9D3C8;
  --card: #FFFCF7;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #141311;
  --ink: #EDE9E2;
  --ink-soft: #A39E94;
  --accent: #4A8F7A;
  --rule: #2C2A26;
  --card: #1C1A17;
  --outer: #0A0908;
  --ex-bg: #2A2418;
  --ex: #C4A46A;
  --muted: #6E6960;
  --rule-strong: #EDE9E2;
  --accent-border: rgba(74, 143, 122, 0.45);
  --accent-glow: rgba(74, 143, 122, 0.35);
  --embed-bg: rgba(74, 143, 122, 0.06);
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--outer); }
body {
  font-family: var(--font-body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  background: var(--outer);
}
.stage {
  max-width: 1440px;
  min-height: 100svh;
  margin: 0 auto;
  background: var(--paper);
  position: relative;
}
.frame { padding: 96px 160px 80px; }
.stage.private .frame { padding: 88px 120px 72px; }

/* ---------- Top bar ---------- */
.topbar {
  position: absolute; top: 18px; left: 28px; right: 28px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; z-index: 3;
}
.label-bar {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-soft); opacity: 0.75;
}
.topbar-right { display: flex; align-items: center; gap: 14px; }
.lock {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-border);
  padding: 5px 12px; border-radius: 999px;
  white-space: nowrap;
}
.lock-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}
.theme-toggle {
  font-family: var(--font-body);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent-border);
  padding: 6px 12px; border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.theme-toggle:hover { background: var(--embed-bg); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Header ---------- */
header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 120px;
  padding-bottom: 28px;
  position: relative;
}
.stage.private header { align-items: end; margin-bottom: 40px; }
/* Motion 1 — rules are real elements so scaleX doesn't rasterize borders */
header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--rule);
  transform-origin: left center;
  animation: ink-draw 1.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.stage.private header::after { background: var(--ink); }
.mark {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 400; letter-spacing: -0.01em;
}
.mark a { color: inherit; text-decoration: none; }
.nav-hint { font-size: 13px; color: var(--ink-soft); letter-spacing: 0.04em; }
.eyebrow {
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px;
}
h1 {
  font-family: var(--font-display);
  font-size: 84px; font-weight: 400; line-height: 0.95;
  letter-spacing: -0.03em; margin-bottom: 36px;
  max-width: 720px;
}
.stage.private h1 { font-size: 48px; letter-spacing: -0.02em; margin-bottom: 0; }
.who {
  text-align: right; font-size: 14px; color: var(--ink-soft); line-height: 1.5;
}
.who strong { color: var(--ink); font-weight: 500; }
.who .inplace-word { font-style: normal; color: var(--ink); }

/* ---------- Public ---------- */
.about {
  font-size: 20px; line-height: 1.55; color: var(--ink-soft);
  max-width: 560px; margin-bottom: 64px;
}
.about em { color: var(--ink); font-style: normal; }
.links {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--rule-strong);
  max-width: 720px;
  position: relative;
}
.links::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px;
  height: 1px; background: var(--rule-strong);
  transform-origin: left center;
  animation: ink-draw 1.4s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}
.link {
  position: relative;
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 16px;
  padding: 22px 0;
  text-decoration: none; color: inherit;
}
.link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--rule);
  transform-origin: left center;
  animation: ink-draw 1.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.link:nth-child(1)::after { animation-delay: 0.55s; }
.link:nth-child(2)::after { animation-delay: 0.85s; }
.link-name {
  font-family: var(--font-display);
  font-size: 28px; letter-spacing: -0.02em;
}
.link-meta {
  font-size: 13px; color: var(--ink-soft); letter-spacing: 0.06em;
  text-transform: uppercase;
}
.link .arrow {
  color: var(--accent); font-size: 22px; margin-left: 24px;
  display: inline-block;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Motion 3 — ink soak */
.soak {
  position: absolute; left: 0; bottom: -1px; height: 2px;
  width: 0%; background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.link:hover .soak, .link:focus-visible .soak { width: 100%; }
.link:hover .arrow, .link:focus-visible .arrow { transform: translateX(6px); }
.link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
footer {
  margin-top: 100px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 12px; color: var(--ink-soft); letter-spacing: 0.04em;
}

/* ---------- Private dashboard ---------- */
.note {
  font-size: 14px; color: var(--ink-soft); margin-bottom: 32px; max-width: 760px;
  line-height: 1.55;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 28px 32px 30px;
  min-height: 240px;
  display: flex; flex-direction: column;
  position: relative;
}
.card-top {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; margin-bottom: 18px;
}
.card-title {
  font-family: var(--font-display);
  font-size: 26px; letter-spacing: -0.01em;
}
.card-tag {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); white-space: nowrap;
}
.card-body {
  font-size: 15px; color: var(--ink-soft); line-height: 1.55; flex: 1;
}
.card-body ul { list-style: none; }
.card-body li {
  padding: 9px 0; border-bottom: 1px solid var(--rule);
  display: flex; justify-content: space-between; gap: 16px;
}
.card-body li:last-child { border-bottom: none; }
.muted { color: var(--muted); font-size: 13px; white-space: nowrap; }
.ex {
  display: inline-block; font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ex); background: var(--ex-bg);
  padding: 2px 7px; border-radius: 2px; margin-right: 6px;
}
.cta {
  margin-top: 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.inplace {
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-soft); border: 1px solid var(--rule);
  padding: 3px 8px; border-radius: 2px;
  white-space: nowrap;
}
.card-open {
  position: relative;
  font-family: var(--font-body);
  font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); background: none; border: none; cursor: pointer;
  padding: 4px 0 6px;
  display: inline-flex; align-items: center; gap: 8px;
}
.card-open .arrow {
  display: inline-block;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.card-open .soak { bottom: 0; }
.card-open:hover .soak, .card-open:focus-visible .soak { width: 100%; }
.card-open:hover .arrow, .card-open:focus-visible .arrow { transform: translateX(6px); }
.card-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.embed-cue {
  margin-top: 14px; padding: 14px 16px;
  border: 1px dashed var(--accent-border);
  background: var(--embed-bg);
  font-size: 12px; color: var(--ink-soft); line-height: 1.45;
}
.embed-cue strong { color: var(--accent); font-weight: 500; letter-spacing: 0.04em; }
.links-row {
  display: flex; gap: 28px; flex-wrap: wrap; margin-top: 8px;
}
.links-row a {
  color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--accent);
  padding-bottom: 2px; font-size: 15px;
}
.links-row a:hover { color: var(--accent); }
.card .links-note { margin-top: 22px; font-size: 13px; color: var(--muted); }

/* Expanded in-place panel */
.card[hidden], .panel[hidden] { display: none; }
.panel {
  grid-column: 1 / -1;
  scroll-margin-top: 16px;
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 28px 32px 30px;
}
.panel-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 18px; padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}
.panel-title {
  font-family: var(--font-display);
  font-size: 30px; letter-spacing: -0.01em;
}
.panel-back {
  font-family: var(--font-body);
  font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); background: none;
  border: 1px solid var(--accent-border); border-radius: 999px;
  padding: 7px 14px; cursor: pointer;
}
.panel-back:hover { background: var(--embed-bg); }
.panel-back:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.panel-frame {
  width: 100%; height: calc(100svh - 160px); min-height: 560px;
  border: 1px solid var(--rule); background: var(--paper);
  display: block;
}
.stage.private.panel-open .frame { padding-top: 64px; }
.stage.private.panel-open header { margin-bottom: 20px; padding-bottom: 16px; }
.stage.private.panel-open .note { margin-bottom: 20px; }
.panel-note { font-size: 13px; color: var(--muted); margin-top: 12px; line-height: 1.5; }
.panel-body { font-size: 15px; color: var(--ink-soft); line-height: 1.6; max-width: 720px; }
.panel-body .embed-cue { margin-top: 18px; }
.same-tab {
  position: relative;
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 22px;
  font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); text-decoration: none;
  padding: 12px 0 10px;
}
.same-tab .arrow { display: inline-block; transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1); }
.same-tab:hover .soak, .same-tab:focus-visible .soak { width: 100%; }
.same-tab:hover .arrow, .same-tab:focus-visible .arrow { transform: translateX(6px); }
.same-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* ---------- Motion 1 keyframes ---------- */
@keyframes ink-draw {
  from { transform: scaleX(0); opacity: 0.4; }
  to { transform: scaleX(1); opacity: 1; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  header::after, .links::before, .link::after {
    animation: none !important; transform: scaleX(1); opacity: 1;
  }
  .soak, .arrow, .card-open .arrow, .same-tab .arrow { transition: none !important; }
  .link:hover .soak, .link:focus-visible .soak,
  .card-open:hover .soak, .card-open:focus-visible .soak,
  .same-tab:hover .soak, .same-tab:focus-visible .soak { width: 100%; }
  .link:hover .arrow, .link:focus-visible .arrow,
  .card-open:hover .arrow, .card-open:focus-visible .arrow,
  .same-tab:hover .arrow, .same-tab:focus-visible .arrow { transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .frame { padding: 96px 80px 72px; }
  .stage.private .frame { padding: 88px 64px 64px; }
}
@media (max-width: 900px) {
  .frame { padding: 88px 48px 64px; }
  .stage.private .frame { padding: 84px 40px 56px; }
  header { margin-bottom: 72px; }
  h1 { font-size: 64px; }
  .about { font-size: 18px; margin-bottom: 48px; }
  .grid { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .panel-frame { height: calc(100svh - 150px); min-height: 520px; }
}
@media (max-width: 560px) {
  .topbar { left: 20px; right: 20px; flex-wrap: wrap; gap: 10px; }
  .label-bar { font-size: 10px; }
  .frame { padding: 108px 24px 48px; }
  .stage.private .frame { padding: 108px 20px 40px; }
  header { flex-direction: column; gap: 8px; margin-bottom: 56px; }
  .stage.private header { align-items: start; }
  .who { text-align: left; }
  h1 { font-size: 52px; }
  .stage.private h1 { font-size: 40px; }
  .about { font-size: 17px; }
  .link-name { font-size: 24px; }
  .link-meta { font-size: 11px; }
  .link .arrow { margin-left: 12px; }
  .card { padding: 22px 20px 24px; }
  .card-top { flex-wrap: wrap; }
  .cta { flex-wrap: wrap; }
  .panel { padding: 22px 20px 24px; }
  .panel-frame { height: calc(100svh - 140px); min-height: 480px; }
  footer { flex-direction: column; gap: 6px; margin-top: 64px; }
}
