@font-face {
  font-family: "Rethink Sans";
  src: url("../midia/fonts/rethink-sans-400.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Rethink Sans";
  src: url("../midia/fonts/rethink-sans-600.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Rethink Sans";
  src: url("../midia/fonts/rethink-sans-700.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --page: min(1180px, calc(100% - 48px));
  --bg: #070b16;
  --bg-soft: #0c1221;
  --surface: #11192b;
  --surface-strong: #172238;
  --ink: #f3f6fb;
  --muted: #9ba8bc;
  --line: #253149;
  --blue: #2f5ed0;
  --blue-light: #a9c0ff;
  --blue-soft: #172a5a;
  --success: #52d3a2;
  --header-bg: rgba(7, 11, 22, 0.92);
  --scroll-thumb: #35435c;
  --radius: 14px;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f6fb;
  --bg-soft: #e8edf6;
  --surface: #ffffff;
  --surface-strong: #e0e8f7;
  --ink: #111c35;
  --muted: #536179;
  --line: #ccd6e6;
  --blue: #275de7;
  --blue-light: #1947bd;
  --blue-soft: #dce7ff;
  --success: #147a57;
  --header-bg: rgba(243, 246, 251, 0.94);
  --scroll-thumb: #8b9ab1;
}

html:not([data-theme="light"]) { color-scheme: dark; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "Rethink Sans", sans-serif;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  transition: background-color 240ms ease, color 240ms ease;
}

::selection { background: var(--blue); color: #fff; }
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { border: 3px solid var(--bg); border-radius: 10px; background: var(--scroll-thumb); }

a { color: inherit; }
button, input { font: inherit; }
h1, h2, h3, p, blockquote { margin-top: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

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

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  border-bottom: 1px solid transparent;
  background: transparent;
  transition: border-color 180ms ease, background-color 180ms ease;
}
.site-header.is-scrolled,
.site-header.is-menu-open { border-color: var(--line); background: var(--header-bg); }
.site-nav {
  display: grid;
  width: var(--page);
  min-height: 76px;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  align-items: center;
  margin: 0 auto;
}
.brand {
  width: max-content;
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
}
.brand span { color: var(--blue-light); }
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a, .nav-studio {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  text-underline-offset: 0.35rem;
  transition: color 160ms ease;
}
.nav-links a:hover, .nav-studio:hover { color: var(--ink); }
.nav-studio-mobile { display: none !important; }
.nav-studio { justify-self: end; color: var(--blue-light); }
.nav-actions { display: flex; gap: 0.75rem; align-items: center; justify-self: end; }
.theme-toggle {
  display: grid;
  width: 44px;
  height: 44px;
  flex: none;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease;
}
.theme-toggle:hover { border-color: var(--blue); color: var(--blue-light); transform: translateY(-1px); }
.theme-icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-icon-moon { display: none; }
html[data-theme="light"] .theme-icon-sun { display: none; }
html[data-theme="light"] .theme-icon-moon { display: block; }
.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}
.menu-toggle span {
  position: absolute;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 180ms ease;
}
.menu-toggle span:first-child { transform: translateY(-3px); }
.menu-toggle span:last-child { transform: translateY(3px); }
.menu-toggle[aria-expanded="true"] span:first-child { transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { transform: rotate(-45deg); }

.hero {
  position: relative;
  display: grid;
  width: var(--page);
  min-height: 100svh;
  align-content: center;
  margin: 0 auto;
  padding: 4rem 0 5rem;
}
.hero-pointer-light {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: radial-gradient(circle 280px at var(--pointer-x, 50%) var(--pointer-y, 42%), rgba(90, 126, 255, 0.17), transparent 72%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}
html[data-theme="light"] .hero-pointer-light { background: radial-gradient(circle 280px at var(--pointer-x, 50%) var(--pointer-y, 42%), rgba(39, 93, 231, 0.1), transparent 72%); }
.hero.is-pointer-active .hero-pointer-light { opacity: 1; }
.hero-grid {
  display: grid;
  position: relative;
  z-index: 1;
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
  gap: clamp(3rem, 7vw, 7rem);
  align-items: center;
}
.hero h1 {
  max-width: 10ch;
  margin-bottom: 1.7rem;
  font-size: clamp(3.6rem, 7vw, 6rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.94;
}
.hero h1 em { color: var(--blue-light); font-style: normal; }
.hero-lead {
  max-width: 54ch;
  margin-bottom: 2.2rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
}
.hero-actions { display: flex; gap: 1.4rem; align-items: center; flex-wrap: wrap; }
.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}
.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--blue); color: #fff; }
.button-primary:hover { background: #244baa; }
.button-light { background: #fff; color: #11192b; }
.button-light:hover { background: #e9efff; }
.text-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 0.35rem;
}
.text-link:hover { color: var(--ink); text-decoration-color: var(--blue); }
.hero-network {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}
.hero-social {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}
.hero-social:hover { border-color: var(--blue-light); color: var(--blue-light); transform: translateY(-2px); }
.hero-social svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.hero-network-divider { width: 1px; height: 28px; margin: 0 0.35rem; background: var(--line); }
.hero-work-link {
  display: inline-flex;
  min-height: 44px;
  gap: 0.55rem;
  align-items: center;
  color: var(--blue-light);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}
.hero-work-link:hover { color: var(--ink); }

.terminal-stage { position: relative; perspective: 1100px; }
.terminal-back {
  position: absolute;
  inset: -18px 28px 18px -18px;
  border: 1px solid #283652;
  border-radius: var(--radius);
  background: #11192b;
  opacity: 0.46;
  transform: translate3d(18px, -4px, -50px) rotateX(3deg) rotateY(-4deg);
}
.terminal {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border: 1px solid #2a3752;
  border-radius: var(--radius);
  background: #0a101c;
  color: #f3f6fb;
  transform: perspective(1100px) rotateX(var(--terminal-x, 0deg)) rotateY(var(--terminal-y, 0deg));
  transform-style: preserve-3d;
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
}
.terminal-bar {
  display: grid;
  min-height: 48px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #29334a;
  background: #141c2a;
  color: #8491a7;
  font-family: var(--mono);
  font-size: 0.72rem;
}
.terminal-bar > span:last-child { justify-self: end; }
.terminal-dots { display: flex; gap: 6px; }
.terminal-dots i { width: 9px; height: 9px; border-radius: 50%; background: #ef6a67; }
.terminal-dots i:nth-child(2) { background: #e7b54b; }
.terminal-dots i:nth-child(3) { background: #52c878; }
.terminal-progress { height: 2px; overflow: hidden; background: #0a101c; opacity: 0; transition: opacity 140ms ease; }
.terminal-progress.is-active { opacity: 1; }
.terminal-progress i { display: block; width: 100%; height: 100%; background: #6f92ff; transform: scaleX(0); transform-origin: left; }
.terminal-content {
  min-height: 370px;
  padding: clamp(1.25rem, 3vw, 2rem);
  font-family: var(--mono);
  font-size: clamp(0.76rem, 1.15vw, 0.88rem);
  line-height: 1.75;
}
.terminal-code p { margin: 0; white-space: nowrap; animation: terminal-boot 440ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.terminal-code p:nth-child(2) { animation-delay: 60ms; }
.terminal-code p:nth-child(3) { animation-delay: 120ms; }
.terminal-code p:nth-child(4) { animation-delay: 180ms; }
.terminal-code p:nth-child(5) { animation-delay: 240ms; }
.terminal-code .indent { padding-left: 1.4rem; }
.code-key, .code-bool { color: #ff8c85; }
.code-prop { color: #8ecbff; }
.code-string { color: #b8d2ff; }
.terminal-output {
  min-height: 82px;
  max-height: 122px;
  margin-top: 1.25rem;
  padding-top: 1rem;
  overflow-y: auto;
  border-top: 1px solid #202b40;
  color: #c5d0e1;
}
.terminal-output p { margin-bottom: 0.35rem; }
.terminal-note { color: #8491a7; }
.terminal-form {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: center;
  margin-top: 0.6rem;
}
.terminal-prompt { color: var(--success); font-weight: 700; }
.terminal-form input {
  min-width: 0;
  padding: 0.65rem 0;
  border: 0;
  border-bottom: 1px solid #35425b;
  outline: 0;
  background: transparent;
  color: #fff;
  caret-color: var(--success);
  font-family: var(--mono);
}
.terminal-form input:focus { border-color: var(--blue-light); }
.terminal-form button {
  min-height: 38px;
  padding: 0.45rem 0.8rem;
  border: 1px solid #334360;
  border-radius: 8px;
  background: #172238;
  color: #f3f6fb;
  cursor: pointer;
}
.terminal-form button:hover { background: #21304c; }
.terminal-form button:disabled { cursor: wait; opacity: 0.6; }
.terminal-effect {
  position: absolute;
  inset: 48px 0 0;
  z-index: 4;
  overflow: hidden;
  background: rgba(4, 9, 16, 0.96);
}
.terminal-effect[hidden] { display: none; }
.matrix-column {
  position: absolute;
  top: 0;
  width: 1ch;
  white-space: pre;
  color: #58f09d;
  font: 700 0.72rem/1.1 var(--mono);
  text-align: center;
  transform: translateY(-66.666%);
  will-change: transform;
  animation: matrix-fall var(--matrix-speed, 2.4s) linear var(--matrix-delay, 0s) infinite;
}
.logo-effect { display: grid; place-items: center; }
.logo-effect img { width: min(42%, 160px); animation: logo-arrive 720ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.logo-effect::after { position: absolute; bottom: 18%; color: #a9c0ff; font: 600 0.78rem var(--mono); content: "gabriel.santana"; letter-spacing: 0.08em; }

@keyframes terminal-boot { from { opacity: 0; transform: translateY(7px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes matrix-fall { from { transform: translateY(-66.666%); } to { transform: translateY(-33.333%); } }
@keyframes logo-arrive { 0% { opacity: 0; transform: scale(0.6) rotate(-8deg); filter: blur(8px); } 70% { opacity: 1; transform: scale(1.04) rotate(1deg); filter: blur(0); } 100% { transform: scale(1) rotate(0); } }
.scroll-cue {
  position: absolute;
  bottom: 2rem;
  left: 0;
  display: flex;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
}
.hero > .scroll-cue { z-index: 1; }
.scroll-cue:hover { color: var(--ink); }

.reveal-item {
  opacity: 0;
  filter: blur(5px);
  translate: 0 22px;
  transition: opacity 620ms cubic-bezier(0.16, 1, 0.3, 1), filter 620ms cubic-bezier(0.16, 1, 0.3, 1), translate 620ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal-item.is-visible { opacity: 1; filter: none; translate: none; }

.section { width: var(--page); margin: 0 auto; padding: clamp(5rem, 9vw, 8rem) 0; }
.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 3rem;
  align-items: end;
  margin-bottom: 4rem;
}
.section-heading h2, .about h2, .studio-bridge h2, .contact h2 {
  margin-bottom: 0;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
}
.section-heading p, .compact-heading p, .about-intro > p, .contact-copy > p {
  max-width: 58ch;
  margin-bottom: 0;
  color: var(--muted);
}

.work-list { border-top: 1px solid var(--line); }
.work-item {
  display: grid;
  grid-template-columns: 0.7fr 1.7fr auto;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  min-height: 230px;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--line);
}
.work-meta { display: grid; gap: 0.4rem; align-self: start; color: var(--muted); font-size: 0.78rem; }
.work-meta span:first-child { color: var(--blue-light); font-weight: 700; }
.work-main h3 { margin-bottom: 0.8rem; font-size: clamp(2rem, 4vw, 3.6rem); letter-spacing: -0.04em; line-height: 1; }
.work-main p { max-width: 60ch; margin-bottom: 0; color: var(--muted); }
.work-item > a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 0.45rem;
  color: var(--blue-light);
  font-weight: 700;
  text-decoration: none;
}
.work-item > a:hover { color: var(--ink); }
.work-item-studio { background: var(--blue-soft); box-shadow: 50vw 0 0 var(--blue-soft), -50vw 0 0 var(--blue-soft); }

.about {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: clamp(3rem, 8vw, 8rem);
  align-items: end;
}
.about h2 { margin-bottom: 1.5rem; }
.about blockquote {
  margin: 0;
  padding-top: 2rem;
  border-top: 1px solid var(--blue);
}
.about blockquote p { margin-bottom: 0; color: var(--ink); font-size: clamp(1.25rem, 2.2vw, 1.65rem); line-height: 1.4; }

.compact-heading {
  display: flex;
  gap: 2rem;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 2.5rem;
}
.compact-heading h2 { margin-bottom: 0; font-size: clamp(2rem, 3.5vw, 3rem); letter-spacing: -0.035em; }
.capability-list { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.capability-list article { min-width: 0; padding: 2.5rem 2.5rem 0 0; }
.capability-list article + article { padding-left: 2.5rem; border-left: 1px solid var(--line); }
.capability-list h3 { margin-bottom: 1rem; font-size: 1.35rem; }
.capability-list p { min-height: 6em; color: var(--muted); }
.capability-list span { color: var(--blue-light); font-size: 0.78rem; }

.knowledge {
  position: relative;
  background: #080d18;
  box-shadow: 50vw 0 0 #080d18, -50vw 0 0 #080d18;
  color: #f3f6fb;
}
.knowledge-heading p { color: #aab7cc; }
.library-scene {
  position: relative;
  height: 650px;
  overflow: hidden;
  border: 1px solid #253149;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 18%, rgba(111, 146, 255, 0.12), transparent 36%),
    linear-gradient(180deg, #0d1525 0%, #0b1220 58%, #0a101c 100%);
  perspective: 1150px;
  perspective-origin: 50% 42%;
  isolation: isolate;
}
.library-scene::before {
  position: absolute;
  inset: auto 6% 0;
  z-index: -1;
  height: 34%;
  background: linear-gradient(180deg, rgba(37, 49, 73, 0), rgba(37, 49, 73, 0.34));
  content: "";
  transform: rotateX(68deg);
  transform-origin: bottom;
}
.library-scene::after {
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: inherit;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035), inset 0 -70px 90px rgba(2, 6, 13, 0.28);
  content: "";
  pointer-events: none;
}
.library-track {
  position: absolute;
  inset: 0;
  transform: rotateX(var(--hall-rotate-x, 0deg)) rotateY(var(--hall-rotate-y, 0deg));
  transform-style: preserve-3d;
  transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
}
.bookcase {
  position: absolute;
  bottom: 78px;
  display: grid;
  width: 30%;
  height: 475px;
  grid-template-rows: auto 1fr 1fr;
  gap: 0.75rem;
  padding: 1.35rem 1rem 1rem;
  border: 1px solid #2b3953;
  border-radius: var(--radius);
  background: #10182a;
  box-shadow: 0 28px 44px rgba(0, 0, 0, 0.24), inset 0 1px rgba(255, 255, 255, 0.025);
  transform-style: preserve-3d;
}
.bookcase h3 {
  min-height: 2.4rem;
  margin: 0;
  color: #bdcbf5;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.bookcase-left {
  left: 2.5%;
  transform: rotateY(19deg) translateZ(-36px);
  transform-origin: right center;
}
.bookcase-center {
  left: 50%;
  z-index: 2;
  width: 34%;
  transform: translateX(-50%) translateZ(72px);
  box-shadow: 0 32px 54px rgba(0, 0, 0, 0.32), inset 0 1px rgba(255, 255, 255, 0.035);
}
.bookcase-right {
  right: 2.5%;
  transform: rotateY(-19deg) translateZ(-36px);
  transform-origin: left center;
}
.shelf-row {
  position: relative;
  display: flex;
  min-width: 0;
  gap: 0.32rem;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0.4rem 0.75rem;
  border-bottom: 12px solid #2b3953;
  background: #0c1322;
  transform: translateZ(1px);
}
.shelf-row::after {
  position: absolute;
  right: -1px;
  bottom: -17px;
  left: -1px;
  height: 5px;
  background: #17233a;
  content: "";
  transform: skewX(-38deg);
  transform-origin: top;
}
.book,
.certificate-book {
  display: flex;
  width: 28px;
  height: 88px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 2px 2px 0 0;
}
.book {
  border-top: 1px solid #40506d;
  background: #202d45;
}
.book:nth-child(3n) { background: #172238; }
.book:nth-child(3n + 2) { background: #26344e; }
.book-short { height: 68px; }
.book-medium { height: 82px; }
.book-tall { height: 104px; }
.book-narrow { width: 18px; }
.book-lean-left { transform: rotate(-6deg); transform-origin: bottom right; }
.book-lean-right { transform: rotate(6deg); transform-origin: bottom left; }
.certificate-book {
  position: relative;
  width: 44px;
  height: 94px;
  overflow: hidden;
  border: 0;
  background: var(--book-color);
  box-shadow: inset -6px 0 rgba(5, 10, 19, 0.2);
  color: #07101e;
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transform: translateZ(3px);
  transition: filter 180ms ease, transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}
.certificate-book span {
  max-height: 82px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.certificate-book:hover,
.certificate-book:focus-visible {
  z-index: 5;
  filter: saturate(1.12) brightness(1.08);
  transform: translate3d(0, -11px, 32px) rotateY(-4deg);
}
.certificate-book:focus-visible { outline: 3px solid #f3f6fb; outline-offset: 3px; }
.certificate-book:active { transform: translate3d(0, -5px, 18px); }
.book-cyan { --book-color: #58c7ff; }
.book-coral { --book-color: #ff8c85; }
.book-green { --book-color: #63d7a5; }
.book-blue { --book-color: #6f92ff; }
.book-amber { --book-color: #e7b54b; }
.book-violet { --book-color: #ad8aff; }
.book-magenta { --book-color: #e779b5; }
.book-teal { --book-color: #45c8bd; }
.book-red { --book-color: #f07373; }
.library-caption {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  margin: 1.25rem 0 0;
  color: #aab7cc;
  font-size: 0.84rem;
}
.library-caption strong { color: #f3f6fb; }

.certificate-dialog {
  width: min(1120px, calc(100% - 32px));
  height: min(860px, calc(100svh - 32px));
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
}
.certificate-dialog[open] {
  display: flex;
  flex-direction: column;
  animation: certificate-dialog-in 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.certificate-dialog::backdrop { background: rgba(3, 7, 14, 0.78); }
.certificate-dialog-bar {
  display: flex;
  min-height: 76px;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem 0.85rem 1.25rem;
  border-bottom: 1px solid var(--line);
}
.certificate-dialog-bar h2 { margin: 0; font-size: 1.15rem; letter-spacing: -0.02em; }
.certificate-dialog-bar p { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.78rem; }
.certificate-dialog-close {
  display: grid;
  width: 44px;
  height: 44px;
  flex: none;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
  color: var(--ink);
  cursor: pointer;
}
.certificate-dialog-close:hover { border-color: var(--blue-light); color: var(--blue-light); }
.certificate-dialog-close svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.certificate-viewer { width: 100%; min-height: 0; flex: 1; border: 0; background: #2f3338; }
.certificate-dialog-actions {
  display: flex;
  min-height: 64px;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.25rem;
  border-top: 1px solid var(--line);
}
.certificate-dialog-actions p { margin: 0; color: var(--muted); font-size: 0.78rem; }
.certificate-dialog-actions a { color: var(--blue-light); font-size: 0.84rem; font-weight: 700; text-decoration: none; }
.certificate-dialog-actions a:hover { color: var(--ink); }
body.is-certificate-open { overflow: hidden; }

@keyframes certificate-dialog-in {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.timeline { background: var(--bg-soft); box-shadow: 50vw 0 0 var(--bg-soft), -50vw 0 0 var(--bg-soft); }
.proof-links { border-top: 1px solid var(--line); }
.proof-links a {
  display: grid;
  min-height: 104px;
  grid-template-columns: 1fr 1fr auto;
  gap: 2rem;
  align-items: center;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.proof-links a > span { color: var(--muted); font-size: 0.86rem; }
.proof-links strong { font-size: 1.15rem; }
.proof-links i { color: var(--blue-light); font-size: 1.2rem; font-style: normal; transition: transform 160ms ease; }
.proof-links a:hover i { transform: translate(3px, -3px); }

.studio-bridge {
  display: flex;
  width: var(--page);
  min-height: 390px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 3rem;
  margin: clamp(2rem, 5vw, 4rem) auto;
  padding: clamp(3rem, 7vw, 6rem);
  border-radius: var(--radius);
  background: var(--blue);
  color: #fff;
}
.studio-bridge > div { max-width: 720px; }
.studio-bridge h2 { margin-bottom: 1.25rem; }
.studio-bridge p { max-width: 55ch; margin-bottom: 0; color: #e6edff; font-size: 1.05rem; }

.contact {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(3rem, 8vw, 8rem);
  align-items: start;
}
.contact h2 { margin-bottom: 1.5rem; }
.contact-links { border-top: 1px solid var(--line); }
.contact-links a {
  display: grid;
  gap: 0.35rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.contact-links span { color: var(--muted); font-size: 0.8rem; }
.contact-links strong { overflow-wrap: anywhere; font-size: 1rem; }
.contact-links a:hover strong { color: var(--blue-light); }

.site-footer {
  display: flex;
  width: var(--page);
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin: 0 auto;
  padding: 3rem 0;
  border-top: 1px solid var(--line);
}
.site-footer p { margin: 0.6rem 0 0; color: var(--muted); font-size: 0.82rem; }
.footer-brand { font-size: 1rem; }

@media (max-width: 920px) {
  .site-nav { grid-template-columns: 1fr auto auto; gap: 0.75rem; }
  .nav-links {
    position: absolute;
    top: 76px;
    left: 0;
    display: grid;
    width: 100%;
    gap: 0;
    padding: 1rem max(24px, calc((100vw - min(1180px, 100% - 48px)) / 2)) 1.5rem;
    visibility: hidden;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
  }
  .nav-links.is-open { visibility: visible; opacity: 1; transform: translateY(0); }
  .nav-links a { padding: 0.9rem 0; }
  .nav-studio-mobile { display: inline-flex !important; color: var(--blue-light) !important; }
  .nav-studio { display: none; }
  .nav-actions { grid-column: 2; grid-row: 1; }
  .menu-toggle { grid-column: 3; grid-row: 1; }
  .menu-toggle { position: relative; display: grid; }
  .hero { min-height: auto; padding-top: 9rem; }
  .hero-grid { grid-template-columns: 1fr; }
  .terminal-stage { max-width: 700px; }
  .scroll-cue { display: none; }
  .work-item { grid-template-columns: 0.6fr 1.4fr; }
  .work-item > a { grid-column: 2; }
  .about, .contact { grid-template-columns: 1fr; }
  .library-scene {
    height: 535px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-padding-inline: 1rem;
    scroll-snap-type: x mandatory;
    scrollbar-color: #52617b #0b1220;
  }
  .library-track {
    position: relative;
    display: flex;
    width: max-content;
    height: 100%;
    gap: 1rem;
    align-items: center;
    padding: 1.5rem;
    transform: none !important;
  }
  .bookcase,
  .bookcase-center {
    position: relative;
    inset: auto;
    width: min(330px, calc(100vw - 64px));
    height: 440px;
    flex: 0 0 auto;
    scroll-snap-align: center;
    transform: none;
  }
}

@media (max-width: 700px) {
  :root { --page: min(100% - 32px, 1180px); }
  .hero { padding: 8rem 0 4rem; }
  .hero h1 { max-width: none; font-size: clamp(3rem, 14vw, 4.4rem); }
  .terminal-bar { grid-template-columns: 1fr auto; }
  .terminal-bar > span:last-child { display: none; }
  .terminal-content { min-height: 330px; padding: 1.1rem; overflow-x: auto; }
  .terminal-back { display: none; }
  .terminal-form { grid-template-columns: auto 1fr; }
  .terminal-form button { grid-column: 2; justify-self: start; }
  .section-heading { grid-template-columns: 1fr; gap: 1.5rem; margin-bottom: 2.5rem; }
  .work-item { grid-template-columns: 1fr; gap: 1.25rem; min-height: 0; padding: 2rem 0; }
  .work-item > a { grid-column: auto; }
  .work-main h3 { font-size: 2.35rem; }
  .compact-heading { align-items: flex-start; flex-direction: column; gap: 0.75rem; }
  .capability-list { grid-template-columns: 1fr; }
  .capability-list article { padding: 2rem 0; }
  .capability-list article + article { padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .capability-list p { min-height: 0; }
  .proof-links a { grid-template-columns: 1fr auto; gap: 0.35rem 1rem; padding: 1.25rem 0; }
  .proof-links a > span { grid-column: 1 / -1; }
  .library-caption { align-items: flex-start; flex-direction: column; }
  .certificate-dialog { width: calc(100% - 16px); height: calc(100svh - 16px); }
  .certificate-dialog-actions { align-items: flex-start; flex-direction: column; }
  .certificate-dialog-actions a { min-height: 44px; display: inline-flex; align-items: center; }
  .studio-bridge { min-height: 480px; align-items: flex-start; flex-direction: column; justify-content: flex-end; padding: 2rem; }
  .studio-bridge .button { width: 100%; }
  .site-footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 420px) {
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-actions .button { width: 100%; }
  .text-link { justify-content: center; }
  .hero-network-divider { display: none; }
  .hero-work-link { width: 100%; margin-top: 0.25rem; }
  .terminal-code { font-size: 0.69rem; }
  .site-nav { gap: 0.45rem; }
  .theme-toggle, .menu-toggle { width: 42px; height: 42px; }
}

@media (max-width: 360px) {
  .hero-grid, .hero-grid > * { min-width: 0; }
  .hero h1 { font-size: 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
  .terminal { transform: none !important; }
  .hero-pointer-light { display: none; }
  .reveal-item { opacity: 1; filter: none; translate: none; }
}

@media (hover: none), (pointer: coarse) {
  .terminal { transform: none !important; }
}
