/* ========== TOKENS ========== */
:root {
  --bg: #f4efe6;
  --bg-2: #ebe4d6;
  --ink: #141210;
  --muted: #5d574e;
  --line: #141210;
  --accent: #ff4d1c;
  --accent-2: #2b50ff;
  --card: #fffaf1;
  --radius: 22px;
  --display: "Syne", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --pad: clamp(16px, 5vw, 72px);
}
:root[data-theme="dark"] {
  --bg: #0f0e0c;
  --bg-2: #1a1815;
  --ink: #f4efe6;
  --muted: #a39b8e;
  --line: #f4efe6;
  --card: #1c1a17;
}

/* ========== BASE ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background .4s, color .4s;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
.mono { font-family: var(--mono); font-size: .8rem; letter-spacing: .02em; }
.accent { color: var(--accent); font-style: normal; }
.outline { color: transparent; -webkit-text-stroke: 1.5px var(--ink); }
::selection { background: var(--accent); color: #fff; }

/* grain overlay */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* custom cursor (desktop only) */
.cursor {
  position: fixed; top: 0; left: 0; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); pointer-events: none; z-index: 200; mix-blend-mode: difference;
  transform: translate(-50%, -50%); transition: width .25s, height .25s, opacity .25s; opacity: 0;
}
.cursor.big { width: 64px; height: 64px; }
@media (hover: none) { .cursor { display: none; } }

/* ========== NAV ========== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 18px var(--pad);
  transition: background .3s, padding .3s, box-shadow .3s;
}
.nav.scrolled { background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); padding-block: 12px; box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 12%, transparent); }
.logo { font-family: var(--display); font-weight: 800; font-size: 1.5rem; margin-right: auto; }
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 28px; font-weight: 500; }
.nav-links a { position: relative; }
.nav-links a::after { content: ""; position: absolute; left: 0; bottom: -4px; height: 2px; width: 0; background: var(--accent); transition: width .3s; }
.nav-links a:hover::after { width: 100%; }
.theme-toggle { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line); background: none; color: var(--ink); font-size: 1.1rem; }
.menu-btn { display: none; width: 40px; height: 40px; border: 0; background: none; flex-direction: column; justify-content: center; gap: 6px; }
.menu-btn span { display: block; height: 2px; width: 26px; background: var(--ink); transition: transform .3s; margin-left: auto; }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ========== HERO ========== */
.hero {
  min-height: 100svh; position: relative;
  padding: 130px var(--pad) 60px;
  display: flex; flex-direction: column; justify-content: center;
}
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 28px; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
.hero-title {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(3rem, 11vw, 10.5rem); line-height: .92; letter-spacing: -.03em;
}
.hero-title .line { display: block; overflow: hidden; }
.hero-title .line > span { display: inline-block; transform: translateY(105%); animation: rise 1s cubic-bezier(.2,.8,.2,1) forwards; }
.hero-title .line:nth-child(2) > span { animation-delay: .12s; }
.hero-title .line:nth-child(3) > span { animation-delay: .24s; }
.hero-title .outline { -webkit-text-stroke-width: 2px; }
@keyframes rise { to { transform: translateY(0); } }
.rotator { display: inline-block; transition: opacity .3s, transform .3s; }
.rotator.out { opacity: 0; transform: translateY(-20px); }
.hero-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 32px; margin-top: 48px; opacity: 0; animation: fade 1s .6s forwards; }
@keyframes fade { to { opacity: 1; } }
.hero-intro { max-width: 520px; font-size: 1.12rem; color: var(--muted); }
.hero-intro strong { color: var(--ink); }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 28px; border-radius: 999px; font-weight: 600;
  border: 1.5px solid var(--ink); transition: background .3s, color .3s, transform .2s;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }
.hero-badge { position: absolute; right: var(--pad); top: 120px; width: 150px; height: 150px; }
.hero-badge svg { width: 100%; height: 100%; animation: spin 18s linear infinite; }
.hero-badge text { font-family: var(--mono); font-size: 13.5px; letter-spacing: 3px; fill: var(--ink); }
.badge-core { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2rem; color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== MARQUEE ========== */
.marquee { background: var(--accent); color: #fff; overflow: hidden; padding: 20px 0; transform: rotate(-2deg) scale(1.04); margin: 20px 0 60px; }
.marquee-track { display: flex; gap: 32px; width: max-content; animation: scroll 30s linear infinite; font-family: var(--display); font-weight: 800; font-size: clamp(1.6rem, 4vw, 3rem); text-transform: uppercase; align-items: center; }
.marquee-track i { font-style: normal; font-size: .7em; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ========== SECTIONS ========== */
.section { padding: clamp(70px, 10vw, 140px) var(--pad); }
.section-label { color: var(--muted); text-transform: uppercase; margin-bottom: 28px; display: flex; align-items: center; gap: 12px; }
.section-label::before { content: ""; width: 36px; height: 1.5px; background: var(--accent); }
.section-title { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: clamp(2.6rem, 8vw, 6.5rem); line-height: .95; letter-spacing: -.02em; margin-bottom: 56px; }

/* About */
.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.big-statement { font-family: var(--display); font-weight: 700; font-size: clamp(1.9rem, 4vw, 3.4rem); line-height: 1.1; letter-spacing: -.01em; }
.about-copy p { margin-bottom: 18px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 32px; border-top: 1.5px solid var(--line); padding-top: 24px; }
.stats strong { display: block; font-family: var(--display); font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1; color: var(--accent); }
.stats span { font-size: .85rem; color: var(--muted); }

/* Work */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; }
.filter { padding: 10px 18px; border-radius: 999px; border: 1.5px solid var(--line); background: none; color: var(--ink); text-transform: uppercase; font-size: .75rem; transition: background .25s, color .25s; }
.filter.active, .filter:hover { background: var(--ink); color: var(--bg); }
.projects { display: grid; gap: 28px; }
.project {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s;
}
.project:nth-child(even) .project-visual { order: 2; }
.project:hover { transform: translate(-6px, -6px); box-shadow: 8px 8px 0 var(--ink); }
.project.hidden { display: none; }
.project-visual { min-height: 340px; position: relative; display: grid; place-items: center; overflow: hidden; border-right: 1.5px solid var(--line); }
.project:nth-child(even) .project-visual { border-right: 0; border-left: 1.5px solid var(--line); }
.project-body { padding: clamp(24px, 4vw, 48px); display: flex; flex-direction: column; gap: 16px; }
.project-meta { display: flex; justify-content: space-between; color: var(--muted); text-transform: uppercase; }
.project h3 { font-family: var(--display); font-weight: 800; font-size: clamp(1.8rem, 3.5vw, 2.8rem); line-height: 1; letter-spacing: -.01em; }
.project p { color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.tags li { padding: 5px 12px; border-radius: 999px; background: var(--bg-2); font-size: .72rem; }
.project-link { margin-top: auto; font-weight: 600; display: inline-flex; gap: 8px; align-items: center; align-self: flex-start; border-bottom: 2px solid var(--accent); padding-bottom: 2px; }
.project-link span { transition: transform .25s; }
.project-link:hover span { transform: translateX(6px); }

/* Visual: denim */
.v-denim {
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.05) 0 2px, transparent 2px 5px),
    repeating-linear-gradient(-45deg, rgba(0,0,0,.12) 0 2px, transparent 2px 6px),
    radial-gradient(circle at 30% 30%, #3f63a8, #1d2f5a 70%);
}
.denim-tag { background: #c9a36a; color: #3b2611; font-family: var(--display); font-weight: 800; font-size: 1.9rem; padding: 18px 28px; border-radius: 6px; transform: rotate(-6deg); box-shadow: 0 10px 30px rgba(0,0,0,.35); letter-spacing: .05em; transition: transform .5s; }
.denim-tag span { font-weight: 500; font-style: italic; text-transform: lowercase; }
.project:hover .denim-tag { transform: rotate(3deg) scale(1.05); }
.stitch { position: absolute; inset: 22px; border: 2px dashed #e0a84b; border-radius: 14px; opacity: .8; }

/* Visual: slots */
.v-slots { background: radial-gradient(circle at 50% 40%, #6d28d9, #1e0b3b 75%); flex-direction: column; gap: 20px; display: flex; justify-content: center; align-items: center; }
.reels { display: flex; gap: 10px; padding: 14px; background: #120626; border: 3px solid #f5c542; border-radius: 16px; box-shadow: 0 0 40px rgba(245,197,66,.35); }
.reel { width: 78px; height: 92px; background: linear-gradient(#fff, #e9e3f5 50%, #fff); border-radius: 10px; display: grid; place-items: center; font-size: 2.6rem; overflow: hidden; }
.reel.spinning span { animation: blur-spin .1s linear infinite; }
@keyframes blur-spin { 0% { transform: translateY(-40%); filter: blur(2px); } 100% { transform: translateY(40%); filter: blur(2px); } }
.spin-btn { background: #f5c542; color: #1e0b3b; border: 0; padding: 10px 30px; border-radius: 999px; font-weight: 700; font-size: .9rem; letter-spacing: .15em; box-shadow: 0 4px 0 #b88d14; transition: transform .1s, box-shadow .1s; }
.spin-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #b88d14; }
.win-flash { position: absolute; top: 20px; font-family: var(--display); font-weight: 800; color: #f5c542; font-size: 1.4rem; animation: fade 0.3s; }

/* Visual: loan */
.v-loan { background: linear-gradient(135deg, #0f766e, #134e4a); }
.loan-card { background: #fff; color: #0f172a; border-radius: 18px; padding: 26px; width: min(290px, 85%); box-shadow: 0 20px 40px rgba(0,0,0,.3); display: grid; gap: 10px; }
.loan-card > span { color: #64748b; }
.loan-card strong { font-family: var(--display); font-size: 2.4rem; line-height: 1; }
.loan-card input { accent-color: #0f766e; width: 100%; }
.loan-row { display: flex; justify-content: space-between; padding-top: 10px; border-top: 1px solid #e2e8f0; }
.loan-row b { color: #0f766e; }

/* Visual: migration */
.v-migrate { background: linear-gradient(160deg, #fbbf24, #f97316); }
.path { display: grid; gap: 12px; width: min(300px, 85%); }
.step { display: flex; align-items: center; gap: 14px; background: rgba(255,255,255,.55); border-radius: 12px; padding: 12px 16px; color: #431407; font-weight: 600; transition: transform .3s; }
.step i { width: 30px; height: 30px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-style: normal; font-family: var(--mono); font-size: .8rem; flex-shrink: 0; }
.step.done i { background: #431407; color: #fbbf24; }
.step.active { background: #fff; transform: scale(1.05); box-shadow: 0 10px 24px rgba(67,20,7,.25); }
.project:hover .step:nth-child(2) { transform: translateX(8px); }
.project:hover .step:nth-child(4) { transform: translateX(-8px); }

/* Visual: menu */
.v-menu { background: #2f3e2c; }
.menu-card { background: #f3ead6; color: #2f3e2c; padding: 28px 30px; width: min(260px, 80%); text-align: center; border-radius: 4px; box-shadow: 0 20px 40px rgba(0,0,0,.4); transform: rotate(4deg); transition: transform .5s; outline: 1px solid #b0894f; outline-offset: -10px; }
.project:hover .menu-card { transform: rotate(-2deg) scale(1.04); }
.menu-card h4 { font-family: Georgia, serif; font-size: 1.7rem; font-style: italic; color: #8a4b1f; }
.menu-card hr { border: 0; border-top: 1px solid #b0894f; margin: 12px 0; }
.menu-card p { display: flex; justify-content: space-between; font-family: Georgia, serif; font-size: .95rem; margin: 6px 0; }
.menu-card p span:last-child { color: #8a4b1f; }

/* Skills */
.skill-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.skill-card { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 30px; background: var(--card); position: relative; overflow: hidden; transition: color .35s; isolation: isolate; }
.skill-card::before { content: ""; position: absolute; inset: 0; background: var(--accent); transform: translateY(101%); transition: transform .45s cubic-bezier(.2,.8,.2,1); z-index: -1; }
.skill-card:hover { color: #fff; }
.skill-card:hover::before { transform: translateY(0); }
.skill-icon { font-size: 2rem; display: block; margin-bottom: 18px; }
.skill-card h3 { font-family: var(--display); font-size: 1.5rem; margin-bottom: 14px; }
.skill-card ul { list-style: none; display: grid; gap: 8px; }
.skill-card li { display: flex; align-items: center; gap: 10px; }
.skill-card li::before { content: "→"; font-family: var(--mono); font-size: .8rem; opacity: .6; }

/* Timeline */
.timeline { list-style: none; border-top: 1.5px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 220px 1fr; gap: 24px; padding: 34px 0; border-bottom: 1.5px solid var(--line); transition: padding .3s, background .3s; }
.timeline li:hover { padding-left: 18px; background: var(--bg-2); }
.t-when { color: var(--muted); text-transform: uppercase; padding-top: 8px; }
.t-what h3 { font-family: var(--display); font-size: clamp(1.3rem, 2.5vw, 2rem); line-height: 1.15; margin-bottom: 8px; }
.t-what p { color: var(--muted); max-width: 680px; }

/* Contact */
.contact { background: var(--ink); color: var(--bg); border-radius: 40px 40px 0 0; }
.contact .section-label { color: color-mix(in srgb, var(--bg) 60%, transparent); }
.contact .outline { -webkit-text-stroke-color: var(--bg); }
.contact-title { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: clamp(2.6rem, 9vw, 8rem); line-height: .92; letter-spacing: -.03em; margin-bottom: 64px; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); }
.contact-links p { color: color-mix(in srgb, var(--bg) 70%, transparent); max-width: 420px; margin-bottom: 28px; }
.contact-big { font-family: var(--display); font-size: clamp(1.2rem, 2.6vw, 2rem); font-weight: 700; border-bottom: 2px solid var(--accent); padding-bottom: 6px; word-break: break-all; display: inline-block; }
.contact-big:hover { color: var(--accent); }
.socials { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.socials a { padding: 10px 18px; border: 1.5px solid color-mix(in srgb, var(--bg) 40%, transparent); border-radius: 999px; transition: background .25s, color .25s; }
.socials a:hover { background: var(--bg); color: var(--ink); }
.contact-form { display: grid; gap: 18px; }
.contact-form label { display: grid; gap: 8px; }
.contact-form label span { color: color-mix(in srgb, var(--bg) 60%, transparent); text-transform: uppercase; }
.contact-form input, .contact-form textarea {
  width: 100%; background: transparent; border: 0; border-bottom: 1.5px solid color-mix(in srgb, var(--bg) 40%, transparent);
  color: var(--bg); font: inherit; padding: 10px 0; outline: none; resize: vertical; transition: border-color .25s;
}
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--accent); }
.contact-form ::placeholder { color: color-mix(in srgb, var(--bg) 35%, transparent); }
.contact-form .btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; justify-self: start; margin-top: 8px; }
.contact-form .btn-primary:hover { background: var(--bg); color: var(--ink); border-color: var(--bg); }
.form-status { min-height: 1.2em; color: var(--accent); }

.footer { background: var(--ink); color: color-mix(in srgb, var(--bg) 60%, transparent); display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; padding: 28px var(--pad); border-top: 1px solid color-mix(in srgb, var(--bg) 15%, transparent); }
.footer a:hover { color: var(--accent); }

/* ========== REVEAL ========== */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity .9s cubic-bezier(.2,.8,.2,1), transform .9s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ========== RESPONSIVE ========== */
@media (max-width: 1000px) {
  .skill-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-badge { display: none; }
}
@media (max-width: 820px) {
  .menu-btn { display: flex; }
  .nav-links {
    position: fixed; inset: 0; background: var(--bg); flex-direction: column; justify-content: center; align-items: center; gap: 28px;
    font-family: var(--display); font-size: 2.4rem; font-weight: 800; text-transform: uppercase;
    transform: translateY(-100%); transition: transform .5s cubic-bezier(.2,.8,.2,1); z-index: -1;
  }
  .nav-links.open { transform: none; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .project { grid-template-columns: 1fr; }
  .project:nth-child(even) .project-visual { order: 0; }
  .project-visual, .project:nth-child(even) .project-visual { min-height: 260px; border: 0; border-bottom: 1.5px solid var(--line); }
  .timeline li { grid-template-columns: 1fr; gap: 6px; }
  .contact { border-radius: 28px 28px 0 0; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .skill-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .stats span { font-size: .72rem; }
  .reel { width: 64px; height: 78px; font-size: 2.1rem; }
  .hero-title .outline { -webkit-text-stroke-width: 1.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
