/* Overhuman: base theme */
:root {
  --ink: #0d1a1e;
  --ink-2: #4a5b60;
  --paper: #f3f5f4;
  --paper-2: #e6ebea;
  --line: #cfd8d6;
  --accent: #1b6f63;
  --accent-ink: #ffffff;
  --night: #080f12;
  --night-1: #0f1b1f;
  --night-fg: #eef3f2;
  --night-2: rgba(238,243,242,0.7);
  --night-line: rgba(159,216,201,0.18);
  --glow: #9fd8c9;
  --sheet: #ffffff;
  --sheet-ink: #0d1a1e;
  --sheet-2: #5a6a6e;
  --sheet-line: #dde4e2;
  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "Figtree", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e8efed; --ink-2: #9db0ac; --paper: #0e181b; --paper-2: #152226;
    --line: #253639; --accent: #8fd3c2; --accent-ink: #081014; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #e8efed; --ink-2: #9db0ac; --paper: #0e181b; --paper-2: #152226;
  --line: #253639; --accent: #8fd3c2; --accent-ink: #081014; color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.6; margin: 0; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--night); }
a { color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--glow); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; text-wrap: balance; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
.view[hidden] { display: none !important; }
.wrap { max-width: 1280px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
@media (min-width: 900px) { .wrap { padding-left: max(40px, env(safe-area-inset-left, 0px)); padding-right: max(40px, env(safe-area-inset-right, 0px)); } }
.label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Header */
.top { position: absolute; top: env(safe-area-inset-top, 0px); left: 0; right: 0; z-index: 5; color: var(--night-fg); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 26px; }
.word { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: 0.18em; text-transform: uppercase; text-decoration: none; }
.nav { display: flex; gap: 32px; align-items: center; }
.nav a { text-decoration: none; font-size: 15px; opacity: 0.8; }
.nav a:hover, .nav a[aria-current] { opacity: 1; }
.nav a[aria-current] { text-decoration: underline; text-underline-offset: 6px; }
.nav .pill { opacity: 1; border: 1px solid currentColor; padding: 8px 18px; border-radius: 999px; }
.nav .pill[aria-current] { text-decoration: none; background: var(--sheet-ink); color: var(--sheet); border-color: var(--sheet-ink); }
body.on-contact .top { color: var(--sheet-ink); }
body.on-contact::before { background: var(--sheet); }
@media (max-width: 720px) { .nav { gap: 14px; } .nav a { font-size: 14px; } .nav .pill { padding: 6px 12px; } .word { font-size: 15px; letter-spacing: 0.12em; } }
@media (max-width: 420px) { .nav { gap: 10px; } .nav a { font-size: 13px; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 12px; font: 600 15px var(--body); text-decoration: none; padding: 14px 22px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); border: 0; cursor: pointer; transition: gap .25s ease; white-space: nowrap; }
.btn:hover { gap: 18px; }
.btn span { font-family: var(--mono); }
.btn.light { background: var(--night-fg); color: var(--night); }
.btn.dark { background: var(--sheet-ink); color: var(--sheet); }

/* Home */
.hero { position: relative; color: var(--night-fg); background: var(--night); min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; }
.hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform-origin: 62% 40%; animation: drift 40s ease-out both; }
@keyframes drift { from { transform: scale(1.16); } to { transform: scale(1.02); } }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,15,18,0.5) 0%, rgba(8,15,18,0) 30%, rgba(8,15,18,0) 50%, rgba(8,15,18,0.85) 100%); }
.hero .wrap { position: relative; z-index: 2; width: 100%; padding-block: 0 56px; display: flex; justify-content: space-between; align-items: end; gap: 32px; flex-wrap: wrap; }
.hero h1 { font-size: clamp(44px, 7.4vw, 112px); line-height: 0.95; font-weight: 300; letter-spacing: -0.045em; max-width: 11ch; margin-top: 18px; }
.hero h1 b { font-weight: 700; }
.hero .side { display: grid; gap: 6px; text-align: right; max-width: 30ch; color: var(--night-2); }
.hero .side a { color: var(--night-fg); text-decoration: none; font-weight: 600; }
.hero .side a:hover { color: var(--glow); }
.credit { position: absolute; right: max(16px, env(safe-area-inset-right, 0px)); top: calc(env(safe-area-inset-top, 0px) + 100px); z-index: 2; color: rgba(238,243,242,0.45); font-size: 10px; writing-mode: vertical-rl; }
@media (max-width: 720px) { .hero .side { text-align: left; } }
@media (prefers-reduced-motion: reduce) { .hero > img { animation: none; } }

/* Field page: title */
.f-head { background: var(--night); color: var(--night-fg); padding-block: 150px 0; }
.f-head .intro { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: end; padding-bottom: 48px; }
.f-head .crumb { color: var(--glow); margin-bottom: 20px; }
.f-head h1 { font-size: clamp(64px, 12vw, 184px); line-height: 0.85; font-weight: 300; letter-spacing: -0.055em; }
.f-head .lede { display: grid; gap: 24px; justify-items: start; min-width: 0; }
.f-head .lede p { font-size: clamp(19px, 1.6vw, 23px); line-height: 1.45; color: var(--night-2); max-width: 36ch; }
.f-head .lede p b { color: var(--night-fg); font-weight: 600; }
.f-head figure { margin: 0; }
.f-head .media { position: relative; border-radius: 4px 4px 0 0; overflow: hidden; aspect-ratio: 21 / 9; max-width: 100%; background: var(--night-1); }
.f-head .media img { width: 100%; height: 100%; object-fit: cover; }
.f-head figcaption { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 14px 18px; color: var(--night-2); border-bottom: 1px solid var(--night-line); }
@media (max-width: 860px) { .f-head .intro { grid-template-columns: 1fr; gap: 28px; } .f-head .media { aspect-ratio: 4 / 3; } }

/* Field page: capabilities */
.caps { padding-block: clamp(72px, 9vw, 120px); }
.caps .head { display: grid; grid-template-columns: 1fr 1.3fr; gap: 48px; margin-bottom: 48px; }
.caps h2 { font-size: clamp(32px, 3.8vw, 50px); line-height: 1.04; }
.caps .head p { color: var(--ink-2); font-size: 19px; max-width: 52ch; align-self: end; }
.caps .grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); }
.cap { display: grid; gap: 12px; align-content: start; padding: 24px 24px 8px 0; min-width: 0; }
.cap + .cap { padding-left: 24px; border-left: 1px solid var(--line); }
.cap .label { color: var(--accent); }
.cap h3 { font-size: 22px; line-height: 1.15; }
.cap p { color: var(--ink-2); font-size: 16px; }
@media (max-width: 960px) { .caps .grid { grid-template-columns: 1fr 1fr; } .cap:nth-child(3) { padding-left: 0; border-left: 0; } .cap:nth-child(n+3) { border-top: 1px solid var(--line); } }
@media (max-width: 860px) { .caps .head { grid-template-columns: 1fr; gap: 20px; } }
@media (max-width: 560px) { .caps .grid { grid-template-columns: 1fr; } .cap, .cap + .cap { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); padding-bottom: 20px; } .cap:first-child { border-top: 0; } }

/* Field page: projects with stage tracker */
.work { background: var(--paper-2); padding-block: clamp(72px, 9vw, 120px); }
.work .head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: 40px; }
.work h2 { font-size: clamp(32px, 3.8vw, 50px); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 28px; display: grid; grid-template-rows: auto auto 1fr auto; gap: 14px; min-width: 0; }
.card .meta { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-2); }
.card h3 { font-size: 26px; line-height: 1.12; }
.card p { color: var(--ink-2); }
.stages { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.stages li { display: grid; gap: 8px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.stages li::before { content: ""; height: 4px; border-radius: 2px; background: var(--line); }
.stages li.done::before { background: var(--accent); }
.stages li.now { color: var(--ink); }
.stages li.now::before { background: var(--accent); }
.tag { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }
@media (max-width: 960px) { .cards { grid-template-columns: 1fr; } }

/* Field page: split statement */
.split { padding-block: clamp(72px, 9vw, 120px); }
.split .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.split figure { margin: 0; border-radius: 4px; overflow: hidden; aspect-ratio: 4 / 5; max-width: 100%; background: var(--night); }
.split figure img { width: 100%; height: 100%; object-fit: cover; }
.split .copy { display: grid; gap: 24px; justify-items: start; min-width: 0; }
.split .copy .label { color: var(--accent); }
.split blockquote { margin: 0; font-family: var(--display); font-size: clamp(28px, 3.2vw, 44px); line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; }
.split .copy p { color: var(--ink-2); font-size: 18px; max-width: 46ch; }
@media (max-width: 860px) { .split .wrap { grid-template-columns: 1fr; } .split figure { aspect-ratio: 4 / 3; } }

/* Field page: next field */
.next { display: block; background: var(--night); color: var(--night-fg); text-decoration: none; }
.next .wrap { display: flex; justify-content: space-between; align-items: end; gap: 24px; padding-block: 64px; }
.next .label { color: var(--glow); display: block; margin-bottom: 12px; }
.next b { font-family: var(--display); font-weight: 300; font-size: clamp(48px, 8vw, 120px); line-height: 0.9; letter-spacing: -0.05em; }
.next .arrow { font-family: var(--mono); font-size: clamp(32px, 4vw, 56px); transition: transform .3s ease; }
.next:hover .arrow { transform: translateX(12px); }
.next:hover b { color: var(--glow); }

/* Software visual: a real interface, set like a photo */
.screen { width: 100%; height: 100%; display: grid; place-items: center; background: radial-gradient(60% 70% at 70% 30%, rgba(159,216,201,0.16), transparent 70%), #0a1417; }
.term { width: min(860px, 88%); border-radius: 10px; background: #0f1d21; border: 1px solid #1f3439; box-shadow: 0 40px 120px rgba(0,0,0,0.5); font-family: var(--mono); font-size: clamp(10px, 1.2vw, 15px); color: #c6d8d4; overflow: hidden; }
.term .bar { display: flex; gap: 8px; padding: 12px 16px; border-bottom: 1px solid #1f3439; }
.term .bar i { width: 10px; height: 10px; border-radius: 50%; background: #2c4449; }
.term pre { margin: 0; padding: 18px 22px; white-space: pre-wrap; line-height: 1.7; }
.term .k { color: #9fd8c9; } .term .s { color: #e9c79a; } .term .c { color: #5f7a80; }

/* Contact: white sheet */
.contact { background: var(--sheet); color: var(--sheet-ink); min-height: 100svh; padding-block: 150px 96px; }
.contact .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 7vw, 120px); }
.contact .label { color: var(--accent); }
.contact h1 { font-size: clamp(48px, 7vw, 104px); line-height: 0.95; font-weight: 300; letter-spacing: -0.045em; margin-top: 20px; }
.contact h1 b { font-weight: 700; }
.contact .intro { display: grid; gap: 28px; align-content: start; min-width: 0; }
.contact .intro p { color: var(--sheet-2); font-size: 19px; max-width: 40ch; }
.contact dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 12px 24px; border-top: 1px solid var(--sheet-line); padding-top: 24px; }
.contact dt { color: var(--sheet-2); }
.contact dd { margin: 0; }
.form { display: grid; gap: 20px; align-content: start; min-width: 0; }
.field { display: grid; gap: 8px; }
.field label { color: var(--sheet-2); }
.field input, .field select, .field textarea { font: 17px var(--body); color: var(--sheet-ink); background: var(--sheet); border: 0; border-bottom: 1px solid var(--sheet-ink); padding: 10px 0; border-radius: 0; width: 100%; }
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-bottom: 2px solid var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.chips legend { color: var(--sheet-2); margin-bottom: 10px; padding: 0; }
.chips input { position: absolute; opacity: 0; }
.chips label { border: 1px solid var(--sheet-line); border-radius: 999px; padding: 8px 16px; cursor: pointer; font-size: 15px; }
.chips input:checked + label { background: var(--sheet-ink); color: var(--sheet); border-color: var(--sheet-ink); }
.chips input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.note { color: var(--sheet-2); min-height: 1.6em; }
@media (max-width: 860px) { .contact .wrap { grid-template-columns: 1fr; } }

/* Footer */
footer { background: var(--night); color: var(--night-2); border-top: 1px solid var(--night-line); }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px 32px; padding-block: 32px; font-size: 14px; }
footer nav { display: flex; gap: 24px; flex-wrap: wrap; }
footer a { text-decoration: none; }
footer a:hover { color: var(--night-fg); }
body.on-home footer { display: none; }

/* ==========================================================
   Overhuman: white redesign 
   ========================================================== */

/* 1. Palette: every dark "night" surface becomes white */
html {
  --ink: #0a0a0b !important;
  --ink-2: #5b5f66 !important;
  --paper: #ffffff !important;
  --paper-2: #f7f7f8 !important;
  --line: #e8e8ea !important;
  --accent: #0b6b5d !important;
  --accent-ink: #ffffff !important;
  --night: #ffffff !important;
  --night-1: #f4f4f5 !important;
  --night-fg: #0a0a0b !important;
  --night-2: #5b5f66 !important;
  --night-line: #e8e8ea !important;
  --glow: #0b6b5d !important;
  --sheet: #ffffff !important;
  --sheet-ink: #0a0a0b !important;
  --sheet-2: #5b5f66 !important;
  --sheet-line: #e8e8ea !important;
  color-scheme: light !important;
}
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
::selection { background: #0a0a0b; color: #fff; }

/* 2. Header: fixed, white, frosted, hairline */
.top {
  position: fixed !important;
  color: var(--ink) !important;
  background: rgba(255,255,255,0.82);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { padding-block: 18px !important; }
.word { font-size: 17px !important; letter-spacing: 0.22em !important; }
.nav a { opacity: 0.66; transition: opacity .2s ease; }
.nav a:hover, .nav a[aria-current] { opacity: 1; }
.nav a[aria-current]:not(.pill) { text-decoration: none; }
.nav .pill { background: var(--ink); color: #fff !important; border-color: var(--ink) !important; padding: 9px 18px !important; font-weight: 500; }
.nav .pill:hover { background: #26272b; }
@media (max-width: 720px) {
  .top .wrap { padding-block: 14px !important; gap: 12px; }
  .word { font-size: 14px !important; letter-spacing: 0.14em !important; }
  .nav { gap: 14px; }
  .nav a { font-size: 13.5px; }
  .nav .pill { padding: 7px 13px !important; }
}
@media (max-width: 420px) {
  .word { font-size: 13px !important; letter-spacing: 0.08em !important; }
  .nav { gap: 10px; }
  .nav a { font-size: 12.5px; }
  .nav .pill { padding: 6px 11px !important; }
}
@media (max-width: 350px) {
  .nav a[href="#software"], .nav a[href="#defence"], .nav a[href="#medical"] { display: none; }
}

/* 3. Buttons: solid black pills */
.btn, .btn.light, .btn.dark { background: var(--ink) !important; color: #fff !important; font-weight: 500; padding: 15px 24px; box-shadow: 0 1px 2px rgba(10,10,11,.12); }
.btn:hover { background: #26272b !important; }

/* 4. Hero: white, big type, left-aligned, photo set as a card below */
.hero {
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column;
  align-items: stretch !important;
  background: #fff !important;
  color: var(--ink) !important;
  overflow: visible !important;
}
.hero::after { display: none !important; }
.hero .wrap {
  order: 1;
  display: grid !important;
  grid-template-columns: 1fr;
  align-items: end !important;
  gap: 28px 64px !important;
  padding-top: clamp(140px, 17vw, 210px) !important;
  padding-bottom: clamp(40px, 5vw, 64px) !important;
}
.hero .wrap .label { color: var(--accent) !important; }
.hero h1 {
  font-size: clamp(52px, 8.4vw, 132px) !important;
  font-weight: 400 !important;
  line-height: 0.94 !important;
  letter-spacing: -0.05em !important;
  max-width: 12ch !important;
}
.hero h1 b { font-weight: 700; }
.hero .side {
  text-align: left !important;
  justify-items: start;
  gap: 24px !important;
  max-width: 34ch !important;
  color: var(--ink-2) !important;
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.5;
}
.hero .side a {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink); color: #fff !important;
  padding: 15px 26px; border-radius: 999px;
  font-size: 16px; font-weight: 500;
  box-shadow: 0 1px 2px rgba(10,10,11,.12);
  transition: background .2s ease, transform .2s ease;
}
.hero .side a:hover { background: #26272b; color: #fff !important; transform: translateY(-1px); }
@media (min-width: 1000px) {
  .hero .wrap { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
  .hero .side { padding-bottom: 12px; }
}
.hero > img {
  order: 2;
  position: relative !important;
  inset: auto !important;
  display: block;
  width: calc(100% - 32px) !important;
  max-width: 1200px;
  height: clamp(300px, 46vw, 600px) !important;
  margin: 0 auto clamp(48px, 6vw, 96px);
  border-radius: 24px;
  object-fit: cover;
  animation: none !important;
  transform: none !important;
  box-shadow: 0 30px 80px -30px rgba(10,10,11,.35);
}
@media (min-width: 900px) { .hero > img { width: calc(100% - 80px) !important; } }
.credit { display: none !important; }

/* 5. Field pages */
.f-head { padding-top: clamp(130px, 14vw, 170px) !important; }
.f-head h1 { font-weight: 400 !important; letter-spacing: -0.06em !important; }
.f-head .lede p { color: var(--ink-2) !important; }
.f-head .lede p b { color: var(--ink) !important; }
.f-head .media { border-radius: 20px !important; box-shadow: 0 30px 80px -40px rgba(10,10,11,.35); }
.f-head figcaption { border-bottom: 0 !important; color: #8a8e95 !important; }

.caps .grid { border-top-color: var(--line) !important; }
.caps h2, .work h2 { letter-spacing: -0.035em; font-weight: 500; }

.work { background: var(--paper-2) !important; border-block: 1px solid var(--line); }
.card {
  background: #fff !important;
  border: 1px solid var(--line) !important;
  border-radius: 16px !important;
  box-shadow: 0 1px 2px rgba(10,10,11,.04);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -18px rgba(10,10,11,.22); border-color: #d9d9dc !important; }
.stages li::before { background: #ececee; }

.split figure { border-radius: 20px !important; background: var(--paper-2) !important; }
.split blockquote { letter-spacing: -0.03em; }

.next { background: #fff !important; border-top: 1px solid var(--line); }
.next:hover b { color: var(--accent) !important; }
.next b { font-weight: 400 !important; }

/* Software terminal stays dark: it reads as a product shot on white */
.screen { border-radius: inherit; }

/* 6. Contact */
.contact h1 { font-weight: 400 !important; }
.chips label { transition: border-color .2s ease; }
.chips label:hover { border-color: var(--ink); }

/* 7. Footer */
footer { background: #fff !important; color: var(--ink-2) !important; border-top: 1px solid var(--line) !important; }
footer a:hover { color: var(--ink) !important; }
