/* ==========================================================================
   Shiv Data & IT
   Mobile-first, no framework. Light + dark via CSS variables.
   ========================================================================== */

/* ---- Fonts (self-hosted, latin subset) ---- */
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/cormorant-garamond-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/cormorant-garamond-latin-500-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
}

/* ---- Tokens ---- */
:root {
  --blue: #0e5484;
  --green: #0f4539;

  --bg: #fbfaf7;
  --surface: #ffffff;
  --tint: #f1f5f7;
  --text: #14212b;
  --muted: #455767;
  --line: #d6dfe5;

  --accent: #0e5484;          /* links, accents (text on --bg: ~7.8:1) */
  --accent-2: #0f4539;        /* secondary accent */
  --btn-bg: #0e5484;
  --btn-text: #ffffff;
  --btn-hover: #0a4066;
  --focus: #0e5484;
  --logo-bg: #f4f7f9;
  --shadow: 0 1px 2px rgba(20, 33, 43, 0.06), 0 8px 24px rgba(20, 33, 43, 0.06);

  --font-head: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --radius: 14px;
  --header-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c141b;
    --surface: #121d26;
    --tint: #101a22;
    --text: #e8eef2;
    --muted: #a7b6c2;
    --line: #253440;
    --accent: #7db9e3;
    --accent-2: #7cc4a6;
    --btn-bg: #7db9e3;
    --btn-text: #0c141b;
    --btn-hover: #a0cdee;
    --focus: #a0cdee;
    --logo-bg: #e9eef2;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c141b;
  --surface: #121d26;
  --tint: #101a22;
  --text: #e8eef2;
  --muted: #a7b6c2;
  --line: #253440;
  --accent: #7db9e3;
  --accent-2: #7cc4a6;
  --btn-bg: #7db9e3;
  --btn-text: #0c141b;
  --btn-hover: #a0cdee;
  --focus: #a0cdee;
  --logo-bg: #e9eef2;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; }
[hidden] { display: none !important; }

h1, h2, h3, .stat__num, .service__num { font-family: var(--font-head); font-variant-numeric: lining-nums; }
h1, h2, h3 { font-weight: 600; line-height: 1.08; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.5rem, 7.2vw + 0.5rem, 4.6rem); font-weight: 700; }
h1 em { font-style: italic; font-weight: 500; color: var(--accent); }
h2 { font-size: clamp(2.1rem, 4.4vw + 0.6rem, 3.2rem); }
h3 { font-size: 1.5rem; line-height: 1.15; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.container { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 1rem; }
@media (min-width: 640px) { .container { padding-inline: 1.5rem; } }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--btn-bg); color: var(--btn-text); padding: 0.6rem 1rem; border-radius: 8px; text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 0.75rem; }

.eyebrow {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0.7rem 1.5rem;
  background: var(--btn-bg); color: var(--btn-text);
  border: 2px solid var(--btn-bg); border-radius: 999px;
  font: 600 1rem/1.2 var(--font-body); text-decoration: none; cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
}
.btn:hover { background: var(--btn-hover); border-color: var(--btn-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn--ghost:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn--small { min-height: 40px; padding: 0.45rem 1.1rem; font-size: 0.9375rem; }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: var(--header-h); }
.brand { display: flex; flex-direction: column; line-height: 1.1; text-decoration: none; color: var(--text); }
.brand__name { font-family: var(--font-head); font-weight: 700; font-size: 1.6rem; letter-spacing: -0.01em; }
.brand__tag { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-2); }

.header-actions { display: flex; align-items: center; gap: 0.25rem; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  background: transparent; border: 0; border-radius: 50%; color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--tint); }

/* theme icon: show moon in light, sun in dark */
.icon--sun { display: none; }
:root[data-theme="dark"] .icon--sun { display: block; }
:root[data-theme="dark"] .icon--moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon--sun { display: block; }
  :root:not([data-theme="light"]) .icon--moon { display: none; }
}

/* Mobile nav: drawer under header when JS is on; plain wrapped list without JS */
.nav { order: 3; width: 100%; }
.nav__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.nav__list a:not(.btn) { color: var(--text); text-decoration: none; font-weight: 500; padding: 0.5rem 0; display: inline-block; }
.nav__list a:not(.btn):hover { color: var(--accent); }
.nav__list a[aria-current="true"]:not(.btn) { color: var(--accent); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }

.js .header-inner { flex-wrap: nowrap; }
.js .nav {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--bg); border-bottom: 1px solid var(--line);
  padding: 0.5rem 1rem 1.25rem; width: auto;
  display: none;
}
.js .nav.is-open { display: block; }
.js .nav__list { flex-direction: column; align-items: flex-start; gap: 0; }
.js .nav__list li { width: 100%; }
.js .nav__list a:not(.btn) { display: block; padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.js .nav__list li:last-child { padding-top: 1rem; }

@media (min-width: 900px) {
  .menu-toggle { display: none; }
  .js .nav, .nav { position: static; display: block; order: 0; width: auto; margin-left: auto; padding: 0; border: 0; background: transparent; }
  .js .nav__list, .nav__list { flex-direction: row; align-items: center; flex-wrap: nowrap; gap: 1.5rem; }
  .js .nav__list li { width: auto; }
  .js .nav__list a:not(.btn) { padding: 0.5rem 0; border: 0; }
  .js .nav__list li:last-child { padding-top: 0; }
}

/* ---- Sections ---- */
.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section--tint { background: var(--tint); border-block: 1px solid var(--line); }
.section__head { max-width: 46rem; margin-bottom: 2.5rem; }
.section__intro { color: var(--muted); font-size: 1.125rem; margin-bottom: 0; }

/* ---- Hero ---- */
.hero {
  position: relative; overflow: hidden;
  padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(3rem, 7vw, 5.5rem);
  background:
    radial-gradient(60rem 28rem at 85% -10%, color-mix(in srgb, var(--blue) 16%, transparent), transparent 70%),
    radial-gradient(40rem 24rem at -10% 110%, color-mix(in srgb, var(--green) 14%, transparent), transparent 70%);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.55;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 0%, transparent 70%);
  mask-image: radial-gradient(ellipse at 70% 30%, #000 0%, transparent 70%);
}
.hero__grid { position: relative; display: grid; gap: 2.75rem; align-items: center; }
.hero__copy { max-width: 40rem; }
.lead { font-size: clamp(1.1rem, 1.2vw + 0.9rem, 1.3rem); color: var(--muted); margin-bottom: 1.75rem; max-width: 36rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.5rem; }
.hero__meta { font-size: 0.9375rem; color: var(--muted); margin: 0; }

.shift {
  margin: 0; display: grid; gap: 0.75rem; padding: 1.25rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.shift__label { margin: 0 0 0.5rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.shift__col { padding: 1rem; border-radius: 10px; }
.shift__col ul { margin: 0; padding-left: 1.1rem; font-size: 0.97rem; line-height: 1.5; }
.shift__col li + li { margin-top: 0.3rem; }
.shift__col--before { background: var(--tint); color: var(--muted); }
.shift__col--before .shift__label { color: var(--muted); }
.shift__col--after { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.shift__col--after .shift__label { color: var(--accent-2); }
.shift__arrow { display: grid; place-items: center; color: var(--accent); transform: rotate(90deg); height: 28px; }
.shift figcaption { font-size: 0.875rem; color: var(--muted); padding: 0.25rem 0.25rem 0; }

@media (min-width: 560px) {
  .shift { grid-template-columns: 1fr auto 1.15fr; align-items: stretch; }
  .shift__arrow { transform: none; height: auto; }
  .shift figcaption { grid-column: 1 / -1; }
}
@media (min-width: 960px) {
  .hero__grid { grid-template-columns: 1.1fr 0.9fr; gap: 3.5rem; }
  .shift { grid-template-columns: 1fr; }
  .shift__arrow { transform: rotate(90deg); height: 28px; }
}

/* ---- Cards + services ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); }
.services { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
.service { position: relative; padding-top: 2.1rem; }
.service h3 { margin-bottom: 0.45em; }
.service p { margin: 0; color: var(--muted); }
.service__num { position: absolute; top: 1.1rem; right: 1.4rem; font-family: var(--font-head); font-weight: 700; font-size: 1.4rem; color: var(--accent); opacity: 0.55; }
@media (min-width: 720px) {
  .services { grid-template-columns: repeat(2, 1fr); }
  .service:last-child { grid-column: 1 / -1; }
}
@media (min-width: 1000px) {
  .services { grid-template-columns: repeat(6, 1fr); }
  .service:nth-child(-n+2) { grid-column: span 3; }
  .service:nth-child(n+3) { grid-column: span 2; }
  .service:last-child { grid-column: span 2; }
}

/* ---- Case study ---- */
.case { display: grid; gap: 1.5rem; }
.case__body { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.4rem, 3vw, 2.25rem); box-shadow: var(--shadow); }
.case__body h3 { font-size: 1.35rem; color: var(--accent-2); margin-top: 0; }
.case__body h3:not(:first-child) { margin-top: 1.6rem; }
.case__list { margin: 0; padding-left: 1.2rem; }
.case__list li + li { margin-top: 0.75rem; }
.case__result {
  background: var(--green); color: #fff; border-radius: var(--radius); padding: clamp(1.4rem, 3vw, 2rem);
  display: flex; flex-direction: column; justify-content: center;
}
:root[data-theme="dark"] .case__result { background: #0f3f34; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .case__result { background: #0f3f34; } }
.stat__num { font-family: var(--font-head); font-weight: 700; font-size: clamp(3.2rem, 8vw, 4.4rem); line-height: 1; margin: 0 0 0.6rem; }
.stat__num span { font-size: 0.4em; font-weight: 600; margin-left: 0.25em; opacity: 0.85; }
.stat__label { margin: 0 0 0.75rem; font-size: 1.02rem; color: #fff; }
.stat__note { margin: 0; font-size: 0.875rem; color: #cfe3dc; }
@media (min-width: 900px) { .case { grid-template-columns: 1.7fr 1fr; align-items: stretch; } }

/* ---- Steps ---- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem; counter-reset: s; }
.step { position: relative; padding-top: 1rem; border-top: 2px solid var(--line); }
.step__num {
  display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; margin-bottom: 0.75rem;
  border-radius: 50%; background: var(--btn-bg); color: var(--btn-text); font-weight: 700; font-size: 1rem;
}
.step h3 { margin-bottom: 0.3em; }
.step p { margin: 0; color: var(--muted); }
@media (min-width: 640px) { .steps { grid-template-columns: repeat(2, 1fr); gap: 2rem; } }
@media (min-width: 960px) { .steps { grid-template-columns: repeat(4, 1fr); } }

/* ---- About ---- */
.about { display: grid; gap: 2.5rem; align-items: start; }
.about__text { max-width: 38rem; }
.about__text p { color: var(--text); }
.about__photos { display: grid; gap: 0.9rem; }
.photo { margin: 0; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line); background: var(--tint); box-shadow: var(--shadow); }
.photo img { display: block; width: 100%; height: auto; }
.photo--portrait { max-width: 26rem; }
@media (min-width: 900px) {
  .about { grid-template-columns: 1.1fr 0.9fr; gap: 4rem; }
  .photo--portrait { max-width: none; }
}

/* ---- Education ---- */
.edu { display: grid; gap: 1.1rem; }
.edu__item h3 { font-size: 1.45rem; margin-bottom: 0.3em; }
.edu__item p { margin: 0; color: var(--muted); }
.edu__item .edu__years { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 0.6rem; }
@media (min-width: 800px) { .edu { grid-template-columns: repeat(3, 1fr); } }

/* ---- Tech stack ---- */
.stack { display: grid; gap: 2rem 3rem; }
.stack__group h3 { font-family: var(--font-body); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.9rem; }
.logos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(8.6rem, 1fr)); gap: 0.75rem; }
.logo { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.8rem 0.6rem 0.6rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font-weight: 500; font-size: 0.95rem; line-height: 1.25; }
.logo__mark { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 10px; background: var(--logo-bg); }
.logo__mark img { width: 30px; height: 30px; }
.logo__mark--text { font-weight: 800; font-size: 0.8rem; letter-spacing: -0.02em; color: #0e5484; }
.logo__name small { display: block; margin-top: 0.15rem; font-size: 0.72rem; font-weight: 400; color: var(--muted); line-height: 1.3; }
.stack__group:nth-child(4) .logos { grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); }
.chips { list-style: none; margin: 0.9rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chips li { padding: 0.35rem 0.85rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 0.9rem; color: var(--muted); }
@media (min-width: 900px) { .stack { grid-template-columns: repeat(2, 1fr); } .stack__group:nth-child(2) { grid-row: span 2; } }

/* ---- Contact ---- */
.section--contact { background: linear-gradient(180deg, var(--bg), color-mix(in srgb, var(--blue) 8%, var(--bg))); border-top: 1px solid var(--line); }
.contact { display: grid; gap: 2.5rem; align-items: start; }
.contact__intro { max-width: 34rem; }
.contact__intro > p:not(.eyebrow) { color: var(--muted); font-size: 1.125rem; }
.form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem); box-shadow: var(--shadow); }
.field { margin-bottom: 1.1rem; }
.field label { display: block; margin-bottom: 0.35rem; font-weight: 600; font-size: 0.95rem; }
.req { color: var(--accent); }
.opt { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 0.7rem 0.9rem; font: inherit; color: var(--text);
  background: var(--bg); border: 1.5px solid color-mix(in srgb, var(--muted) 60%, var(--line)); border-radius: 10px;
}
.field textarea { min-height: 8rem; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.form .btn { width: 100%; }
.form__note { margin: 0.9rem 0 0; font-size: 0.875rem; color: var(--muted); text-align: center; }
@media (min-width: 900px) { .contact { grid-template-columns: 0.9fr 1.1fr; gap: 4rem; } .form .btn { width: auto; } .form__note { text-align: left; } }

.schedule-or { margin-top: -0.25rem; font-size: 0.95rem !important; }

/* ---- Availability status: driven by <html data-availability="open|waitlist|closed"> ---- */
:root { --status-color: #1f9d68; }
html[data-availability="waitlist"] { --status-color: #c47f00; }
html[data-availability="closed"] { --status-color: #7b8996; }

[data-when] { display: none; }
html:not([data-availability="waitlist"]):not([data-availability="closed"]) [data-when="open"],
html[data-availability="waitlist"] [data-when="waitlist"],
html[data-availability="closed"] [data-when="closed"] { display: inline; }
html[data-availability="closed"] .schedule,
html[data-availability="closed"] .schedule-or { display: none; }

.status { display: flex; align-items: center; gap: 0.65rem; margin: 0 0 1.25rem; font-size: 0.9375rem; font-weight: 600; line-height: 1.35; color: var(--text); }
.status--pill { display: inline-flex; padding: 0.4rem 1rem 0.4rem 0.8rem; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); }
.status--box { align-items: flex-start; padding: 0.9rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--status-color); border-radius: var(--radius); font-weight: 400; font-size: 1rem; }
.status--box strong { font-weight: 700; }
.contact__intro > p.status { color: var(--text); font-size: 1rem; }
.status__dot { flex: none; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--status-color); box-shadow: 0 0 0 4px color-mix(in srgb, var(--status-color) 24%, transparent); }
.status--box .status__dot { margin-top: 0.5rem; }
@media (prefers-reduced-motion: no-preference) {
  html:not([data-availability="waitlist"]):not([data-availability="closed"]) .status__dot { animation: pulse 2.6s ease-in-out infinite; }
}
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--status-color) 24%, transparent); } 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--status-color) 8%, transparent); } }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--line); padding-block: 2rem; font-size: 0.9375rem; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; }
.footer-inner p { margin: 0; }

/* ---- Simple pages (thanks / 404) ---- */
.simple { min-height: 70vh; display: grid; place-items: center; text-align: center; padding-block: 4rem; }
.simple p { color: var(--muted); max-width: 32rem; margin-inline: auto; }

/* ---- Scroll reveal (only when JS is running) ---- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  * { scroll-behavior: auto !important; }
}

@media print {
  .site-header, .skip-link, .form, .icon-btn { display: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
