@charset "UTF-8";

/* =========================================================
   Thomas Sanavia — portfolio
   Dark technical world: navy surfaces, terminal mono, one
   blue accent. System is documented in DESIGN.md.
   ========================================================= */

@font-face {
  font-family: "Manrope";
  src: url("fonts/manrope-latin-var.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --page: #0b111c;
  --surface: #111c2c;
  --surface-raised: #172538;
  --text: #f5f7fc;
  --muted: #acb9ce;
  --muted-soft: #8fa4c0;
  --line: #29384e;
  --line-soft: #1d2b3f;
  --line-strong: #3a5273;
  --blue: #2463d4;
  --blue-hover: #1e55b9;
  --accent: #92b8ff;
  --accent-strong: #b8d2ff;
  --good: #6fd39a;

  --radius: 16px;
  --font-sans: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", "Cascadia Code", "Consolas", "Liberation Mono", monospace;
  --shadow: 0 22px 60px rgba(0, 0, 0, .28);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 104px;
  scrollbar-color: #3a4f6c var(--page);
  scrollbar-width: thin;
}

body {
  margin: 0;
  background-color: var(--page);
  background-image:
    radial-gradient(1000px 560px at 88% -12%, rgba(36, 99, 212, .14), transparent 62%),
    radial-gradient(760px 480px at -12% 34%, rgba(36, 99, 212, .06), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { color: #fff; background: #285db3; }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--page); }
::-webkit-scrollbar-thumb { border: 3px solid var(--page); border-radius: 999px; background: #3a4f6c; }
::-webkit-scrollbar-thumb:hover { background: #4c678a; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { color: var(--accent-strong); }

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; }

img, svg { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, p, ul, ol, figure, dl, dd { margin: 0; }
h1, h2, h3 {
  font-weight: 650;
  line-height: 1.15;
  text-wrap: balance;
}
h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); letter-spacing: -.035em; }
h3 { font-size: 1.15rem; letter-spacing: -.02em; }
p { color: var(--muted); text-wrap: pretty; }

:focus-visible { outline: 3px solid #a9c9ff; outline-offset: 4px; border-radius: 4px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }

.section { padding-block: 96px; border-top: 1px solid var(--line); }

.section-heading { max-width: 720px; margin-bottom: 42px; }
.section-heading > p { max-width: 62ch; margin-top: 16px; }

.skip-link {
  position: fixed;
  top: 10px;
  left: 16px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform .2s ease;
}
.skip-link:focus,
.skip-link:hover { color: #fff; transform: translateY(0); }

/* ============ HEADER ============ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid #253248;
  background: rgba(11, 17, 28, .92);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  backdrop-filter: blur(16px) saturate(120%);
  transition: box-shadow .25s ease, background-color .25s ease;
}
.site-header.is-scrolled {
  box-shadow: 0 12px 34px rgba(0, 0, 0, .32);
  background: rgba(11, 17, 28, .98);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 84px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: #fff; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid #4c6b9a;
  border-radius: 11px;
  background: #15243a;
  color: #b3cfff;
  font-size: .86rem;
  font-weight: 700;
  letter-spacing: -.05em;
}
.brand-mark span { color: var(--accent); }
.brand-name { font-size: .94rem; font-weight: 650; letter-spacing: -.02em; }

.nav-menu, .nav-links { display: flex; align-items: center; }
.nav-menu { gap: 22px; }
.nav-links { list-style: none; padding: 0; gap: 20px; }
.nav-links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: .8rem;
  font-weight: 500;
  color: #c4cfe0;
  text-decoration: none;
  transition: color .18s ease;
}
.nav-links a:hover, .nav-links a.is-active { color: #fff; }
.nav-links a.is-active { position: relative; }
.nav-links a.is-active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 5px;
  left: 0;
  height: 1px;
  background: var(--accent);
}

.language-switch { display: flex; align-items: center; gap: 4px; }
.language-switch a {
  display: grid;
  place-items: center;
  min-width: 36px;
  min-height: 44px;
  border-radius: 7px;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 650;
  letter-spacing: .04em;
  text-decoration: none;
  transition: color .18s ease, background-color .18s ease;
}
.language-switch a[aria-current="page"] { color: #fff; background: #202e43; }
.language-switch a:hover { color: #fff; background: #202e43; }

.menu-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #425773;
  border-radius: 9px;
  color: var(--text);
  background: transparent;
  font-size: .82rem;
  font-weight: 600;
}

/* ============ BUTTONS AND LINKS ============ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  padding: 13px 21px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: .875rem;
  font-weight: 650;
  line-height: 1.55;
  text-align: center;
  text-decoration: none;
  transition: background-color .18s ease, border-color .18s ease, transform .18s ease, color .18s ease;
}
.btn-primary { color: #fff; background: var(--blue); }
.btn-primary:hover { color: #fff; background: var(--blue-hover); }
.btn-secondary { color: #e2eafa; background: transparent; border-color: #425773; }
.btn-secondary:hover { color: #fff; background: #17263c; border-color: #6b89b4; }
.btn:active { transform: translateY(1px); }
.header-cta { min-height: 44px; padding: 10px 16px; font-size: .78rem; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  color: var(--accent);
  font-size: .86rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(146, 184, 255, .38);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  transition: color .18s ease, text-decoration-color .18s ease;
}
.text-link span { transition: transform .18s ease; }
.text-link:hover { color: var(--accent-strong); text-decoration-color: currentColor; }
.text-link:hover span { transform: translateX(2px); }

/* ============ HERO ============ */

.hero { padding-block: 88px 80px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr);
  align-items: center;
  gap: 56px;
}
.hero-copy, .hero-visual { min-width: 0; }

.hero-title {
  max-width: 780px;
  font-size: clamp(2.4rem, 5.2vw, 4.35rem);
  line-height: 1.06;
  letter-spacing: -.04em;
}
.hero-title span { display: block; color: #94baff; }
.hero-description { max-width: 610px; margin-top: 26px; font-size: 1.02rem; line-height: 1.82; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 30px; }
.hero-cv { margin-left: 6px; }
.hero-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  color: #9db0c9;
  font-size: .82rem;
  letter-spacing: .005em;
}
.hero-proof {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 26px;
  color: var(--muted);
  font-size: .82rem;
}
.hero-proof strong { color: var(--text); font-weight: 650; }
.hero-proof-separator { width: 1px; height: 14px; background: #40506b; }

.status-dot {
  display: inline-block;
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 4px rgba(111, 211, 154, .12);
}

/* Hero visual: terminal on a coordinate grid */
.hero-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 480px;
}
.hero-visual::before {
  content: "";
  position: absolute;
  inset: 2% -6% 6%;
  background-image: radial-gradient(circle, rgba(146, 184, 255, .2) 1px, transparent 1.4px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(closest-side, #000 18%, transparent 76%);
  mask-image: radial-gradient(closest-side, #000 18%, transparent 76%);
  pointer-events: none;
}

.terminal-card {
  position: relative;
  z-index: 2;
  width: min(100%, 400px);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: linear-gradient(160deg, #162539 0%, #0d1725 100%);
  box-shadow: var(--shadow), 0 0 0 1px rgba(146, 184, 255, .04) inset;
  overflow: hidden;
  transform: rotate(-2deg);
  transition: transform .4s var(--ease);
}
.hero-visual:hover .terminal-card { transform: rotate(0deg) translateY(-3px); }

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border-bottom: 1px solid #2a3c55;
  background: rgba(255, 255, 255, .025);
}
.terminal-dots { display: inline-flex; gap: 6px; }
.terminal-dots i { width: 8px; height: 8px; border-radius: 50%; background: #46607f; }
.terminal-dots i:first-child { background: #d96b6b; }
.terminal-dots i:nth-child(2) { background: #d9b06b; }
.terminal-dots i:nth-child(3) { background: #7fbf96; }
.terminal-title { color: #8ea3be; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .02em; }

.terminal-body {
  padding: 22px 22px 26px;
  font-family: var(--font-mono);
  font-size: .82rem;
  line-height: 1.85;
}
.terminal-body p { margin: 0; color: #dbe6f5; }
.terminal-body p + p { margin-top: 2px; }
.terminal-body p:not(.t-out) { margin-top: 15px; }
.terminal-body p:first-child { margin-top: 0; }
.t-prompt { margin-right: 8px; color: #78a8ff; font-weight: 700; }
.t-out { padding-left: 19px; color: #9fb2c9; }
.t-out:first-of-type { color: #d9e7fa; }
.t-cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  margin-left: 5px;
  background: #8fb7ff;
  vertical-align: -3px;
}

.visual-caption {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 34px;
  color: #8297b2;
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .04em;
  text-align: center;
}
.visual-caption span {
  color: #9db0c9;
  font-family: var(--font-sans);
  font-size: .75rem;
  font-weight: 650;
  letter-spacing: .13em;
  text-transform: uppercase;
}

/* ============ SERVICES ============ */

.service-list { border-top: 1px solid var(--line-strong); }
.service-row {
  display: grid;
  grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr);
  gap: 56px;
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
}
.service-row-head { display: flex; align-items: flex-start; gap: 15px; }
.service-icon { flex-shrink: 0; margin-top: 3px; color: var(--accent); transition: color .2s ease; }
.service-row:hover .service-icon { color: var(--accent-strong); }
.service-row h3 { font-size: 1.35rem; letter-spacing: -.03em; }
.service-row-body > p { max-width: 62ch; font-size: .94rem; line-height: 1.8; }
.service-tags {
  margin-top: 14px;
  color: #9fb3ce;
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .01em;
}
.service-row-body .text-link { margin-top: 16px; }

/* ============ ABOUT ============ */

.about-copy {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  column-gap: 64px;
  align-items: start;
}
.about-copy h2 { grid-column: 1 / -1; max-width: 26ch; margin-bottom: 30px; }
.about-copy p { max-width: 62ch; font-size: .95rem; line-height: 1.85; }
.about-copy p + p { margin-top: 16px; }
.about-copy p:first-of-type {
  grid-column: 1;
  grid-row: 2 / span 2;
  margin-top: 0;
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1.65;
  letter-spacing: -.01em;
}
.about-copy p:nth-of-type(2) { grid-column: 2; grid-row: 2; margin-top: 0; }
.about-copy p:nth-of-type(3) { grid-column: 2; grid-row: 3; }
.about-links {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  margin-top: 42px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

/* ============ EXPERIENCE ============ */

.role {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 48px;
  padding: 36px 0 38px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
}
.role-meta { display: flex; flex-direction: column; gap: 5px; }
.role-date { color: var(--accent); font-family: var(--font-mono); font-size: .8rem; letter-spacing: .02em; }
.role-place { color: var(--muted-soft); font-size: .78rem; }
.role-body h3 { font-size: 1.55rem; letter-spacing: -.03em; }
.role-company { margin-top: 6px; color: #a9bbd3; font-size: .9rem; }
.role-company span { color: #8297b2; }
.role-summary { max-width: 62ch; margin-top: 18px; font-size: .95rem; line-height: 1.8; }
.role-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 32px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}
.role-list li {
  position: relative;
  padding-left: 20px;
  color: #b9c7da;
  font-size: .87rem;
  line-height: 1.7;
  text-wrap: pretty;
}
.role-list li::before {
  content: "";
  position: absolute;
  top: .66em;
  left: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #5d82b5;
}

.role-tags, .project-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 26px; }
.role-tags span, .project-tags span {
  padding: 5px 10px;
  border: 1px solid #2d4667;
  border-radius: 999px;
  background: rgba(20, 35, 55, .7);
  color: #a9c2e2;
  font-family: var(--font-mono);
  font-size: .75rem;
  line-height: 1.5;
}

/* ============ PROJECTS ============ */

.projects-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.project-card {
  display: flex;
  flex-direction: column;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(165deg, rgba(23, 37, 56, .82), rgba(14, 24, 38, .68));
  transition: transform .25s ease, border-color .25s ease;
}
.project-card:hover { border-color: #42618d; transform: translateY(-3px); }
.project-featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  gap: 44px;
  align-items: start;
  padding: 38px;
  background:
    radial-gradient(640px 300px at 100% 0%, rgba(36, 99, 212, .14), transparent 66%),
    linear-gradient(150deg, #16263b, #0e1826);
}
.project-main { display: flex; flex-direction: column; min-width: 0; }
.project-card h3 { font-size: 1.28rem; letter-spacing: -.03em; }
.project-featured h3 { max-width: 640px; font-size: clamp(1.55rem, 2.6vw, 2rem); letter-spacing: -.035em; }
.project-card > p, .project-main > p { max-width: 62ch; margin-top: 12px; font-size: .92rem; line-height: 1.78; }
.nowrap { white-space: nowrap; }

.project-points { margin: 20px 0 0; padding: 0; list-style: none; }
.project-points li { position: relative; padding-left: 19px; color: #b5c5da; font-size: .86rem; line-height: 1.7; text-wrap: pretty; }
.project-points li + li { margin-top: 5px; }
.project-points li::before { content: "↳"; position: absolute; left: 0; color: #5d82b5; }

.project-tags { margin-top: 22px; }
.project-link { margin-top: auto; padding-top: 24px; }

.project-figure {
  align-self: center;
  max-width: 460px;
  margin: 0 auto;
}
.project-figure svg { width: 100%; height: auto; }
.project-figure figcaption {
  margin-top: 10px;
  color: #8297b2;
  font-family: var(--font-mono);
  font-size: .75rem;
  text-align: right;
}

.arch text {
  fill: #c6d6ee;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .02em;
  text-anchor: middle;
  dominant-baseline: middle;
}
.arch rect { fill: rgba(17, 28, 44, .66); stroke: var(--line-strong); stroke-width: 1; }
.arch .arch-accent rect { fill: rgba(36, 99, 212, .16); stroke: #6b89b4; }
.arch .arch-accent text { fill: #e0ecff; }
.arch path { fill: none; stroke: #4b678a; stroke-width: 1.2; }
.arch .arch-dashed { stroke-dasharray: 3 4; }

/* ============ SKILLS ============ */

.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  overflow: hidden;
}
.stack-item { padding: 28px; background: var(--page); }
.stack-item h3 { margin-bottom: 9px; font-size: .95rem; letter-spacing: -.01em; }
.stack-item p { color: #a9b9cf; font-size: .86rem; line-height: 1.7; }

/* ============ EDUCATION ============ */

.credentials { border-top: 1px solid var(--line-strong); }
.credential {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, .82fr);
  gap: 32px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.credential h3 { font-size: 1.15rem; letter-spacing: -.02em; }
.credential-school { margin-top: 6px; font-size: .86rem; line-height: 1.65; }
.credential-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
  color: var(--muted-soft);
  font-size: .78rem;
  text-align: right;
}
.credential-date { color: #9fb3ce; font-family: var(--font-mono); font-size: .75rem; }

/* ============ CONTACT ============ */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .95fr);
  gap: 64px;
  align-items: center;
}
.contact-copy h2 { max-width: 480px; margin-bottom: 20px; }
.contact-copy > p { max-width: 470px; font-size: 1rem; line-height: 1.75; }
.contact-copy .btn { margin-top: 30px; }

.contact-panel {
  padding: 28px 30px 30px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background:
    radial-gradient(500px 260px at 100% 0%, rgba(36, 99, 212, .1), transparent 70%),
    var(--surface);
}
.contact-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #24354c;
}
.contact-panel-title {
  color: #8297b2;
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.contact-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 13px 0;
  border-bottom: 1px solid #24354c;
}
.contact-label {
  flex-shrink: 0;
  color: #8297b2;
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.contact-row a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: #cfdbed;
  font-size: .88rem;
  text-align: right;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color .18s ease;
}
.contact-row > span:last-child {
  color: #cfdbed;
  font-size: .88rem;
  text-align: right;
  overflow-wrap: anywhere;
}
.contact-row a:hover { color: var(--accent); text-decoration: underline; }
.copy-email { width: 100%; margin-top: 20px; font-size: .82rem; }
.copy-email.is-copied { border-color: #4e8a68; color: #b7e7c9; }
.contact-availability {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-soft);
  font-size: .76rem;
  white-space: nowrap;
}

/* ============ 404 ============ */

.error-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  overflow: hidden;
}
.error-link {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 26px 58px 26px 28px;
  background: var(--page);
  text-decoration: none;
  transition: background-color .18s ease;
}
.error-link:hover { background: var(--surface); }
.error-link-label {
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -.02em;
}
.error-link:hover .error-link-label { color: #fff; }
.error-link-desc { color: var(--muted); font-size: .86rem; line-height: 1.65; }
.error-link-arrow {
  position: absolute;
  top: 26px;
  right: 26px;
  color: var(--accent);
  font-size: .95rem;
  transition: transform .18s ease, color .18s ease;
}
.error-link:hover .error-link-arrow { color: var(--accent-strong); transform: translateX(2px); }

/* ============ FOOTER ============ */

.site-footer { border-top: 1px solid var(--line); padding-block: 34px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.footer-inner .brand-mark { width: 34px; height: 34px; border-radius: 9px; font-size: .72rem; }
.footer-inner .brand-name { font-size: .84rem; }
.footer-inner p { color: #8297b2; font-size: .75rem; }
.footer-separator { padding-inline: 3px; }
.footer-links { display: flex; gap: 20px; }
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: #93a7c1;
  font-size: .75rem;
  text-decoration: none;
}
.footer-links a:hover { color: #fff; text-decoration: underline; }

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #3b5678;
  border-radius: 10px;
  background: rgba(17, 28, 44, .94);
  color: #c6d8ef;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease, background-color .2s ease;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.back-to-top:hover { background: #17263c; color: #fff; }
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }

/* ============ MOTION ============ */

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(16px); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

.hero-copy > * { animation: hero-rise .7s var(--ease) both; }
.hero-copy > :nth-child(2) { animation-delay: .06s; }
.hero-copy > :nth-child(3) { animation-delay: .12s; }
.hero-copy > :nth-child(4) { animation-delay: .18s; }
.hero-copy > :nth-child(5) { animation-delay: .24s; }
.hero-visual { animation: hero-rise .8s var(--ease) .12s both; }

/* ============ RESPONSIVE ============ */

@media (max-width: 1200px) {
  .nav-menu { gap: 14px; }
  .nav-links { gap: 15px; }
  .nav-links a { font-size: .78rem; }
  .header-cta { padding: 9px 12px; font-size: .74rem; }
  .hero-grid { gap: 40px; }
  .contact-grid { gap: 44px; }
}

@media (max-width: 1024px) {
  .menu-toggle { display: inline-flex; }
  .nav-menu {
    position: absolute;
    top: calc(100% + 1px);
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    max-height: calc(100vh - 84px);
    overflow-y: auto;
    padding: 18px 24px 24px;
    border-bottom: 1px solid #2b3d57;
    background: #0d1623;
    box-shadow: 0 24px 40px rgba(0, 0, 0, .32);
  }
  .nav-menu.is-open { display: flex; }
  .nav-links { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-links a { min-height: 46px; font-size: .92rem; border-bottom: 1px solid var(--line-soft); }
  .nav-links a.is-active::after { display: none; }
  .language-switch { align-self: flex-start; padding-top: 2px; }
  .language-switch a { min-width: 42px; }
  .header-cta { margin-top: 6px; }
  body.menu-open { overflow: hidden; }

  .hero-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
  .service-row { gap: 38px; }
}

@media (max-width: 900px) {
  .container { width: min(1120px, calc(100% - 48px)); }
  .section { padding-block: 72px; }

  .hero { padding-block: 64px 62px; }
  .hero-grid { grid-template-columns: 1fr; gap: 38px; }
  .hero-title { max-width: 660px; }
  .hero-visual { min-height: 460px; max-width: 470px; margin-inline: auto; }
  .visual-caption { margin-top: 28px; }

  .service-row { grid-template-columns: 1fr; gap: 16px; padding: 30px 0; }
  .service-row h3 { font-size: 1.3rem; }

  .about-copy { display: block; }
  .about-copy h2 { margin-bottom: 24px; }
  .about-copy p:first-of-type { font-size: 1.08rem; line-height: 1.7; }
  .about-copy p:nth-of-type(2),
  .about-copy p:nth-of-type(3) { margin-top: 16px; }
  .about-links { margin-top: 32px; }

  .role { grid-template-columns: 1fr; gap: 20px; padding: 30px 0 32px; }
  .role-meta { flex-direction: row; flex-wrap: wrap; gap: 8px 20px; align-items: baseline; }
  .role-list { grid-template-columns: 1fr; }

  .projects-grid { grid-template-columns: 1fr; }
  .project-featured { grid-column: auto; grid-template-columns: 1fr; gap: 30px; padding: 30px; }
  .project-figure { max-width: 460px; }

  .stack-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .credential { grid-template-columns: 1fr; gap: 10px; }
  .credential-meta { flex-direction: row; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; text-align: left; }

  .contact-grid { grid-template-columns: 1fr; gap: 34px; }
  .contact-copy h2 { max-width: 620px; }
  .contact-copy > p { max-width: 620px; }

  .footer-inner { flex-wrap: wrap; }
  .footer-links { margin-left: auto; }
}

@media (max-width: 620px) {
  html { scroll-padding-top: 90px; }
  .container { width: calc(100% - 40px); }
  .section { padding-block: 60px; }
  .header-inner { min-height: 74px; }
  .brand-name { display: none; }

  .hero { padding-block: 52px 54px; }
  .hero-title { font-size: clamp(2.2rem, 10vw, 2.9rem); }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .hero-cv { margin-left: 0; align-self: flex-start; }
  .hero-proof { gap: 8px 12px; }
  .hero-proof-separator { display: none; }
  .hero-visual { min-height: 430px; }
  .hero-visual::before { inset: 4% -4% 4%; background-size: 22px 22px; }
  .terminal-card { width: calc(100% - 14px); transform: none; }
  .terminal-body { padding: 18px; font-size: .78rem; }
  .visual-caption { margin-top: 24px; }

  .service-row { padding: 26px 0; }
  .service-icon { width: 24px; height: 24px; }
  .project-card, .project-featured, .contact-panel { padding: 24px; }
  .project-figure { padding: 12px; }
  .project-figure figcaption { text-align: left; }

  .stack-grid { grid-template-columns: 1fr; }

  .error-links { grid-template-columns: 1fr; }
  .error-link { padding: 22px 50px 22px 22px; }
  .error-link-arrow { top: 22px; right: 22px; }

  .contact-row { gap: 12px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .footer-links { margin-left: 0; }
  .back-to-top { right: 14px; bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .hero-copy > *, .hero-visual { animation: none !important; }
  .hero-visual:hover .terminal-card { transform: rotate(-2deg); }
  .project-card:hover { transform: none; }
}

@media (max-width: 900px) {
  body { background-attachment: scroll; }
}
