/* =============================================================
   Nativo IA — Archetype 05 · Mouse-Reactive Gradient (warm/amber)
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg:        #0a0908;   /* near-black, warm */
  --bg-2:      #141210;
  --ink:       #f5f1ea;   /* warm near-white */
  --mute:      #9b9186;
  --mute-2:    #6a6259;
  --accent:    #ff7a1a;   /* amber — single neon accent */
  --accent-2:  #ffb066;
  --line:      rgba(245, 241, 234, 0.10);
  --line-2:    rgba(245, 241, 234, 0.18);

  --grad-1:    #ff7a1a;   /* amber   */
  --grad-2:    #ff2e7e;   /* magenta */
  --grad-3:    #7a3cff;   /* violet  */
  --grad-4:    #1ac6ff;   /* cyan    */

  --serif: "Fraunces", Georgia, serif;
  --sans:  "Inter", system-ui, -apple-system, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, monospace;

  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft:  cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --pad: clamp(1.25rem, 5vw, 6rem);
  --maxw: 1240px;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  overflow-x: clip;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; line-height: 1.02; letter-spacing: -0.02em; font-weight: 400; }
::selection { background: var(--accent); color: #0a0908; }

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

.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--ink); color: var(--bg);
  z-index: 9999; border-radius: 8px; font-weight: 500;
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   3. Background — mouse-reactive gradient + grain
   ============================================================= */
.bg-gradient {
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(circle 650px at var(--mx, 30%) var(--my, 25%), var(--grad-1) 0%, transparent 55%),
    radial-gradient(circle 750px at calc(var(--mx, 70%) + 8%) calc(var(--my, 60%) + 6%), var(--grad-2) 0%, transparent 50%),
    radial-gradient(circle 800px at 80% 15%, var(--grad-3) 0%, transparent 55%),
    radial-gradient(circle 700px at 15% 85%, var(--grad-4) 0%, transparent 55%),
    var(--bg);
  filter: blur(70px) saturate(135%);
  opacity: 0.30;
  transition: background 0.5s var(--ease-soft);
}
.bg-grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* =============================================================
   4. Nav
   ============================================================= */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem var(--pad);
  transition: background .4s var(--ease-out), backdrop-filter .4s var(--ease-out), padding .4s var(--ease-out);
}
.nav.is-scrolled {
  background: rgba(10, 9, 8, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  padding-block: .8rem;
  border-bottom: 1px solid var(--line);
}
.nav-brand {
  font-family: var(--mono);
  font-size: .95rem; font-weight: 500; letter-spacing: .02em;
  display: inline-flex; align-items: center; gap: .55rem;
}
.nav-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.nav-brand-accent { color: var(--accent); }
.nav-links { display: none; gap: 2rem; }
.nav-links a {
  font-size: .82rem; color: var(--mute); letter-spacing: .01em;
  position: relative; padding: .2rem 0; transition: color .3s var(--ease-out);
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1px; width: 0;
  background: var(--accent); transition: width .35s var(--ease-out);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }
.nav-cta {
  font-family: var(--mono); font-size: .8rem; letter-spacing: .02em;
  padding: .55rem 1.1rem; border: 1px solid var(--line-2); border-radius: 100px;
  transition: border-color .3s var(--ease-out), color .3s var(--ease-out), background .3s var(--ease-out);
}
.nav-cta:hover { border-color: var(--accent); color: var(--accent); }

@media (min-width: 960px) { .nav-links { display: flex; } }

/* =============================================================
   5. Layout helpers
   ============================================================= */
.section { padding: clamp(5rem, 12vh, 10rem) var(--pad); max-width: var(--maxw); margin-inline: auto; }
.section-head { margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.section-label {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1.2rem;
}
.section-title { font-family: var(--serif); font-size: clamp(2rem, 5.2vw, 3.9rem); line-height: 1.02; }
.section-title em, .hero-title em, .manifesto-text em, .contact-title em {
  font-style: italic; color: var(--accent); font-variation-settings: "SOFT" 40;
}

/* =============================================================
   6. Hero
   ============================================================= */
.hero {
  min-height: 100vh; min-height: 100svh;
  max-width: var(--maxw); margin-inline: auto;
  padding: 7rem var(--pad) 4rem;
  display: flex; flex-direction: column; justify-content: center;
}
.kicker {
  font-family: var(--mono); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--mute); margin-bottom: 1.8rem;
}
.hero-title {
  font-family: var(--serif);
  font-size: clamp(2.7rem, 9vw, 7rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  max-width: 16ch;
  margin-bottom: 2rem;
}
.hero-sub {
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
  color: var(--mute); max-width: 46ch; line-height: 1.6; margin-bottom: 2.6rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; }

.hero-scroll {
  margin-top: clamp(3rem, 8vh, 6rem);
  display: flex; align-items: center; gap: .8rem;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--mute-2);
}
.hero-scroll-line { width: 60px; height: 1px; background: linear-gradient(90deg, var(--accent), transparent); }

/* =============================================================
   7. Buttons
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--mono); font-size: .85rem; letter-spacing: .01em;
  padding: .95rem 1.7rem; border-radius: 100px;
  transition: transform .3s var(--ease-out), background .3s var(--ease-out), color .3s var(--ease-out), border-color .3s var(--ease-out), box-shadow .3s var(--ease-out);
  will-change: transform;
}
.btn-primary {
  background: var(--accent); color: #0a0908; font-weight: 500;
  box-shadow: 0 8px 30px -8px rgba(255, 122, 26, 0.6);
}
.btn-primary:hover { background: var(--accent-2); box-shadow: 0 14px 40px -8px rgba(255, 122, 26, 0.7); }
.btn-ghost { border: 1px solid var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* =============================================================
   8. Manifesto
   ============================================================= */
.manifesto { text-align: left; }
.manifesto-text {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.6vw, 2.9rem);
  line-height: 1.32; letter-spacing: -0.015em;
  max-width: 24ch; font-weight: 400;
  max-width: 20ch;
}
.manifesto-text { max-width: 28ch; }

/* =============================================================
   9. Skills — accordion list rows
   ============================================================= */
.skill-list { list-style: none; border-top: 1px solid var(--line); }
.skill-row { border-bottom: 1px solid var(--line); }
.skill-head {
  width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: 1.2rem; padding: clamp(1.3rem, 3vw, 2.1rem) 0; text-align: left;
  transition: color .3s var(--ease-out);
}
.skill-num { font-family: var(--mono); font-size: .85rem; color: var(--mute-2); }
.skill-name {
  font-family: var(--serif); font-size: clamp(1.4rem, 3.6vw, 2.6rem);
  letter-spacing: -0.02em; transition: color .3s var(--ease-out), transform .4s var(--ease-out);
}
.skill-head:hover .skill-name { color: var(--accent); transform: translateX(10px); }
.skill-toggle { position: relative; width: 20px; height: 20px; flex-shrink: 0; }
.skill-toggle::before, .skill-toggle::after {
  content: ""; position: absolute; top: 50%; left: 50%; background: var(--mute);
  transition: transform .35s var(--ease-out), background .3s var(--ease-out);
}
.skill-toggle::before { width: 16px; height: 1.5px; transform: translate(-50%, -50%); }
.skill-toggle::after  { width: 1.5px; height: 16px; transform: translate(-50%, -50%); }
.skill-head[aria-expanded="true"] .skill-toggle::after { transform: translate(-50%, -50%) scaleY(0); }
.skill-head[aria-expanded="true"] .skill-toggle::before { background: var(--accent); }
.skill-body {
  overflow: hidden; max-height: 0;
  transition: max-height .5s var(--ease-out), opacity .4s var(--ease-out);
  opacity: 0;
}
.skill-row.is-open .skill-body { max-height: 260px; opacity: 1; }
.skill-body p {
  color: var(--mute); max-width: 60ch; font-size: 1.05rem;
  padding: 0 0 1.8rem calc(0.85rem + 1.2rem);
}

/* =============================================================
   10. Stats
   ============================================================= */
.stats {
  display: grid; grid-template-columns: 1fr; gap: 3rem;
  border-block: 1px solid var(--line); text-align: center;
}
.stat-num { font-family: var(--serif); font-size: clamp(3.5rem, 9vw, 6rem); line-height: 1; color: var(--ink); }
.stat-suffix { font-family: var(--serif); font-size: clamp(2rem, 5vw, 3rem); color: var(--accent); }
.stat-label { color: var(--mute); font-size: .95rem; max-width: 24ch; margin: 1rem auto 0; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(3, 1fr); } }

/* =============================================================
   11. Opportunities
   ============================================================= */
.opp-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.opp {
  padding: clamp(1.8rem, 3vw, 2.6rem); border: 1px solid var(--line); border-radius: 18px;
  background: rgba(20, 18, 16, 0.4);
  transition: transform .4s var(--ease-out), border-color .4s var(--ease-out), background .4s var(--ease-out);
}
.opp:hover { transform: translateY(-6px); border-color: var(--line-2); background: rgba(20, 18, 16, 0.7); }
.opp-num { font-family: var(--serif); font-style: italic; font-size: 1.6rem; color: var(--accent); }
.opp h3 { font-family: var(--serif); font-size: 1.5rem; margin: .8rem 0 .8rem; }
.opp p { color: var(--mute); font-size: 1rem; }
@media (min-width: 860px) { .opp-grid { grid-template-columns: repeat(3, 1fr); } }

/* =============================================================
   12. About
   ============================================================= */
.about { display: grid; grid-template-columns: 1fr; gap: clamp(2.5rem, 5vw, 4.5rem); align-items: center; }
.portrait { position: relative; }
.portrait img, .portrait-placeholder {
  width: 100%; aspect-ratio: 4/5; border-radius: 18px; object-fit: cover;
}
.portrait-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem;
  background:
    radial-gradient(circle at 50% 35%, rgba(255,122,26,0.22), transparent 60%),
    linear-gradient(160deg, #1a1613, #0d0b0a);
  border: 1px solid var(--line-2);
}
.portrait-monogram {
  font-family: var(--serif); font-size: clamp(3rem, 8vw, 5rem); color: var(--accent);
  font-style: italic; line-height: 1;
}
.portrait-caption { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--mute-2); }
.portrait-tag {
  position: absolute; bottom: 1rem; left: 1rem;
  font-family: var(--mono); font-size: .74rem; letter-spacing: .04em;
  padding: .4rem .8rem; border-radius: 100px;
  background: rgba(10,9,8,0.7); backdrop-filter: blur(8px); color: var(--ink);
}
.about-copy { color: var(--mute); font-size: 1.1rem; line-height: 1.7; margin-top: 1.6rem; max-width: 48ch; }
@media (min-width: 860px) { .about { grid-template-columns: 0.85fr 1fr; } }

/* =============================================================
   13. Contact
   ============================================================= */
.contact-head { margin-bottom: clamp(2.5rem, 6vw, 4rem); }
.contact-title { font-family: var(--serif); font-size: clamp(2.2rem, 6vw, 4.5rem); line-height: 1; margin-bottom: 1.4rem; }
.contact-lead { color: var(--mute); max-width: 44ch; font-size: 1.1rem; margin-bottom: 1.8rem; }
.contact-email {
  font-family: var(--mono); font-size: clamp(1rem, 2.4vw, 1.4rem); color: var(--ink);
  position: relative; display: inline-block;
}
.contact-email::after {
  content: ""; position: absolute; left: 0; bottom: -3px; height: 1.5px; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease-out);
}
.contact-email:hover { color: var(--accent); }
.contact-email:hover::after { transform: scaleX(1); }

.contact-form {
  display: grid; grid-template-columns: 1fr; gap: 1.3rem;
  padding: clamp(1.6rem, 4vw, 2.8rem);
  border: 1px solid var(--line); border-radius: 22px;
  background: rgba(20, 18, 16, 0.45);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.field { display: flex; flex-direction: column; gap: .5rem; }
.field label { font-family: var(--mono); font-size: .76rem; letter-spacing: .05em; text-transform: uppercase; color: var(--mute); }
.field-opt { text-transform: none; color: var(--mute-2); }
.field input, .field select, .field textarea {
  font-family: var(--sans); font-size: 1rem; color: var(--ink);
  background: rgba(10, 9, 8, 0.6); border: 1px solid var(--line-2); border-radius: 12px;
  padding: .85rem 1rem; transition: border-color .3s var(--ease-out), background .3s var(--ease-out);
  width: 100%;
}
.field textarea { resize: vertical; min-height: 90px; }
.field input::placeholder, .field textarea::placeholder { color: var(--mute-2); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); background: rgba(10, 9, 8, 0.85); outline: none;
}
.field select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%239b9186' stroke-width='2'%3E%3Cpath d='M3 5l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center;
}
.field-full { grid-column: 1 / -1; }
.btn-submit { grid-column: 1 / -1; justify-content: center; margin-top: .4rem; overflow: hidden; }
.btn-submit-check { width: 20px; height: 20px; fill: none; stroke: #0a0908; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 30; stroke-dashoffset: 30; display: none; }
.contact-form.is-sent .btn-submit-label { display: none; }
.contact-form.is-sent .btn-submit-check { display: block; animation: drawCheck .5s var(--ease-out) forwards; }
@keyframes drawCheck { to { stroke-dashoffset: 0; } }
.form-status { grid-column: 1 / -1; font-family: var(--mono); font-size: .82rem; color: var(--accent); min-height: 1.2em; text-align: center; }
@media (min-width: 640px) { .contact-form { grid-template-columns: 1fr 1fr; } }

/* =============================================================
   14. Footer
   ============================================================= */
.footer {
  padding: 3rem var(--pad); max-width: var(--maxw); margin-inline: auto;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between;
}
.footer-brand { font-family: var(--mono); font-weight: 500; }
.footer-copy { color: var(--mute-2); font-size: .85rem; }
.footer-top { font-family: var(--mono); font-size: .8rem; color: var(--mute); transition: color .3s var(--ease-out); }
.footer-top:hover { color: var(--accent); }

/* =============================================================
   15. Reveal animations
   ============================================================= */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }
/* DEFENSIVE: split elements must never stay invisible (gotcha A.4.5) */
.reveal[data-split] { opacity: 1; transform: none; }

/* Split words: visible by default. Animate via CSS only when JS adds .do-split
   (CSS animations run on the compositor — no dependency on rAF being live). */
.split-word { display: inline-block; }
[data-split].do-split .split-word {
  animation: wordIn .8s var(--ease-out) both;
  animation-delay: calc(var(--wi, 0) * 38ms);
}
@keyframes wordIn {
  from { opacity: 0; transform: translateY(0.55em); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  [data-split].do-split .split-word { animation: none; }
}

.is-ready .hero .reveal { transition-delay: .05s; }

/* =============================================================
   16. Reduced motion — only intrusive effects
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .bg-gradient { transition: none; }
  .hero-scroll { display: none; }
}
