@font-face {
  font-family: "Interphases";
  src: url("../../compania/TT_Interphases_Regular.woff2") format("woff2");
  font-display: swap;
  font-weight: 400;
}

@font-face {
  font-family: "Interphases";
  src: url("../../compania/TT_Interphases_Bold.woff2") format("woff2");
  font-display: swap;
  font-weight: 700;
}

@font-face {
  font-family: "Octosquares";
  src: url("../../compania/TT_Octosquares_Bold.woff2") format("woff2");
  font-display: swap;
  font-weight: 700;
}

:root {
  --ink: #f4f7fb;
  --muted: #9aa9bb;
  --quiet: #6c7b8f;
  --bg: #070b12;
  --panel: #0d1420;
  --panel-2: #111b2a;
  --line: rgba(170, 197, 226, 0.16);
  --cyan: #4ee4ff;
  --cyan-soft: rgba(78, 228, 255, 0.13);
  --violet: #a97cff;
  --violet-soft: rgba(169, 124, 255, 0.13);
  --green: #69f0ae;
  --danger: #ff8e9c;
  --max: 1180px;
  --radius: 22px;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 4%, rgba(112, 65, 210, 0.16), transparent 30rem),
    radial-gradient(circle at 8% 22%, rgba(27, 165, 190, 0.09), transparent 26rem),
    var(--bg);
  font: 400 17px/1.65 "Interphases", system-ui, sans-serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.25;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
  z-index: -1;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: .7rem 1rem;
  border-radius: 10px;
  color: #071016;
  background: var(--cyan);
  transition: top .2s ease;
}

.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 11, 18, 0.82);
  backdrop-filter: blur(18px);
}

.nav-shell {
  width: min(calc(100% - 40px), var(--max));
  min-height: 74px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

.brand-mark {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(78, 228, 255, .45);
  border-radius: 10px;
  color: var(--cyan);
  font: 700 13px/1 "Octosquares", monospace;
  background: linear-gradient(145deg, rgba(78,228,255,.12), rgba(169,124,255,.1));
  box-shadow: 0 0 24px rgba(78, 228, 255, .08);
}

.nav-links { display: flex; align-items: center; gap: 1.2rem; }
.nav-links a { color: var(--muted); font-size: .9rem; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links .lang { color: var(--cyan); }

.nav-dropdown {
  position: relative;
  display: grid;
  grid-template-columns: auto 32px;
  align-items: center;
  gap: 1px;
}

.nav-dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 18px;
}

.nav-section-link { padding: .7rem .1rem; }
.nav-submenu-toggle {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  color: var(--cyan);
  background: transparent;
  cursor: pointer;
}
.nav-submenu-toggle:hover, .nav-submenu-toggle:focus-visible { background: var(--cyan-soft); }
.nav-submenu-toggle span { transition: transform .18s ease; }
.nav-dropdown:is(.is-hovered, .is-focused, .is-pinned) .nav-submenu-toggle span { transform: rotate(180deg); }

.nav-submenu {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  z-index: 60;
  width: min(330px, calc(100vw - 32px));
  display: grid;
  gap: .25rem;
  padding: .65rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(13, 20, 32, .99);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-7px);
  transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
}
.nav-dropdown:is(.is-hovered, .is-focused, .is-pinned) .nav-submenu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}
.nav-submenu a {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: .55rem;
  padding: .72rem .75rem;
  border-radius: 10px;
}
.nav-submenu a:hover, .nav-submenu a:focus-visible { color: var(--ink); background: var(--cyan-soft); }
.nav-submenu a span { color: var(--cyan); font: 700 .65rem/1 "Octosquares", monospace; }
.nav-submenu a strong { overflow-wrap: anywhere; font-size: .84rem; line-height: 1.3; }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--panel);
  cursor: pointer;
}

.container { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }
.section { padding: 96px 0; }
.section.compact { padding: 64px 0; }
.section-line { border-top: 1px solid var(--line); }

.eyebrow {
  margin: 0 0 1rem;
  color: var(--cyan);
  font: 700 .76rem/1.2 "Octosquares", monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.eyebrow::before { content: "// "; color: var(--violet); }

h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { line-height: 1.08; letter-spacing: -.04em; }
h1 { max-width: 980px; margin-bottom: 1.5rem; font-size: clamp(2.8rem, 7vw, 6.8rem); }
h2 { margin-bottom: 1.2rem; font-size: clamp(2.1rem, 4.5vw, 4rem); }
h3 { margin-bottom: .8rem; font-size: clamp(1.25rem, 2vw, 1.65rem); }
h4 { margin-bottom: .8rem; font-size: clamp(1.18rem, 2vw, 1.5rem); }

.gradient-text {
  color: transparent;
  background: linear-gradient(95deg, var(--cyan), #a8f0ff 38%, #c3a6ff 72%, var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
}

.hero { padding: 64px 0 56px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 3rem; align-items: end; }
.hero-copy { max-width: 800px; }
.hero h1 {
  max-width: 800px;
  margin-bottom: 1.2rem;
  font-size: clamp(2.65rem, 5.3vw, 5rem);
  line-height: 1.02;
  letter-spacing: -.055em;
}
.hero-name {
  margin: 0 0 .25rem;
  color: var(--ink);
  font-size: clamp(1.08rem, 1.7vw, 1.35rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.02em;
}
.hero-role {
  margin: 0 0 1.15rem;
  color: #b8c5d4;
  font-size: .92rem;
  line-height: 1.45;
  letter-spacing: .015em;
}
.hero-role::before { content: "•"; margin-right: .5rem; color: var(--cyan); }
.hero-lead { max-width: 700px; color: #c3cedb; font-size: clamp(1.02rem, 1.5vw, 1.16rem); line-height: 1.58; }
.hero-actions, .button-row { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }

.button {
  display: inline-flex;
  min-height: 49px;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .75rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: rgba(255,255,255,.035);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.button:hover { transform: translateY(-2px); border-color: rgba(78,228,255,.45); }
.button.primary { color: #061118; border-color: var(--cyan); background: var(--cyan); font-weight: 700; }
.button.small { min-height: 42px; padding: .55rem .85rem; font-size: .88rem; }
.arrow { color: currentColor; transition: transform .2s ease; }
.button:hover .arrow, .text-link:hover .arrow { transform: translate(3px, -2px); }

.hero-identity {
  position: relative;
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(78,228,255,.07), rgba(169,124,255,.07));
  box-shadow: var(--shadow);
}

.identity-line { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; color: var(--muted); border-bottom: 1px solid var(--line); font-size: .83rem; }
.identity-line:last-child { border-bottom: 0; }
.identity-line strong { color: var(--ink); font-weight: 400; text-align: right; }
.status { color: var(--green); }

.compact-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.5rem; }
.compact-heading h2 { max-width: 720px; margin-bottom: 0; font-size: clamp(1.8rem, 3.3vw, 2.8rem); }
.proof-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; padding: 1px; border-radius: var(--radius); overflow: hidden; background: var(--line); }
.proof-item { min-width: 0; min-height: 142px; padding: 1.4rem; background: rgba(13,20,32,.96); }
.proof-item:is(a):hover { background: rgba(78,228,255,.045); }
.proof-label { display: block; margin-bottom: .55rem; color: var(--cyan); font: 700 .64rem/1.3 "Octosquares", monospace; letter-spacing: .08em; text-transform: uppercase; }
.proof-number { display: block; margin-bottom: .4rem; color: var(--ink); font-size: clamp(2rem, 3.5vw, 3.15rem); line-height: 1; letter-spacing: -.06em; }
.proof-item p { margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.45; }

.section-heading { display: flex; justify-content: space-between; gap: 2rem; align-items: end; margin-bottom: 3rem; }
.section-heading h2 { max-width: 760px; margin-bottom: 0; }
.section-heading > p { max-width: 430px; margin-bottom: .35rem; color: var(--muted); }

.project-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1rem; }
.project-card {
  position: relative;
  grid-column: span 6;
  min-height: 450px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(17,27,42,.94), rgba(10,16,26,.94));
  transition: border-color .25s ease, transform .25s ease;
}

.project-card:hover { transform: translateY(-5px); border-color: rgba(78,228,255,.35); }
.project-card.wide { grid-column: span 8; }
.project-card.narrow { grid-column: span 4; }
.project-media { position: relative; min-height: 230px; overflow: hidden; border-bottom: 1px solid var(--line); background: #0a111b; }
.project-media img { width: 100%; height: 100%; min-height: 230px; object-fit: cover; transition: transform .5s ease; }
.project-card:hover .project-media img { transform: scale(1.025); }
.project-media.contain img { object-fit: contain; padding: 1.4rem; }
.project-body { padding: 1.55rem; }
.project-kicker, .meta { color: var(--cyan); font: 700 .72rem/1.4 "Octosquares", monospace; letter-spacing: .09em; text-transform: uppercase; }
.project-body h3 { margin: .55rem 0 .8rem; }
.project-body p { margin-bottom: 1rem; color: var(--muted); }
.text-link { display: inline-flex; align-items: center; gap: .45rem; color: var(--ink); font-weight: 700; }

.code-visual {
  min-height: 230px;
  padding: 1.5rem;
  display: grid;
  align-content: center;
  gap: .75rem;
  background:
    linear-gradient(120deg, rgba(78,228,255,.07), transparent 55%),
    radial-gradient(circle at 80% 20%, rgba(169,124,255,.15), transparent 34%);
}

.code-line { display: flex; align-items: center; gap: .75rem; color: var(--muted); font: .82rem/1.5 ui-monospace, Consolas, monospace; }
.code-line::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 13px var(--cyan); }
.code-line:nth-child(2)::before { background: var(--violet); box-shadow: 0 0 13px var(--violet); }
.code-line strong { color: var(--ink); }

.split {
  display: grid;
  grid-template-columns: minmax(230px, .64fr) minmax(0, 1.36fr);
  gap: clamp(2.5rem, 5vw, 5rem);
}
.sticky-title { position: sticky; top: 110px; align-self: start; }
.sticky-title p { max-width: 430px; color: var(--muted); }

.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; top: .7rem; bottom: .7rem; left: 7px; width: 1px; background: var(--line); }
.timeline-item { position: relative; padding: 0 0 3rem 2.5rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: 0; top: .45rem; width: 15px; height: 15px; border: 3px solid var(--bg); border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 1px rgba(78,228,255,.4), 0 0 20px rgba(78,228,255,.22); }
.timeline-date { color: var(--cyan); font: 700 .75rem/1.4 "Octosquares", monospace; letter-spacing: .08em; text-transform: uppercase; }
.timeline-role { margin: .4rem 0 .3rem; font-size: 1.5rem; }
.timeline-company { margin-bottom: .8rem; color: #c7d2de; }
.timeline-item > p { color: var(--muted); }
.mandates { display: grid; gap: .65rem; margin-top: 1.15rem; }
.mandate { padding: .8rem 1rem; border-left: 2px solid var(--violet); color: var(--muted); background: rgba(169,124,255,.05); font-size: .9rem; }
.mandate strong { color: var(--ink); }

.achievement-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.achievement-card { min-width: 0; min-height: 285px; display: flex; flex-direction: column; padding: 1.6rem; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(13,20,32,.72); }
.achievement-card.featured { background: linear-gradient(145deg, rgba(78,228,255,.1), rgba(169,124,255,.08)); }
.achievement-card p { flex: 1; color: var(--muted); }
.achievement-card .metric { display: block; margin-bottom: .9rem; color: var(--cyan); font: 700 clamp(2.3rem, 4vw, 4rem)/1 "Octosquares", monospace; letter-spacing: -.05em; }

.link-list { display: grid; gap: .7rem; }
.link-list a { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 1.15rem; border: 1px solid var(--line); border-radius: 14px; color: #cbd5df; background: rgba(255,255,255,.02); }
.link-list a:hover { color: var(--ink); border-color: rgba(78,228,255,.35); }
.publication-content { min-width: 0; display: grid; gap: 1.6rem; }
.publication-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.25rem 1.35rem;
  border: 1px solid rgba(78,228,255,.28);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(78,228,255,.09), rgba(169,124,255,.07));
}
.publication-overview:hover { border-color: rgba(78,228,255,.55); }
.publication-overview > span:first-child { min-width: 0; display: grid; gap: .3rem; }
.publication-overview strong { color: var(--ink); font-size: clamp(1.25rem, 2vw, 1.65rem); }
.publication-overview small { color: var(--muted); line-height: 1.45; }
.publication-overview > span:last-child { flex: 0 0 auto; color: var(--cyan); font-size: .82rem; font-weight: 700; }
.publication-group { display: grid; gap: .75rem; }
.publication-group h3 { margin: 0; color: #cbd5df; font-size: .88rem; letter-spacing: .02em; }
.publication-list a > span:first-child { min-width: 0; display: grid; gap: .2rem; }
.publication-list strong { color: var(--ink); }
.publication-list small { color: var(--muted); font-size: .82rem; line-height: 1.4; overflow-wrap: anywhere; }
.publication-collections { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.publication-collections a { align-items: flex-start; }

.contact-panel { position: relative; overflow: hidden; padding: clamp(2rem, 7vw, 5rem); border: 1px solid var(--line); border-radius: 30px; background: linear-gradient(135deg, rgba(78,228,255,.1), rgba(169,124,255,.1) 65%, rgba(13,20,32,.9)); }
.contact-panel::after { content: "RB"; position: absolute; right: -1rem; bottom: -3rem; color: rgba(255,255,255,.035); font: 700 clamp(8rem, 24vw, 18rem)/1 "Octosquares", monospace; pointer-events: none; }
.contact-panel h2 { max-width: 800px; }
.contact-panel p { max-width: 650px; color: #c6d0db; }

.site-footer { padding: 2rem 0; border-top: 1px solid var(--line); color: var(--quiet); font-size: .8rem; }
.footer-row { display: flex; justify-content: space-between; gap: 1rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-links a:hover { color: var(--ink); }

/* Project listing */
.page-hero { padding: 94px 0 64px; }
.page-hero h1 { max-width: 950px; font-size: clamp(3rem, 7vw, 6.5rem); }
.page-hero p { max-width: 720px; color: #c3cedb; font-size: 1.2rem; }
.repo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.repo-card { min-height: 245px; display: flex; flex-direction: column; padding: 1.35rem; border: 1px solid var(--line); border-radius: 18px; background: rgba(13,20,32,.68); }
.repo-card[hidden] { display: none; }
.repo-card h3 { margin-top: .7rem; font-size: 1.18rem; overflow-wrap: anywhere; }
.repo-card p { flex: 1; color: var(--muted); font-size: .9rem; }
.repo-footer { display: flex; justify-content: space-between; gap: .75rem; color: var(--quiet); font-size: .75rem; }
.repo-footer span:first-child { color: var(--cyan); }

/* Project details */
.case-hero { padding: 90px 0 64px; }
.case-hero-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 3rem; align-items: center; }
.case-hero h1 { font-size: clamp(3rem, 6.5vw, 6rem); }
.case-summary { color: #c3cedb; font-size: 1.16rem; }
.case-media { overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: var(--panel); box-shadow: var(--shadow); }
.case-media img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.case-media.contain img { object-fit: contain; padding: 1.5rem; }
.case-facts { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 2.5rem; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.case-fact { padding: 1rem; border-right: 1px solid var(--line); }
.case-fact:last-child { border-right: 0; }
.case-fact span { display: block; color: var(--quiet); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.case-fact strong { display: block; margin-top: .3rem; font-size: .92rem; }
.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.content-card { padding: clamp(1.5rem, 3vw, 2.5rem); border: 1px solid var(--line); border-radius: var(--radius); background: rgba(13,20,32,.7); }
.content-card p, .content-card li { color: var(--muted); }
.clean-list { margin: 1rem 0 0; padding: 0; list-style: none; }
.clean-list li { position: relative; padding: .45rem 0 .45rem 1.35rem; }
.clean-list li::before { content: ""; position: absolute; left: 0; top: 1rem; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); }
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; }
.flow-step { position: relative; padding: 1.2rem; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.flow-step:not(:last-child)::after { content: "→"; position: absolute; right: -.65rem; top: 50%; z-index: 2; color: var(--cyan); transform: translateY(-50%); }
.flow-step span { display: block; margin-bottom: .45rem; color: var(--cyan); font: 700 .72rem/1 "Octosquares", monospace; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.gallery img, .gallery video { width: 100%; aspect-ratio: 16/10; object-fit: cover; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.resource-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.resource-card { padding: 1rem 1.15rem; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.02); }
.resource-card span { display: block; margin-bottom: .35rem; color: var(--cyan); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.resource-card:hover { border-color: rgba(78,228,255,.35); }
.catalog-group + .catalog-group { margin-top: 2rem; }
.catalog-group h3 { margin-bottom: .8rem; font-size: 1.15rem; }
.back-link { display: inline-flex; margin-bottom: 1.2rem; color: var(--muted); font-size: .9rem; }
.back-link:hover { color: var(--ink); }
.notice { padding: 1rem 1.2rem; border-left: 2px solid var(--violet); color: var(--muted); background: rgba(169,124,255,.05); font-size: .88rem; }

/* Homepage portfolio */
.portfolio-split {
  display: grid;
  grid-template-columns: minmax(230px, .64fr) minmax(0, 1.36fr);
  gap: clamp(2.5rem, 5vw, 5rem);
}

.portfolio-split > *,
.portfolio-group,
.portfolio-card,
.portfolio-card-body { min-width: 0; }

.sticky-title h2 { font-size: clamp(2rem, 3.6vw, 3.25rem); overflow-wrap: anywhere; }
.section-jumps { display: grid; gap: .45rem; margin-top: 1.5rem; }
.section-jumps a { width: fit-content; color: var(--muted); font-size: .9rem; }
.section-jumps a::before { content: "→ "; color: var(--cyan); }
.section-jumps a:hover { color: var(--ink); }
.portfolio-group { scroll-margin-top: 100px; }
.project-category-section { scroll-margin-top: 74px; }

.portfolio-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: stretch; }
.portfolio-card {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(17,27,42,.94), rgba(10,16,26,.94));
  transition: transform .25s ease, border-color .25s ease;
}
.portfolio-card:hover { transform: translateY(-4px); border-color: rgba(78,228,255,.35); }
.portfolio-media { display: block; height: clamp(145px, 14vw, 170px); overflow: hidden; background: #05080d; }
.portfolio-media img,
.portfolio-card > video,
.portfolio-card > img {
  width: 100%;
  height: clamp(145px, 14vw, 170px);
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}
.portfolio-media img { height: 100%; }
.portfolio-media img { transition: transform .45s ease; }
.portfolio-card:hover .portfolio-media img { transform: scale(1.025); }
.portfolio-media.contain img { object-fit: contain; padding: 1rem; }
.portfolio-card-body { flex: 1; display: flex; flex-direction: column; padding: 1rem; }
.portfolio-card-body h4 { margin: .4rem 0 .55rem; overflow-wrap: anywhere; font-size: 1.22rem; }
.portfolio-card-body p { flex: 1; margin-bottom: .7rem; color: var(--muted); font-size: .86rem; line-height: 1.48; }
.media-card .portfolio-card-body p { margin-bottom: 0; }
.subsection-heading { margin: 4rem 0 1.5rem; }
.compact-subheading h3 { max-width: 680px; margin-bottom: 0; font-size: clamp(1.5rem, 2.7vw, 2.15rem); }

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
}

.video-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(13,20,32,.76);
  transition: transform .2s ease, border-color .2s ease;
}

.video-card:hover { transform: translateY(-3px); border-color: rgba(78,228,255,.4); }
.video-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 1px solid var(--line); }
.video-card-copy { min-width: 0; flex: 1; padding: .9rem 1rem 1rem; }
.video-card-copy span { display: block; margin-bottom: .4rem; color: var(--cyan); font: 700 .66rem/1.3 "Octosquares", monospace; letter-spacing: .08em; text-transform: uppercase; }
.video-card-copy strong { display: block; overflow-wrap: anywhere; font-size: .9rem; line-height: 1.35; }

.hero-grid > *, .section-heading > *, .project-card, .project-body { min-width: 0; }

.identity-line strong, .project-body h3 { overflow-wrap: anywhere; }

.research-note {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: .82rem;
}
.research-note a { color: var(--cyan); font-weight: 700; }
.research-note a:hover { color: var(--ink); }

.github-section .repo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.github-section .repo-card { min-height: 255px; }
.repo-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.repo-actions a { padding: .45rem .7rem; border: 1px solid var(--line); border-radius: 9px; color: var(--cyan); font-size: .78rem; }
.repo-actions a:hover { border-color: var(--cyan); }

[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s ease; }
[data-reveal].is-visible { opacity: 1; transform: none; }

@media (max-width: 1050px) {
  .nav-toggle { display: grid; place-items: center; }
  .nav-links {
    position: absolute;
    top: 74px;
    left: 0;
    right: 0;
    display: none;
    align-items: stretch;
    padding: 1rem max(20px, calc((100vw - var(--max)) / 2)) 1.25rem;
    border-bottom: 1px solid var(--line);
    background: rgba(7,11,18,.98);
    max-height: calc(100dvh - 74px);
    overflow-y: auto;
  }
  .nav-links.is-open { display: grid; }
  .nav-links > a { padding: .7rem .4rem; }
  .nav-dropdown {
    grid-template-columns: minmax(0, 1fr) 46px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }
  .nav-dropdown::after { display: none; }
  .nav-section-link { padding: .85rem .4rem; }
  .nav-submenu-toggle { width: 46px; height: 46px; justify-self: end; border-radius: 12px; }
  .nav-submenu {
    position: static;
    grid-column: 1 / -1;
    width: 100%;
    display: none;
    margin: 0 0 .65rem;
    padding: .35rem;
    border-radius: 12px;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }
  .nav-dropdown:is(.is-pinned, .is-focused) .nav-submenu { display: grid; }
  .nav-submenu a { padding: .72rem; }
}

@media (max-width: 900px) {
  .hero-grid, .case-hero-grid, .split, .portfolio-split { grid-template-columns: 1fr; gap: 2.25rem; }
  .hero-identity { max-width: 520px; }
  .proof-grid { grid-template-columns: repeat(2, 1fr); }
  .project-card, .project-card.wide, .project-card.narrow { grid-column: span 6; }
  .achievement-grid, .repo-grid { grid-template-columns: repeat(2, 1fr); }
  .sticky-title { position: static; }
  .case-facts, .flow { grid-template-columns: repeat(2, 1fr); }
  .case-fact:nth-child(2) { border-right: 0; }
  .case-fact:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .flow-step:nth-child(2)::after { display: none; }
  .video-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 700px) {
  body { font-size: 16px; }
  .container, .nav-shell { width: min(calc(100% - 28px), var(--max)); }
  .section { padding: 68px 0; }
  .section.compact { padding: 48px 0; }
  .hero { padding: 48px 0 44px; }
  .hero h1 { font-size: clamp(2.35rem, 11vw, 3.4rem); }
  .case-hero { padding: 60px 0 48px; }
  .compact-heading { display: block; }
  .compact-heading .eyebrow { margin-bottom: .7rem; }
  .section-heading { display: block; }
  .section-heading h2 { margin-bottom: 1rem; }
  .project-card, .project-card.wide, .project-card.narrow { grid-column: 1 / -1; }
  .achievement-grid, .repo-grid, .content-grid, .gallery, .resource-grid, .publication-collections { grid-template-columns: 1fr; }
  .achievement-card { min-height: 0; }
  .proof-number { font-size: 2.4rem; }
  .case-facts, .flow { grid-template-columns: 1fr; }
  .case-fact { border-right: 0; border-bottom: 1px solid var(--line); }
  .case-fact:last-child { border-bottom: 0; }
  .flow-step::after { display: none; }
  .footer-row { display: grid; }
  .project-card, .project-card.wide, .project-card.narrow { min-height: 0; }
  .portfolio-card-grid { grid-template-columns: 1fr; }
  .portfolio-card { min-height: 0; }
  .github-section .repo-grid { grid-template-columns: 1fr; }
  .github-section .repo-card { min-height: 0; }
  .video-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(250px, 84vw);
    overflow-x: auto;
    padding: 0 0 .75rem;
    scroll-snap-type: x mandatory;
    overscroll-behavior-inline: contain;
    scrollbar-color: rgba(78,228,255,.45) transparent;
  }
  .video-card { scroll-snap-align: start; }
  .page-hero h1, .case-hero h1 { font-size: clamp(2.55rem, 12vw, 4rem); }
}

@media (max-width: 560px) {
  .proof-grid { grid-template-columns: 1fr; }
  .proof-item { min-height: 0; }
  .publication-overview { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 440px) {
  .brand { gap: .55rem; font-size: .92rem; white-space: nowrap; }
  .brand-mark { width: 32px; height: 32px; }
  .brand .gradient-text { display: none; }
  .hero-actions .button, .button-row .button { width: 100%; }
  .contact-panel { padding: 1.5rem; border-radius: 22px; }
  .identity-line { align-items: flex-start; }
  .video-grid { grid-template-columns: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
