/* =====================================================================
   Luis Fernando Varas — Portfolio
   Layout concept: centered, professional portfolio in a Spider-Man
   palette (red / royal blue / white / navy) with a light robotic
   accent: blueprint grid, corner brackets, a blueprint arm watermark,
   and purposeful motion. Short copy, high contrast, colour blocks.
   ===================================================================== */

:root {
  /* Color */
  --white: #ffffff;
  --paper: #eef2fc;
  --line: #c9d4f5;
  --ink: #080f3a;
  --ink-2: #2a3566;
  --muted: #5f6b99;
  --blue: #1d3fbf;
  --blue-bright: #3d6bff;
  --blue-light: #8fb0ff;
  --blue-deep: #10237a;
  --blue-soft: #dfe7ff;
  --red: #e3262e;
  --red-deep: #b3161d;
  --red-soft: #fde7e8;
  --on-dark: #eef2ff;
  --on-dark-muted: rgba(238, 242, 255, 0.7);
  --grid-dark: rgba(120, 160, 255, 0.16);
  --grid-white: rgba(255, 255, 255, 0.08);

  /* Type */
  --font-display: "Montserrat", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", Consolas, "Liberation Mono", monospace;

  /* Layout */
  --gutter: clamp(16px, 5vw, 80px);
  --max: 1320px;
  --nav-h: 76px;
  --ease: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --chamfer: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));

  color-scheme: light;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 8px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p, h1, h2, h3, dl, dd, dt { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
::selection { background: var(--red); color: var(--white); }

.mono { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; }
.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); position: relative; z-index: 1; }

/* ---------- Shared decorations ---------- */
.sec-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(to right, var(--grid-white) 1px, transparent 1px), linear-gradient(to bottom, var(--grid-white) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
}
.glow { position: absolute; width: 55vmax; height: 55vmax; border-radius: 50%; filter: blur(70px); opacity: 0.6; pointer-events: none; will-change: transform; animation: float 16s ease-in-out infinite alternate; }
.glow-hero { background: radial-gradient(circle, rgba(61, 107, 255, 0.6), transparent 60%); top: -25%; right: -15%; }
.glow-a { background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent 60%); bottom: -30%; left: -15%; animation-duration: 20s; }
.glow-b { background: radial-gradient(circle, rgba(29, 63, 191, 0.7), transparent 60%); left: -15%; bottom: -35%; }
.glow-c { background: radial-gradient(circle, rgba(227, 38, 46, 0.4), transparent 60%); right: -15%; top: -30%; animation-duration: 18s; }
@keyframes float { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(-8%, 10%, 0) scale(1.15); } }

/* HUD corner brackets */
.spec, .card, .award, .edu-main, .skill-group, .tile, .job { position: relative; }
.spec::before, .spec::after, .card::before, .card::after, .award::before, .award::after,
.edu-main::before, .edu-main::after, .skill-group::before, .skill-group::after,
.tile::before, .tile::after, .job::before, .job::after {
  content: ""; position: absolute; width: 14px; height: 14px;
  border-style: solid; border-color: var(--blue);
  pointer-events: none; transition: border-color 0.4s; z-index: 2;
}
.spec::before, .card::before, .award::before, .edu-main::before, .skill-group::before, .tile::before, .job::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.spec::after, .card::after, .award::after, .edu-main::after, .skill-group::after, .tile::after, .job::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

/* ---------- Buttons ---------- */
.btn {
  --btn-border: var(--ink);
  --btn-bg: transparent;
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  padding: 1rem 1.9rem;
  font-family: var(--font-display); font-weight: 700; font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--btn-border);
  clip-path: var(--chamfer);
  transition: transform 0.4s var(--ease-out), color 0.3s;
}
.btn::before { content: ""; position: absolute; inset: 1.5px; z-index: -1; background: var(--btn-bg); clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 11px, 100% 100%, 11px 100%, 0 calc(100% - 11px)); transition: background-color 0.3s; }
.btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.35) 50%, transparent 65%); transform: translateX(-110%); transition: transform 0.7s var(--ease); pointer-events: none; }
.btn:hover { transform: translateY(-2px); }
.btn:hover::after { transform: translateX(110%); }
.btn-red { --btn-border: var(--red); --btn-bg: var(--red); color: var(--white); }
.btn-red:hover { --btn-border: var(--red-deep); --btn-bg: var(--red-deep); }
.btn-ghost { --btn-border: var(--white); --btn-bg: var(--ink); color: var(--white); }
.btn-ghost:hover { --btn-bg: var(--white); color: var(--ink); }
.btn-sm { padding: 0.65rem 1.15rem; font-size: 0.7rem; }
.btn-lg { padding: 1.2rem 2.5rem; font-size: 0.92rem; }

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--ink);
  background-image: linear-gradient(to right, var(--grid-dark) 1px, transparent 1px), linear-gradient(to bottom, var(--grid-dark) 1px, transparent 1px);
  background-size: 56px 56px;
  color: var(--on-dark);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--gutter);
  transform: translateY(0);
  transition: transform 0.9s var(--ease);
}
.loader.done { transform: translateY(-100%); }
.loader-inner { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 1rem; }
.loader-mark { font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1; letter-spacing: -0.02em; }
.loader-count { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.1rem, 3vw, 1.8rem); font-variant-numeric: tabular-nums; color: var(--red); }
.loader-bar { height: 2px; background: rgba(143, 176, 255, 0.2); overflow: hidden; }
.loader-bar span { display: block; height: 100%; width: 0; background: var(--red); transition: width 0.15s linear; }
html.no-js .loader { display: none; }

/* ---------- Cursor ---------- */
.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  html.js .cursor { display: block; position: fixed; top: 0; left: 0; z-index: 999; pointer-events: none; }
  .cursor-dot, .cursor-ring { position: absolute; top: 0; left: 0; transform: translate(-50%, -50%); }
  .cursor-dot { width: 6px; height: 6px; background: var(--red); border-radius: 50%; }
  .cursor-ring { width: 34px; height: 34px; border: 1.5px solid var(--red); border-radius: 50%; opacity: 0.75; transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out), opacity 0.3s, background-color 0.3s, border-radius 0.3s; }
  .cursor-ring::before, .cursor-ring::after { content: ""; position: absolute; background: var(--red); left: 50%; top: 50%; }
  .cursor-ring::before { width: 1px; height: 8px; transform: translate(-50%, -50%) translateY(-17px); }
  .cursor-ring::after { width: 8px; height: 1px; transform: translate(-50%, -50%) translateX(17px); }
  .cursor.is-hover .cursor-ring { width: 60px; height: 60px; opacity: 0.5; border-radius: 6px; background: rgba(227, 38, 46, 0.08); }
  .cursor.is-hover .cursor-ring::before, .cursor.is-hover .cursor-ring::after { opacity: 0; }
  .cursor.is-down .cursor-ring { width: 22px; height: 22px; }
  .cursor.is-hidden { opacity: 0; }
  body.has-cursor, body.has-cursor a, body.has-cursor button { cursor: none; }
}

/* ---------- Scroll progress ---------- */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; background: var(--red); transform-origin: 0 50%; transform: scaleX(0); z-index: 950; }

/* ---------- Nav ---------- */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 900; height: var(--nav-h); display: flex; align-items: center; color: var(--on-dark); border-bottom: 1px solid transparent; transition: background-color 0.4s, border-color 0.4s, transform 0.5s var(--ease); }
.nav.is-scrolled { background: rgba(8, 15, 58, 0.9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom-color: rgba(120, 160, 255, 0.22); }
.nav.is-hidden { transform: translateY(-100%); }
.nav-inner { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 2rem; min-width: 0; }
.brand { display: inline-flex; align-items: center; gap: 0.75rem; }
.brand-mark { display: inline-grid; place-items: center; width: 38px; height: 38px; background: var(--red); color: var(--white); font-family: var(--font-display); font-weight: 800; font-size: 0.9rem; clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px)); }
.brand-text { font-family: var(--font-display); font-weight: 600; font-size: 0.86rem; letter-spacing: 0.04em; }
.brand-text strong { font-weight: 800; }
.nav-links { display: flex; gap: 1.6rem; }
.nav-links a { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; position: relative; padding-block: 0.3rem; color: var(--on-dark-muted); transition: color 0.3s; }
.nav-links a:hover, .nav-links a.is-active { color: var(--on-dark); }
.nav-links a::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1.5px; background: var(--red); transform: scaleX(0); transform-origin: 100% 50%; transition: transform 0.4s var(--ease); }
.nav-links a:hover::after, .nav-links a.is-active::after { transform: scaleX(1); transform-origin: 0 50%; }
.nav-actions { display: flex; align-items: center; gap: 1rem; flex: none; }
.lang { display: inline-flex; align-items: center; gap: 0.35rem; font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.08em; }
.lang-btn { padding: 0.3rem 0.2rem; color: var(--on-dark-muted); border-bottom: 1.5px solid transparent; transition: color 0.3s, border-color 0.3s; }
.lang-btn[aria-pressed="true"] { color: var(--on-dark); border-bottom-color: var(--red); }
.lang-sep { color: rgba(238, 242, 255, 0.3); }
.burger { display: none; width: 44px; height: 44px; position: relative; }
.burger span { position: absolute; left: 10px; right: 10px; height: 2px; background: var(--on-dark); transition: transform 0.4s var(--ease), top 0.4s var(--ease); }
.burger span:first-child { top: 17px; }
.burger span:last-child { top: 25px; }
.burger.is-open span:first-child { top: 21px; transform: rotate(45deg); }
.burger.is-open span:last-child { top: 21px; transform: rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 890;
  background: var(--blue);
  background-image: linear-gradient(to right, var(--grid-white) 1px, transparent 1px), linear-gradient(to bottom, var(--grid-white) 1px, transparent 1px);
  background-size: 56px 56px;
  color: var(--white);
  display: flex; flex-direction: column; justify-content: space-between; align-items: center; text-align: center;
  padding: calc(var(--nav-h) + 1rem) var(--gutter) var(--gutter);
  transform: translateY(-100%);
  transition: transform 0.7s var(--ease);
}
.mobile-menu.is-open { transform: translateY(0); }
.mobile-menu nav { display: flex; flex-direction: column; gap: 0.3rem; }
.mobile-menu nav a { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.7rem, 7vw, 2.6rem); line-height: 1.2; text-transform: uppercase; letter-spacing: -0.01em; opacity: 0; transform: translateY(20px); transition: opacity 0.5s, transform 0.6s var(--ease-out); }
.mobile-menu.is-open nav a { opacity: 1; transform: none; }
.mobile-menu.is-open nav a:nth-child(1) { transition-delay: 0.25s; }
.mobile-menu.is-open nav a:nth-child(2) { transition-delay: 0.30s; }
.mobile-menu.is-open nav a:nth-child(3) { transition-delay: 0.35s; }
.mobile-menu.is-open nav a:nth-child(4) { transition-delay: 0.40s; }
.mobile-menu.is-open nav a:nth-child(5) { transition-delay: 0.45s; }
.mobile-menu.is-open nav a:nth-child(6) { transition-delay: 0.50s; }
.mobile-menu.is-open nav a:nth-child(7) { transition-delay: 0.55s; }
.mobile-menu-foot { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; opacity: 0.85; }
body.menu-open { overflow: hidden; }

/* ---------- Hero (centered) ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  padding-top: calc(var(--nav-h) + 3rem);
  padding-bottom: 5rem;
  display: flex; flex-direction: column; justify-content: center;
  overflow: hidden;
  color: var(--on-dark);
  text-align: center;
  background: var(--blue-deep);
  background-image: radial-gradient(ellipse 70% 65% at 50% 30%, #1e3fb8 0%, var(--blue-deep) 50%, var(--ink) 100%);
}
.hero-grid {
  position: absolute; inset: -56px 0 0 -56px;
  background-image: linear-gradient(to right, var(--grid-dark) 1px, transparent 1px), linear-gradient(to bottom, var(--grid-dark) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 45%, #000 25%, transparent 100%);
  mask-image: radial-gradient(ellipse 70% 70% at 50% 45%, #000 25%, transparent 100%);
  pointer-events: none;
  animation: gridDrift 10s linear infinite;
}
@keyframes gridDrift { to { transform: translate(56px, 56px); } }
.hero-scan { position: absolute; left: 0; right: 0; top: -160px; height: 160px; background: linear-gradient(to bottom, transparent, rgba(143, 176, 255, 0.14) 50%, transparent); pointer-events: none; animation: scan 7s linear infinite; }
@keyframes scan { to { transform: translateY(calc(100vh + 320px)); } }
.hero::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 4px); pointer-events: none; z-index: 2; mix-blend-mode: overlay; }
.hero-inner { display: flex; flex-direction: column; align-items: center; gap: 2.2rem; }
.hero-inner > * { min-width: 0; }
.hero-top, .hero-name, .hero-bottom { position: relative; z-index: 1; }
.hero-top { display: flex; flex-direction: column; align-items: center; gap: 0.9rem; }
.status {
  display: inline-flex; align-items: center; gap: 0.7rem; width: fit-content;
  padding: 0.45rem 1rem 0.45rem 0.8rem;
  border: 1px solid rgba(143, 176, 255, 0.35);
  background: rgba(8, 15, 58, 0.5);
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(227, 38, 46, 0.6); } 70% { box-shadow: 0 0 0 10px rgba(227, 38, 46, 0); } 100% { box-shadow: 0 0 0 0 rgba(227, 38, 46, 0); } }
.eyebrow { color: var(--blue-light); }

.hero-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 8.5vw, 8rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--white);
  text-shadow: 0 0 30px rgba(61, 107, 255, 0.25);
}
.hero-name .accent { color: var(--red); text-shadow: 0 0 30px rgba(227, 38, 46, 0.25); }
.line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.line > span { display: block; }
html.js .line > span { transform: translateY(115%); transition: transform 1.1s var(--ease); transition-delay: calc(0.12s * var(--i, 0)); }
html.js body.is-loaded .line > span { transform: none; }

.hero-bottom { display: flex; flex-direction: column; align-items: center; gap: 2.2rem; width: 100%; }
.hero-copy { display: flex; flex-direction: column; align-items: center; gap: 1.6rem; max-width: 38rem; }
.hero-tagline { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.2rem, 2.1vw, 1.65rem); line-height: 1.35; color: var(--on-dark); text-wrap: balance; }
.hero-ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.9rem; }

html.js .hero-copy, html.js .spec, html.js .hero-top, html.js .arm { opacity: 0; transform: translateY(18px); transition: opacity 0.9s ease, transform 1s var(--ease-out); }
html.js body.is-loaded .hero-top { opacity: 1; transform: none; transition-delay: 0.05s; }
html.js body.is-loaded .hero-copy { opacity: 1; transform: none; transition-delay: 0.45s; }
html.js body.is-loaded .spec { opacity: 1; transform: none; transition-delay: 0.6s; }
html.js body.is-loaded .arm { opacity: 0.32; transition-delay: 0.3s; }

/* Profile panel */
.spec { width: 100%; max-width: 38rem; border: 1px solid rgba(143, 176, 255, 0.4); background: rgba(8, 15, 58, 0.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); text-align: left; }
.spec::before, .spec::after { border-color: var(--red); }
.spec-title { padding: 0.7rem 1.2rem; background: var(--blue); color: var(--white); text-align: center; }
.spec-list { padding: 0.4rem 1.2rem; }
.spec-list > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px dashed rgba(143, 176, 255, 0.25); }
.spec-list > div:last-child { border-bottom: 0; }
.spec-list dt { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue-light); }
.spec-list dd { font-weight: 600; font-size: 0.95rem; text-align: right; color: var(--white); }

/* The arm drawing — centered blueprint watermark */
.arm { position: absolute; left: 50%; top: 50%; width: clamp(320px, 52vw, 780px); color: var(--blue-light); pointer-events: none; z-index: 0; --py: 0px; }
html.js .arm { transform: translate(-50%, calc(-50% + 24px)); }
html.js body.is-loaded .arm { transform: translate(-50%, calc(-50% + var(--py))); }
html.no-js .arm { opacity: 0.32; transform: translate(-50%, -50%); }
.arm-reach { fill: none; stroke: currentColor; stroke-width: 1; stroke-dasharray: 4 6; opacity: 0; transition: opacity 1.2s ease 1.6s; }
body.is-loaded .arm-reach { opacity: 0.7; }
.arm-ground { stroke: currentColor; stroke-width: 1.5; }
.arm-base { fill: var(--ink); stroke: currentColor; stroke-width: 1.5; }
.arm-link { stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.arm-joint { fill: var(--ink); stroke: currentColor; stroke-width: 2; }
.arm-ee { fill: var(--red); stroke: none; }
.arm-ee-line { stroke: var(--red); stroke-width: 2; stroke-linecap: round; }
.arm-label { font-family: var(--font-mono); font-size: 10px; fill: currentColor; letter-spacing: 0.08em; }
.arm-label-strong { fill: var(--white); }
.arm-l1 { transform-origin: 230px 290px; animation: swing1 7s ease-in-out infinite alternate; }
.arm-l2 { transform-origin: 230px 150px; animation: swing2 5s ease-in-out infinite alternate; }
@keyframes swing1 { from { transform: rotate(-28deg); } to { transform: rotate(22deg); } }
@keyframes swing2 { from { transform: rotate(-40deg); } to { transform: rotate(35deg); } }
html.js .arm .draw:not(.arm-reach) { stroke-dasharray: 1400; stroke-dashoffset: 1400; transition: stroke-dashoffset 2.2s ease 0.5s; }
html.js body.is-loaded .arm .draw:not(.arm-reach) { stroke-dashoffset: 0; }

.scroll-hint { position: absolute; left: 50%; transform: translateX(-50%); bottom: 1.6rem; display: inline-flex; align-items: center; gap: 0.8rem; color: var(--blue-light); z-index: 3; }
.scroll-line { width: 48px; height: 1px; background: rgba(143, 176, 255, 0.5); position: relative; overflow: hidden; }
.scroll-line::after { content: ""; position: absolute; inset: 0; background: var(--red); transform: translateX(-100%); animation: scrollline 2.2s var(--ease) infinite; }
@keyframes scrollline { 0% { transform: translateX(-100%); } 60% { transform: translateX(100%); } 100% { transform: translateX(100%); } }

/* ---------- Marquee ---------- */
.marquee { background: var(--red); color: var(--white); overflow: hidden; padding-block: 0.95rem; border-block: 1px solid var(--red-deep); }
.marquee-track { display: flex; width: max-content; animation: marquee 36s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group { display: inline-flex; align-items: center; gap: 2.2rem; padding-right: 2.2rem; white-space: nowrap; }
.marquee-group span { font-family: var(--font-display); font-weight: 700; font-size: clamp(0.85rem, 1.2vw, 1rem); letter-spacing: 0.12em; text-transform: uppercase; }
.marquee-group i { width: 7px; height: 7px; background: var(--white); transform: rotate(45deg); flex: none; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections (centered) ---------- */
.section { position: relative; padding-block: clamp(5rem, 9vw, 8rem); overflow: hidden; text-align: center; }
.section-alt { background: var(--paper); border-block: 1px solid var(--line); }
.section-blue { background: var(--blue); background-image: radial-gradient(ellipse 60% 60% at 90% 10%, rgba(61, 107, 255, 0.55) 0%, transparent 70%); color: var(--white); }
.section-red { background: var(--red); background-image: radial-gradient(ellipse 60% 60% at 10% 90%, rgba(255, 255, 255, 0.14) 0%, transparent 70%); color: var(--white); }
.section-dark { background: var(--ink); color: var(--on-dark); }
.section-head { display: flex; flex-direction: column; align-items: center; gap: 1.1rem; margin: 0 auto clamp(2.5rem, 5vw, 4.5rem); max-width: 50rem; }
.label { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--blue); width: fit-content; }
.label::before { content: "["; color: var(--red); }
.label::after { content: "]"; color: var(--red); }
.section-blue .label, .section-red .label { color: rgba(255, 255, 255, 0.85); }
.section-blue .label::before, .section-blue .label::after { color: var(--red); }
.section-red .label::before, .section-red .label::after { color: var(--ink); }
.section-dark .label { color: var(--blue-light); }
.section-title { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.8rem, 3.6vw, 3rem); line-height: 1.08; letter-spacing: -0.025em; text-transform: uppercase; }

/* Reveal on scroll (+ variants) */
html.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s ease, transform 0.9s var(--ease-out); }
html.js .reveal[data-reveal="left"] { transform: translateY(28px); }
html.js .reveal[data-reveal="scale"] { transform: scale(0.94) translateY(16px); }
html.js .reveal.in { opacity: 1; transform: none; }
html.js .section-head .section-title { clip-path: inset(0 50% 0 50%); transition: clip-path 1s var(--ease) 0.15s; }
html.js .section-head.in .section-title { clip-path: inset(0 0 0 0); }
html.js .section-head .label { opacity: 0; transform: translateY(-10px); transition: opacity 0.6s, transform 0.7s var(--ease-out); }
html.js .section-head.in .label { opacity: 1; transform: none; }

/* SVG line drawing on reveal */
html.js .card-art .draw { stroke-dasharray: 600; stroke-dashoffset: 600; transition: stroke-dashoffset 1.8s ease 0.3s; }
html.js .card-art .dash.draw { stroke-dasharray: 3 4; stroke-dashoffset: 0; opacity: 0; transition: opacity 0.8s ease 1.4s; }
html.js .reveal.in .card-art .draw { stroke-dashoffset: 0; }
html.js .reveal.in .card-art .dash.draw { opacity: 0.75; }

/* ---------- About ---------- */
.about-grid { display: flex; flex-direction: column; align-items: center; gap: clamp(2.5rem, 5vw, 4rem); }
.about-copy { display: flex; flex-direction: column; align-items: center; gap: 1.3rem; max-width: 46rem; }
.lead { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.15rem, 1.8vw, 1.5rem); line-height: 1.45; color: var(--ink); }
.about-meta { color: var(--blue); }
.goal { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; padding: 1.2rem 1.6rem; border-top: 3px solid var(--red); background: var(--blue-soft); max-width: 40rem; }
.goal-k { color: var(--red-deep); }
.goal-v { font-weight: 600; font-size: 1.1rem; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; width: 100%; }
.tile { padding: 1.8rem 1.6rem; color: var(--white); display: flex; flex-direction: column; align-items: center; gap: 0.4rem; transition: transform 0.5s var(--ease-out), box-shadow 0.5s; }
.tile::before, .tile::after { border-color: rgba(255, 255, 255, 0.85); }
.tile:hover { transform: translateY(-8px); box-shadow: 0 8px 0 var(--red); }
.tile-blue { background: var(--blue); }
.tile-red { background: var(--red); }
.tile-red:hover { box-shadow: 0 8px 0 var(--blue); }
.tile-navy { background: var(--ink); }
.tile-title { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.15rem, 1.7vw, 1.4rem); line-height: 1.15; letter-spacing: -0.01em; text-transform: uppercase; }
.tile-desc { opacity: 0.9; font-size: 1rem; max-width: 26ch; }

/* ---------- Experience (royal blue) ---------- */
.timeline { position: relative; display: flex; flex-direction: column; gap: 1.25rem; max-width: 58rem; margin-inline: auto; text-align: left; }
.job { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 2rem; padding: 2rem 2.2rem; background: var(--white); color: var(--ink); border: 1px solid rgba(255, 255, 255, 0.5); transition: transform 0.5s var(--ease-out), box-shadow 0.5s; }
.job:hover { transform: translateY(-4px); box-shadow: 0 24px 50px -24px rgba(8, 15, 58, 0.7); }
.job::before { border-color: var(--red); }
.job-meta { display: flex; flex-direction: column; gap: 0.4rem; color: var(--muted); }
.job-date { color: var(--blue); }
.job-body { display: flex; flex-direction: column; gap: 0.9rem; }
.job-company { font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; letter-spacing: 0.02em; text-transform: uppercase; display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; }
.job-type { color: var(--blue); font-weight: 400; text-transform: none; letter-spacing: 0.06em; }
.job-role { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.25rem, 2.1vw, 1.7rem); line-height: 1.15; letter-spacing: -0.015em; }
.job-list { display: flex; flex-direction: column; gap: 0.5rem; color: var(--ink-2); font-size: 1.02rem; }
.job-list li { position: relative; padding-left: 1.3rem; }
.job-list li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 10px; height: 2px; background: var(--red); }

.tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.tags span { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; padding: 0.3rem 0.65rem; border: 1px solid var(--line); border-radius: 2px; color: var(--blue); background: var(--white); transition: border-color 0.4s, color 0.4s, background-color 0.4s; }

/* ---------- Education ---------- */
.edu-grid { display: flex; flex-direction: column; align-items: center; gap: 2.5rem; max-width: 54rem; margin-inline: auto; }
.edu-main { display: flex; flex-direction: column; align-items: center; gap: 0.8rem; padding: 2.2rem 2rem; width: 100%; background: var(--ink); color: var(--on-dark); border: 1px solid var(--blue); box-shadow: 10px 10px 0 var(--red); }
.edu-main::before, .edu-main::after { border-color: var(--blue-light); }
.edu-date { color: var(--red); }
.edu-school { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.4rem, 2.4vw, 2rem); line-height: 1.1; letter-spacing: -0.02em; text-transform: uppercase; }
.edu-degree { font-weight: 600; color: var(--blue-light); }
.edu-desc { color: var(--on-dark-muted); max-width: 44rem; }
.edu-loc { color: var(--blue-light); margin-top: 0.4rem; }
.certs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; width: 100%; }
.cert { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35rem; padding: 1.4rem 1.2rem; border: 1px solid var(--line); background: var(--white); transition: transform 0.4s var(--ease-out), border-color 0.4s, box-shadow 0.4s; }
.cert:hover { transform: translateY(-4px); border-color: var(--blue); box-shadow: 0 16px 40px -24px rgba(29, 63, 191, 0.6); }
.cert > div:first-child { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; min-width: 0; }
.cert-org { color: var(--blue); }
.cert-title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; line-height: 1.3; }
.cert-right { display: flex; align-items: center; gap: 0.9rem; }
.cert-date { color: var(--muted); }
.cert-link { color: var(--red); }
.cert-link:hover { text-decoration: underline; }
.certs .cert:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* ---------- Projects ---------- */
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; perspective: 1200px; }
.card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.9rem; padding: 2rem 1.8rem; min-height: 22rem; background: var(--white); border: 1px solid var(--line); transform-style: preserve-3d; transition: background-color 0.5s var(--ease), color 0.5s var(--ease), border-color 0.5s, transform 0.6s var(--ease-out), box-shadow 0.5s; }
.card.is-tilting { transition: background-color 0.5s var(--ease), color 0.5s var(--ease), border-color 0.5s, transform 0.12s ease, box-shadow 0.5s; }
.card:hover { background: var(--blue); color: var(--white); border-color: var(--blue); box-shadow: 0 24px 60px -24px rgba(29, 63, 191, 0.7); }
.card:hover::before, .card:hover::after { border-color: var(--red); }
.card-wide { grid-column: 1 / -1; min-height: 0; }
.card-featured { background: var(--ink); color: var(--white); border-color: var(--ink); }
.card-featured::before, .card-featured::after { border-color: var(--blue-light); }
.card-wide-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 2rem; align-items: center; width: 100%; }
.card-wide-grid > div { display: flex; flex-direction: column; align-items: center; gap: 0.9rem; }
.card-head { display: flex; justify-content: center; align-items: center; gap: 1rem; width: 100%; position: relative; }
.card-sub { color: var(--blue); transition: color 0.5s; }
.card-featured .card-sub, .card:hover .card-sub { color: var(--blue-light); }
.card-arrow { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); font-size: 1rem; transition: background-color 0.4s, border-color 0.4s, transform 0.5s var(--ease-out); }
.card-featured .card-arrow { border-color: rgba(255, 255, 255, 0.3); }
.card:hover .card-arrow { background: var(--red); border-color: var(--red); color: var(--white); transform: translateY(-50%) rotate(45deg); }
.card-impact { display: inline-block; padding: 0.32rem 0.7rem; background: var(--red); color: var(--white); font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px)); }
.card-title { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.25rem, 2vw, 1.65rem); line-height: 1.15; letter-spacing: -0.02em; text-transform: uppercase; max-width: 24ch; }
.card-wide .card-title { font-size: clamp(1.4rem, 2.3vw, 1.9rem); }
.card-desc { color: var(--ink-2); max-width: 42ch; font-size: 1.02rem; transition: color 0.5s; }
.card-featured .card-desc, .card:hover .card-desc { color: rgba(255, 255, 255, 0.84); }
.tags { justify-content: center; }
.timeline .tags { justify-content: flex-start; }
.card-featured .tags span, .card:hover .tags span { border-color: rgba(255, 255, 255, 0.35); background: transparent; color: var(--white); }
.card-link { color: var(--red); }
.card-link:hover { text-decoration: underline; }
.card:hover .card-link { color: #ffb3b6; }
.card-art { width: clamp(140px, 44%, 200px); margin-top: auto; color: var(--blue); fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: color 0.5s, transform 0.7s var(--ease-out); }
.card-featured .card-art, .card:hover .card-art { color: var(--blue-light); }
.card:hover .card-art { transform: translateY(-4px) scale(1.04); }
.card-art-lg { width: 100%; max-width: 400px; margin-top: 0; }
.card-art .fill { fill: var(--white); transition: fill 0.5s; }
.card-featured .card-art .fill { fill: var(--ink); }
.card:hover .card-art .fill { fill: var(--blue); }
.card-art .red { fill: var(--red); stroke: none; }
.card-art .red-stroke { stroke: var(--red); }
.card-art .dash { stroke-dasharray: 3 4; opacity: 0.75; }
.card-art .art-label { font-family: var(--font-mono); font-size: 9px; fill: currentColor; stroke: none; letter-spacing: 0.1em; }

/* ---------- Awards (navy) ---------- */
.awards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-bottom: 3rem; }
.award { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 2.2rem 2rem; border: 1px solid rgba(143, 176, 255, 0.3); background: rgba(29, 63, 191, 0.18); transition: background-color 0.4s, transform 0.5s var(--ease-out); }
.award:hover { background: rgba(29, 63, 191, 0.32); transform: translateY(-4px); }
.award::before, .award::after { border-color: var(--blue-light); }
.award-org { color: var(--blue-light); }
.award-big { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.1rem, 4.2vw, 3.4rem); line-height: 1.05; letter-spacing: -0.02em; color: var(--red); margin-top: 0.3rem; }
.award-sub { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; }
.award-detail { color: var(--on-dark-muted); }
.award-link { color: var(--white); margin-top: 0.8rem; border-bottom: 1px solid var(--red); padding-bottom: 0.2rem; }
.award-link:hover { color: var(--blue-light); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid rgba(143, 176, 255, 0.3); }
.stats > div { padding: 1.8rem 1rem; border-right: 1px solid rgba(143, 176, 255, 0.18); display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.stats > div:last-child { border-right: 0; }
.stat-n { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.7rem, 2.8vw, 2.5rem); line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat-n .sup { color: var(--red); font-size: 0.6em; }
.stat-k { color: var(--on-dark-muted); }

/* ---------- Skills (red) ---------- */
.skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.skill-group { display: flex; flex-direction: column; align-items: center; gap: 1.1rem; padding: 1.8rem; border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: background-color 0.4s; }
.skill-group:hover { background: rgba(255, 255, 255, 0.16); }
.skill-group::before, .skill-group::after { border-color: var(--white); }
.skill-group h3 { color: var(--white); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.chips span { padding: 0.45rem 0.85rem; border: 1px solid transparent; border-radius: 2px; background: var(--white); color: var(--red-deep); font-size: 0.88rem; font-weight: 600; }
html.js .reveal .chips span { opacity: 0; transform: translateY(8px); transition: opacity 0.5s ease calc(var(--i, 0) * 35ms), transform 0.6s var(--ease-out) calc(var(--i, 0) * 35ms), background-color 0.3s, color 0.3s, border-color 0.3s; }
html.js .reveal.in .chips span { opacity: 1; transform: none; }
.chips span:hover { background: var(--ink); color: var(--white); }

/* ---------- Contact (deep blue) ---------- */
.contact { padding-block: clamp(5rem, 11vw, 9rem); background: var(--blue-deep); background-image: linear-gradient(160deg, var(--blue-deep) 0%, var(--ink) 100%); color: var(--white); }
.contact .label { color: var(--blue-light); }
.contact-grid { display: flex; flex-direction: column; align-items: center; gap: clamp(2.5rem, 5vw, 4rem); }
.contact-grid > div:first-child { display: flex; flex-direction: column; align-items: center; gap: 1.3rem; }
.contact-title { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.6rem, 6.5vw, 5.5rem); line-height: 1; letter-spacing: -0.035em; text-transform: uppercase; }
.contact-sub { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; color: rgba(255, 255, 255, 0.85); max-width: 32rem; }
.contact-list { width: 100%; max-width: 44rem; border-top: 1px solid rgba(255, 255, 255, 0.45); }
.contact-list li { display: grid; grid-template-columns: 7rem minmax(0, 1fr) auto; align-items: center; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid rgba(255, 255, 255, 0.18); text-align: left; }
.ck { color: var(--blue-light); }
.cv { font-weight: 600; font-size: 1.05rem; word-break: break-word; }
a.cv:hover { color: #ffb3b6; }
.copy { padding: 0.4rem 0.8rem; border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 2px; color: var(--white); transition: background-color 0.3s, border-color 0.3s, color 0.3s; }
.copy:hover { background: var(--white); border-color: var(--white); color: var(--blue); }
.copy.is-done { background: var(--red); border-color: var(--red); color: var(--white); }

/* ---------- Footer ---------- */
.footer { background: var(--red); color: var(--white); padding-block: 1.6rem; border-top: 1px solid var(--red-deep); text-align: center; }
.footer-inner { display: flex; justify-content: center; align-items: center; gap: 1rem 2.5rem; flex-wrap: wrap; }
.footer-top { border-bottom: 1px solid rgba(255, 255, 255, 0.5); padding-bottom: 0.15rem; }
.footer-top:hover { border-bottom-color: var(--white); }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 1.6rem; transform: translate(-50%, 20px); padding: 0.7rem 1.1rem; background: var(--ink); color: var(--white); border: 1px solid var(--blue-light); opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.4s var(--ease-out); z-index: 960; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .burger { display: block; }
}
@media (max-width: 900px) {
  .hero { min-height: 0; padding-top: calc(var(--nav-h) + 2rem); padding-bottom: 4.5rem; }
  .hero-name { font-size: clamp(2.4rem, 11.5vw, 6.5rem); }
  .arm { width: min(140%, 560px); }
  .tiles { grid-template-columns: 1fr; }
  .job { grid-template-columns: 1fr; gap: 1rem; padding: 1.5rem; }
  .job-meta { flex-direction: row; flex-wrap: wrap; gap: 1rem; }
  .certs { grid-template-columns: 1fr; }
  .projects { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .card-wide-grid { grid-template-columns: 1fr; }
  .card-art-lg { max-width: 320px; }
  .awards { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > div:nth-child(2) { border-right: 0; }
  .stats > div:nth-child(3), .stats > div:nth-child(4) { border-top: 1px solid rgba(143, 176, 255, 0.18); }
  .skills { grid-template-columns: 1fr; }
  .scroll-hint { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 1rem; }
  .brand-text { display: none; }
  .hero-name { font-size: clamp(2rem, 12vw, 4.5rem); }
  .spec-list > div { flex-direction: column; align-items: center; gap: 0.2rem; text-align: center; }
  .spec-list dd { text-align: center; }
  .contact-list li { grid-template-columns: 1fr; justify-items: center; gap: 0.35rem; text-align: center; }
  .card-art { width: 50%; }
  .card-art-lg { width: 100%; max-width: 300px; }
  .footer-inner { flex-direction: column; }
  .glow { filter: blur(50px); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  html.js .reveal, html.js .line > span, html.js .hero-copy, html.js .spec, html.js .hero-top { opacity: 1; transform: none; }
  html.js .arm, html.js body.is-loaded .arm { opacity: 0.32; transform: translate(-50%, -50%); }
  html.js .section-head .section-title { clip-path: none; }
  html.js .section-head .label, html.js .reveal .chips span { opacity: 1; transform: none; }
  html.js .card-art .draw, html.js .arm .draw:not(.arm-reach) { stroke-dashoffset: 0; }
  html.js .card-art .dash.draw { opacity: 0.75; }
  .arm-reach { opacity: 0.7; }
  .loader { display: none; }
  .cursor { display: none !important; }
  .hero-scan, .glow { display: none; }
}
