/* Heath Mackaay — heathmackaay.com.au
   Warm editorial. Golden ratio (φ = 1.618) drives the type scale,
   spacing scale, and the hero/about layout splits (38.2 / 61.8). */

/* Self-hosted brand fonts (variable woff2). Inter for UI/body, Fraunces
   for the italic accent words and numerals. */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-stretch: 100%;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-stretch: 100%;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-var-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-stretch: 100%;
  font-display: swap;
}

:root {
  --bg: #F7F3EE;
  --surface: #FFFFFF;
  --surface-2: #EFEAE2;
  --ink: #1C1917;
  --muted: #4C4A46;
  --faint: #7A7570;
  --line: #E3DFD9;
  --accent: #C4521A;
  --accent-strong: #A34412;
  --on-accent: #FFF9F3;

  /* Emboss: warm light from the top-left, warm shadow to the bottom-right */
  --emboss-hi: rgba(255,255,255,0.92);
  --emboss-lo: rgba(74,53,34,0.15);
  --emboss-lo-2: rgba(74,53,34,0.26);
  /* Text emboss (accent Fraunces words) — crisper, same light direction */
  --emboss-text-hi: rgba(255,255,255,0.85);
  --emboss-text-lo: rgba(74,38,15,0.38);

  --font-sans: "Inter", -apple-system, "Segoe UI", sans-serif;
  --font-accent: "Fraunces", Georgia, serif;

  /* φ spacing ladder */
  --s-1: 0.618rem;
  --s0: 1rem;
  --s1: 1.618rem;
  --s2: 2.618rem;
  --s3: 4.236rem;
  --s4: 6.854rem;

  /* Baked-in design values (formerly the design-tool tweak panel) */
  --avatar-size: 92%;
  --etch-depth: 0.75;

  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0F0F0E;
  --surface: #191816;
  --surface-2: #201E1B;
  --ink: #F0ECE5;
  --muted: #B0AAA2;
  --faint: #908A84;
  --line: #2C2926;
  --accent: #D4622A;
  --accent-strong: #E27438;
  --on-accent: #14100D;
  --emboss-hi: rgba(255,255,255,0.055);
  --emboss-lo: rgba(0,0,0,0.5);
  --emboss-lo-2: rgba(0,0,0,0.68);
  --emboss-text-hi: rgba(255,255,255,0.14);
  --emboss-text-lo: rgba(0,0,0,0.55);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-optical-sizing: auto;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.618;
  font-size: 1rem;
  font-weight: 400;
  transition: background-color 0.35s ease, color 0.35s ease;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: var(--on-accent); }

.container {
  width: min(1120px, 100% - 3rem);
  margin-inline: auto;
}

/* ---------- Type ---------- */

.kicker {
  font-size: 0.72rem;
  font-weight: 550;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s0);
}

.accent-word {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 480;
  color: var(--accent);
  /* Carved into the paper: highlight up-left, warm shadow down-right
     (same light direction as the embossed cards). Applies to accent
     Fraunces words only — numerals/% live in other classes. */
  text-shadow:
    -0.5px -0.5px 0 var(--emboss-text-hi),
    0.5px 0.5px 0 var(--emboss-text-lo),
    0.5px 1px 1.5px var(--emboss-text-lo);
}

.section-title {
  font-size: clamp(1.8rem, 1.2rem + 2.6vw, 2.618rem);
  font-weight: 560;
  letter-spacing: -0.018em;
  line-height: 1.18;
  margin-bottom: var(--s1);
  max-width: 21em;
}

h3 {
  font-size: 1.17rem;
  font-weight: 570;
  letter-spacing: -0.01em;
  margin-bottom: var(--s-1);
}

/* ---------- Buttons + links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-weight: 530;
  font-size: 0.95rem;
  padding: 0.85em 1.7em;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  white-space: nowrap;
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  will-change: transform;
}

.btn-accent {
  background: var(--accent);
  color: var(--on-accent);
}
.btn-accent:hover { background: var(--accent-strong); box-shadow: 0 10px 30px -12px var(--accent); }

.btn-ink { background: var(--ink); color: var(--bg); }
.btn-ink:hover { background: var(--accent); color: var(--on-accent); }

.btn-small { font-size: 0.82rem; padding: 0.62em 1.3em; }

.link-quiet {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.link-quiet:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Progress + nav ---------- */

.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 60;
  background: transparent;
}
#progress-bar {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.35s ease, border-color 0.35s ease;
}

.nav-inner {
  width: min(1120px, 100% - 3rem);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s1);
  padding-block: 0.85rem;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  text-decoration: none;
  color: var(--ink);
  font-size: 1.5rem;
}
.brand-name { font-size: 1em; font-weight: 360; letter-spacing: 0; white-space: nowrap; }

.brand-mark {
  height: 0.74em;   /* ≈ cap height, so the mark reads as the H */
  width: auto;
  align-self: baseline;
  color: var(--ink);
  display: block;
  margin-right: 0.03em;
}
.brand-mark .mark-accent { fill: var(--accent); }

.nav-links {
  display: flex;
  gap: var(--s1);
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--accent); }

.nav-actions { display: flex; align-items: center; gap: 0.9rem; }

.theme-toggle {
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  width: 34px; height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.3s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); transform: rotate(15deg); }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--s4) var(--s3);
}

.hero-watermark {
  position: absolute;
  width: clamp(260px, 32vw, 460px);
  height: clamp(260px, 32vw, 460px);
  /* The H's right stroke ends at x=53.16 of the 64-unit box, leaving 16.94%
     empty padding on the right. Offset the box by that padding so the visible
     right stroke — not the box edge — lands on the container's right edge,
     lining up with where the content ends below. */
  right: calc(-0.1694 * clamp(260px, 32vw, 460px));
  top: 50%;
  translate: 0 -50%;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

/* Letterpress: the mark is pressed into the paper, not printed on it.
   Face colours sit just off the page background; the inner top shadow and
   bottom light catch come from the #wm-deboss SVG filter in index.html.
   --etch-depth (tweakable) scales the whole effect. */
.hero-watermark .wm-face { fill: color-mix(in srgb, var(--ink) 7%, var(--bg)); }
.hero-watermark .wm-face { fill: color-mix(in srgb, var(--ink) calc(7% * var(--etch-depth, 1)), var(--bg)); }
.hero-watermark .mark-accent { fill: color-mix(in srgb, var(--accent) 18%, var(--bg)); }
.hero-watermark .mark-accent { fill: color-mix(in srgb, var(--accent) calc(18% * var(--etch-depth, 1)), var(--bg)); }
[data-theme="dark"] .hero-watermark .wm-face { fill: color-mix(in srgb, #000000 45%, var(--bg)); }
[data-theme="dark"] .hero-watermark .mark-accent { fill: color-mix(in srgb, var(--accent) 14%, #0A0A09); }

.wm-shadow { flood-color: #1C1917; flood-opacity: calc(0.2 * var(--etch-depth, 1)); }
.wm-lite   { flood-color: #FFFFFF; flood-opacity: calc(0.85 * var(--etch-depth, 1)); }
[data-theme="dark"] .wm-shadow { flood-color: #000000; flood-opacity: calc(0.55 * var(--etch-depth, 1)); }
[data-theme="dark"] .wm-lite   { flood-opacity: calc(0.07 * var(--etch-depth, 1)); }

/* The hero content and the H watermark both live inside .container, so they
   sit within the same page margins as every section below. Text runs down the
   left; the mark is anchored to the container's right edge, overlapping just
   behind the end of the headline. */
.hero-inner { position: relative; }

.hero-content { position: relative; z-index: 1; max-width: 40rem; }

.hero-headline {
  font-size: clamp(2.4rem, 1.4rem + 4.6vw, 4.236rem);
  font-weight: 560;
  letter-spacing: -0.022em;
  line-height: 1.08;
  margin-bottom: var(--s1);
  cursor: default;
}
.hero-headline .line { display: block; }
.hover-text span { display: inline-block; white-space: pre; will-change: transform; }

.hero-sub {
  font-size: 1.09rem;
  color: var(--muted);
  max-width: 34em;
  margin-bottom: var(--s2);
}

.hero-cta { display: flex; align-items: center; gap: var(--s1); flex-wrap: wrap; }

/* ---------- Credibility strip ---------- */

.strip {
  border-block: 1px solid var(--line);
  background: var(--surface);
  padding-block: var(--s3);
  transition: background-color 0.35s ease, border-color 0.35s ease;
}

.strip-intro {
  color: var(--muted);
  max-width: 44em;
  margin-bottom: var(--s2);
}

.strip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s2);
}

.stat-number {
  display: block;
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 480;
  font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.4rem);
  color: var(--accent);
  line-height: 1.1;
  margin-bottom: 0.35rem;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--faint);
  max-width: 24em;
  display: block;
}

/* ---------- Sections ---------- */

.section { padding-block: var(--s4); }

.section-alt {
  background: var(--surface);
  border-block: 1px solid var(--line);
  transition: background-color 0.35s ease, border-color 0.35s ease;
}

/* ---------- Cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s1);
  margin-top: var(--s2);
  align-items: start;
}

/* Cards read as embossed: raised off the warm paper with a top-left light
   catch and a soft warm shadow below-right, plus a hairline top bevel. On
   hover the emboss deepens and the card follows the cursor (magnetic, like the
   buttons — movement handled by main.js via `transform`). */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: var(--s2) var(--s1) var(--s1);
  box-shadow:
    inset 0 1px 0 var(--emboss-hi),
    inset 0 -1.5px 1px var(--emboss-lo),
    -5px -6px 15px var(--emboss-hi),
    7px 10px 24px var(--emboss-lo);
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.4s ease,
    border-color 0.35s ease,
    background-color 0.35s ease;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  height: 3px;
  width: 100%;
  background: var(--accent);
  transform: scaleX(1);
  transform-origin: left;
}
.card:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  box-shadow:
    inset 0 1px 0 var(--emboss-hi),
    inset 0 -1.5px 1px var(--emboss-lo),
    -7px -8px 18px var(--emboss-hi),
    10px 14px 30px var(--emboss-lo-2);
}

.card p { color: var(--muted); font-size: 0.95rem; margin-bottom: var(--s0); }

.card-flagship {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}
.card-flagship::before { transform: scaleX(1); }

.card-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 570;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent) !important;
  margin-bottom: var(--s0);
}

.card-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: var(--s0);
}
.card-tags li {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28em 0.85em;
  cursor: default;
  transition: border-color 0.25s ease, color 0.25s ease;
}
.card-tags li:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  color: var(--accent);
}

/* ---------- Steps ---------- */

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s2);
  margin-top: var(--s2);
  counter-reset: step;
}

/* Each step's rule is a circuit trace: it starts at a hollow through-hole pad
   just right of the numeral (--rule-start is measured by main.js), draws
   across on first reveal, and stamps a second pad at the far end. Pad rings
   are 2px — double the rule's weight, like a real annular ring; their punched
   centres show the paper.
   The line is drawn via background-size so the pads (pseudo-elements) don't
   stretch with it. Draw-once: after the first reveal a step always carries
   .in-view or .revisit, so the drawn state persists. */
.step { position: relative; padding-top: var(--s1); }

.step-rule {
  position: absolute;
  top: 0;
  left: calc(var(--rule-start, 2.4em) + 11px);
  right: 11px;
  height: 1px;
  background-image: linear-gradient(var(--line), var(--line));
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 100% 1px;
}
.step-rule::before,
.step-rule::after {
  content: "";
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: 11px;
  height: 11px;
  box-sizing: border-box;
  border: 4px solid var(--line);
  border-radius: 50%;
}
.step-rule::before { left: -11px; }
.step-rule::after { right: -11px; }

.js .step .step-rule { background-size: 0% 1px; }
.js .step .step-rule::before { opacity: 0; }
.js .step .step-rule::after { opacity: 0; }
.js .step.in-view .step-rule,
.js .step.revisit .step-rule {
  background-size: 100% 1px;
  transition: background-size 1.8s cubic-bezier(0.33, 1, 0.68, 1) calc(var(--d, 0s) + 0.2s);
}
.js .step.in-view .step-rule::before,
.js .step.revisit .step-rule::before {
  opacity: 1;
  transition: opacity 0.25s ease var(--d, 0s);
}
.js .step.in-view .step-rule::after,
.js .step.revisit .step-rule::after {
  opacity: 1;
  transition: opacity 0.25s ease calc(var(--d, 0s) + 1.9s);
}

/* A 3-line trace bus under the step text (built by main.js): flat under 01,
   45° down across the first column gap, flat under 02, 45° up across the
   second, flat under 03. Hollow through-hole pads at both ends. Draw-once,
   same gating as the step rules. */
.step-traces { margin-top: 14px; }
.step-traces svg { display: block; overflow: visible; }
.step-traces .tline { fill: none; stroke: var(--line); stroke-width: 1; }
.step-traces .tpad  { fill: none; stroke: var(--line); stroke-width: 4; }

.js .step-traces .tline { stroke-dasharray: 1000; stroke-dashoffset: 1000; }
.js .step-traces .tpad  { opacity: 0; }
.js .step-traces.in-view .tline,
.js .step-traces.revisit .tline {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 2.6s cubic-bezier(0.33, 1, 0.68, 1) calc(var(--td, 0s) + 0.2s);
}
.js .step-traces.in-view .tpad-start,
.js .step-traces.revisit .tpad-start {
  opacity: 1;
  transition: opacity 0.25s ease var(--td, 0s);
}
.js .step-traces.in-view .tpad-end,
.js .step-traces.revisit .tpad-end {
  opacity: 1;
  transition: opacity 0.25s ease 3.1s;
}

.step-number {
  position: absolute;
  top: -0.85em;
  left: 0;
  background: inherit;
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 1.6rem;
  color: var(--accent);
  background: var(--surface);
  padding-right: 0.6rem;
  transition: background-color 0.35s ease;
}
.section:not(.section-alt) .step-number { background: var(--bg); }

.step p { color: var(--muted); font-size: 0.95rem; }

/* ---------- About ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 38.2%;   /* text left, avatar right (same proportions) */
  gap: var(--s3);
  align-items: center;
}

/* Same embossed treatment as the What-I-do cards: raised off the paper,
   subtle rise + deeper emboss on hover. */
.avatar-frame {
  position: relative;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 50%;
  aspect-ratio: 1;
  max-width: 272px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 var(--emboss-hi),
    inset 0 -1.5px 1px var(--emboss-lo),
    -5px -6px 15px var(--emboss-hi),
    7px 10px 24px var(--emboss-lo);
  translate: 0 0;
  transition:
    translate 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.4s ease,
    border-color 0.35s ease;
}
.avatar-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  scale: 1.06;
  transition: scale 0.5s ease;
}
.avatar-frame:hover::after { scale: 1.0; }
.avatar-frame:hover {
  translate: 0 -3px;
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  box-shadow:
    inset 0 1px 0 var(--emboss-hi),
    inset 0 -1.5px 1px var(--emboss-lo),
    -7px -8px 18px var(--emboss-hi),
    10px 14px 30px var(--emboss-lo-2);
}
.avatar-frame img { width: var(--avatar-size, 85%); height: auto; }

.about-text p:not(.kicker) { color: var(--muted); margin-bottom: var(--s0); max-width: 38em; }

/* ---------- Contact ---------- */

.section-contact {
  background: var(--ink);
  color: var(--bg);
  transition: background-color 0.35s ease, color 0.35s ease;
}
[data-theme="dark"] .section-contact {
  background: var(--surface);
  color: var(--ink);
  border-top: 1px solid var(--line);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 38.2%;   /* form left, text right (same proportions) */
  gap: var(--s3);
  align-items: start;
}

.section-contact .kicker { color: var(--accent-strong); }
[data-theme="light"] .section-contact .kicker { color: #E8926B; }
.section-contact .section-title { color: inherit; }
/* The contact section's accent word ("week.") sits on a busier surface —
   dial the carved emboss back so it reads softer than the other accents. */
.section-contact .accent-word {
  text-shadow:
    -0.4px -0.4px 0 color-mix(in srgb, var(--emboss-text-hi) 55%, transparent),
    0.4px 0.6px 1px color-mix(in srgb, var(--emboss-text-lo) 55%, transparent);
}
.section-contact .contact-text > p:last-child { color: color-mix(in srgb, currentColor 68%, transparent); }

.contact-form { display: grid; gap: var(--s1); }

.field { display: grid; gap: 0.45rem; }

.field label {
  font-size: 0.82rem;
  font-weight: 530;
  letter-spacing: 0.02em;
}
.field .optional { color: color-mix(in srgb, currentColor 55%, transparent); font-weight: 400; }

.field input,
.field textarea {
  font-family: inherit;
  font-size: 0.96rem;
  color: inherit;
  background: color-mix(in srgb, currentColor 6%, transparent);
  border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
  border-radius: 10px;
  padding: 0.8em 1em;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: color-mix(in srgb, currentColor 3%, transparent);
}
.field ::placeholder { color: color-mix(in srgb, currentColor 40%, transparent); }

.hp-field { position: absolute; left: -9999px; }

.contact-form .btn { justify-self: start; }

/* Invisible reCAPTCHA: the floating badge is hidden, so Google's terms are
   shown as this quiet attribution line under the send button instead. */
.grecaptcha-badge { visibility: hidden; }

.recaptcha-note {
  font-size: 0.72rem;
  line-height: 1.5;
  color: color-mix(in srgb, currentColor 48%, transparent);
  max-width: 30em;
  margin-top: -0.3rem;
}
.recaptcha-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.recaptcha-note a:hover { color: var(--accent); }

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding-block: var(--s2);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s1);
  flex-wrap: wrap;
}

.footer-id { display: flex; align-items: center; gap: 0.9rem; }

.footer-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #FFFFFF;
  object-fit: contain;
  padding: 1.8px;
}

.footer-name { font-size: 0.92rem; font-weight: 550; }
.footer-role { font-size: 0.8rem; color: var(--faint); }
.footer-copy { font-size: 0.8rem; color: var(--faint); }

.footer-mark { height: 34px; width: auto; color: var(--ink); display: block; }
.footer-mark .mark-accent { fill: var(--accent); }

/* ---------- Reveal on scroll ---------- */

/* Hidden-until-scroll only when JS is confirmed running (html.js is set by an
   inline script), so content is never invisible if scripts fail to load. */
.js .reveal {
  opacity: 0;
  translate: 0 26px;
  transition: opacity 0.7s ease var(--d, 0s), translate 0.7s cubic-bezier(0.22, 1, 0.36, 1) var(--d, 0s);
}
/* After the first full reveal, sections that leave the viewport come back
   with a shorter, shallower fade (no stagger delay) in either direction. */
.js .reveal.revisit {
  opacity: 0.25;
  translate: 0 12px;
  transition: opacity 0.5s ease, translate 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.js .reveal.in-view { opacity: 1; translate: 0 0; }

/* Cards animate movement like the magnetic buttons: the cursor-follow uses
   `transform` (set by main.js), the reveal slide uses the independent
   `translate` prop — so they never fight. This wins the `transition` for cards
   over .js .reveal, so it must re-list the reveal opacity+translate too. */
.js .card {
  transition:
    opacity 0.7s ease var(--d, 0s),
    translate 0.7s cubic-bezier(0.22, 1, 0.36, 1) var(--d, 0s),
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.4s ease,
    border-color 0.35s ease,
    background-color 0.35s ease;
}

/* ---------- Motion + responsive ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .reveal.revisit { opacity: 1; translate: 0 0; transition: none; }
  .card, .btn, .theme-toggle, .avatar-frame::after { transition: none; }
  .js .step .step-rule { background-size: 100% 1px; transition: none; }
  .js .step .step-rule::before,
  .js .step .step-rule::after { opacity: 1; transition: none; }
  .js .step-traces .tline { stroke-dashoffset: 0; transition: none; }
  .js .step-traces .tpad  { opacity: 1; transition: none; }
  .hover-text span { transform: none !important; }
}

@media (max-width: 900px) {
  .hero-inner { max-width: 100%; margin-inline: auto; }
  .hero-watermark { display: none; }
  .hero { padding-block: var(--s3); }
  .cards, .steps, .strip-grid { grid-template-columns: 1fr; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: var(--s2); }
  .about-visual { order: -1; }        /* avatar stays above text on mobile */
  .contact-text { order: -1; }        /* intro stays above the form on mobile */
  .avatar-frame { max-width: 240px; }
  .step-traces { display: none; }
  .nav-links { display: none; }
  .section { padding-block: var(--s3); }
}
