/* =====================================================================
   Tokens
   ===================================================================== */
:root {
  --abyss: #071318;
  --deep: #0b1c22;
  --surface: #0f242b;
  --surface-2: #132d35;
  --line: #1c3a42;
  --line-soft: rgba(120, 235, 205, 0.09);
  --mint: #3fe3b8;
  --mint-deep: #17a383;
  --mint-glow: rgba(63, 227, 184, 0.35);
  --ink: #e3eeeb;
  --fog: #8ea7a2;
  --fog-2: #5c7873;

  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;

  --gutter: clamp(16px, 4vw, 32px);
  --nav-h: 72px;
}

/* =====================================================================
   Base
   ===================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--abyss);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }

::selection { background: var(--mint); color: var(--abyss); }

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

.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* =====================================================================
   Buttons
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.005em;
  white-space: nowrap;
  transition:
    transform 160ms var(--ease-out),
    background-color 200ms ease,
    border-color 200ms ease,
    color 200ms ease,
    box-shadow 200ms ease;
}
.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--mint);
  color: #04231b;
  box-shadow: 0 0 0 0 var(--mint-glow), 0 8px 30px -10px var(--mint-glow);
}
.btn--ghost {
  border-color: rgba(63, 227, 184, 0.45);
  color: var(--ink);
  background: rgba(63, 227, 184, 0.03);
}
.btn--sm { height: 40px; padding: 0 18px; font-size: 0.875rem; }

@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { background: #63ecc7; box-shadow: 0 0 0 4px rgba(63, 227, 184, 0.14), 0 10px 40px -10px var(--mint-glow); }
  .btn--ghost:hover { border-color: var(--mint); background: rgba(63, 227, 184, 0.08); }
}

/* =====================================================================
   Scroll progress + Nav
   ===================================================================== */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--mint);
  transform-origin: 0 50%;
  transform: scaleX(0);
  z-index: 60;
}

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--nav-h);
  transition: background-color 250ms ease, border-color 250ms ease, backdrop-filter 250ms ease;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(7, 19, 24, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line-soft);
}
.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav__logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--mint);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.nav__logo span { color: var(--ink); }

.nav__links {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.nav__links a {
  position: relative;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fog);
  transition: color 200ms ease;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--mint);
  transform: scaleX(0);
  transition: transform 250ms var(--ease-out);
}
.nav__links a.is-active { color: var(--mint); }
.nav__links a.is-active::after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) {
  .nav__links a:hover { color: var(--ink); }
}

.nav__burger {
  display: none;
  width: 44px; height: 44px;
  margin-left: auto;
  background: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  position: relative;
}
.nav__burger span {
  position: absolute;
  left: 13px; right: 13px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 250ms var(--ease-out);
}
.nav__burger span:first-child { top: 17px; }
.nav__burger span:last-child { top: 25px; }
.nav__burger[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav__cta { display: none; }
  .nav__burger { display: block; }
  .nav__links {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px var(--gutter) 20px;
    background: rgba(7, 19, 24, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 200ms ease, transform 250ms var(--ease-out);
  }
  .nav__links.is-open { opacity: 1; transform: none; pointer-events: auto; }
  .nav__links a { padding: 14px 0; font-size: 1.05rem; border-bottom: 1px solid var(--line-soft); }
  .nav__links a::after { display: none; }
}

/* =====================================================================
   Hero
   ===================================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 40px) 0 80px;
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  /* soft vignette that lights the right-hand visual */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 70% at 75% 45%, rgba(23, 163, 131, 0.16), transparent 70%),
    radial-gradient(40% 40% at 15% 20%, rgba(63, 227, 184, 0.05), transparent 70%);
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 160px;
  z-index: -1;
  background: linear-gradient(to bottom, transparent, var(--abyss));
}
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 10px;
  margin-bottom: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 36, 43, 0.6);
  font-size: 0.85rem;
  color: var(--fog);
}
.status__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 0 var(--mint-glow);
  animation: ping 2.4s var(--ease-out) infinite;
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(63, 227, 184, 0.55); }
  70%, 100% { box-shadow: 0 0 0 8px rgba(63, 227, 184, 0); }
}

.hero__title {
  font-size: clamp(2.75rem, 6.2vw, 5rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.hero__title .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}
.hero__title .word > span { display: inline-block; will-change: transform; }

.hero__sub {
  margin-top: 24px;
  max-width: 34rem;
  font-size: clamp(1.02rem, 1.3vw, 1.15rem);
  line-height: 1.65;
  color: var(--fog);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}

/* ---- Visual ---- */
.hero__visual {
  position: relative;
  aspect-ratio: 560 / 500;
  width: 100%;
  max-width: 640px;
  justify-self: end;
}
.iso {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.iso .pillar-top { transition: opacity 400ms ease; }

.window {
  background: linear-gradient(180deg, rgba(19, 45, 53, 0.92), rgba(11, 28, 34, 0.94));
  border: 1px solid rgba(63, 227, 184, 0.16);
  border-radius: var(--r-md);
  box-shadow:
    0 30px 80px -20px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
}
.window__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(63, 227, 184, 0.09);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--fog-2);
}
.window__bar > i,
.window__close {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #24434a;
  border: 0;
  padding: 0;
  flex: none;
}
.window__bar > :nth-child(1) { background: #ef6a5e; }
.window__bar > :nth-child(2) { background: #e9b949; }
.window__bar > :nth-child(3) { background: #3fe3b8; }
.window__bar span { margin-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.code-window {
  position: absolute;
  top: 2%;
  left: 0;
  width: 56%;
  z-index: 2;
}
.code {
  margin: 0;
  padding: 14px 16px 16px;
  min-height: 25.6em; /* 15 lines, so the window never grows while typing */
  font-family: var(--mono);
  font-size: clamp(0.6rem, 0.82vw, 0.74rem);
  line-height: 1.6;
  color: #b9cdc8;
  white-space: pre;
  overflow: hidden;
}
.code .k { color: #c792ea; }
.code .a { color: #ffcb6b; }
.code .t { color: #3fe3b8; }
.code .s { color: #c3e88d; }
.code .f { color: #82aaff; }
.code .c { color: var(--fog-2); }
.caret {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 1px;
  vertical-align: text-bottom;
  background: var(--mint);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.graph-window {
  position: absolute;
  right: 0;
  bottom: 2%;
  width: 60%;
  z-index: 3;
}
.live {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-style: normal;
  color: var(--mint);
}
.live::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--mint);
  animation: blink 1.6s steps(1) infinite;
}
.graph { width: 100%; height: auto; padding: 6px 4px 0; }
.graph .edge { stroke: rgba(63, 227, 184, 0.22); stroke-width: 1; fill: none; }
.graph .node-ring { fill: #0b1c22; stroke: var(--mint); stroke-width: 1.3; }
.graph .node-halo { fill: var(--mint); opacity: 0; }
.graph .node-icon { stroke: var(--mint); stroke-width: 1.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.graph .node-label { fill: var(--fog); font-family: var(--mono); font-size: 8.5px; text-anchor: middle; }
.graph .packet { fill: #b6fbe7; filter: drop-shadow(0 0 4px var(--mint)); }

.graph__log {
  height: 54px;
  padding: 6px 14px 10px;
  border-top: 1px solid rgba(63, 227, 184, 0.08);
  font-family: var(--mono);
  font-size: 0.64rem;
  line-height: 1.55;
  color: var(--fog-2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.graph__log div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: logIn 300ms var(--ease-out); }
.graph__log b { font-weight: 500; color: var(--mint); }
.graph__log b.warn { color: #e9b949; }
@keyframes logIn { from { opacity: 0; transform: translateY(6px); } }

@media (max-width: 960px) {
  .hero { min-height: auto; padding-top: calc(var(--nav-h) + 48px); }
  .hero__inner { grid-template-columns: 1fr; }
  .hero__visual { justify-self: center; max-width: 560px; margin-top: 16px; }
}
@media (max-width: 520px) {
  .code-window { width: 74%; }
  .graph-window { width: 78%; }
  .graph__log { display: none; }
  .hero__actions .btn { flex: 1 1 auto; }
}

/* =====================================================================
   Sections
   ===================================================================== */
.section {
  position: relative;
  padding: clamp(80px, 11vw, 140px) 0;
}
.section__head { max-width: 40rem; margin-bottom: clamp(40px, 5vw, 64px); }
.section__head--row {
  max-width: none;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 40px;
  flex-wrap: wrap;
}
.section__head--row > div { max-width: 40rem; }
.section__title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.section__lead {
  margin-top: 14px;
  color: var(--fog);
  font-size: 1.05rem;
  max-width: 36rem;
}

/* =====================================================================
   Timeline
   ===================================================================== */
.timeline {
  position: relative;
  display: grid;
  gap: 20px;
  padding-left: 44px;
}
.timeline__rail {
  position: absolute;
  left: 11px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--line);
  border-radius: 2px;
}
.timeline__fill {
  position: absolute;
  inset: 0;
  display: block;
  background: linear-gradient(to bottom, var(--mint), var(--mint-deep));
  transform-origin: 50% 0;
  transform: scaleY(0);
  border-radius: 2px;
  box-shadow: 0 0 12px var(--mint-glow);
}
.job {
  position: relative;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 8px 40px;
  padding: 28px 32px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(15, 36, 43, 0.7), rgba(11, 28, 34, 0.4));
  transition: border-color 400ms ease;
}
.job::before {
  /* node on the rail */
  content: "";
  position: absolute;
  left: -40px;
  top: 34px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--abyss);
  border: 2px solid var(--line);
  transition: border-color 300ms ease, box-shadow 300ms ease, background-color 300ms ease;
}
.job.is-on { border-color: rgba(63, 227, 184, 0.28); }
.job.is-on::before {
  border-color: var(--mint);
  background: var(--mint);
  box-shadow: 0 0 0 5px rgba(63, 227, 184, 0.14), 0 0 18px var(--mint-glow);
}
.job__period { font-size: 0.9rem; color: var(--fog); padding-top: 3px; font-variant-numeric: tabular-nums; }
.job__role { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.015em; }
.job__company { color: var(--mint); font-weight: 500; }
.job__summary { margin-top: 10px; color: var(--fog); max-width: 60ch; }
.job__body .tags { margin-top: 16px; }

@media (max-width: 720px) {
  .timeline { padding-left: 32px; }
  .timeline__rail { left: 7px; }
  .job { grid-template-columns: 1fr; padding: 22px 20px; }
  .job::before { left: -32px; top: 28px; width: 14px; height: 14px; }
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 3px 10px;
  border-radius: var(--r-sm);
  background: rgba(63, 227, 184, 0.07);
  border: 1px solid rgba(63, 227, 184, 0.12);
  color: #a9dccd;
  font-size: 0.78rem;
  font-weight: 500;
}

/* =====================================================================
   Projects
   ===================================================================== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(11, 28, 34, 0.7);
  position: relative;
}
.filter {
  position: relative;
  z-index: 1;
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--fog);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 200ms ease;
}
.filter[aria-pressed="true"] { color: #04231b; }
.filter__pill {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  height: 36px;
  border-radius: 999px;
  background: var(--mint);
  transition: transform 320ms var(--ease-out), width 320ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .filter:not([aria-pressed="true"]):hover { color: var(--ink); }
}

.projects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.project {
  --mx: 50%;
  --my: 50%;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  padding: 26px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--deep);
  text-align: left;
  overflow: hidden;
  transition: border-color 250ms ease, transform 160ms var(--ease-out);
}
.project::before {
  /* cursor-following light */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(63, 227, 184, 0.09), transparent 45%);
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}
.project:active { transform: scale(0.99); }
@media (hover: hover) and (pointer: fine) {
  .project:hover { border-color: rgba(63, 227, 184, 0.35); }
  .project:hover::before { opacity: 1; }
  .project:hover .project__open { color: var(--mint); transform: translate(2px, -2px); }
}
.project.is-hidden { display: none; }

.project__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  font-size: 0.8rem;
  color: var(--fog-2);
}
.project__cat { color: var(--fog); font-weight: 500; }
.project__open { color: var(--fog-2); transition: color 200ms ease, transform 250ms var(--ease-out); }
.project__title { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.project__summary { margin-top: 10px; color: var(--fog); font-size: 0.95rem; flex: 1; }
.project .tags { margin-top: 22px; }

/* Featured: wide card with architecture flow */
.project--featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 40px;
  min-height: 0;
  padding: 36px;
  background:
    radial-gradient(80% 120% at 100% 0%, rgba(23, 163, 131, 0.12), transparent 60%),
    var(--deep);
}
.project--featured .project__title { font-size: clamp(1.5rem, 2.4vw, 2rem); }
.project--featured .project__summary { font-size: 1.02rem; flex: 0; }
.project__copy { display: flex; flex-direction: column; }
.project__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  margin-bottom: 18px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(63, 227, 184, 0.1);
  color: var(--mint);
  font-size: 0.78rem;
  font-weight: 600;
}

/* Architecture flow (featured card + modal) */
.flow {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  border-radius: var(--r-md);
  border: 1px solid rgba(63, 227, 184, 0.12);
  background:
    linear-gradient(rgba(63, 227, 184, 0.04) 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(90deg, rgba(63, 227, 184, 0.04) 1px, transparent 1px) 0 0 / 20px 20px,
    rgba(7, 19, 24, 0.6);
}
.flow__step {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--ink);
}
.flow__node {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 9px;
  border: 1px solid rgba(63, 227, 184, 0.5);
  background: var(--deep);
  color: var(--mint);
  font-size: 0.7rem;
}
.flow__step + .flow__step::before {
  /* connector + travelling packet */
  content: "";
  position: absolute;
  left: 14.5px;
  bottom: 100%;
  width: 1px;
  height: 12px;
  background: rgba(63, 227, 184, 0.35);
}
.flow__step + .flow__step::after {
  content: "";
  position: absolute;
  left: 13px;
  bottom: 100%;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #b6fbe7;
  box-shadow: 0 0 6px var(--mint);
  animation: hop 2.4s linear infinite;
  animation-delay: calc(var(--i) * 0.4s);
  opacity: 0;
}
@keyframes hop {
  0% { transform: translateY(-2px); opacity: 0; }
  10% { opacity: 1; }
  25% { transform: translateY(10px); opacity: 1; }
  30%, 100% { transform: translateY(10px); opacity: 0; }
}

@media (max-width: 1024px) {
  .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .projects { grid-template-columns: 1fr; }
  .project--featured { grid-template-columns: 1fr; padding: 26px; gap: 28px; }
  .section__head--row { align-items: flex-start; }
  .filters { border-radius: var(--r-md); }
}

/* =====================================================================
   Technologies — stack layers
   ===================================================================== */
.stack {
  position: relative;
  display: grid;
  gap: 10px;
}
.layer {
  position: relative;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: center;
  gap: 16px 32px;
  padding: 20px 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: linear-gradient(90deg, rgba(15, 36, 43, 0.85), rgba(11, 28, 34, 0.45));
  overflow: hidden;
}
.layer::after {
  /* request "scan" passing through the layer */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(63, 227, 184, 0.08), transparent);
  transform: translateX(-100%);
  pointer-events: none;
}
.stack.is-scanning .layer::after {
  animation: scan 1.1s var(--ease-in-out) forwards;
  animation-delay: calc(var(--i) * 110ms);
}
@keyframes scan { to { transform: translateX(100%); } }

.layer__name {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 1.02rem;
}
.layer__idx {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(63, 227, 184, 0.3);
  color: var(--mint);
  font-family: var(--mono);
  font-size: 0.72rem;
}
.layer__items { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(7, 19, 24, 0.5);
  color: var(--fog);
  font-size: 0.88rem;
  font-weight: 500;
}
.chip--daily { color: var(--ink); border-color: rgba(63, 227, 184, 0.3); }
.chip--daily::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 8px var(--mint-glow);
}
.stack__legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 0.85rem;
  color: var(--fog-2);
}
.stack__legend::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--mint);
}

@media (max-width: 760px) {
  .layer { grid-template-columns: 1fr; padding: 18px; }
}

/* =====================================================================
   Contact
   ===================================================================== */
.contact__card {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(63, 227, 184, 0.18);
  background:
    radial-gradient(70% 90% at 50% 120%, rgba(23, 163, 131, 0.28), transparent 70%),
    var(--deep);
  isolation: isolate;
}
.contact__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.8;
}
.contact__content {
  padding: clamp(48px, 8vw, 96px) var(--gutter);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.contact__title {
  font-size: clamp(2rem, 4.6vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.06;
  max-width: 18ch;
  text-wrap: balance;
}
.contact__content .section__lead { margin-inline: auto; }
.contact__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 36px;
}
.socials { display: flex; gap: 10px; margin-top: 32px; }
.socials a {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--fog);
  background: rgba(7, 19, 24, 0.5);
  transition: color 200ms ease, border-color 200ms ease, transform 160ms var(--ease-out);
}
.socials a:active { transform: scale(0.95); }
@media (hover: hover) and (pointer: fine) {
  .socials a:hover { color: var(--mint); border-color: rgba(63, 227, 184, 0.5); }
}

/* =====================================================================
   Footer
   ===================================================================== */
.footer { border-top: 1px solid var(--line-soft); padding: 28px 0; font-size: 0.875rem; color: var(--fog-2); }
.footer__inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer__top { transition: color 200ms ease; }
@media (hover: hover) and (pointer: fine) { .footer__top:hover { color: var(--mint); } }

/* =====================================================================
   Modal
   ===================================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: var(--gutter);
}
.modal[hidden] { display: none; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 10, 13, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal__panel {
  position: relative;
  width: min(760px, 100%);
  max-height: min(86vh, 860px);
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
}
.window__close { cursor: pointer; }
.modal__body { padding: clamp(24px, 4vw, 40px); overflow-y: auto; overscroll-behavior: contain; }
.modal__meta { font-size: 0.85rem; color: var(--fog); }
.modal__title { margin-top: 8px; font-size: clamp(1.6rem, 3.4vw, 2.2rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.modal__desc { margin-top: 14px; color: var(--fog); font-size: 1.02rem; max-width: 62ch; }
.modal h3 { margin: 32px 0 14px; font-size: 1rem; font-weight: 600; }
.modal__list { display: grid; gap: 10px; }
.modal__list li { position: relative; padding-left: 22px; color: #c4d6d1; }
.modal__list li::before {
  content: "";
  position: absolute;
  left: 2px; top: 0.62em;
  width: 8px; height: 8px;
  border-radius: 2px;
  border: 1.5px solid var(--mint);
  transform: rotate(45deg);
}
.modal__links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* =====================================================================
   Toast
   ===================================================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 120;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid rgba(63, 227, 184, 0.35);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.6);
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 300ms var(--ease-out);
}
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* =====================================================================
   Reduced motion
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .caret { display: none; }
}

/* =====================================================================
   Additions: intro guard, iso pulses, card details
   ===================================================================== */
/* hide intro elements until GSAP takes over (class removed by JS) */
.js [data-hero],
.js [data-hero-win],
.js #hero-title,
.js #iso { visibility: hidden; }

.iso-tile { animation: tile 3.6s ease-in-out infinite; opacity: 0; }
@keyframes tile { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
.pillar-glow { animation: glow 3.2s ease-in-out infinite; }
@keyframes glow { 0%, 100% { opacity: 0.55; } 50% { opacity: 0.15; } }

.project__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 28px;
  color: var(--mint);
  font-weight: 600;
  font-size: 0.95rem;
}
.project__more svg { transition: transform 250ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .project--featured:hover .project__more svg { transform: translate(2px, -2px); }
}

/* =====================================================================
   Language toggle (TR | EN)
   ===================================================================== */
.nav__inner { gap: 20px; }
.nav__links { margin-right: 4px; }

.lang {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: none;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(11, 28, 34, 0.7);
}
.lang::before {
  /* sliding pill */
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: 999px;
  background: var(--mint);
  transition: transform 280ms var(--ease-out);
}
.lang[data-active="en"]::before { transform: translateX(100%); }
.lang button {
  position: relative;
  z-index: 1;
  min-width: 38px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--fog);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: color 200ms ease, transform 160ms var(--ease-out);
}
.lang button[aria-pressed="true"] { color: #04231b; }
.lang button:active { transform: scale(0.95); }
@media (hover: hover) and (pointer: fine) {
  .lang button:not([aria-pressed="true"]):hover { color: var(--ink); }
}

@media (max-width: 1060px) and (min-width: 861px) {
  .nav__links a { padding: 8px 10px; }
  .nav__links a::after { left: 10px; right: 10px; }
}
@media (max-width: 860px) {
  .lang { margin-left: auto; }
  .nav__burger { margin-left: 0; }
}
