/* ==========================================================================
   shubhamtrivedi.com — stylesheet
   1. Fonts            8. Work
   2. Tokens           9. Capabilities / approach / technology
   3. Base + a11y      10. About / engagements
   4. Layout           11. Contact
   5. Header / nav     12. Footer / back-to-top
   6. Hero             13. Motion + responsive
   7. Positioning      14. Print
   ========================================================================== */

/* 1. Fonts ---------------------------------------------------------------- */

@font-face {
  font-family: "Inter var";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter var";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* 2. Tokens --------------------------------------------------------------- */

:root {
  /* Surfaces climb in visible steps — bg, sunken band, panel, raised panel.
     Every text pair below clears WCAG AAA against --bg and --panel. */
  --bg: #131c22;
  --bg-sunken: #0f171d;
  --panel: #1d2a32;
  --panel-2: #223039;
  --field-bg: #16212a;

  --line: #2e3f49;          /* decorative hairlines */
  --line-strong: #405560;   /* panel and button borders */
  --line-input: #55707d;    /* form controls — 3.1:1, meets WCAG 1.4.11 */

  --text: #f2f7f9;          /* 15.98:1 */
  --muted: #b4c4cb;         /*  9.61:1 */
  --muted-strong: #d3dee3;  /* 12.60:1 */
  --accent: #7ddcf2;        /* 11.00:1 */
  --accent-ink: #0c161b;
  --warm: #ef6f69;          /*  5.87:1 — accents only, never body copy */
  --good: #8bd7b3;          /* 10.25:1 */

  --max: 1180px;
  --gutter: 24px;
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;

  /* Cool and soft. Heavy black shadows read as grime on a lifted base. */
  --shadow: 0 22px 60px rgba(4, 10, 14, 0.34);
  --shadow-sm: 0 10px 26px rgba(4, 10, 14, 0.26);

  --section-y: clamp(64px, 8vw, 104px);
  --section-y-tight: clamp(48px, 5.5vw, 72px);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* 3. Base + accessibility -------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Inter var", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 82% -4%, rgba(125, 220, 242, 0.13), transparent 38%),
    radial-gradient(circle at 4% 42%, rgba(239, 111, 105, 0.07), transparent 28%),
    linear-gradient(180deg, #1a262e 0%, #131c22 34%, #101920 72%, #16212a 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; height: auto; }

button, input, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 200;
  padding: 12px 18px;
  border-radius: 0 0 12px 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  transition: top 0.18s var(--ease);
}
.skip-link:focus { top: 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* 4. Layout primitives ----------------------------------------------------- */

.wrap {
  width: min(calc(100% - (var(--gutter) * 2)), var(--max));
  margin-inline: auto;
}

.section { padding-block: var(--section-y); }
.section.tight { padding-block: var(--section-y-tight); }

/* Alternating bands give the page vertical rhythm — without them a single
   flat background reads as one undifferentiated dark slab. */
.section.banded {
  background: var(--bg-sunken);
  border-block: 1px solid var(--line);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  font-weight: 700;
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.65;
  flex: none;
}

.section-title {
  font-size: clamp(1.95rem, 4vw, 3.3rem);
  line-height: 1.06;
  margin: 0 0 18px;
  letter-spacing: -0.035em;
  font-weight: 750;
}

.section-copy {
  max-width: 74ch;
  color: var(--muted);
  font-size: 1.02rem;
  margin: 0;
}

/* Buttons ------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 13px 20px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease),
    border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn.primary {
  background: var(--text);
  color: var(--accent-ink);
  border-color: var(--text);
  font-weight: 700;
}
.btn.primary:hover { background: #ffffff; border-color: #ffffff; }

.btn.secondary { background: rgba(255, 255, 255, 0.03); }
.btn.secondary:hover {
  background: rgba(125, 220, 242, 0.09);
  border-color: var(--accent);
  color: #ffffff;
}

.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

/* Status pill -------------------------------------------------------------- */

.status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(139, 215, 179, 0.06);
  color: var(--muted-strong);
  font-size: 0.82rem;
  margin-bottom: 22px;
}
.status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
  animation: pulse 2.6s infinite;
  flex: none;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(139, 215, 179, 0.5); }
  70%  { box-shadow: 0 0 0 9px rgba(139, 215, 179, 0); }
  100% { box-shadow: 0 0 0 0 rgba(139, 215, 179, 0); }
}

/* 5. Header / navigation --------------------------------------------------- */

.nav-shell {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(19, 28, 34, 0.78);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: box-shadow 0.25s var(--ease), background-color 0.25s var(--ease);
}
.nav-shell.scrolled {
  background: rgba(19, 28, 34, 0.95);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.brand .mark { width: 30px; height: 30px; flex: none; border-radius: 9px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  color: var(--muted-strong);
  font-size: 0.93rem;
}
.nav-links a { transition: color 0.18s var(--ease); }
.nav-links a:hover { color: #ffffff; }
.nav-links a[aria-current="true"] { color: var(--accent); }

.nav-cta {
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
}
.nav-cta:hover { border-color: var(--accent); }

.menu-btn {
  display: none;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: transparent;
  border-radius: 10px;
  padding: 9px 13px;
  cursor: pointer;
  font-size: 0.9rem;
}

/* 6. Hero ------------------------------------------------------------------ */

.hero {
  min-height: calc(100svh - 72px);
  display: grid;
  align-items: center;
  padding: 72px 0 56px;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 58px;
  align-items: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.7rem, 6.6vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
  font-weight: 800;
  max-width: 15ch;
}
.hero h1 .accent { color: var(--accent); }

.hero-lede {
  color: var(--muted);
  max-width: 62ch;
  font-size: 1.1rem;
  margin: 26px 0 30px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.capline {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}

/* Hero visual: portrait + diagram ------------------------------------------ */

.hero-visual {
  position: relative;
  aspect-ratio: 1 / 1.02;
  max-height: 540px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(125, 220, 242, 0.07), transparent 42%),
    var(--panel);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero-visual::after {
  content: "";
  position: absolute;
  inset: -90px -90px auto auto;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(125, 220, 242, 0.18), transparent 70%);
  pointer-events: none;
}

/* The portrait bleeds into the bottom-right corner; the scrim fades its left
   and bottom edges into the panel so it reads as part of the card rather than
   a photo pasted on top of one. */
.hero-portrait {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 56%;
  height: 80%;
  margin: 0;
  overflow: hidden;
}
.hero-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 6%;
}
.hero-portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, var(--panel) 0%, rgba(29, 42, 50, 0.55) 15%, transparent 46%),
    linear-gradient(to bottom, var(--panel) 0%, transparent 15%),
    linear-gradient(to top, rgba(29, 42, 50, 0.5) 0%, transparent 24%);
}

.diagram { position: absolute; inset: 30px; }

.diagram .node {
  position: absolute;
  min-width: 124px;
  padding: 12px 15px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  border-radius: 13px;
  color: #dce8ec;
  font-size: 0.84rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}
.diagram .node .idx {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 2px;
}
/* Nodes stay clear of the portrait: a staggered run down the left, plus one
   in the free band above it. */
.diagram .n1 { left: 0;    top: 2%; }
.diagram .n2 { right: 0;   top: 0; }
.diagram .n3 { left: 7%;   top: 30%; }
.diagram .n4 { left: 1%;   top: 55%; }
.diagram .n5 { left: 13%;  top: 79%; }

.diagram svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.diagram path {
  stroke: #4a6b78;
  stroke-width: 1.4;
  fill: none;
  stroke-dasharray: 6 8;
  animation: flow 2.6s linear infinite;
}
@keyframes flow { to { stroke-dashoffset: -28; } }

/* 7. Positioning strip ------------------------------------------------------ */

.positioning {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-sunken);
}
.positioning-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 50px;
  align-items: start;
}
.impact {
  font-size: clamp(1.9rem, 4.2vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  margin: 0;
}
.impact .arrow { color: var(--warm); }

.steps-inline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}
.steps-inline li {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted-strong);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
}

/* 8. Work ------------------------------------------------------------------ */

.work-groups { margin-top: 48px; display: grid; gap: 66px; }

.group-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 20px;
}
.group-head h3 { margin: 0; font-size: 1.28rem; letter-spacing: -0.01em; }
.group-head p {
  max-width: 60ch;
  color: var(--muted);
  margin: 0;
  font-size: 0.93rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}

.project {
  grid-column: span 6;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.022));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.22s var(--ease), border-color 0.22s var(--ease),
    box-shadow 0.22s var(--ease);
}
.project:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}
.project.featured {
  grid-column: span 12;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

.project-media {
  position: relative;
  overflow: hidden;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}
.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  transition: transform 0.5s var(--ease);
}
.project:hover .project-media img { transform: scale(1.03); }

.project.featured .project-media {
  border-bottom: none;
  border-right: 1px solid var(--line);
}
.project.featured .project-media img { aspect-ratio: auto; min-height: 100%; }

.project-body { padding: 28px; }

.tag {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  margin-bottom: 10px;
}
.project h4 {
  margin: 0 0 12px;
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
  letter-spacing: -0.02em;
}
.project p { margin: 0 0 16px; color: var(--muted); }

.meta {
  color: var(--muted-strong);
  font-size: 0.86rem;
  line-height: 1.55;
  margin-top: 16px;
}
.meta strong { color: var(--text); font-weight: 650; }

.disclaimer {
  margin: 14px 0 0;
  padding: 10px 13px;
  border-left: 2px solid var(--warm);
  background: rgba(226, 85, 79, 0.06);
  color: var(--muted-strong);
  font-size: 0.85rem;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 22px;
  font-size: 0.9rem;
  font-weight: 650;
}
.project-links a { color: #d8e5e9; border-bottom: 1px solid transparent; }
.project-links a:hover { color: var(--accent); border-bottom-color: currentColor; }

/* 9. Capabilities / approach / technology ----------------------------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 38px;
}
.card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 16px;
  padding: 24px;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.card .num {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.card h3 { margin: 12px 0 8px; font-size: 1.06rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.93rem; }

.process {
  margin-top: 38px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.process-step {
  padding: 22px 18px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent);
  min-height: 190px;
}
.process-step b {
  font-size: 0.76rem;
  color: var(--accent);
  letter-spacing: 0.14em;
}
.process-step h3 { font-size: 1rem; margin: 14px 0 8px; }
.process-step p { font-size: 0.87rem; color: var(--muted); margin: 0; }

.manifesto {
  margin-top: 34px;
  padding: 26px 0 0;
  border-top: 1px solid var(--line);
  font-size: clamp(1.3rem, 3vw, 2.4rem);
  letter-spacing: -0.035em;
  max-width: 24ch;
  font-weight: 750;
  line-height: 1.15;
}
.manifesto span { color: var(--accent); }

.tech-grid {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.tech-block { border-left: 2px solid var(--line); padding-left: 18px; }
.tech-block h3 { font-size: 0.93rem; margin: 0 0 10px; }
.tech-block p { font-size: 0.89rem; color: var(--muted); margin: 0; }

/* 10. About / engagements --------------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 64px;
  align-items: start;
}
.about-copy p { color: var(--muted); font-size: 1rem; }
.about-copy p:first-child { margin-top: 0; }

.about-portrait {
  position: relative;
  margin: 28px 0 0;
  max-width: 300px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
}
.about-portrait img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
.about-portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(125, 220, 242, 0.22);
  pointer-events: none;
}
.about-portrait figcaption {
  padding: 12px 16px;
  background: var(--panel-2);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.link-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 24px; }

.engagements { display: grid; gap: 14px; margin-top: 28px; }
.engagement {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-2);
  transition: border-color 0.2s var(--ease);
}
.engagement:hover { border-color: var(--line-strong); }
.engagement h3 { font-size: 1rem; margin: 0 0 5px; }
.engagement p { margin: 0; color: var(--muted); font-size: 0.91rem; }

/* 11. Contact --------------------------------------------------------------- */

.contact-panel {
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(125, 220, 242, 0.06), transparent 42%),
    var(--panel);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 3.4vw, 38px);
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 48px;
}

.contact-form { display: grid; gap: 14px; }

.field-group { display: grid; gap: 6px; }
.field-group label {
  font-size: 0.82rem;
  color: var(--muted-strong);
  letter-spacing: 0.02em;
}
.field-group .optional { color: #93a7b0; }

.field {
  width: 100%;
  border: 1px solid var(--line-input);
  background: var(--field-bg);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.field::placeholder { color: #8ba0aa; }
.field:focus-visible {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(125, 220, 242, 0.16);
}
.field[aria-invalid="true"] { border-color: var(--warm); }
textarea.field { min-height: 140px; resize: vertical; }

.field-error {
  color: #f0938f;
  font-size: 0.79rem;
  min-height: 1em;
}
.field-error:empty { display: none; }

/* Honeypot — hidden from humans, visible to naive bots. */
.hp-field {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.note { font-size: 0.78rem; color: #93a7b0; margin: 4px 0 0; }
.note a { color: var(--muted-strong); border-bottom: 1px solid var(--line-strong); }

.form-status {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.form-status:empty { display: none; }
.form-status.is-error {
  border-color: rgba(226, 85, 79, 0.5);
  background: rgba(226, 85, 79, 0.09);
  color: #f4a9a5;
}
.form-status.is-success {
  border-color: rgba(139, 215, 179, 0.45);
  background: rgba(139, 215, 179, 0.09);
  color: var(--good);
}

.contact-alt { margin-top: 24px; }

/* 12. Footer / back-to-top -------------------------------------------------- */

footer {
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
  background: var(--bg-sunken);
  color: var(--muted);
  font-size: 0.87rem;
}
.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.footer-name { color: var(--muted-strong); font-weight: 700; }

.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: rgba(29, 42, 50, 0.92);
  backdrop-filter: blur(8px);
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease),
    visibility 0.25s var(--ease), border-color 0.2s var(--ease);
}
.to-top.visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { border-color: var(--accent); color: var(--accent); }

/* Error page --------------------------------------------------------------- */

.error-page {
  min-height: calc(100svh - 72px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 80px 0;
}
.error-code {
  font-size: clamp(4rem, 16vw, 10rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
  margin: 0 0 10px;
  color: var(--accent);
}

/* 13. Motion + responsive --------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media (max-width: 980px) {
  .hero-grid,
  .positioning-grid,
  .split,
  .contact-panel { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .split { gap: 34px; }
  .hero-visual { max-height: 440px; aspect-ratio: 1 / 0.72; }
  .hero-portrait { width: 46%; height: 92%; }
  .about-portrait { max-width: 240px; }
  /* Two nodes would collide with the narrower portrait. */
  .diagram .n4 { display: none; }
  .diagram .n5 { left: 2%; top: 66%; }
  .project.featured { grid-template-columns: 1fr; }
  .project.featured .project-media {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .project.featured .project-media img { aspect-ratio: 16 / 9; min-height: 0; }
  .project { grid-column: span 12; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .process { grid-template-columns: repeat(2, 1fr); }
  .tech-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-inline { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  :root { --gutter: 18px; }
  .menu-btn { display: inline-flex; }
  .nav-links {
    position: absolute;
    left: 0;
    right: 0;
    top: 72px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    box-shadow: var(--shadow);
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px; border-radius: 10px; }
  .nav-cta { text-align: center; }
  .hero { padding-top: 48px; }
  .hero h1 { font-size: clamp(2.5rem, 12vw, 4.4rem); }
  /* On a phone the diagram and the portrait cannot share the panel without
     one of them becoming unreadable. The portrait wins. */
  .hero-visual { max-height: 380px; aspect-ratio: 1 / 0.92; }
  .diagram { display: none; }
  .hero-portrait {
    width: 72%;
    height: 96%;
    right: 14%;
  }
  .hero-portrait::after {
    background:
      linear-gradient(to right, var(--panel) 0%, transparent 26%),
      linear-gradient(to left, var(--panel) 0%, transparent 26%),
      linear-gradient(to bottom, var(--panel) 0%, transparent 14%);
  }
  .about-portrait { max-width: 100%; }
  .cards,
  .process,
  .tech-grid { grid-template-columns: 1fr; }
  .process-step { min-height: 0; }
  .steps-inline { grid-template-columns: repeat(2, 1fr); }
  .group-head { display: block; }
  .group-head p { margin-top: 10px; }
  .project-body { padding: 22px; }
  .to-top { right: 14px; bottom: 14px; }
}

/* 14. Print ----------------------------------------------------------------- */

@media print {
  :root { --line: #cccccc; }
  body {
    background: #ffffff;
    color: #111111;
    font-size: 11pt;
  }
  .nav-shell,
  .hero-visual,
  .contact-form,
  .to-top,
  .skip-link,
  .status,
  .hero-actions,
  .link-row,
  .menu-btn { display: none !important; }
  .section,
  .section.tight { padding-block: 14pt; }
  .reveal { opacity: 1; transform: none; }
  .project,
  .card,
  .engagement,
  .contact-panel {
    border: 1px solid #cccccc;
    background: none;
    box-shadow: none;
    break-inside: avoid;
  }
  .project-media { display: none; }
  .project.featured { grid-template-columns: 1fr; }
  .section-title,
  .hero h1 { color: #111111; }
  .eyebrow,
  .tag,
  .card .num,
  .impact .arrow { color: #555555; }
  .section-copy,
  .project p,
  .card p,
  .meta,
  .about-copy p { color: #333333; }
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #666666;
  }
}

/* Error page centring ------------------------------------------------------ */
.error-page .section-copy { margin-inline: auto; }
.error-page .hero-actions { justify-content: center; margin-top: 26px; }
