/* ============================================================
   automedia — the AI printing press
   Quiet, editorial, high-class. Inspired by the restraint of
   runwayml.com + the simple elegance of stanford.edu.
   Simple palette: warm white / near-black / a single Cardinal accent.
   Light default + dark.
   ============================================================ */

:root {
  color-scheme: light;
  --bg:      #FCFCFA;   /* warm white */
  --bg-2:    #F4F3EE;   /* faint section band */
  --ink:     #1B1A18;   /* near-black */
  --muted:   #6A675F;
  --faint:   #908C83;
  --line:    #E7E4DC;
  --line-2:  #D6D2C8;
  --accent:  #8C1515;   /* Cardinal — the one accent, used sparingly */
  --on-acc:  #FCFCFA;

  --maxw:    1080px;
  --gut:     clamp(22px, 6vw, 80px);
  --ease:    cubic-bezier(.22, .61, .36, 1);

  --serif:   "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans:    "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg:      #121110;
  --bg-2:    #1A1916;
  --ink:     #F1EFE9;
  --muted:   #A8A398;
  --faint:   #76716A;
  --line:    rgba(241, 239, 233, .12);
  --line-2:  rgba(241, 239, 233, .22);
  --accent:  #D9605A;   /* brighter Cardinal for dark contrast */
  --on-acc:  #1A1512;
}

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 19px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--accent); color: var(--on-acc); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.skip-link { position: absolute; left: 16px; top: -64px; z-index: 200; background: var(--ink); color: var(--bg); padding: .6em 1em; border-radius: 6px; transition: top .2s var(--ease); }
.skip-link:focus { top: 14px; }

/* ---- type / helpers ---- */
.serif { font-family: var(--serif); }
.wrap  { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }
.label { font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.section { padding: clamp(80px, 13vw, 168px) 0; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -.02em; line-height: 1.06; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; gap: .5em; font-family: var(--sans); font-weight: 600; font-size: 1rem; padding: .8em 1.5em; border-radius: 100px; transition: transform .2s var(--ease), background .2s, color .2s, box-shadow .2s, border-color .2s; }
.btn svg { width: 1em; height: 1em; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -16px rgba(0,0,0,.5); }
.btn-quiet { color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-quiet:hover { box-shadow: inset 0 0 0 1px var(--ink); transform: translateY(-2px); }
.alink { color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; gap: .35em; transition: gap .2s; }
.alink svg { width: 1em; height: 1em; }
.alink:hover { gap: .6em; }

/* ---- nav ---- */
.nav { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; padding: 20px var(--gut); transition: background .3s var(--ease), border-color .3s, padding .3s; border-bottom: 1px solid transparent; }
.nav.scrolled { background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px) saturate(140%); -webkit-backdrop-filter: blur(12px) saturate(140%); border-bottom-color: var(--line); padding-block: 14px; }
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.4rem; letter-spacing: -.01em; }
.brand .d { color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: clamp(16px, 3vw, 36px); }
.nav-links { display: flex; gap: clamp(16px, 3vw, 32px); }
.nav-links a { font-size: .96rem; color: var(--muted); transition: color .2s; }
.nav-links a:hover { color: var(--ink); }
@media (max-width: 680px) { .nav-links { display: none; } }
.toggle { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); transition: color .2s, box-shadow .2s, transform .2s var(--ease); }
.toggle:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); transform: translateY(-1px); }
.toggle svg { width: 18px; height: 18px; }
.toggle .moon { display: none; }
[data-theme="dark"] .toggle .sun { display: none; }
[data-theme="dark"] .toggle .moon { display: block; }

/* ---- hero ---- */
.hero { padding: clamp(72px, 14vw, 184px) 0 clamp(64px, 10vw, 120px); }
.hero .eyebrow { color: var(--accent); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-size: .82rem; }
.hero h1 { font-size: clamp(2.7rem, 7.4vw, 5.6rem); margin: 26px 0 28px; max-width: 16ch; font-weight: 500; }
.hero h1 .em { font-style: italic; }
.hero-sub { font-size: clamp(1.15rem, 2.4vw, 1.5rem); line-height: 1.5; color: var(--muted); max-width: 40ch; font-weight: 400; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 38px; }

/* ---- work / formats ---- */
.work .lead { font-family: var(--serif); font-weight: 500; font-size: clamp(1.6rem, 3.6vw, 2.5rem); line-height: 1.2; letter-spacing: -.02em; max-width: 22ch; margin: 20px 0 0; }
.work .note { color: var(--muted); max-width: 52ch; margin-top: 22px; font-size: 1.08rem; }
.formats { margin-top: clamp(48px, 7vw, 80px); border-top: 1px solid var(--line); }
.fmt { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: clamp(16px, 4vw, 48px); align-items: baseline; padding: 30px 0; border-bottom: 1px solid var(--line); transition: padding-left .25s var(--ease); }
.fmt:hover { padding-left: 10px; }
.fmt h3 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 500; }
.fmt .fi { font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding-top: .5em; }
.fmt p { color: var(--muted); font-size: 1.05rem; max-width: 46ch; margin-top: 4px; }

/* ---- mission ---- */
.mission { background: var(--bg-2); }
.mission .label { margin-bottom: 26px; display: block; }
.mission p { font-family: var(--serif); font-weight: 500; font-size: clamp(1.7rem, 4.4vw, 3rem); line-height: 1.18; letter-spacing: -.02em; max-width: 20ch; }
.mission p .em { color: var(--accent); font-style: italic; }
.mission .sub { font-family: var(--sans); font-weight: 400; font-size: 1.1rem; line-height: 1.6; color: var(--muted); max-width: 54ch; margin-top: 26px; letter-spacing: 0; }

/* ---- brands ---- */
.brands .head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: clamp(36px, 5vw, 52px); flex-wrap: wrap; }
.brands .head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.brand-row { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 3vw, 36px); }
.bcard { border-top: 2px solid var(--ink); padding-top: 26px; }
.bcard .bt { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.bcard h3 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); margin: 12px 0 6px; }
.bcard .bs { color: var(--accent); font-weight: 600; font-size: 1rem; }
.bcard p { color: var(--muted); margin: 14px 0 22px; font-size: 1.05rem; max-width: 42ch; }
@media (max-width: 720px) { .brand-row { grid-template-columns: 1fr; gap: 40px; } }

/* ---- contact ---- */
.contact { text-align: center; }
.contact h2 { font-size: clamp(2rem, 5.5vw, 3.4rem); max-width: 18ch; margin: 16px auto 22px; }
.contact p { color: var(--muted); max-width: 46ch; margin: 0 auto 34px; font-size: 1.1rem; }

/* ---- footer ---- */
.foot { border-top: 1px solid var(--line); padding: clamp(40px, 6vw, 64px) 0 36px; }
.foot-row { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; justify-content: space-between; }
.foot-row .brand { font-size: 1.25rem; }
.foot-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.foot-nav a { color: var(--muted); font-size: .95rem; transition: color .2s; }
.foot-nav a:hover { color: var(--ink); }
.foot-meta { margin-top: 26px; color: var(--faint); font-size: .86rem; }
.foot-meta a { color: var(--muted); border-bottom: 1px solid var(--line-2); transition: color .2s, border-color .2s; }
.foot-meta a:hover { color: var(--accent); border-color: var(--accent); }

/* ---- reveal ---- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

@media (max-width: 560px) {
  body { font-size: 18px; }
  .fmt { grid-template-columns: 1fr; gap: 4px; }
  .fmt .fi { padding-top: 0; }
}
