/* etractive — 2026 redesign
   Tokens: graphite keycaps, cool paper, the old signal red,
   and the four step colours from the original timeline. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Comfortaa";
  src: url("../fonts/comfortaa-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --graphite: #2a2b2f;
  --graphite-2: #34353a;
  --graphite-3: #45464c;
  --paper: #edeef0;
  --white: #ffffff;
  --rule: #d4d6db;
  --muted: #5d6068;
  --muted-on-dark: #a9abb3;
  --red: #f44336;
  --red-ink: #c62828;

  --k-yellow: #ffeb3b;
  --k-green: #43a047;
  --k-purple: #ab47bc;
  --k-blue: #2196f3;

  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --brand: "Comfortaa", var(--display);

  /* type scale, ratio ~1.25 from 18px */
  --fs-sm: 0.875rem;
  --fs-base: 1.125rem;
  --fs-lg: 1.375rem;
  --fs-xl: 1.75rem;
  --fs-2xl: clamp(2rem, 1.4rem + 2.4vw, 2.75rem);
  --fs-hero: clamp(2.25rem, 1.3rem + 4vw, 4.25rem);

  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section: clamp(4.5rem, 10vw, 8rem);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--graphite);
  font-family: var(--serif);
  font-size: var(--fs-base);
  line-height: 1.65;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
p { margin: 0 0 1em; text-wrap: pretty; }

a { color: var(--red-ink); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--k-blue);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--white);
  padding: 0.5rem 1rem;
  font-family: var(--display);
}
.skip:focus { top: 1rem; }

/* ---------- Header ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--graphite) 94%, transparent);
  backdrop-filter: blur(10px);
  color: var(--white);
}
.site-head .wrap {
  display: flex;
  align-items: center;
  gap: 2rem;
  min-height: 4.25rem;
}
.wordmark {
  font-family: var(--brand);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--red);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--display);
  font-size: 0.95rem;
}
.site-nav a {
  color: var(--muted-on-dark);
  text-decoration: none;
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
}
.site-nav a:hover { color: var(--white); background: var(--graphite-2); }
.site-nav .lang {
  margin-left: 0.75rem;
  color: var(--white);
  border: 1px solid var(--graphite-3);
}
.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--graphite-3);
  color: var(--white);
  border-radius: 6px;
  padding: 0.45rem 0.8rem;
  font: 600 0.95rem var(--display);
  cursor: pointer;
}

@media (max-width: 52rem) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute;
    inset: 100% 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem var(--gutter) 1.25rem;
    background: var(--graphite);
    border-top: 1px solid var(--graphite-3);
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.75rem 0.5rem; }
  .site-nav .lang { margin: 0.5rem 0 0; text-align: center; }
}

/* ---------- Hero ---------- */

.hero {
  background: var(--graphite);
  color: var(--white);
  overflow: hidden;
  position: relative;
}
/* faint keyboard grid in the background */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 4.5rem, rgb(255 255 255 / 0.045) 4.5rem calc(4.5rem + 1px)),
    repeating-linear-gradient(0deg, transparent 0 4.5rem, rgb(255 255 255 / 0.045) 4.5rem calc(4.5rem + 1px));
  mask-image: radial-gradient(ellipse at 75% 50%, #000 0%, transparent 70%);
  pointer-events: none;
}

.hero .wrap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
  padding-block: clamp(4rem, 10vw, 7.5rem);
}
.hero-lead {
  font-style: italic;
  font-size: var(--fs-lg);
  color: var(--muted-on-dark);
  margin-bottom: 1.25rem;
}
.hero h1 {
  font-size: var(--fs-hero);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin-bottom: 1.75rem;
  hyphens: auto;
  overflow-wrap: break-word;
}
.hero-text {
  font-size: var(--fs-lg);
  line-height: 1.55;
  color: #d9dade;
  max-width: 34em;
  margin-bottom: 2.25rem;
}
.actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font: 650 1rem/1 var(--display);
  padding: 1rem 1.4rem;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  border: 0;
  /* keycap-like bottom edge */
  box-shadow: inset 0 -4px 0 rgb(0 0 0 / 0.22);
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 rgb(0 0 0 / 0.22); }
.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: #e53935; }
.btn-ghost { background: var(--graphite-2); color: var(--white); box-shadow: inset 0 -4px 0 rgb(0 0 0 / 0.35), inset 0 0 0 1px var(--graphite-3); }
.btn-ghost:hover { background: var(--graphite-3); }
.btn-light { background: var(--white); color: var(--graphite); box-shadow: inset 0 -4px 0 var(--rule), inset 0 0 0 1px var(--rule); }

/* The E key — the one loud thing on the page */
.keystage {
  display: grid;
  justify-items: center;
  gap: 1.75rem;
}
.key {
  --size: clamp(11rem, 26vw, 17rem);
  width: var(--size);
  aspect-ratio: 1;
  position: relative;
  border: 0;
  padding: 0;
  cursor: pointer;
  border-radius: 18%;
  background: linear-gradient(180deg, #4a4b51 0%, #2f3034 100%);
  box-shadow:
    0 14px 0 #1b1c1f,
    0 22px 40px rgb(0 0 0 / 0.5),
    inset 0 2px 0 rgb(255 255 255 / 0.08);
  transform: rotate(-4deg);
  transition: transform 0.09s ease-out, box-shadow 0.09s ease-out;
  -webkit-tap-highlight-color: transparent;
}
/* the dished top surface */
.key::before {
  content: "";
  position: absolute;
  inset: 9% 9% 14% 9%;
  border-radius: 14%;
  background:
    radial-gradient(ellipse at 50% 40%, #44454b 0%, #393a3f 60%, #333438 100%);
  box-shadow: inset 0 2px 6px rgb(0 0 0 / 0.35), 0 1px 0 rgb(255 255 255 / 0.05);
}
.key-legend {
  position: absolute;
  font-family: var(--display);
  color: #f2f2f2;
  line-height: 1;
}
.key-legend.main { left: 22%; top: 18%; font-size: calc(var(--size) * 0.36); font-weight: 600; }
.key-legend.alt  { right: 22%; bottom: 25%; font-size: calc(var(--size) * 0.13); font-weight: 700; color: var(--red); letter-spacing: 0.02em; }
.key.is-down,
.key:active {
  transform: rotate(-4deg) translateY(10px);
  box-shadow:
    0 4px 0 #1b1c1f,
    0 10px 18px rgb(0 0 0 / 0.5),
    inset 0 2px 0 rgb(255 255 255 / 0.05);
}
.key:focus-visible { outline-offset: 12px; border-radius: 18%; }

.key-output {
  min-height: 5.5rem;
  text-align: center;
  max-width: 22rem;
}
.key-word {
  font-family: var(--display);
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  display: block;
  min-height: 1.3em;
}
.key-word .caret {
  display: inline-block;
  width: 0.08em;
  height: 0.9em;
  margin-left: 0.06em;
  background: var(--red);
  vertical-align: -0.08em;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.key-gloss {
  display: block;
  font-size: 1rem;
  color: var(--muted-on-dark);
  line-height: 1.45;
  margin-top: 0.35rem;
}
.key-hint {
  font-family: var(--display);
  font-size: var(--fs-sm);
  color: var(--muted-on-dark);
}
.key-hint { text-align: center; margin: 0; }
.hint-touch { display: none; }
@media (hover: none) {
  .hint-keys { display: none; }
  .hint-touch { display: inline; }
}
.key-hint kbd {
  font-family: var(--display);
  border: 1px solid var(--graphite-3);
  border-bottom-width: 3px;
  border-radius: 5px;
  padding: 0.05rem 0.4rem;
  color: var(--white);
}

@media (max-width: 52rem) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); padding-block: 2.5rem 4rem; }
  .keystage { gap: 1rem; }
  .keystage { order: -1; }
  .key { --size: 9.5rem; }
  .key-output { min-height: 4.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .key, .btn { transition: none; }
  .key-word .caret { animation: none; }
}

/* ---------- Sections ---------- */

.section { padding-block: var(--section); }
.section-white { background: var(--white); }
.section-dark { background: var(--graphite); color: var(--white); }

.section-head {
  max-width: 40rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.section-head h2 { font-size: var(--fs-2xl); margin-bottom: 1rem; }
.section-head p { font-size: var(--fs-lg); color: var(--muted); margin: 0; line-height: 1.5; }
.section-dark .section-head p { color: var(--muted-on-dark); }

/* Services: split layout, heading pinned left, list right */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}
.split > .section-head { position: sticky; top: 7rem; margin-bottom: 0; }
@media (max-width: 52rem) {
  .split { grid-template-columns: 1fr; }
  .split > .section-head { position: static; }
}

.service-list { list-style: none; margin: 0; padding: 0; }
.service-list li {
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  gap: 0 1.25rem;
  padding-block: 1.75rem;
  border-top: 1px solid var(--rule);
}
.service-list li:last-child { border-bottom: 1px solid var(--rule); }
.service-list h3 { font-size: var(--fs-lg); margin: 0.2rem 0 0.5rem; }
.service-list p { color: var(--muted); margin: 0; max-width: 36em; }
.service-list .new {
  font: 600 0.8rem var(--display);
  color: var(--red-ink);
  margin-left: 0.5rem;
  vertical-align: 0.15em;
}
/* small keycap icons */
.cap {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9px;
  background: var(--graphite);
  color: var(--white);
  display: grid;
  place-items: center;
  box-shadow: inset 0 -4px 0 rgb(0 0 0 / 0.4);
  font: 700 0.95rem var(--display);
}
.cap svg { width: 1.3rem; height: 1.3rem; }

/* ---------- AI section ---------- */

.ai-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--graphite-3);
}
.ai-item {
  padding: 2rem 2rem 2.25rem 0;
  border-bottom: 1px solid var(--graphite-3);
}
.ai-item:nth-child(even) { padding-left: 2rem; padding-right: 0; border-left: 1px solid var(--graphite-3); }
.ai-item h3 { font-size: var(--fs-lg); margin-bottom: 0.65rem; }
.ai-item p { color: #cfd0d5; margin: 0; }
@media (max-width: 44rem) {
  .ai-grid { grid-template-columns: 1fr; }
  .ai-item, .ai-item:nth-child(even) { padding: 1.75rem 0; border-left: 0; }
}

.ai-note {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: start;
  max-width: 48rem;
}
.ai-note .cap { background: var(--red); box-shadow: inset 0 -4px 0 rgb(0 0 0 / 0.25); }
.ai-note p { margin: 0; color: #e4e5e8; font-style: italic; font-size: var(--fs-lg); line-height: 1.5; }

/* ---------- Process ---------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2.5rem);
  counter-reset: step;
}
.step { counter-increment: step; }
.step-key {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 14px;
  background: var(--graphite);
  position: relative;
  box-shadow: inset 0 -6px 0 rgb(0 0 0 / 0.4);
  margin-bottom: 1.5rem;
}
.step-key::before {
  content: counter(step);
  position: absolute;
  left: 0.75rem;
  top: 0.55rem;
  font: 700 1.6rem var(--display);
  color: var(--white);
}
.step-key::after {
  content: "";
  position: absolute;
  right: 0.75rem;
  bottom: 1.05rem;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--c);
}
.step h3 { font-size: var(--fs-xl); margin-bottom: 0.2rem; }
.step .sub { font-style: italic; color: var(--muted); margin-bottom: 0.9rem; display: block; }
.step p { margin: 0; font-size: 1.05rem; }
.step:nth-child(1) { --c: var(--k-yellow); }
.step:nth-child(2) { --c: var(--k-green); }
.step:nth-child(3) { --c: var(--k-purple); }
.step:nth-child(4) { --c: var(--k-blue); }

.steps-end {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.25rem;
}
.steps-end strong { font: 700 var(--fs-xl) var(--display); letter-spacing: -0.02em; }
.steps-end span { color: var(--muted); }

@media (max-width: 60rem) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 3rem; } }
@media (max-width: 34rem) { .steps { grid-template-columns: 1fr; } }

/* ---------- Technology (disclosures) ---------- */

.tech { border-top: 1px solid var(--rule); }
.tech details { border-bottom: 1px solid var(--rule); }
.tech summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding-block: 1.6rem;
}
.tech summary::-webkit-details-marker { display: none; }
.tech summary h3 { font-size: var(--fs-xl); }
.tech summary .sub { display: block; font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--muted); font-size: 1.05rem; letter-spacing: 0; margin-top: 0.3rem; }
.tech .toggle {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 8px;
  border: 1px solid var(--rule);
  box-shadow: inset 0 -3px 0 var(--rule);
  display: grid;
  place-items: center;
  font: 600 1.4rem/1 var(--display);
  transition: transform 0.2s;
}
.tech details[open] .toggle { transform: rotate(45deg); }
.tech summary:hover .toggle { border-color: var(--graphite); }
.tech-body {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  padding-bottom: 2rem;
}
.tech-body p { max-width: 38em; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; align-content: start; }
.tags li {
  font: 500 0.9rem var(--display);
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  background: var(--paper);
  box-shadow: inset 0 -2px 0 var(--rule);
}
@media (max-width: 44rem) { .tech-body { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .tech .toggle { transition: none; } }

/* ---------- About ---------- */

.about {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.portrait {
  width: 12rem;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 22px;
  filter: grayscale(1) contrast(1.05);
  box-shadow: 0 10px 0 var(--graphite);
}
.about h2 { font-size: var(--fs-2xl); margin-bottom: 1.25rem; }
.about-text { max-width: 38em; }
.about-text .lead { font-size: var(--fs-lg); line-height: 1.55; }
.principles {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}
.principles strong { display: block; font: 700 1.1rem var(--display); margin-bottom: 0.3rem; }
.principles span { color: var(--muted); font-size: 1rem; line-height: 1.5; display: block; }
@media (max-width: 52rem) {
  .about { grid-template-columns: 1fr; }
  .portrait { width: 9rem; }
  .principles { grid-template-columns: 1fr; }
}

/* ---------- Contact ---------- */

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: clamp(2.5rem, 6vw, 6rem);
}
.contact h2 { font-size: var(--fs-2xl); margin-bottom: 1rem; }
.contact .intro { color: var(--muted-on-dark); font-size: var(--fs-lg); line-height: 1.5; }
.mail-link {
  display: inline-block;
  margin-top: 1.5rem;
  font: 700 clamp(1.6rem, 1rem + 2.6vw, 2.75rem)/1.1 var(--display);
  letter-spacing: -0.02em;
  color: var(--white);
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 3px;
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}
.mail-link:hover { color: var(--red); text-decoration-thickness: 3px; }
.phone { margin-top: 1.25rem; color: var(--muted-on-dark); }
.phone a { color: var(--white); }
.contact-card { align-self: end; }
.address { font-style: normal; line-height: 1.6; margin-bottom: 1.75rem; }
.address strong { font-family: var(--display); font-size: 1.15rem; }
@media (max-width: 52rem) {
  .contact { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */

.site-foot {
  background: #1f2023;
  color: var(--muted-on-dark);
  font-family: var(--display);
  font-size: 0.95rem;
}
.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.75rem;
}
.site-foot nav { display: flex; gap: 1.5rem; }
.site-foot a { color: var(--muted-on-dark); }
.site-foot a:hover { color: var(--white); }

/* ---------- Legal / simple pages ---------- */

.page {
  max-width: 44rem;
  margin-inline: auto;
  padding: var(--section) var(--gutter);
}
.page h1 { font-size: var(--fs-2xl); margin-bottom: 2rem; }
.page h2 { font-size: var(--fs-lg); margin: 2.5rem 0 0.75rem; }
.page address { font-style: normal; }

.notfound {
  min-height: calc(100vh - 4.25rem);
  display: grid;
  place-items: center;
  text-align: center;
  background: var(--graphite);
  color: var(--white);
  padding: 3rem var(--gutter);
}
.notfound h1 { font-size: var(--fs-2xl); margin: 2.5rem 0 1rem; }
.notfound p { color: var(--muted-on-dark); margin-bottom: 2rem; }
.notfound .key { cursor: default; }

/* nav on simple pages: no toggle, always inline */
.site-nav.simple,
.site-nav.simple.open {
  display: flex;
  position: static;
  flex-direction: row;
  padding: 0;
  border: 0;
  background: none;
}

/* ---------- Consent banner ---------- */

.consent {
  position: fixed;
  z-index: 100;
  inset: auto 0.75rem 0.75rem;
  max-width: 34rem;
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  padding: 0.75rem 1rem;
  background: #141518;
  color: #8e9099;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgb(0 0 0 / 0.35), inset 0 0 0 1px #2a2b2f;
  font: 400 0.78rem/1.45 var(--display);
}
.consent p { flex: 1 1 16rem; margin: 0; }
.consent a { color: #c4c6cd; }
.consent a:hover { color: var(--white); }
.consent-actions { display: flex; gap: 0.5rem; }
.consent .btn {
  padding: 0.5rem 0.8rem;
  font-size: 0.78rem;
  border-radius: 7px;
  background: #23242a;
  color: #d6d8de;
  box-shadow: inset 0 -2px 0 rgb(0 0 0 / 0.4), inset 0 0 0 1px #34353a;
}
.consent .btn:hover { background: #2e2f35; color: var(--white); }
@media print { .consent { display: none; } }
