:root {
  --ink: #111417;
  --ink-2: #1b2025;
  --text: #2b3137;
  --muted: #6c747c;
  --rule: #d8dcdf;
  --paper: #f6f6f4;
  --paper-2: #eceeed;
  --brass: #b8894a;
  --brass-light: #d8b27a;

  --f-serif: "Instrument Serif", "Times New Roman", serif;
  --f-sans: "Instrument Sans", "Helvetica Neue", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;

  --wrap: 1200px;
  --ease: cubic-bezier(.22, .65, .12, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--f-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-serif); font-weight: 400; margin: 0; color: var(--ink); }
em { font-style: italic; }
::selection { background: var(--brass-light); color: var(--ink); }

.wrap { width: min(var(--wrap), 100% - 56px); margin-inline: auto; }

.label {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 28px;
}
.label span:first-child {
  color: var(--brass);
  min-width: 2.2em;
  padding-right: 14px;
  border-right: 1px solid var(--rule);
}

/* ---------- NAV ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px max(28px, (100% - var(--wrap)) / 2);
  color: #fff;
  transition: background .4s var(--ease), color .4s var(--ease), padding .4s var(--ease), box-shadow .4s;
}
.nav.scrolled {
  background: rgba(246, 246, 244, .9);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  color: var(--ink);
  padding-block: 16px;
  box-shadow: 0 1px 0 rgba(17, 20, 23, .07);
}
.nav-brand {
  font-family: var(--f-serif);
  font-size: 28px;
  line-height: 1;
  text-decoration: none;
}
.nav-brand span { color: var(--brass); }
.nav-links { display: flex; align-items: center; gap: clamp(18px, 3vw, 40px); }
.nav-links a {
  position: relative;
  text-decoration: none; font-size: 14px; letter-spacing: .02em;
  opacity: .85; transition: opacity .3s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform .4s var(--ease);
}
.nav-links a:hover { opacity: 1; }
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }
.lang {
  font: 500 12px var(--f-mono); letter-spacing: .1em;
  color: inherit; background: none;
  border: 1px solid currentColor; border-radius: 999px;
  padding: 6px 12px; cursor: pointer; opacity: .85;
  transition: opacity .3s, background .3s, color .3s;
}
.lang:hover { opacity: 1; }
.nav:not(.scrolled) .lang:hover { background: #fff; color: var(--ink); }
.nav.scrolled .lang:hover { background: var(--ink); color: var(--paper); }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  overflow: hidden;
  color: #fff;
  background: var(--ink);
}
.hero-media {
  position: absolute; inset: 0;
  background: url("../images/hero-robots.jpg") 64% 42% / cover no-repeat;
  filter: grayscale(1) contrast(1.08) brightness(.9);
  animation: drift 26s var(--ease) both;
}
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 12, 14, .94) 0%, rgba(10, 12, 14, .78) 36%, rgba(10, 12, 14, .28) 72%, rgba(10, 12, 14, .45) 100%),
    linear-gradient(0deg, rgba(10, 12, 14, .9) 0%, transparent 42%);
}
@keyframes drift {
  from { transform: scale(1.12); }
  to   { transform: scale(1.02); }
}
.hero-inner {
  position: relative;
  width: min(var(--wrap), 100% - 56px);
  margin: 0 auto;
  padding: 160px 0 64px;
}
.hero-kicker {
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--brass-light); margin: 0 0 26px;
}
.hero-brand {
  color: #fff;
  font-size: clamp(68px, 11.5vw, 184px);
  line-height: .9;
  letter-spacing: -.02em;
}
.hero-brand em { color: var(--brass-light); }
.hero-lede {
  max-width: 30em;
  margin: 34px 0 40px;
  color: rgba(255, 255, 255, .78);
  font-size: clamp(17px, 1.35vw, 20px);
  line-height: 1.6;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }

.hero-facts {
  position: relative;
  width: min(var(--wrap), 100% - 56px);
  margin: 0 auto;
  padding: 28px 0 40px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  border-top: 1px solid rgba(255, 255, 255, .18);
}
.hero-facts div { display: flex; align-items: baseline; gap: 16px; }
.hero-facts dt { font-family: var(--f-serif); font-size: 38px; line-height: 1; color: #fff; white-space: nowrap; }
.hero-facts dd { margin: 0; font-size: 14px; line-height: 1.45; color: rgba(255, 255, 255, .62); max-width: 16em; }

.reveal-hero { opacity: 0; transform: translateY(22px); animation: rise 1.1s var(--ease) forwards; }
.hero-inner .reveal-hero:nth-child(1) { animation-delay: .2s; }
.hero-inner .reveal-hero:nth-child(2) { animation-delay: .32s; }
.hero-inner .reveal-hero:nth-child(3) { animation-delay: .5s; }
.hero-inner .reveal-hero:nth-child(4) { animation-delay: .62s; }
.hero-facts.reveal-hero { animation-delay: .82s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 500; font-size: 15px; letter-spacing: .01em; text-decoration: none;
  padding: 15px 28px; border-radius: 999px;
  transition: background .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease), transform .35s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn-solid { background: #fff; color: var(--ink); }
.btn-solid:hover { background: var(--brass-light); }
.btn-line { border: 1px solid rgba(255, 255, 255, .45); color: #fff; }
.btn-line:hover { border-color: #fff; background: rgba(255, 255, 255, .08); }

/* ---------- SECTIONS ---------- */
.section { padding: clamp(96px, 13vw, 180px) 0; }
.section h2 {
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1.04;
  letter-spacing: -.015em;
  max-width: 15em;
}
.section h2 em, .contact-h em { color: var(--muted); }
.section-head { margin-bottom: clamp(56px, 7vw, 96px); }

/* About */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(48px, 8vw, 120px);
  align-items: start;
}
.about-photo { margin: 0; position: sticky; top: 110px; max-width: 420px; }
.about-photo img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 18%;
  filter: grayscale(1) contrast(1.05);
  transition: filter 1.2s var(--ease);
}
.about-photo:hover img { filter: grayscale(0) contrast(1); }
.about-photo figcaption {
  margin-top: 14px;
  font: 12px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.about-text h2 { margin-bottom: 36px; }
.about-text > p:not(.label) { max-width: 34em; margin: 0 0 20px; }

.timeline { list-style: none; padding: 0; margin: 56px 0 0; border-top: 1px solid var(--ink); }
.timeline li {
  display: grid; grid-template-columns: 96px 1fr; gap: 20px; align-items: baseline;
  padding: 18px 0; border-bottom: 1px solid var(--rule);
}
.t-year { font-family: var(--f-serif); font-size: 26px; line-height: 1; color: var(--ink); }

/* Expertise */
.expertise { background: var(--paper-2); }
.exp-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
}
.exp { padding: 32px 32px 8px 0; }
.exp + .exp { padding-left: 32px; border-left: 1px solid var(--rule); }
.exp-no { display: block; font: 12px var(--f-mono); letter-spacing: .12em; color: var(--brass); margin-bottom: 40px; }
.exp h3 { font-size: 28px; line-height: 1.1; margin-bottom: 16px; }
.exp p { margin: 0; font-size: 15.5px; color: var(--text); }

/* Projects */
.proj-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.proj a {
  position: relative;
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) 220px;
  gap: clamp(20px, 3vw, 48px);
  align-items: start;
  padding: clamp(36px, 4.5vw, 56px) 0;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.proj a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: var(--ink); transform: scaleX(0); transform-origin: left;
  transition: transform .7s var(--ease);
}
.proj a:hover::after, .proj a:focus-visible::after { transform: scaleX(1); }
.proj-no { font: 12px var(--f-mono); letter-spacing: .12em; color: var(--brass); padding-top: 14px; }
.proj-body { display: flex; flex-direction: column; gap: 14px; }
.proj-name {
  font-family: var(--f-serif);
  font-size: clamp(34px, 4.2vw, 58px); line-height: 1.02; letter-spacing: -.015em;
  color: var(--ink);
  transition: transform .6s var(--ease);
}
.proj-name em { color: var(--muted); }
.proj a:hover .proj-name { transform: translateX(10px); }
.proj-desc { max-width: 38em; }
.proj-stack { font: 12px var(--f-mono); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.proj-go {
  justify-self: end; padding-top: 16px;
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 14px; font-weight: 500; white-space: nowrap; color: var(--ink);
}
.proj-go i {
  font-style: normal; font-size: 18px;
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--rule);
  transition: background .4s var(--ease), color .4s var(--ease), border-color .4s var(--ease), transform .4s var(--ease);
}
.proj a:hover .proj-go i { background: var(--ink); color: var(--paper); border-color: var(--ink); transform: rotate(45deg); }

/* Contact */
.contact {
  position: relative;
  color: #fff;
  background: var(--ink);
  padding: clamp(110px, 14vw, 200px) 0 clamp(90px, 10vw, 140px);
  overflow: hidden;
}
.contact::before {
  content: ""; position: absolute; inset: 0;
  background: url("../images/hero-robots.jpg") 30% 55% / cover no-repeat;
  filter: grayscale(1);
  opacity: .12;
}
.contact-inner { position: relative; }
.contact .label { color: rgba(255, 255, 255, .55); }
.contact .label span:first-child { border-color: rgba(255, 255, 255, .2); color: var(--brass-light); }
.contact-h {
  color: #fff;
  font-size: clamp(48px, 8vw, 128px); line-height: .95; letter-spacing: -.02em;
  max-width: 10em; margin-bottom: 36px;
}
.contact-h em { color: var(--brass-light); }
.contact-p { max-width: 32em; color: rgba(255, 255, 255, .7); margin: 0 0 56px; font-size: 18px; }
.contact-links { display: flex; flex-wrap: wrap; align-items: center; gap: 28px 40px; }
.contact-mail {
  font-family: var(--f-serif);
  font-size: clamp(28px, 3.4vw, 46px); line-height: 1.1;
  text-decoration: none;
  background: linear-gradient(var(--brass-light), var(--brass-light)) 0 100% / 100% 1px no-repeat;
  padding-bottom: 6px;
  transition: color .4s var(--ease), background-size .5s var(--ease);
}
.contact-mail:hover { color: var(--brass-light); }

/* Footer */
.footer { background: var(--ink); color: rgba(255, 255, 255, .45); font-size: 13px; padding: 0 0 36px; }
.footer-inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding-top: 28px; border-top: 1px solid rgba(255, 255, 255, .1);
}
.footer a { color: rgba(255, 255, 255, .7); text-decoration-color: rgba(255, 255, 255, .25); }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal, .no-js .reveal-hero { opacity: 1; transform: none; animation: none; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1080px) {
  .exp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exp:nth-child(3) { padding-left: 0; border-left: 0; }
  .exp:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .proj a { grid-template-columns: 60px minmax(0, 1fr); }
  .proj-go { grid-column: 2; justify-self: start; padding-top: 0; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap, .hero-inner, .hero-facts { width: calc(100% - 40px); }
  .nav { padding-inline: 20px; }
  .nav-links a { display: none; }
  .hero-media { background-position: 72% 40%; }
  .hero-media::after {
    background: linear-gradient(0deg, rgba(10, 12, 14, .96) 0%, rgba(10, 12, 14, .78) 55%, rgba(10, 12, 14, .5) 100%);
  }
  .hero-inner { padding-bottom: 40px; }
  .hero-brand { font-size: 17vw; }
  .hero-facts { grid-template-columns: 1fr; gap: 14px; padding-bottom: 32px; }
  .hero-facts dt { font-size: 30px; min-width: 3.2em; }
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { position: static; max-width: 320px; }
  .exp-grid { grid-template-columns: 1fr; }
  .exp, .exp + .exp { padding: 28px 0 24px; border-left: 0; }
  .exp + .exp { border-top: 1px solid var(--rule); }
  .exp-no { margin-bottom: 16px; }
  .proj a { grid-template-columns: 1fr; gap: 14px; }
  .proj-no { padding-top: 0; }
  .proj-go { grid-column: 1; }
  .timeline li { grid-template-columns: 64px 1fr; }
}

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