/* ==========================================================================
   Farooq Alwi — portfolio
   Direction: navy + gold executive style. Header with serif wordmark, navy
   hero with a typed italic gold line and an orbiting tech card, cream stats
   panel, banded sections with banner-topped cards, gold-framed covers, navy
   invitation band, dark footer. Light and dark themes.
   Type: Playfair Display (headings) / DM Sans (text)
   ========================================================================== */

:root {
  --serif: "Playfair Display", "Iowan Old Style", Georgia, serif;
  --sans: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1230px;
  --gutter: clamp(16px, 5vw, 80px);
  --head-h: 75px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t: 220ms var(--ease);

  /* fixed brand colours (same in both themes) */
  --navy: #1a2740;
  --gold: #b8973a;
  --gold-2: #c9a548;
  --gold-light: #d4af5a;
  --on-navy: #fdfcfa;
  --on-navy-2: rgba(253, 252, 250, .86);
  --on-navy-3: #bdbec8;

  /* light theme */
  --bg: #ffffff;
  --band: #ede8de;
  --surface: #fdfcfa;
  --frame: #ffffff;
  --panel: #f4f1ea;
  --line: #e2dccd;
  --heading: #001219;
  --text: #1a2740;
  --muted: #5c5c52;
  --accent: #7d621a;
  --header: #ffffff;
  --header-line: rgba(0, 18, 25, .09);
  --hero: #1a2740;
  --footer: #0c1626;
  --btn-navy: #1c3450;
  --btn-navy-hover: #142540;
  --shadow: rgba(0, 18, 25, .45);
}

:root[data-theme="dark"] {
  --bg: #0b1220;
  --band: #0f1829;
  --surface: #152036;
  --frame: #152036;
  --panel: #121c30;
  --line: rgba(255, 255, 255, .11);
  --heading: #f5f2ea;
  --text: #c7cedb;
  --muted: #9ba4b5;
  --accent: #d4af5a;
  --header: #0b1220;
  --header-line: rgba(255, 255, 255, .09);
  --hero: #131e36;
  --footer: #070c16;
  --btn-navy: #2a4a78;
  --btn-navy-hover: #33588e;
  --shadow: rgba(0, 0, 0, .75);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--head-h) + 8px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background var(--t), color var(--t);
}
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; }
.ic { width: 1em; height: 1em; flex: none; }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: 8px; top: -48px; z-index: 100; padding: 8px 12px; background: var(--navy); color: #fff; font-weight: 600; }
.skip:focus { top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 32px;
  font-size: .875rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  border: 1.5px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background var(--t), color var(--t), border-color var(--t), transform var(--t);
}
.btn .ic { width: 16px; height: 16px; }
.btn:hover { transform: translateY(-1px); }
.btn-sm { min-height: 42px; padding: 0 20px; font-size: .8125rem; letter-spacing: .06em; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-light); }
.btn-navy { background: var(--btn-navy); color: #fff; }
.btn-navy:hover { background: var(--btn-navy-hover); }
.btn-line { border-color: var(--on-navy); color: var(--on-navy); background: transparent; }
.btn-line:hover { background: var(--on-navy); color: var(--navy); }

.tlink {
  display: inline-flex; align-items: center; gap: 12px;
  padding-bottom: 8px; border-bottom: 1px solid currentColor;
  font-size: .8125rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--text);
  transition: color var(--t), gap var(--t);
}
.tlink .ic { width: 16px; height: 16px; }
.tlink:hover { color: var(--accent); gap: 18px; }

/* ---------- Header ---------- */
.header { position: sticky; top: 0; z-index: 50; background: var(--header); box-shadow: 0 1px 0 var(--header-line); transition: background var(--t); }
.header-row { height: var(--head-h); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.logo { display: inline-flex; align-items: center; }
.logo-name { font-family: var(--serif); font-size: 1.45rem; color: var(--heading); letter-spacing: .01em; white-space: nowrap; }
.logo-name em { color: var(--accent); }
.nav { display: flex; gap: clamp(14px, 2vw, 26px); }
.nav a {
  position: relative; padding: 6px 0;
  font-size: .84rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--text);
}
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--gold-2); transform: scaleX(0); transform-origin: left; transition: transform 260ms var(--ease); }
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }
.header-tools { display: flex; align-items: center; gap: 12px; }
.theme-btn {
  width: 42px; height: 42px; display: grid; place-items: center; cursor: pointer;
  background: transparent; border: 1px solid var(--line); color: var(--text);
  transition: border-color var(--t), color var(--t), background var(--t);
}
.theme-btn:hover { border-color: var(--gold-2); color: var(--accent); }
.theme-btn .ic { width: 18px; height: 18px; }
.ic-sun { display: none; }
:root[data-theme="dark"] .ic-moon { display: none; }
:root[data-theme="dark"] .ic-sun { display: block; }
.burger { display: none; width: 44px; height: 42px; background: none; border: 0; cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 6px; }
.burger span { display: block; width: 24px; height: 1.5px; background: var(--heading); transition: transform var(--t), opacity var(--t); }
body.menu-open .burger span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
body.menu-open .burger span:nth-child(2) { opacity: 0; }
body.menu-open .burger span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }
.menu { background: var(--header); border-top: 1px solid var(--line); box-shadow: 0 24px 40px -24px var(--shadow); max-height: calc(100vh - var(--head-h)); overflow-y: auto; }
.menu[hidden] { display: none; }
.menu-links { display: grid; padding: 8px 0 24px; }
.menu-links a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: .875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text); }
.menu-links .btn { margin-top: 20px; }

/* ---------- Hero ---------- */
.hero { background: var(--hero); color: var(--on-navy); padding: clamp(36px, 5vw, 64px) 0 clamp(40px, 5vw, 56px); transition: background var(--t); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.hero-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.95rem, 3.7vw, 3.3rem); line-height: 1.08; letter-spacing: -.02em;
}

/* typed line: the ghost holds the space, the live copy is typed over it */
.typed { position: relative; display: block; margin-top: .25em; font-size: .8em; line-height: 1.2; min-height: 1.2em; color: var(--gold-2); }
.typed-live { position: absolute; left: 0; top: 0; right: 0; display: none; }
.typed.is-typing .typed-ghost { opacity: 0; }
.typed.is-typing .typed-live { display: block; }
/* the caret is tied to the last typed character, so it can never drop to a new line */
.typed-tail { white-space: nowrap; }
.typed-caret { display: inline-block; width: 2px; height: .82em; margin-left: 5px; background: var(--gold-light); vertical-align: -.06em; animation: caret 900ms steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

.hero-text { margin-top: 28px; max-width: 62ch; font-size: 1rem; line-height: 1.75; color: var(--on-navy-2); }
.hero-cta { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 20px; }
.hero-stats { margin-top: clamp(40px, 6vw, 76px); display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 24px; max-width: 700px; }
.stat-num { display: block; font-family: var(--serif); font-size: 2.1rem; line-height: 1; color: var(--on-navy); }
.stat-num i { font-style: normal; font-weight: 400; margin-left: 2px; }
.stat-label { display: block; margin-top: 12px; font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; line-height: 1.5; color: var(--on-navy-2); }

/* hero card */
.hero-panel {
  position: relative; overflow: hidden; border-radius: 12px;
  min-height: clamp(440px, 40vw, 540px);
  background:
    radial-gradient(70% 55% at 60% 38%, rgba(74, 122, 184, .5), transparent 70%),
    linear-gradient(160deg, #1f4068 0%, #16294a 55%, #0f1d36 100%);
  display: grid; place-items: center;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6);
}
:root[data-theme="dark"] .hero-panel { border: 1px solid rgba(255, 255, 255, .08); }
.hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 12px; z-index: 3; }
.ring { position: absolute; border-radius: 50%; border: 1px solid rgba(253, 252, 250, .07); pointer-events: none; }
.ring-1 { width: 150%; aspect-ratio: 1; right: -70%; top: -34%; }
.ring-2 { width: 120%; aspect-ratio: 1; left: -60%; bottom: -50%; }
.ring-3 { display: none; }
.panel-chip {
  position: absolute; top: 22px; left: 22px; z-index: 2;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-light);
}
.panel-chip span { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-light); box-shadow: 0 0 0 4px rgba(212, 175, 90, .2); animation: beat 2.4s ease-out infinite; }
@keyframes beat { 0% { box-shadow: 0 0 0 0 rgba(212, 175, 90, .55); } 70%, 100% { box-shadow: 0 0 0 9px rgba(212, 175, 90, 0); } }

/* orbiting tech rings */
.orbit-stage { position: relative; z-index: 1; width: min(76%, 20.5rem); aspect-ratio: 1; margin-top: -34px; }
.orbit { position: absolute; z-index: 2; border-radius: 50%; animation: spin 38s linear infinite; }
.orbit-outer { inset: 0; border: 1px solid rgba(212, 175, 90, .5); }
/* two glowing dots, placed in the gaps between the outer labels */
.orbit-outer::before, .orbit-outer::after { content: ""; position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--gold-light); box-shadow: 0 0 14px 2px rgba(212, 175, 90, .7); top: 65.45%; transform: translate(-50%, -50%); }
.orbit-outer::before { left: 2.45%; }
.orbit-outer::after { left: 97.55%; }
.orbit-inner { inset: 21%; border: 1px dashed rgba(253, 252, 250, .32); animation-duration: 26s; animation-direction: reverse; }
.sat { position: absolute; transform: translate(-50%, -50%); }
.sat > span {
  display: block; padding: 6px 12px; border-radius: 999px; white-space: nowrap;
  background: rgba(10, 18, 34, .88); border: 1px solid rgba(212, 175, 90, .6);
  font-size: .8rem; font-weight: 600; letter-spacing: .04em; color: var(--on-navy);
  box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .7);
  animation: spin 38s linear infinite reverse;      /* counter-rotate so labels stay upright */
}
.orbit-inner .sat > span { animation-duration: 26s; animation-direction: normal; border-color: rgba(253, 252, 250, .4); }
.core {
  position: absolute; inset: 35%; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, rgba(212, 175, 90, .28), rgba(10, 18, 34, .75) 70%);
  border: 1px solid rgba(212, 175, 90, .55); color: var(--gold-light);
  box-shadow: 0 0 46px rgba(212, 175, 90, .28);
}
.core .ic { width: 42%; height: 42%; }
.core::before {
  content: ""; position: absolute; inset: -9px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 62%, var(--gold-light) 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
  animation: spin 4.5s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hero-panel:hover .orbit, .hero-panel:hover .sat > span { animation-play-state: paused; }

.panel-caption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 44px 24px 22px; display: grid; gap: 2px;
  background: linear-gradient(180deg, transparent, rgba(8, 16, 30, .85));
}
.panel-caption strong { font-family: var(--serif); font-weight: 400; font-size: 1.35rem; color: var(--on-navy); }
.panel-caption span { font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; color: var(--on-navy-2); }

/* ---------- Sections ---------- */
.sec { padding: clamp(56px, 9vw, 120px) 0; }
.band { background: var(--band); transition: background var(--t); }
.title { font-family: var(--serif); font-weight: 400; font-size: clamp(1.75rem, 3vw, 2.4rem); line-height: 1.2; letter-spacing: -.02em; color: var(--heading); margin-bottom: clamp(32px, 4vw, 52px); }
.lead { margin-top: 14px; max-width: 60ch; color: var(--text); }
.head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 40px; margin-bottom: clamp(28px, 4vw, 52px); }
.head-row .title { margin-bottom: 0; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr); gap: clamp(36px, 6vw, 96px); align-items: start; }
.about-copy { display: grid; gap: 20px; justify-items: start; }
.about-copy .title { max-width: 16ch; margin-bottom: 12px; }
.about-copy p { font-size: 1rem; max-width: 62ch; }
.checks { display: grid; gap: 10px; }
.checks li { display: flex; align-items: flex-start; gap: 12px; font-size: 1rem; }
.checks .ic { width: 16px; height: 16px; margin-top: 5px; color: var(--accent); }
.about-copy .tlink { margin-top: 12px; }

.about-side { display: grid; gap: 20px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--gold-2); transition: background var(--t), border-color var(--t); }
.stats-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 28px; padding: clamp(24px, 3vw, 44px); }
.big { display: block; font-family: var(--serif); font-size: clamp(2.5rem, 4vw, 3.4rem); line-height: 1; color: var(--heading); }
.big i { font-style: normal; font-size: .45em; vertical-align: baseline; margin-left: 6px; color: var(--accent); }
.cap { display: block; margin-top: 14px; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; line-height: 1.6; color: var(--muted); }
.facts-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding: clamp(22px, 3vw, 36px) clamp(24px, 3vw, 44px); border-top-width: 1px; border-top-color: var(--line); }
.fact { display: flex; gap: 14px; align-items: flex-start; }
.fact > .ic { width: 22px; height: 22px; color: var(--accent); margin-top: 2px; }
.fact-label { font-family: var(--sans); font-size: .8rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.fact-main { font-family: var(--serif); font-size: 1.12rem; color: var(--heading); line-height: 1.4; }
.fact-main span { display: block; font-family: var(--sans); font-size: .875rem; color: var(--muted); }
.fact-main + .fact-main { margin-top: 8px; }
.fact-sub { font-size: .875rem; color: var(--muted); }

/* ---------- Experience timeline ---------- */
.band .title { margin-bottom: clamp(36px, 4.5vw, 56px); }
#experience .title { margin-bottom: clamp(44px, 5.5vw, 68px); }
.band .head-row .title { margin-bottom: 0; }
/* A career timeline, newest role first. A gold line grows down the rail and each marker lights up as the
   section is scrolled (site.js sets --tl-p and .is-on). Without JavaScript everything is shown lit. */
.timeline { --tl-when: 190px; --tl-node: 54px; --tl-gap: clamp(18px, 2.6vw, 36px); --tl-p: 1; position: relative; display: grid; gap: clamp(26px, 3.2vw, 40px); margin-top: clamp(16px, 2vw, 24px); }
html.js .timeline { --tl-p: 0; }
.timeline::before, .timeline::after { content: ""; position: absolute; left: calc(var(--tl-when) + var(--tl-gap) + var(--tl-node) / 2 - 1px); top: calc(var(--tl-node) / 2); bottom: 0; width: 2px; }
.timeline::before { background: linear-gradient(var(--muted) 0, var(--muted) calc(100% - 80px), transparent); opacity: .26; }
.timeline::after { background: linear-gradient(var(--gold) 0, var(--gold) calc(100% - 80px), transparent); transform-origin: top; transform: scaleY(var(--tl-p)); transition: transform 450ms var(--ease); }
.tl-item { position: relative; z-index: 1; display: grid; grid-template-columns: var(--tl-when) var(--tl-node) minmax(0, 1fr); grid-template-areas: "when node card"; column-gap: var(--tl-gap); align-items: start; }
.tl-when { grid-area: when; padding-top: 6px; }
.tl-dates { font-family: var(--serif); font-size: 1.22rem; line-height: 1.3; letter-spacing: -.01em; color: var(--heading); }
.tl-tag { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: .78rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.is-current .tl-tag { color: var(--accent); }
.tl-live { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
/* marker on the rail: gold once the line has reached it */
.tl-node { grid-area: node; position: relative; display: grid; place-items: center; width: var(--tl-node); height: var(--tl-node); border-radius: 50%; border: 2px solid var(--gold); background: var(--gold); color: #0c1626; box-shadow: 0 0 0 7px var(--band); transition: background 450ms var(--ease), border-color 450ms var(--ease), color 450ms var(--ease), box-shadow var(--t); }
.tl-node .ic { width: 23px; height: 23px; }
html.js .tl-item:not(.is-on) .tl-node { background: var(--band); border-color: var(--line); color: var(--muted); }
/* the current role keeps a slow pulse around its marker */
.is-current .tl-node::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 1px solid var(--gold); opacity: 0; }
.is-current.is-on .tl-node::after { animation: tl-pulse 2.6s ease-out infinite; }
@keyframes tl-pulse { 0% { transform: scale(1); opacity: .75; } 80%, 100% { transform: scale(1.55); opacity: 0; } }
.tl-card { grid-area: card; position: relative; background: var(--surface); padding: clamp(20px, 2.4vw, 30px) clamp(18px, 2.6vw, 34px) clamp(18px, 2vw, 24px); transition: transform 300ms var(--ease), box-shadow 300ms var(--ease), background var(--t); }
.tl-card:hover { transform: translateY(-4px); box-shadow: 0 26px 44px -30px var(--shadow); }
/* small pointer from the card towards its marker */
.tl-card::before { content: ""; position: absolute; left: -7px; top: calc(var(--tl-node) / 2 - 7px); width: 14px; height: 14px; background: inherit; transform: rotate(45deg); }
/* large faint step number in the corner */
.tl-card::after { content: attr(data-step); position: absolute; top: clamp(12px, 1.6vw, 20px); right: clamp(16px, 2.2vw, 28px); font-family: var(--serif); font-size: clamp(2.1rem, 3.6vw, 3.1rem); line-height: 1; color: var(--heading); opacity: .09; pointer-events: none; }
.tl-title { padding-right: 72px; font-family: var(--serif); font-weight: 400; font-size: clamp(1.2rem, 1.9vw, 1.45rem); line-height: 1.25; letter-spacing: -.01em; color: var(--heading); }
.tl-text { margin: 12px 0 20px; max-width: 70ch; font-size: 1rem; line-height: 1.7; color: var(--text); }
.tl-card .card-link { display: flex; }
@media (max-width: 800px) {
  /* rail moves to the left edge; dates sit above each card */
  .timeline { --tl-when: 0px; --tl-node: 44px; --tl-gap: 16px; }
  .timeline::before, .timeline::after { left: calc(var(--tl-node) / 2 - 1px); }
  .tl-item { grid-template-columns: var(--tl-node) minmax(0, 1fr); grid-template-areas: "node when" "node card"; row-gap: 12px; }
  .tl-when { display: flex; flex-direction: column; justify-content: center; min-height: var(--tl-node); padding-top: 0; }
  .tl-dates { font-size: 1.15rem; }
  .tl-tag { margin-top: 3px; }
  .tl-node { box-shadow: 0 0 0 5px var(--band); }
  .tl-node .ic { width: 19px; height: 19px; }
  .tl-card::before { display: none; }
  .tl-title { padding-right: 56px; }
}
.card-link {
  margin-top: auto; padding-top: 18px; position: relative;
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .8125rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--text);
  transition: gap var(--t), color var(--t);
}
.card-link::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line); }
.card-link .ic { width: 15px; height: 15px; }
.card-link:hover { gap: 16px; color: var(--accent); }
.band-note { margin-top: 32px; font-size: .9375rem; font-style: italic; color: var(--muted); max-width: 70ch; }

/* ---------- Services & Solutions ---------- */
.services-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 2.4vw, 28px); }
@media (max-width: 980px) { .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .services-grid { grid-template-columns: 1fr; } }
.service-card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: clamp(24px, 2.5vw, 32px) clamp(20px, 2.2vw, 26px); box-shadow: 0 4px 16px -8px var(--shadow);
  display: flex; flex-direction: column;
  transition: transform 300ms var(--ease), border-color var(--t), box-shadow 300ms var(--ease), background var(--t);
}
.service-card:hover { transform: translateY(-4px); border-color: var(--gold); box-shadow: 0 16px 36px -16px var(--shadow); }
.service-icon {
  width: 44px; height: 44px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; color: var(--accent); margin-bottom: 18px;
  flex-shrink: 0; transition: background var(--t), color var(--t), border-color var(--t);
}
.service-card:hover .service-icon { background: var(--gold); color: #0c1626; border-color: var(--gold); }
.service-icon .ic { width: 22px; height: 22px; }
.service-title {
  margin: 0 0 10px; font-family: var(--serif); font-size: 1.24rem; font-weight: 500; color: var(--heading);
  letter-spacing: -.01em; line-height: 1.35;
}
.service-desc { font-size: .9375rem; line-height: 1.68; color: var(--muted); margin: 0 0 20px; flex-grow: 1; }
.service-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; }
.service-tags span {
  display: inline-block; padding: 4px 11px; font-size: .75rem; font-weight: 600; letter-spacing: .02em;
  border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--text);
  transition: border-color var(--t);
}

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.skills li { padding: 28px 26px 30px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background var(--t); }
.skills li:hover { background: var(--panel); }
.skill-num { font-family: var(--serif); font-size: .95rem; letter-spacing: .08em; color: var(--accent); }
.skills h3 { margin: 10px 0 10px; font-family: var(--serif); font-weight: 400; font-size: 1.2rem; letter-spacing: -.01em; color: var(--heading); }
.skills p { font-size: .9375rem; line-height: 1.75; color: var(--muted); }

/* ---------- Certificates (frames) ---------- */
.frames { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.frame { display: flex; flex-direction: column; height: 100%; background: var(--frame); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 2px rgba(0, 18, 25, .06); transition: transform 300ms var(--ease), box-shadow 300ms var(--ease), background var(--t); }
.frame:hover { transform: translateY(-5px); box-shadow: 0 26px 44px -30px var(--shadow); }
.frame-art { position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; color: #fff; }
.frame-art::before { content: ""; position: absolute; width: 62%; aspect-ratio: 1; right: -16%; top: -34%; border-radius: 50%; border: 1px solid rgba(212, 175, 90, .32); }
.frame-art::after { content: ""; position: absolute; width: 92%; aspect-ratio: 1; right: -34%; top: -56%; border-radius: 50%; border: 1px solid rgba(253, 252, 250, .1); }
.g1 { background: linear-gradient(135deg, #25467a, #111f3b); }
.g2 { background: linear-gradient(135deg, #2c2a27, #151412); }
.g3 { background: linear-gradient(135deg, #1c3450, #0c1626); }
.frame-word { position: relative; z-index: 1; font-family: var(--serif); font-style: italic; font-size: clamp(1.6rem, 2.6vw, 2.2rem); color: var(--gold-light); letter-spacing: -.01em; }
.frame-pill { position: absolute; z-index: 1; right: 12px; bottom: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, .55); font-size: .78rem; font-weight: 500; color: #fff; }
/* certificate preview: the real certificate sits on a mat, shown whole whatever its proportions */
.frame-shot { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--panel); border-bottom: 1px solid var(--line); overflow: hidden; transition: background var(--t), border-color var(--t); }
.frame-shot img { position: absolute; inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); object-fit: scale-down; border-radius: 6px; filter: drop-shadow(0 6px 10px rgba(0, 18, 25, .2)); transition: transform 500ms var(--ease); }
.frame:hover .frame-shot img { transform: scale(1.035); }
.frame-more { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 0 16px 15px; font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); transition: gap 300ms var(--ease); }
.frame-more .ic { width: 13px; height: 13px; }
.frame:hover .frame-more { gap: 14px; }
.frame-shot + .frame-title { padding: 13px 16px 10px; font-size: .9375rem; }
/* certificate cards are kept compact: four across on desktop, stepping down with the screen */
.frames.frames-certs { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 1100px) { .frames.frames-certs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 800px) { .frames.frames-certs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }
@media (max-width: 480px) {
  .frames.frames-certs { grid-template-columns: 1fr; }
  .frames-certs .frame-shot { aspect-ratio: 16 / 9; }
}
.frame-title { display: block; padding: 16px 18px 18px; font-size: .95rem; font-weight: 500; line-height: 1.4; color: var(--heading); }
.frame-text { display: block; padding: 0 18px 18px; margin-top: -8px; font-size: .9375rem; color: var(--muted); }
.frames-projects { margin-top: 48px; }

/* ---------- Projects (covers) ---------- */
.projects-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.projects-copy { display: grid; gap: 20px; justify-items: start; }
.projects-copy p { font-size: 1rem; max-width: 46ch; }
.covers { display: grid; grid-template-columns: repeat(2, minmax(0, 260px)); gap: 28px; justify-content: end; }
.cover {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  aspect-ratio: 2 / 3; padding: 18px 16px;
  border: 10px solid var(--gold); color: var(--on-navy);
  transition: transform 300ms var(--ease), box-shadow 300ms var(--ease);
}
.cover:hover { transform: translateY(-6px) rotate(-.6deg); box-shadow: 0 30px 50px -30px var(--shadow); }
.cover::before { content: ""; position: absolute; width: 120%; aspect-ratio: 1; left: -10%; bottom: -62%; border-radius: 50%; border: 1px solid rgba(212, 175, 90, .35); }
.cover-navy { background: radial-gradient(80% 50% at 50% 100%, rgba(74, 122, 184, .5), transparent 70%), linear-gradient(180deg, #1c3450, #101d38); }
.cover-dark { background: radial-gradient(80% 50% at 50% 100%, rgba(140, 132, 120, .35), transparent 70%), linear-gradient(180deg, #33312e, #171614); }
.cover-tag { align-self: flex-start; padding: 4px 9px; background: rgba(8, 16, 30, .7); font-family: var(--sans); font-weight: 500; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; }
.cover-title { margin-top: auto; font-family: var(--serif); font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.1; }
.cover-sub { margin-top: 10px; font-family: var(--serif); font-style: italic; font-size: .98rem; color: var(--gold-light); }
.cover-foot { margin-top: auto; font-size: .78rem; line-height: 1.5; letter-spacing: .08em; text-transform: uppercase; color: var(--on-navy-2); position: relative; }

/* ---------- Invitation ---------- */
.invite { background: var(--hero); color: var(--on-navy); padding: clamp(64px, 9vw, 116px) 0; text-align: center; transition: background var(--t); }
.invite-inner { display: grid; justify-items: center; }
.eyebrow { font-size: .8125rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-light); margin-bottom: 18px; }
.invite-title { font-family: var(--serif); font-weight: 400; font-size: clamp(1.6rem, 3vw, 2.3rem); line-height: 1.2; letter-spacing: -.015em; }
.invite-text { margin-top: 16px; max-width: 52ch; font-size: 1rem; color: var(--on-navy-2); }
.invite-cta { margin-top: 32px; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }

/* ---------- Footer ---------- */
.footer { background: var(--footer); color: var(--on-navy-3); padding: 64px 0 0; transition: background var(--t); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) repeat(2, minmax(0, .8fr)) minmax(0, 1.2fr); gap: 40px; padding-bottom: 56px; }
.fbrand { display: inline-flex; align-items: center; gap: 14px; }
.fbrand-text { display: grid; }
.fbrand-text strong { font-family: var(--serif); font-weight: 400; font-size: 1.15rem; letter-spacing: .08em; color: var(--on-navy); }
.fbrand-text small { margin-top: 4px; font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-light); }
.footer-brand p { margin-top: 22px; max-width: 40ch; font-size: .9375rem; line-height: 1.75; color: #a8a89e; }
.socials { display: flex; gap: 8px; margin-top: 22px; }
.socials a { display: grid; place-items: center; width: 38px; height: 38px; color: var(--on-navy-3); transition: color var(--t), background var(--t); }
.socials a:hover { color: #0c1626; background: var(--gold-light); }
.socials .ic { width: 17px; height: 17px; }
.footer-h { font-family: var(--sans); font-size: .8125rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-light); margin-bottom: 22px; }
.footer-list { display: grid; gap: 14px; font-size: .9375rem; }
.footer-list a { overflow-wrap: anywhere; transition: color var(--t); }
.footer-list a:hover { color: var(--gold-light); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding: 24px 0 28px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: .875rem; color: #a8a89e; }
.footer-bottom a:hover { color: var(--gold-light); }

/* ---------- Reveal ---------- */
html.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
html.js .reveal.in { opacity: 1; transform: none; }
html.js .timeline .reveal:nth-child(2), html.js .frames .reveal:nth-child(3n+2) { transition-delay: 90ms; }
html.js .frames .reveal:nth-child(3n) { transition-delay: 180ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html.js .reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* large and very large screens */
@media (min-width: 1700px) { :root { --wrap: 1360px; } }
@media (min-width: 2200px) { html { font-size: 118%; } :root { --wrap: 1640px; --head-h: 86px; } }

/* small laptop / tablet landscape: nav collapses */
@media (max-width: 1100px) {
  .nav, .header-tools .btn { display: none; }
  .burger { display: flex; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* narrow two-column hero: slightly tighter stat labels so each stays on two lines */
@media (min-width: 961px) and (max-width: 1160px), (min-width: 641px) and (max-width: 740px) {
  .hero-stats { gap: 24px 12px; }
  .stat-label { font-size: .78rem; letter-spacing: .03em; }
}

/* tablet */
@media (max-width: 960px) {
  .hero-grid, .about-grid, .projects-grid { grid-template-columns: 1fr; }
  .hero-panel { min-height: 460px; width: 100%; max-width: 560px; margin-inline: auto; }
  .about-copy .title { max-width: none; }
  .frames { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .covers { justify-content: center; }   /* covers drop below the text here, so they sit in the middle */
}

/* mobile */
@media (max-width: 640px) {
  :root { --head-h: 66px; }
  .logo-name { font-size: 1.3rem; }
  .hero-cta { flex-direction: column; gap: 12px; }
  .hero-cta .btn { width: 100%; }
  .typed { font-size: .7em; }
  .hero-stats { grid-template-columns: 1fr; gap: 22px; }
  .hero-stats li { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 12px; }
  .stat-label { margin-top: 0; }
  .hero-panel { min-height: 440px; }
  .frames { grid-template-columns: 1fr; }
  .stats-panel { gap: 28px 20px; }
  .facts-panel { grid-template-columns: 1fr; }
  .covers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .cover { border-width: 7px; padding: 12px 10px; }
  .cover-foot { font-size: .75rem; letter-spacing: .03em; overflow-wrap: anywhere; }
  .cover-sub { font-size: .95rem; }
  .invite-cta { flex-direction: column; width: 100%; max-width: 340px; }
  /* footer: brand and contact take the full width; the two short link lists sit side by side */
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 24px; }
  .footer-grid > :first-child, .footer-grid > :last-child { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; }
  /* the copyright line stays on one line: it scales down a little on narrow phones, never below 12px */
  .footer-bottom p { white-space: nowrap; font-size: clamp(.75rem, 3.65vw, .875rem); }
}

/* Below these widths two columns would break headings or labels onto extra lines, so each goes to one column. */
@media (max-width: 599px) { .skills { grid-template-columns: 1fr; } }
@media (max-width: 459px) { .covers { grid-template-columns: 1fr; width: 100%; max-width: 240px; margin-inline: auto; } }   /* single cover column, centred */
@media (max-width: 340px) { .footer-bottom p { letter-spacing: -.015em; } }   /* last few pixels at 320px */

/* small phones */
@media (max-width: 380px) {
  /* every typed phrase stays on one line: the text shrinks slightly on the narrowest phones instead of wrapping */
  .typed { font-size: min(.7em, 6.3vw); white-space: nowrap; }
  .hero-panel { min-height: 400px; }
  .orbit-stage { width: 74%; }
  .orbit-inner { inset: 27%; }
  .core { inset: 39%; }
  .sat > span { padding: 4px 8px; font-size: .75rem; letter-spacing: 0; }
  .panel-caption { padding: 36px 18px 18px; }
  .panel-caption strong { font-size: 1.2rem; }
  .panel-caption span { font-size: .75rem; letter-spacing: .04em; }
  .stats-panel { grid-template-columns: 1fr 1fr; gap: 24px 16px; padding: 22px 18px; }
  .btn { padding: 0 20px; }
}

@media print {
  .header, .hero-panel, .invite-cta { display: none !important; }
  .hero, .invite, .footer { background: #fff; color: #000; }
}
