/* ============================================================
   Imran Hossain: personal site stylesheet
   An editorial page: serif reading text, one column, quiet
   sans labels. Colours come from the IH mark (navy, with red
   used sparingly); typography stays distinct from the firm site.
   ============================================================ */

:root {
  --paper: #F6F4EF;
  --paper-2: #EEEBE3;
  --rule: #DAD5CA;
  --ink: #1D1C1A;
  --ink-2: #47453F;
  --ink-3: #6E6B64;
  --accent: #052C48;
  --accent-ink: #0B3D63;
  --on-accent: #FFFFFF;
  --mark-navy: #052C48;
  --mark-red: #FF1616;
  --dot: rgba(5, 44, 72, 0.22);
  --tile: #FFFFFF;

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --fs-display: clamp(2.6rem, 7vw, 4.25rem);
  --fs-h2: clamp(1.65rem, 3.4vw, 2.2rem);
  --fs-h3: 1.4rem;
  --fs-lead: clamp(1.2rem, 2.2vw, 1.4rem);
  --fs-body: 1.1875rem;
  --fs-small: 0.9375rem;
  --fs-label: 0.75rem;

  --wrap: 1080px;
  --measure: 40rem;
  --gutter: clamp(16px, 4vw, 40px);
  --gap: clamp(48px, 6.5vw, 84px);
  color-scheme: only light;
}


*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--fs-body);
  line-height: 1.65;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { margin: 0; font-weight: 500; line-height: 1.15; letter-spacing: -0.012em; text-wrap: balance; }
h1 { font-size: var(--fs-display); letter-spacing: -0.02em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--paper); padding: 8px 12px; }

/* Labels and small UI text use the sans */
.eyebrow, .label, .meta, .nav, .btn, .site-footer, .timeline .when, .figure .cap, .fig-note, .tag, .chips {
  font-family: var(--sans);
}
.eyebrow, .label {
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 16px;
}

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--rule); }
.header-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 32px; padding-top: 22px; padding-bottom: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 1.3rem; font-weight: 500; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.brand .mark { width: 30px; height: 28px; flex: none; }
.mark-dot { fill: var(--mark-red); }
.mark-body { fill: var(--mark-navy); }
.nav { display: flex; flex-wrap: wrap; gap: 6px 24px; font-size: 0.95rem; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 4px 0; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -1px 0 var(--ink); }
@media (max-width: 480px) { .nav { gap: 6px 16px; font-size: 0.9rem; } }

/* ---------- Page structure ---------- */
main { display: block; }
.section { padding: var(--gap) 0 0; }
.section:last-child { padding-bottom: var(--gap); }
.section-head { max-width: var(--measure); margin-bottom: 28px; }
.section-head h2 + p { margin-top: 14px; color: var(--ink-2); }
.prose { max-width: var(--measure); }
.prose h2 { margin: 1.8em 0 0.6em; }
.prose > :first-child, .prose > .label + h2 { margin-top: 0; }
.prose h3 { margin: 1.6em 0 0.5em; font-size: 1.3rem; }
.prose ul { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.4em; }
.lead { font-size: var(--fs-lead); line-height: 1.5; color: var(--ink-2); }
.muted { color: var(--ink-3); }
.more { font-family: var(--sans); font-size: var(--fs-small); font-weight: 500; }

/* ---------- Hero ---------- */
.hero, .page-head { position: relative; isolation: isolate; }
.hero { padding: clamp(48px, 9vw, 112px) 0 0; }
/* Dotted field behind the hero, fading out from the portrait side */
.dotfield::before {
  content: ""; position: absolute; z-index: -1; inset: 0 0 -80px 0;
  background-image: radial-gradient(var(--dot) 1.3px, transparent 1.6px);
  background-size: 18px 18px;
  -webkit-mask-image: radial-gradient(ellipse 55% 75% at 82% 45%, #000 0%, transparent 70%);
          mask-image: radial-gradient(ellipse 55% 75% at 82% 45%, #000 0%, transparent 70%);
  pointer-events: none;
}
.hero-grid { display: grid; gap: 32px; align-items: end; }
.hero h1 { margin-bottom: 24px; }
.hero .lead { max-width: 36rem; }
/* Soft oval portrait with a red square and a navy circle taken from the IH mark. Alternatives: materials/portrait-options.html */
.portrait { margin: 0; max-width: 190px; order: -1; position: relative; }
.portrait .frame { position: relative; isolation: isolate; }
.portrait img { position: relative; width: 100%; aspect-ratio: 1; object-fit: cover; object-position: 50% 35%; border-radius: 47% 53% 44% 56% / 54% 46% 54% 46%; }
.portrait .sq, .portrait .circ { position: absolute; z-index: 1; display: block; }
.portrait .sq { left: -4%; top: 10%; width: 11%; aspect-ratio: 291 / 240; background: var(--mark-red); }
.portrait .circ { right: 2%; bottom: 4%; width: 9%; aspect-ratio: 1; border-radius: 50%; background: var(--accent); }
.portrait figcaption { font-family: var(--sans); font-size: 0.85rem; color: var(--ink-3); margin-top: 22px; }
@media (min-width: 820px) {
  .hero-grid { gap: 72px; }
  .portrait { max-width: none; order: 0; }
  .hero-grid { grid-template-columns: minmax(0, 1fr) 320px; }
}

.page-head { padding: clamp(48px, 9vw, 104px) 0 0; }
.page-head h1 { font-size: clamp(2.3rem, 6vw, 3.4rem); margin-bottom: 20px; }
.page-head .lead { max-width: var(--measure); }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  font-size: 0.95rem; font-weight: 500; text-decoration: none; border-radius: 2px;
  border: 1px solid var(--ink-3); color: var(--ink);
}
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--on-accent); }

/* ---------- Logos of organisations I've worked with ---------- */
.logo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 640px) { .logo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
.logo-grid li { display: grid; grid-template-rows: 1fr auto; border: 1px solid var(--rule); background: var(--tile); border-radius: 4px; overflow: hidden; }
.logo-grid .logo-box { display: grid; place-items: center; height: 112px; padding: 16px 20px; }
.logo-grid img { max-width: 82%; max-height: 40px; width: auto; height: auto; }
.logo-grid img.sq { max-height: 64px; }
.logo-grid .cap { font-family: var(--sans); font-size: 0.8rem; line-height: 1.4; color: #6E6B64; padding: 10px 14px; border-top: 1px solid #E6E1D6; background: #FAF9F6; }
.logo-grid .cap strong { display: block; color: #1D1C1A; font-weight: 600; }
.role-logo { display: grid; place-items: center; width: 96px; height: 56px; margin: 12px 0 12px; padding: 8px 10px; background: var(--tile); border: 1px solid var(--rule); border-radius: 4px; }
.role-logo img { max-width: 100%; max-height: 28px; width: auto; height: auto; }
.role-logo img.sq { max-height: 40px; }

/* ---------- Focus areas ---------- */
.focus { display: grid; gap: 36px; margin: 0; padding: 0; list-style: none; }
.focus h3 { font-size: 1.25rem; margin-bottom: 8px; }
.focus p { color: var(--ink-2); font-size: 1.0625rem; }
@media (min-width: 820px) { .focus { grid-template-columns: repeat(3, 1fr); gap: 40px; } }
.aside-note { max-width: var(--measure); margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--rule); color: var(--ink-2); }

/* ---------- Work entries ---------- */
.work-list { border-top: 1px solid var(--rule); }
.entry { display: grid; gap: 14px 56px; padding: 36px 0; border-bottom: 1px solid var(--rule); }
.entry .meta, .case .meta { font-size: 0.85rem; line-height: 1.5; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; }
.entry .meta .type, .case .meta .type { color: var(--accent-ink); font-weight: 600; }
.entry h3 a { color: var(--ink); text-decoration: none; }
.entry h3 a:hover { text-decoration: underline; }
.entry .summary { color: var(--ink-2); font-size: 1.0625rem; max-width: 38rem; margin-top: 10px; }
.figure { align-self: start; }
.figure .num { font-size: 2rem; line-height: 1.1; font-weight: 500; font-variant-numeric: lining-nums tabular-nums; }
.figure .cap { display: block; font-size: 0.85rem; line-height: 1.45; color: var(--ink-3); margin-top: 6px; }
@media (min-width: 820px) { .entry { grid-template-columns: minmax(0, 1fr) 200px; } }

/* Full case write-ups on the Work page */
.case { padding: 48px 0; border-bottom: 1px solid var(--rule); scroll-margin-top: 24px; }
.case:first-of-type { border-top: 1px solid var(--rule); }
.case-grid { display: grid; gap: 24px 56px; }
@media (min-width: 820px) { .case-grid { grid-template-columns: minmax(0, 1fr) 220px; } }
.case h3 { font-size: clamp(1.45rem, 2.6vw, 1.75rem); margin: 8px 0 20px; }
.case dl { margin: 0; max-width: var(--measure); }
.case dt { font-family: var(--sans); font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-top: 20px; }
.case dt:first-child { margin-top: 0; }
.case dd { margin: 6px 0 0; }
.case dd ul { padding-left: 1.2em; margin: 0; }
.case dd li { margin-bottom: 0.35em; }
.fig-note { font-size: 0.85rem; color: var(--ink-3); }
.group-head { margin: var(--gap) 0 0; }
.group-head:first-child { margin-top: 0; }
.group-head h2 { margin-bottom: 12px; }
.group-head p { color: var(--ink-2); max-width: var(--measure); margin-bottom: 32px; }

/* ---------- Quotes ---------- */
.quote { margin: 32px 0 0; padding-left: 20px; border-left: 2px solid var(--accent); max-width: 36rem; }
.quote p { font-style: italic; color: var(--ink-2); font-size: 1.0625rem; }
.quote footer { font-family: var(--sans); font-size: 0.85rem; color: var(--ink-3); margin-top: 8px; }
.quote footer strong { color: var(--ink); font-weight: 600; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; max-width: 46rem; }
.timeline > li { display: grid; gap: 4px 32px; padding: 22px 0; border-top: 1px solid var(--rule); }
.timeline > li:last-child { border-bottom: 1px solid var(--rule); }
.timeline .when { font-size: 0.875rem; color: var(--ink-3); font-variant-numeric: tabular-nums; padding-top: 4px; }
.timeline h3 { font-size: 1.2rem; }
.timeline .org { color: var(--ink-2); margin: 4px 0 0; }
.timeline .detail { margin-top: 12px; font-size: 1.0625rem; }
.timeline .detail ul { padding-left: 1.2em; margin: 0; }
.timeline .detail li { margin-bottom: 0.4em; }
@media (min-width: 640px) { .timeline > li { grid-template-columns: 150px minmax(0, 1fr); } }

/* ---------- Facts (education, tools) ---------- */
.facts { display: grid; gap: 40px; max-width: 56rem; }
@media (min-width: 820px) { .facts { grid-template-columns: 1fr 1fr; gap: 56px; } }
.facts h3 { font-size: 1.2rem; margin-bottom: 14px; }
.facts ul { list-style: none; margin: 0; padding: 0; }
.facts li { padding: 10px 0; border-top: 1px solid var(--rule); font-size: 1.0625rem; }
.facts li span { display: block; color: var(--ink-3); font-size: 0.95rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 0.875rem; }
.chips li { padding: 4px 10px; border: 1px solid var(--rule); border-radius: 2px; color: var(--ink-2); }

/* ---------- Writing ---------- */
.writing-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); max-width: 46rem; }
.writing-list li { padding: 22px 0; border-bottom: 1px solid var(--rule); }
.writing-list a { color: var(--ink); text-decoration: none; font-size: 1.25rem; line-height: 1.3; }
.writing-list a:hover { text-decoration: underline; }
.writing-list p { color: var(--ink-2); font-size: 1.0625rem; margin: 6px 0 0; }
.writing-list .meta { display: block; font-family: var(--sans); font-size: 0.85rem; color: var(--ink-3); margin-top: 6px; }

.article-head { max-width: var(--measure); padding-top: clamp(40px, 8vw, 88px); }
.article-head h1 { font-size: clamp(2rem, 5vw, 2.9rem); margin: 8px 0 16px; }
.article { max-width: var(--measure); margin-top: 40px; }
.article h2 { font-size: 1.5rem; margin: 1.6em 0 0.5em; }
.article ul, .article ol { padding-left: 1.2em; }
.article li { margin-bottom: 0.4em; }
.article-foot { max-width: var(--measure); margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--rule); font-family: var(--sans); font-size: var(--fs-small); color: var(--ink-3); }
.back { font-family: var(--sans); font-size: var(--fs-small); text-decoration: none; }

/* ---------- Contact ---------- */
.contact-list { list-style: none; margin: 0; padding: 0; max-width: var(--measure); border-top: 1px solid var(--rule); }
.contact-list li { display: grid; gap: 2px 32px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.contact-list .k { font-family: var(--sans); font-size: 0.85rem; color: var(--ink-3); padding-top: 3px; }
@media (min-width: 640px) { .contact-list li { grid-template-columns: 150px minmax(0, 1fr); } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); font-size: 0.875rem; color: var(--ink-3); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 28px; padding-bottom: 40px; }
.footer-inner p { margin: 0; }
.site-footer a { color: var(--ink-2); }
.footer-inner .rights { flex-basis: 100%; font-size: 0.8rem; margin-top: 4px; }

/* ---------- Education and recognition ---------- */
.edu-card { display: grid; gap: 20px 28px; padding: 28px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper-2); max-width: 56rem; }
@media (min-width: 640px) { .edu-card { grid-template-columns: 96px minmax(0, 1fr); } }
.edu-logo { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%; background: var(--tile); border: 1px solid var(--rule); }
.edu-logo img { width: 80px; height: 80px; }
.edu-card h3 { font-size: 1.3rem; }
.edu-card .org { color: var(--ink-2); margin: 6px 0 0; }
.edu-points { list-style: none; margin: 14px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-family: var(--sans); font-size: 0.9rem; color: var(--ink-2); }
.edu-points strong { color: var(--ink); font-weight: 600; }
.honours { display: grid; gap: 16px; margin-top: 16px; max-width: 56rem; }

.honour { position: relative; padding: 26px 28px 24px; border: 1px solid var(--rule); border-top: 3px solid var(--accent); border-radius: 6px; background: var(--paper); }
.honour::before { content: ""; position: absolute; top: 22px; right: 24px; width: 14px; aspect-ratio: 291 / 240; background: var(--mark-red); }
.honour .kicker { font-family: var(--sans); font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-ink); margin: 0 0 10px; }
.honour h3 { font-size: 1.3rem; }
.honour .when-line { font-family: var(--sans); font-size: 0.85rem; color: var(--ink-3); margin: 4px 0 12px; }
.honour p:last-child { font-size: 1.0625rem; color: var(--ink-2); }
.minor-honours { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 28px; font-family: var(--sans); font-size: 0.9rem; color: var(--ink-3); }

/* Photos on education and recognition cards */
.photo-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.photo-strip figure { margin: 0; }
.photo-strip img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; }
.photo-strip figcaption { font-family: var(--sans); font-size: 0.8rem; line-height: 1.4; color: var(--ink-3); margin-top: 6px; }
.honour-feature { display: grid; gap: 4px 32px; }
@media (min-width: 640px) { .honour-feature { grid-column: 1 / -1; } }
@media (min-width: 820px) { .honour-feature { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); align-items: start; } .honour-feature .photo-strip { margin-top: 0; } }
.honour-feature::before { display: none; }
.facts li.has-badge { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; align-items: center; }
.badge { display: block; }
.badge img { width: 64px; height: 64px; }

/* ---------- Selected contract work ---------- */
.client-grid { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 640px) { .client-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .client-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.client { padding: 0 0 22px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); overflow: hidden; }
.client > :not(.client-mark) { padding-left: 22px; padding-right: 22px; }
.client-mark { display: grid; place-items: center; height: 96px; margin-bottom: 18px; padding: 16px 24px; background: var(--tile); border-bottom: 1px solid var(--rule); }
.client-mark img { max-width: 70%; max-height: 40px; width: auto; height: auto; }
.wordmark { font-family: var(--serif); font-size: 1.45rem; font-weight: 500; letter-spacing: -0.01em; color: #1D1C1A; text-align: center; line-height: 1.1; }
.client h3 { font-size: 1.15rem; }
.client .meta { font-family: var(--sans); font-size: 0.8rem; color: var(--ink-3); margin: 4px 0 10px; }
.client p:last-child { font-size: 1rem; color: var(--ink-2); line-height: 1.55; }
.described { margin-top: 36px; max-width: var(--measure); }
.described ul { margin: 0; padding-left: 1.2em; }
.described li { margin-bottom: 0.5em; font-size: 1.0625rem; color: var(--ink-2); }
.client-mark img.tall { max-height: 64px; }

/* =========================================================
   Motion and interaction (js/site.js). All of it is switched
   off for reduced motion and touch devices.
   ========================================================= */

/* Brand: logo and name share one optical centre line */
.brand { gap: 11px; line-height: 1; }
.brand span { display: block; line-height: 1; padding-top: 0.12em; }
.brand .mark { width: 28px; height: 26px; }

/* Sticky header with a scroll-progress line */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 244, 239, 0.86);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
  transition: box-shadow .3s ease, background-color .3s ease;
}
.site-header.scrolled { box-shadow: 0 10px 30px -22px rgba(5, 44, 72, 0.45); }
.header-inner { transition: padding .3s ease; }
.site-header.scrolled .header-inner { padding-top: 14px; padding-bottom: 13px; }
.progress {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent) 92%, var(--mark-red));
  transform: scaleX(0); transform-origin: left; pointer-events: none;
}
.nav a { position: relative; }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform .35s cubic-bezier(.2,.7,.2,1);
}
.nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav a[aria-current="page"]::after { display: none; }

/* Nav hover preview */
.nav-preview {
  position: absolute; top: calc(100% + 10px); width: 280px; padding: 16px 18px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 8px;
  box-shadow: 0 18px 40px -24px rgba(5, 44, 72, 0.45);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s ease, transform .25s cubic-bezier(.2,.7,.2,1), left .25s cubic-bezier(.2,.7,.2,1), visibility 0s .25s;
}
/* Invisible bridge over the gap so the pointer can travel from the link into the panel */
.nav-preview::before { content: ""; position: absolute; left: 0; right: 0; top: -40px; height: 40px; }
.nav-preview.open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.nav-preview a { color: var(--ink); text-decoration: none; display: block; transition: color .2s, transform .2s; }
.nav-preview a:hover { color: var(--accent-ink); transform: translateX(3px); }
.nav-preview .np-title { font-family: var(--sans); font-size: var(--fs-label); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); margin: 0 0 8px; }
.nav-preview ul { margin: 0; padding: 0; list-style: none; }
.nav-preview li { font-size: 0.98rem; padding: 5px 0 5px 14px; position: relative; color: var(--ink-2); }
.nav-preview li::before { content: ""; position: absolute; left: 0; top: 0.85em; width: 6px; height: 5px; background: var(--mark-red); }

/* Hero buttons with quick-link menus */
.btn { transition: transform .25s cubic-bezier(.2,.7,.2,1), background-color .2s, border-color .2s, color .2s; }
.btn-wrap { position: relative; display: inline-flex; }
.btn-menu {
  position: absolute; z-index: 20; left: 0; top: 100%; min-width: 230px; padding-top: 10px;
  display: grid; opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .2s ease, transform .25s cubic-bezier(.2,.7,.2,1), visibility 0s .25s;
}
.btn-menu a {
  display: flex; justify-content: space-between; gap: 16px; padding: 10px 14px;
  font-family: var(--sans); font-size: 0.9rem; color: var(--ink); text-decoration: none;
  background: var(--paper); border: 1px solid var(--rule); border-top-width: 0;
  opacity: 0; transform: translateY(-6px);
  transition: opacity .25s ease calc(var(--i) * 45ms), transform .3s cubic-bezier(.2,.7,.2,1) calc(var(--i) * 45ms), background-color .2s;
}
.btn-menu a:first-child { border-top-width: 1px; border-radius: 6px 6px 0 0; }
.btn-menu a:last-child { border-radius: 0 0 6px 6px; box-shadow: 0 18px 36px -24px rgba(5, 44, 72, 0.5); }
.btn-menu a span { color: var(--mark-red); transition: transform .2s; }
.btn-menu a:hover { background: var(--paper-2); }
.btn-menu a:hover span { transform: translateX(3px); }
@media (hover: hover) and (pointer: fine) {
  .btn-wrap:hover .btn-menu, .btn-wrap:focus-within .btn-menu { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .btn-wrap:hover .btn-menu a, .btn-wrap:focus-within .btn-menu a { opacity: 1; transform: none; }
}
@media not ((hover: hover) and (pointer: fine)) { .btn-menu { display: none; } }

/* Cursor follower */
.cursor-ring, .cursor-dot { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; opacity: 0; transition: opacity .3s; }
.cursor-on .cursor-ring, .cursor-on .cursor-dot { opacity: 1; }
.cursor-on, .cursor-on * { cursor: none !important; }
.cursor-ring::before {
  content: ""; position: absolute; left: -17px; top: -17px; width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid var(--accent); opacity: .45;
  transition: transform .3s cubic-bezier(.2,.7,.2,1), opacity .3s, background-color .3s;
}
.cursor-ring.hover::before { transform: scale(1.55); opacity: .6; background: rgba(5, 44, 72, 0.06); }
.cursor-ring.press::before { transform: scale(.8); }
.cursor-dot::before { content: ""; position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; background: var(--mark-red); transition: transform .2s; }
.cursor-ring.hover + .cursor-dot::before { transform: scale(.6); }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(22px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .7s ease var(--d, 0ms), transform .8s cubic-bezier(.2,.7,.2,1) var(--d, 0ms); }

/* Hero entrance and gentle motion on the portrait accents */
@media (prefers-reduced-motion: no-preference) {
  .hero .eyebrow, .hero h1, .hero .lead, .hero .actions, .page-head .eyebrow, .page-head h1, .page-head .lead {
    animation: rise .9s cubic-bezier(.2,.7,.2,1) both;
  }
  .hero h1, .page-head h1 { animation-delay: .08s; }
  .hero .lead, .page-head .lead { animation-delay: .18s; }
  .hero .actions { animation-delay: .28s; }
  .portrait .frame { animation: pop 1s cubic-bezier(.2,.7,.2,1) .15s both; }
  .portrait .sq { animation: drift 7s ease-in-out infinite; }
  .portrait .circ { animation: drift 9s ease-in-out -3s infinite reverse; }
  .logo-grid li, .client { transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s; }
  .logo-grid li:hover, .client:hover { transform: translateY(-4px); box-shadow: 0 20px 40px -28px rgba(5, 44, 72, 0.5); }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes drift { 0%, 100% { translate: 0 0; } 50% { translate: 4px -7px; } }

/* Keep anchored headings clear of the sticky header */
[id] { scroll-margin-top: 96px; }
