/* =========================================================
   LEONARDO RIBEIRO · personal site
   palette + typography derived from the night home-office
   pixel-art used in the hero section.
   ========================================================= */

:root {
  /* night palette — primary */
  --ink-1000: #060818;
  --ink-900:  #0B0E22;
  --ink-800:  #131732;
  --ink-700:  #1C2147;
  --ink-600:  #2A305A;
  --ink-500:  #3A416E;
  --ink-400:  #5A608A;

  /* warm lamp glow — primary accent */
  --lamp-200: #FFEDC4;
  --lamp-300: #FFE4A3;
  --lamp-400: #FFCB6B;
  --lamp-500: #FFB347;
  --lamp-600: #E89B3F;
  --lamp-700: #B97524;

  /* status accent (online dot, terminal cursor) */
  --leaf-400: #4FAA5E;

  /* neutrals */
  --text:     #ECEBF8;
  --text-dim: #A4ACC9;
  --text-mute:#6E7596;

  /* radii — kept tiny by design */
  --r-1: 2px;
  --r-2: 4px;

  /* spacing scale */
  --s-1: .25rem;
  --s-2: .5rem;
  --s-3: .75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;
  --s-10: 8rem;

  /* fonts */
  --f-pixel: "Press Start 2P", system-ui, sans-serif;
  --f-retro: "VT323", "JetBrains Mono", ui-monospace, monospace;
  --f-mono:  "JetBrains Mono", ui-monospace, "Cascadia Code", Menlo, monospace;
  --f-sans:  "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* easing */
  --ease-out: cubic-bezier(.16,1,.3,1);
  --ease-soft: cubic-bezier(.4,.14,.3,1);
}

/* =========== reset =========== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--f-sans);
  font-size: clamp(15px, 0.92vw + 12px, 17px);
  line-height: 1.6;
  color: var(--text);
  background: var(--ink-900);
  background-image:
    radial-gradient(1200px 800px at 80% -10%, rgba(255,179,71,.10), transparent 60%),
    radial-gradient(1000px 700px at -10% 110%, rgba(91,186,220,.08), transparent 60%),
    linear-gradient(180deg, var(--ink-900), var(--ink-1000));
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; padding: 0; }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.05; letter-spacing: -.02em; }

/* pixel images stay sharp */
.pixel-img,
.hero-bg-img {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

::selection { background: var(--lamp-500); color: var(--ink-900); }

/* =========== ambient overlays =========== */
.scanlines {
  position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  background: repeating-linear-gradient(
    180deg,
    rgba(255,255,255,0) 0,
    rgba(255,255,255,0) 2px,
    rgba(0,0,0,.045) 3px,
    rgba(0,0,0,.045) 3px
  );
  mix-blend-mode: overlay;
  opacity: .55;
}
.grain {
  position: fixed; inset: -20%;
  pointer-events: none; z-index: 9998; opacity: .04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.7'/></svg>");
  animation: grainShift 6s steps(8) infinite;
}
@keyframes grainShift {
  0%   { transform: translate(0,0); }
  25%  { transform: translate(-2%, 1%); }
  50%  { transform: translate(1%, -1%); }
  75%  { transform: translate(-1%, 2%); }
  100% { transform: translate(0,0); }
}
.cursor-glow {
  position: fixed; pointer-events: none; z-index: 1;
  width: 600px; height: 600px; border-radius: 50%;
  left: var(--mx, 50%); top: var(--my, 50%);
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(255,179,71,.10), transparent 70%);
  mix-blend-mode: screen; transition: opacity .4s var(--ease-soft);
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-4) var(--s-6);
  background: linear-gradient(180deg, rgba(11,14,34,.92), rgba(11,14,34,.55) 60%, transparent);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
}
.brand { display: flex; align-items: center; gap: var(--s-3); color: var(--text); }
.brand-mark {
  font-family: var(--f-pixel);
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--ink-900);
  background: var(--lamp-500);
  padding: .55rem .55rem .4rem;
  box-shadow: 3px 3px 0 var(--ink-1000);
  display: inline-block;
  transform: translateZ(0);
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.brand:hover .brand-mark { transform: translate(-1px,-1px); box-shadow: 5px 5px 0 var(--ink-1000); }
.brand-meta { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 600; font-size: .92rem; }
.brand-role {
  font-family: var(--f-retro); font-size: 1.05rem;
  color: var(--lamp-400); letter-spacing: .04em;
}

.nav { display: flex; align-items: center; gap: var(--s-5); }
.nav a {
  font-family: var(--f-mono);
  font-size: .82rem;
  color: var(--text-dim);
  position: relative;
  padding: .25rem 0;
  transition: color .2s var(--ease-out);
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -4px;
  height: 2px; background: var(--lamp-500);
  transition: right .35s var(--ease-out);
}
.nav a:hover { color: var(--text); }
.nav a:hover::after { right: 0; }
.nav-cta {
  color: var(--ink-900) !important;
  background: var(--lamp-400);
  padding: .55rem .85rem !important;
  font-weight: 600;
  box-shadow: 3px 3px 0 var(--ink-1000);
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), background .25s !important;
}
.nav-cta::after { display: none; }
.nav-cta:hover { background: var(--lamp-300); transform: translate(-1px,-1px); box-shadow: 5px 5px 0 var(--ink-1000); }

.menu-toggle { display: none; width: 40px; height: 40px; flex-direction: column; gap: 5px; align-items: center; justify-content: center; }
.menu-toggle span { width: 22px; height: 2px; background: var(--text); display: block; }

/* ============================================================
   HERO — full-bleed background image + content overlay
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  padding: 7rem var(--s-6) var(--s-7);
  padding-left: max(1.5rem, 51vw);
  padding-right: max(1.5rem, 22vw);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  isolation: isolate;
}

.hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.hero-bg-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% center;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  filter: saturate(1.05) contrast(1.02);
  animation: heroSubtle 36s ease-in-out infinite;
}
@keyframes heroSubtle {
  0%, 100% { transform: scale(1.02) translate(0, 0); }
  50%      { transform: scale(1.035) translate(.3%, .2%); }
}
.hero-bg-overlay {
  position: absolute; inset: 0;
  /* gentle universal dim — top/bottom only; the panel behind the text handles its own legibility */
  background: linear-gradient(180deg, rgba(11,14,34,.32) 0%, rgba(11,14,34,0) 22%, rgba(11,14,34,0) 78%, rgba(11,14,34,.5) 100%);
}
.hero-bg-grain {
  position: absolute; inset: 0;
  opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence baseFrequency='.95' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ----- panel behind text — echoes site card language (border + chunky offset shadow) ----- */
.hero-frame {
  position: absolute;
  inset: -1.75rem -2rem;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  background: rgba(11, 14, 34, .55);
  -webkit-backdrop-filter: blur(20px) saturate(135%);
          backdrop-filter: blur(20px) saturate(135%);
  border: 2px solid var(--ink-500);
  box-shadow: 8px 8px 0 var(--lamp-500);
  animation: hero-frame-in 1s var(--ease-out) both;
}
@keyframes hero-frame-in {
  from { opacity: 0; transform: translate(4px, 4px); }
  to   { opacity: 1; transform: translate(0, 0);     }
}

/* soft amber sheen drifting diagonally — premium polished surface */
.hero-frame::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(115deg,
    transparent 0%,
    transparent 38%,
    rgba(255, 179, 71, .07) 50%,
    transparent 62%,
    transparent 100%);
  background-size: 220% 100%;
  background-position: -110% 0;
  animation: hero-sheen 9s ease-in-out infinite;
}
@keyframes hero-sheen {
  0%, 100% { background-position: -110% 0; }
  50%      { background-position:  210% 0; }
}

/* top hairline accent — gentle breathing pulse (matches site rhythm) */
.hero-frame::after {
  content: "";
  position: absolute;
  top: -2px; left: 8%; right: 8%;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--lamp-400) 50%,
    transparent 100%);
  animation: hero-line-pulse 5s ease-in-out infinite;
}
@keyframes hero-line-pulse {
  0%, 100% { opacity: .35; transform: scaleX(.85); }
  50%      { opacity: 1;   transform: scaleX(1);   }
}

.hero-content {
  position: relative; z-index: 2;
  max-width: 480px;
  width: 100%;
}

.hero-tag {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--f-retro); font-size: 1.1rem; letter-spacing: .04em;
  color: var(--text-dim);
  padding: .35rem .8rem;
  border: 1px solid var(--ink-500);
  background: rgba(28,33,71,.5);
  margin-bottom: var(--s-5);
}
.hero-tag .dot { width: 8px; height: 8px; background: var(--leaf-400); box-shadow: 0 0 0 3px rgba(79,170,94,.18); }

.hero-title { margin-bottom: var(--s-4); }
.hero-title-pre {
  display: block;
  font-family: var(--f-mono);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .14em;
  color: var(--lamp-400);
  margin-bottom: var(--s-4);
  text-transform: lowercase;
}
.hero-title-name {
  display: block;
  font-family: var(--f-sans);
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: .98;
  color: var(--text);
}

.hero-sub {
  font-size: 1.02rem;
  color: var(--text-dim);
  max-width: 42ch;
  margin-bottom: var(--s-6);
  line-height: 1.55;
}

.terminal {
  border: 2px solid var(--ink-500);
  background: var(--ink-1000);
  box-shadow: 5px 5px 0 var(--lamp-500);
  margin-bottom: var(--s-5);
  font-family: var(--f-mono);
}
.terminal-bar {
  display: flex; align-items: center; gap: .35rem;
  padding: .55rem .8rem;
  background: var(--ink-700);
  border-bottom: 2px solid var(--ink-500);
}
.terminal-bar span {
  width: 10px; height: 10px;
  background: var(--ink-500);
}
.terminal-bar span:nth-child(1) { background: #FF5F56; }
.terminal-bar span:nth-child(2) { background: var(--lamp-500); }
.terminal-bar span:nth-child(3) { background: var(--leaf-400); }
.terminal-bar em {
  margin-left: auto; font-style: normal;
  color: var(--text-mute); font-size: .8rem;
}
.terminal-body {
  padding: var(--s-4) var(--s-5);
  font-family: var(--f-mono); font-size: .87rem;
  color: var(--lamp-200); line-height: 1.6;
  white-space: pre-wrap; min-height: 130px;
}
.terminal-body .prompt { color: var(--leaf-400); }
.terminal-body .cmd { color: var(--text); }
.terminal-body .out { color: var(--text-dim); }
.terminal-body .key { color: var(--lamp-400); }
.terminal-cursor {
  display: inline-block; width: .55rem; height: 1rem;
  background: var(--lamp-400); vertical-align: -3px;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-cta { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-6); }

.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .9rem 1.3rem;
  font-family: var(--f-mono); font-size: .9rem; font-weight: 600;
  letter-spacing: .02em;
  border: 2px solid transparent;
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), background .25s, color .25s;
}
.btn-primary {
  color: var(--ink-900);
  background: var(--lamp-500);
  box-shadow: 5px 5px 0 var(--ink-1000);
}
.btn-primary:hover { background: var(--lamp-300); transform: translate(-2px,-2px); box-shadow: 8px 8px 0 var(--ink-1000); }
.btn-primary:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--ink-1000); }
.btn-primary i { font-style: normal; transition: transform .3s var(--ease-out); }
.btn-primary:hover i { transform: translateX(3px); }

.btn-ghost {
  color: var(--text);
  border-color: var(--ink-500);
  background: transparent;
  box-shadow: 5px 5px 0 var(--ink-700);
}
.btn-ghost:hover { border-color: var(--lamp-400); color: var(--lamp-300); transform: translate(-2px,-2px); box-shadow: 8px 8px 0 var(--ink-700); }

.hero-meta {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: var(--s-3);
  border-top: 1px dashed var(--ink-500);
  padding-top: var(--s-5);
}
.hero-meta li { display: flex; flex-direction: column; gap: .2rem; }
.hero-meta .k {
  font-family: var(--f-retro); font-size: 1rem; letter-spacing: .08em;
  color: var(--text-mute); text-transform: uppercase;
}
.hero-meta .v { font-size: .9rem; color: var(--text); }

.hero-scroll {
  position: absolute; left: 50%; bottom: 1.2rem; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .35rem;
  font-family: var(--f-retro); font-size: 1rem; color: var(--text-mute);
  letter-spacing: .12em;
}
.hero-scroll span {
  width: 2px; height: 30px;
  background: linear-gradient(180deg, var(--lamp-500), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%   { transform: scaleY(.4); opacity: .3; transform-origin: top; }
  50%  { transform: scaleY(1);  opacity: 1;  transform-origin: top; }
  100% { transform: scaleY(.4); opacity: .3; transform-origin: bottom; }
}

/* ============================================================
   SECTION SHARED
   ============================================================ */
section { position: relative; }
.about, .stats, .journey, .projects, .contact {
  padding: var(--s-9) var(--s-6);
  max-width: 1280px;
  margin: 0 auto;
}
.section-head { margin-bottom: var(--s-7); max-width: 880px; }
.section-head.center { text-align: center; margin-left: auto; margin-right: auto; }
.section-kicker {
  display: inline-block;
  font-family: var(--f-mono); font-size: .8rem; font-weight: 500;
  letter-spacing: .12em; color: var(--lamp-500);
  margin-bottom: var(--s-3);
  text-transform: lowercase;
}
.section-title {
  font-family: var(--f-sans);
  font-size: clamp(2rem, 4.5vw, 3.6rem);
  font-weight: 800; letter-spacing: -.03em;
  color: var(--text);
  line-height: 1.05;
}
.section-title em {
  font-style: italic; font-weight: 400;
  color: var(--lamp-400);
  font-family: "Inter", serif;
}
.section-sub {
  margin-top: var(--s-4);
  font-size: 1.05rem;
  color: var(--text-dim);
  max-width: 60ch;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: var(--s-6);
  align-items: start;
}
.about-grid p { color: var(--text-dim); font-size: 1rem; }
.about-lead { font-size: 1.2rem !important; color: var(--text) !important; line-height: 1.5; }
.about-lead strong, .about-grid p strong { color: var(--lamp-400); font-weight: 600; }

/* ============================================================
   STATS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-4);
}
.stat-card {
  position: relative;
  background: rgba(28,33,71,.6);
  border: 2px solid var(--ink-500);
  padding: var(--s-5);
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out), border-color .35s;
}
.stat-card::before {
  content: ""; position: absolute; inset: -2px;
  background: linear-gradient(135deg, var(--lamp-500), transparent 60%);
  opacity: 0; transition: opacity .35s; z-index: -1;
}
.stat-card:hover {
  transform: translate(-3px,-3px);
  box-shadow: 6px 6px 0 var(--lamp-500);
  border-color: var(--lamp-500);
}
.stat-card header {
  display: flex; align-items: center; gap: var(--s-3);
  margin-bottom: var(--s-4);
}
.stat-icon {
  font-family: var(--f-mono);
  font-size: .95rem; font-weight: 600;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: var(--ink-700);
  color: var(--lamp-400);
  border: 2px solid var(--ink-500);
  letter-spacing: -.02em;
}
.stat-card h3 { font-size: 1.1rem; flex: 1; color: var(--text); }
.stat-tier {
  font-family: var(--f-mono);
  font-size: .7rem; font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--lamp-500);
  padding: .25rem .5rem;
  border: 1px solid var(--lamp-700);
  background: rgba(255,179,71,.06);
}
.stat-bar {
  height: 4px;
  background: var(--ink-700);
  margin-bottom: var(--s-4);
  position: relative; overflow: hidden;
}
.stat-bar > div {
  height: 100%;
  width: var(--w);
  background: linear-gradient(90deg, var(--lamp-600), var(--lamp-400));
  transform-origin: left;
}
.stat-card ul {
  display: flex; flex-direction: column; gap: .35rem;
  font-family: var(--f-mono); font-size: .85rem;
  color: var(--text-dim);
}
.stat-card ul li { position: relative; padding-left: 1rem; }
.stat-card ul li::before {
  content: "▸"; position: absolute; left: 0; color: var(--lamp-500);
}

/* ============================================================
   JOURNEY / TIMELINE
   ============================================================ */
.timeline {
  position: relative;
  display: flex; flex-direction: column;
  gap: var(--s-6);
  padding-left: 2.5rem;
}
.timeline::before {
  content: ""; position: absolute;
  left: 12px; top: 8px; bottom: 8px;
  width: 2px;
  background: repeating-linear-gradient(
    180deg, var(--ink-500) 0 6px, transparent 6px 12px
  );
}
.t-item {
  position: relative;
  border: 2px solid var(--ink-500);
  background: rgba(19,23,50,.7);
  padding: var(--s-5) var(--s-6);
  transition: border-color .3s, transform .3s var(--ease-out);
}
.t-item:hover { border-color: var(--lamp-500); transform: translateX(4px); }
.t-dot {
  position: absolute; left: -2.6rem; top: 1.6rem;
  width: 14px; height: 14px;
  background: var(--lamp-500);
  border: 2px solid var(--ink-900);
  box-shadow: 0 0 0 3px rgba(255,179,71,.15);
}
.t-head {
  display: grid; grid-template-columns: auto 1fr auto; gap: var(--s-4);
  align-items: baseline; margin-bottom: var(--s-3);
}
.t-when {
  font-family: var(--f-retro); font-size: 1.15rem;
  color: var(--lamp-400);
  letter-spacing: .04em;
}
.t-title { font-size: 1.25rem; }
.t-where { font-family: var(--f-mono); font-size: .85rem; color: var(--text-mute); }
.t-body {
  display: flex; flex-direction: column; gap: var(--s-2);
  color: var(--text-dim); font-size: .98rem;
}
.t-body li { padding-left: 1.1rem; position: relative; }
.t-body li::before {
  content: "→"; position: absolute; left: 0;
  color: var(--lamp-500); font-family: var(--f-mono);
}

/* ============================================================
   PROJECTS
   ============================================================ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-5);
}
.proj-card {
  display: flex; flex-direction: column;
  background: var(--ink-800);
  border: 2px solid var(--ink-500);
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out);
}
.proj-card:hover {
  transform: translate(-4px,-4px);
  box-shadow: 8px 8px 0 var(--accent, var(--lamp-500));
  border-color: var(--accent, var(--lamp-500));
}
.proj-screen {
  aspect-ratio: 16/9;
  background:
    radial-gradient(ellipse at center, color-mix(in srgb, var(--accent) 30%, var(--ink-900)), var(--ink-900) 80%);
  position: relative; overflow: hidden;
  border-bottom: 2px solid var(--ink-500);
}
.proj-screen-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(ellipse at center, #000 40%, transparent 75%);
}
.proj-screen-tag {
  position: absolute; top: 12px; left: 12px;
  font-family: var(--f-retro); font-size: 1rem;
  color: var(--accent, var(--lamp-400));
  letter-spacing: .04em;
}
.proj-screen-emoji {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 5rem; color: var(--accent, var(--lamp-400));
  opacity: .9;
  text-shadow: 4px 4px 0 var(--ink-1000);
  filter: drop-shadow(0 0 20px color-mix(in srgb, var(--accent) 40%, transparent));
  font-family: var(--f-pixel);
  transition: transform .5s var(--ease-out);
}
.proj-card:hover .proj-screen-emoji { transform: scale(1.06) rotate(-3deg); }

.proj-body {
  display: flex; flex-direction: column; gap: var(--s-3);
  padding: var(--s-5);
  flex: 1;
}
.proj-body header { display: flex; flex-direction: column; gap: .25rem; }
.proj-genre {
  font-family: var(--f-retro); font-size: 1rem;
  color: var(--accent, var(--lamp-400));
  letter-spacing: .08em; text-transform: lowercase;
}
.proj-body h3 { font-size: 1.5rem; color: var(--text); }
.proj-body p { color: var(--text-dim); font-size: .95rem; flex: 1; }
.proj-stack {
  display: flex; flex-wrap: wrap; gap: .35rem;
  font-family: var(--f-mono); font-size: .75rem;
}
.proj-stack li {
  padding: .25rem .55rem;
  background: var(--ink-700);
  color: var(--text-dim);
  border: 1px solid var(--ink-500);
}
.proj-link {
  margin-top: var(--s-2);
  font-family: var(--f-mono); font-size: .85rem; font-weight: 600;
  color: var(--accent, var(--lamp-400));
  align-self: flex-start;
  position: relative;
}
.proj-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: currentColor;
  transform-origin: right; transform: scaleX(0); transition: transform .3s var(--ease-out);
}
.proj-link:hover::after { transform: scaleX(1); transform-origin: left; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact { padding-top: var(--s-9); padding-bottom: var(--s-9); }
.contact-lead {
  color: var(--text-dim);
  font-size: 1.1rem;
  max-width: 56ch;
  margin: var(--s-4) auto 0;
}
.contact-grid {
  margin-top: var(--s-7);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-3);
  max-width: 880px;
  margin-left: auto; margin-right: auto;
}
.contact-grid a {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-5);
  background: rgba(19,23,50,.7);
  border: 2px solid var(--ink-500);
  transition: transform .3s var(--ease-out), border-color .3s, background .3s, box-shadow .3s var(--ease-out);
}
.contact-grid a:hover {
  border-color: var(--lamp-500);
  background: var(--ink-800);
  transform: translate(-2px,-2px);
  box-shadow: 5px 5px 0 var(--lamp-500);
}
.c-key {
  font-family: var(--f-retro); font-size: 1.1rem;
  letter-spacing: .08em; color: var(--lamp-500);
  text-transform: lowercase;
}
.c-val { font-family: var(--f-mono); font-size: .95rem; color: var(--text); overflow-wrap: anywhere; }
.c-go { color: var(--text-mute); font-size: 1.4rem; transition: transform .3s var(--ease-out), color .3s; }
.contact-grid a:hover .c-go { color: var(--lamp-400); transform: translate(3px,-3px); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--ink-700);
  padding: var(--s-5) var(--s-6);
  background: var(--ink-1000);
}
.footer-row {
  display: flex; align-items: center; gap: var(--s-5);
  justify-content: center;
  max-width: 1280px; margin: 0 auto;
  font-family: var(--f-mono); font-size: .8rem; color: var(--text-dim);
  flex-wrap: wrap;
}
.footer-mark {
  font-family: var(--f-pixel); font-size: 11px;
  color: var(--ink-900); background: var(--lamp-500);
  padding: .35rem .45rem .25rem;
  box-shadow: 2px 2px 0 var(--ink-700);
}
.footer-text { font-family: var(--f-mono); font-size: .85rem; }
.footer-text.dim { margin-left: auto; color: var(--text-mute); }

/* ============================================================
   PARTICLES — animated ambient layer (per section)
   ============================================================ */
.particles {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.particle {
  position: absolute;
  width: var(--size, 4px); height: var(--size, 4px);
  pointer-events: none;
  will-change: transform, opacity;
}

/* ===== night particles ===== */
.particle.firefly {
  background: var(--lamp-300);
  border-radius: 50%;
  box-shadow:
    0 0 6px var(--lamp-400),
    0 0 12px rgba(255,179,71,.55);
  animation: firefly-drift var(--dur, 9s) ease-in-out infinite,
             firefly-glow var(--gdur, 2.4s) ease-in-out infinite;
  opacity: 0;
}
@keyframes firefly-drift {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(28px, -36px); }
  50%  { transform: translate(-14px, -56px); }
  75%  { transform: translate(22px, -28px); }
  100% { transform: translate(0, 0); }
}
@keyframes firefly-glow {
  0%, 100% { opacity: .15; }
  50%      { opacity: 1; }
}

.particle.dust {
  background: rgba(255, 240, 210, .55);
  border-radius: 50%;
  filter: blur(.4px);
  animation: dust-rise var(--dur, 14s) linear infinite;
  opacity: 0;
}
@keyframes dust-rise {
  0%   { transform: translate(0, 60px); opacity: 0; }
  10%  { opacity: .6; }
  50%  { transform: translate(20px, -20vh); opacity: .55; }
  90%  { opacity: .35; }
  100% { transform: translate(40px, -110vh); opacity: 0; }
}

.particle.spark {
  background: var(--lamp-200);
  width: var(--size, 2px); height: var(--size, 2px);
  box-shadow: 0 0 4px var(--lamp-400);
  animation: spark-twinkle var(--dur, 3.5s) ease-in-out infinite;
  opacity: 0;
}
@keyframes spark-twinkle {
  0%, 100% { opacity: 0; transform: scale(.6); }
  50%      { opacity: 1; transform: scale(1.4); }
}

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
[data-reveal] {
  opacity: 0; transform: translateY(24px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
}
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
/* ============================================================
   RESPONSIVE — progressive breakpoints
   • >1280   default desktop (right-aligned hero)
   • 1024-1280  laptop intermediate (lighter asymmetric padding)
   • 768-1024   tablet (centered hero, mobile nav, 2-col grids)
   • 480-768    mobile (1-col, lighter spacing)
   • <480       small mobile (hide brand-meta, stack CTAs, tighter frame)
   ============================================================ */

/* === laptop intermediate — 1024-1280 === */
@media (max-width: 1280px) {
  .hero {
    padding-left:  max(1.5rem, 40vw);
    padding-right: max(1.5rem, 10vw);
  }
  .about, .stats, .journey, .projects, .contact { padding: var(--s-8) var(--s-6); }
}

/* === tablet — < 1024px : centered hero, mobile nav === */
@media (max-width: 1024px) {
  .hero {
    padding: 6rem var(--s-6) var(--s-7);
    justify-content: center;
  }
  .hero-content { max-width: 100%; }
  .hero-bg-img { object-position: 50% center; }
  .hero-bg-overlay {
    background:
      linear-gradient(180deg, rgba(11,14,34,.55) 0%, rgba(11,14,34,.32) 35%, rgba(11,14,34,.85) 78%, rgba(6,8,24,.95) 100%);
  }
  .hero-frame {
    inset: -1.25rem -1.5rem;
    box-shadow: 6px 6px 0 var(--lamp-500);
  }
  .hero-frame::after { left: 6%; right: 6%; }

  .nav { display: none; }
  .menu-toggle { display: flex; }
  .topbar.is-open { flex-wrap: wrap; }
  .topbar.is-open .nav {
    display: flex;
    order: 99; width: 100%;
    flex-direction: column; align-items: flex-start;
    padding: var(--s-4) 0 var(--s-2);
    gap: var(--s-3);
  }

  .about-grid   { grid-template-columns: 1fr; gap: var(--s-4); }
  .stats-grid   { grid-template-columns: repeat(2, 1fr); }
  .projects-grid{ grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-grid a { grid-template-columns: 90px 1fr auto; padding: var(--s-4); }
}

/* === mobile — < 768px : true vertical stack — image is a clean block, text below it, nothing overlaid === */
@media (max-width: 768px) {
  .about, .stats, .journey, .projects, .contact { padding: var(--s-7) var(--s-5); max-width: 100%; }
  .stats-grid    { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: 1fr; }
  .t-head        { grid-template-columns: 1fr; gap: .15rem; }
  .footer-row    { gap: var(--s-3); }

  /* clean opaque topbar — no blur over image, clear separation */
  .topbar {
    background: var(--ink-900);
    -webkit-backdrop-filter: none;
            backdrop-filter: none;
    border-bottom: 1px solid rgba(255, 179, 71, .08);
  }

  /* hero becomes a normal block stack — flex disabled, no padding around image */
  .hero {
    display: block;
    padding: 4rem 0 0 0;
    min-height: auto;
    overflow: visible;
    isolation: auto;
  }

  /* hero-bg leaves the absolute layer system — sits in normal flow as the image block */
  .hero-bg {
    position: static;
    inset: auto;
    z-index: auto;
    width: 100%;
    height: auto;
    background: var(--ink-1000);
    overflow: visible;
  }

  /* image is a normal block element with its native aspect ratio — nothing on top of it */
  .hero-bg-img {
    position: static;
    inset: auto;
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 1;
    object-fit: contain;
    object-position: center;
    display: block;
    animation: none;
    filter: none;
  }

  /* everything that used to overlay the image is removed on mobile */
  .hero-bg-overlay,
  .hero-bg-grain,
  .particles-night,
  .hero-frame,
  .hero-scroll { display: none; }

  /* text block sits below the image — its own padding, its own real estate */
  .hero-content {
    max-width: 100%;
    padding: var(--s-7) var(--s-5) var(--s-6);
  }

  /* tighten typography hierarchy for the post-image text block */
  .hero-title-name { font-size: clamp(2rem, 7vw, 2.8rem); }
  .hero-title-pre  { font-size: .72rem; margin-bottom: var(--s-3); letter-spacing: .18em; }
  .hero-sub        { font-size: .98rem; margin-bottom: var(--s-5); max-width: 38ch; }
  .hero-cta        { gap: var(--s-2); }
}

/* === small mobile — < 560px === */
@media (max-width: 560px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card  { padding: var(--s-4); }
  .timeline   { padding-left: 1.8rem; }
  .t-dot      { left: -2rem; }
  .t-item     { padding: var(--s-4); }
  .contact-grid a { grid-template-columns: 70px 1fr auto; padding: var(--s-4); gap: var(--s-3); }
  .section-head { margin-bottom: var(--s-6); }
}

/* === extra small — < 480px === */
@media (max-width: 480px) {
  .topbar { padding: var(--s-3) var(--s-5); }
  .brand-meta { display: none; }
  .menu-toggle { width: 36px; height: 36px; }
  .hero-frame {
    inset: -.75rem -1rem;
    box-shadow: 4px 4px 0 var(--lamp-500);
  }
  .hero-title-name { font-size: clamp(2rem, 9vw, 2.8rem); }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; justify-content: center; padding: .8rem 1rem; }
  .hero-scroll { font-size: .85rem; bottom: .8rem; }

  .footer { padding: var(--s-4); }
  .footer-row { font-size: .75rem; }
}

/* === ultra-narrow — < 360px (older phones, Galaxy Fold closed) === */
@media (max-width: 360px) {
  .about, .stats, .journey, .projects, .contact { padding: var(--s-6) var(--s-4); }
  .hero-frame { inset: -.5rem -.75rem; }
  .stat-card  { padding: var(--s-3); }
  .t-item     { padding: var(--s-3); }
  .contact-grid a { padding: var(--s-3); grid-template-columns: 60px 1fr auto; }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
  html { scroll-behavior: auto; }
}
