:root {
  --bg: #0c0c0e; --surface: #141417; --text: #e8e6e1; --muted: #8d8a84; --accent: #c8323a; --accentSoft: #6f9cc9;
  --line: rgba(255,255,255,.08); --serif: "Cormorant Garamond", "Times New Roman", serif; --jp: "Shippori Mincho", serif; --sans: "Inter", system-ui, sans-serif;
  --ease: cubic-bezier(.2,.7,.2,1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 54px; } /* sticky nav height */
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body.ready main, body.ready .nav { opacity: 1; }
main, .nav { opacity: 0; transition: opacity .6s var(--ease); }
body { background: var(--bg); color: var(--text); font: 400 15px/1.6 var(--serif); -webkit-font-smoothing: antialiased; overflow-x: hidden;
  background-image: radial-gradient(ellipse 60% 40% at 20% 10%, rgba(255,255,255,.035), transparent 60%), radial-gradient(ellipse 50% 50% at 85% 30%, rgba(255,255,255,.03), transparent 60%); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }
svg { width: 1em; height: 1em; fill: currentColor; display: block; }

/* paper / ink texture over everything (optional image, falls back to noise) */
.texture { position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: .06; background-size: 420px; will-change: transform;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E"); }

/* ---------- type helpers ---------- */
.label, .num, .chip, .btn, .jp-list, .view-all, .card-meta span, .social-text small, .stat span, .filters, .footer { font-family: var(--sans); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; }
.num { color: var(--muted); font-size: 12px; letter-spacing: .1em; }
.rule { flex: 1; height: 1px; background: var(--line); max-width: 200px; }
.muted { color: var(--muted); }
.stroke { display: inline-block; width: 28px; height: 10px; margin-left: 12px; vertical-align: middle; background: var(--accent); clip-path: polygon(0 55%, 60% 30%, 100% 40%, 55% 75%, 20% 70%); opacity: .8; }
h2 { font: 500 30px/1 var(--serif); letter-spacing: .04em; text-transform: uppercase; }
.section-head { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.arrow { margin-left: 8px; transition: transform .35s var(--ease); }
a:hover .arrow, button:hover .arrow { transform: translateX(4px); }

/* ---------- layout / sections ---------- */
.section { position: relative; padding: 36px 48px; border-bottom: 1px solid var(--line); overflow: hidden; isolation: isolate; contain: paint; }
.section > :not(.art, .side-note) { position: relative; z-index: 2; }
.row-2 { display: grid; grid-template-columns: 57fr 43fr; border-bottom: 1px solid var(--line); }
.row-2 > .section { border-bottom: 0; }
.row-2 > .section + .section { border-left: 1px solid var(--line); }

/* art layers: independent images with masks/gradients, parallax via JS */
.art { position: absolute; inset: -6% 0; z-index: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity 1.2s var(--ease); will-change: transform; pointer-events: none; }
.art-empty { opacity: 1; background: radial-gradient(ellipse at 70% 40%, rgba(255,255,255,.06), transparent 55%), radial-gradient(ellipse at 30% 90%, rgba(255,255,255,.04), transparent 50%); }
.art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,12,14,.35), transparent 25%, transparent 75%, rgba(12,12,14,.5)); }
.art-hero { left: 34%; right: 0; -webkit-mask: linear-gradient(90deg, transparent, #000 18%, #000 88%, transparent), linear-gradient(180deg, transparent, #000 22%, #000 80%, transparent); -webkit-mask-composite: source-in; mask: linear-gradient(90deg, transparent, #000 18%, #000 88%, transparent), linear-gradient(180deg, transparent, #000 22%, #000 80%, transparent); mask-composite: intersect; background-position: center top; }
.art-figure { top: 6%; bottom: 0; left: 52%; right: 13%; background-repeat: no-repeat; z-index: 1; -webkit-mask: linear-gradient(180deg, #000 70%, transparent); mask: linear-gradient(180deg, #000 70%, transparent); }
.art-figure::after { display: none; }
.art-figure-about { top: 0; bottom: -4%; left: 34%; right: 12%; -webkit-mask: linear-gradient(180deg, #000 72%, transparent 97%); mask: linear-gradient(180deg, #000 72%, transparent 97%); }
.art-figure-skills { top: 0; bottom: -10%; left: 40%; right: -10%; -webkit-mask: linear-gradient(90deg, transparent, #000 30%), linear-gradient(180deg, #000 60%, transparent); -webkit-mask-composite: source-in; mask: linear-gradient(90deg, transparent, #000 30%), linear-gradient(180deg, #000 60%, transparent); mask-composite: intersect; }
.art-figure-projects { top: 0; bottom: 0; left: 0; right: 66%; -webkit-mask: linear-gradient(90deg, #000 55%, transparent); mask: linear-gradient(90deg, #000 55%, transparent); }
.art-figure-projects-b { top: 10%; bottom: 0; left: 80%; right: -4%; -webkit-mask: linear-gradient(90deg, transparent, #000 30%), linear-gradient(180deg, #000 60%, transparent); -webkit-mask-composite: source-in; mask: linear-gradient(90deg, transparent, #000 30%), linear-gradient(180deg, #000 60%, transparent); mask-composite: intersect; }
.art-figure-contact { top: 0; bottom: 0; left: 70%; right: 0; -webkit-mask: linear-gradient(180deg, #000 60%, transparent); mask: linear-gradient(180deg, #000 60%, transparent); }
.art-about::after { background: radial-gradient(ellipse 34% 46% at 50% 58%, rgba(12,12,14,.92), rgba(12,12,14,.5) 55%, transparent 75%); } /* dark halo so the bolts sit behind the figure */
.art-about::after { background: radial-gradient(ellipse 36% 48% at 50% 55%, rgba(12,12,14,.92), rgba(12,12,14,.5) 55%, transparent 75%); } /* dark halo: bolts sit behind the figure */
.art-about { left: 44%; right: 18%; -webkit-mask: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent), linear-gradient(180deg, transparent, #000 20%, #000 80%, transparent); -webkit-mask-composite: source-in; mask: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent), linear-gradient(180deg, transparent, #000 20%, #000 80%, transparent); mask-composite: intersect; }
.art-skills { left: 68%; -webkit-mask: linear-gradient(90deg, transparent, #000 45%); mask: linear-gradient(90deg, transparent, #000 45%); }
.art-projects { right: 76%; -webkit-mask: linear-gradient(90deg, #000 55%, transparent); mask: linear-gradient(90deg, #000 55%, transparent); background-position: left center; }
.art-contact { left: 64%; right: 12%; -webkit-mask: linear-gradient(90deg, transparent, #000 30%, #000 85%, transparent); mask: linear-gradient(90deg, transparent, #000 30%, #000 85%, transparent); background-position: right bottom; }

/* vertical japanese side notes */
.side-note { position: absolute; z-index: 3; text-align: right; color: var(--muted); font-family: var(--jp); }
.side-note > * { display: block; margin-bottom: 14px; }
.jp-vertical { display: inline-block; width: 1em; word-break: break-all; line-height: 1.35; font-size: 20px; text-align: center; color: var(--text); opacity: .9; }
.side-rule { display: inline-block; }
.jp-quote { font-size: 13px; letter-spacing: .1em; }
.jp-list { font-size: 9px; line-height: 1.9; text-align: right; }
.side-rule { width: 1px; height: 60px; background: var(--line); position: relative; }
.side-rule::after { content: "✦"; position: absolute; bottom: -8px; left: -5px; font-size: 9px; color: var(--text); }
.side-note-hero { right: 48px; top: 110px; }
.side-note-about { right: 60px; top: 90px; }
.side-note-projects { left: 48px; top: 140px; text-align: left; }
.side-note-contact { right: 48px; top: 32px; }

/* ---------- nav ---------- */
.progress { position: absolute; left: 0; bottom: -1px; height: 1px; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.nav { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 40px; height: 54px; padding: 0 48px; border-bottom: 1px solid var(--line); background: rgba(12,12,14,.88); backdrop-filter: blur(6px); }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo { height: 22px; width: auto; filter: saturate(.85); }
.brand-name { font: 500 12px var(--sans); letter-spacing: .32em; }
.nav-links { display: flex; gap: 32px; font: 500 14px var(--serif); letter-spacing: .04em; }
.nav-links a { position: relative; padding: 4px 0; opacity: .75; transition: opacity .3s; }
.nav-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease); }
.nav-links a:hover, .nav-links a.is-active { opacity: 1; color: #fff; }
.nav-links a.is-active::after { transform: scaleX(1); }
.nav-social { margin-left: auto; display: flex; gap: 18px; }
.icon-btn { font-size: 17px; opacity: .85; transition: opacity .3s, transform .3s var(--ease); }
.icon-btn:hover { opacity: 1; transform: translateY(-2px); }
.nav-toggle { display: none; margin-left: auto; width: 32px; height: 24px; flex-direction: column; justify-content: center; gap: 6px; }
.nav-toggle span { height: 1px; background: var(--text); }

/* ---------- hero ---------- */
.hero { min-height: 430px; padding: 40px 48px 32px 110px; }
.art-hero { top: 0; bottom: 0; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 440px) 120px 1fr; gap: 28px; align-items: start; padding-top: 24px; }
.hero-copy .label { display: flex; align-items: center; gap: 12px; color: var(--muted); margin-bottom: 6px; }
.hero-copy .label .num { position: absolute; left: -60px; }
.hero-copy { position: relative; }
.hero-name { font: 500 clamp(60px, 6.6vw, 104px)/1 var(--serif); letter-spacing: -.005em; margin-bottom: 14px; position: relative; }
.hero-name::after { content: ""; position: absolute; left: 44%; top: 55%; width: 60px; height: 20px; background: var(--accent); opacity: 0; clip-path: polygon(0 50%, 70% 10%, 100% 35%, 60% 80%, 15% 85%); filter: blur(.5px); pointer-events: none; transform: scaleX(0); transform-origin: left; transition: opacity .3s .9s, transform .5s .9s var(--ease); }
body.ready .hero-name::after { opacity: .55; transform: none; }
.hero-intro { max-width: 430px; font-size: 14px; line-height: 1.5; margin-bottom: 16px; }
.btn-row { display: flex; gap: 14px; margin-bottom: 14px; }
.btn { display: inline-flex; align-items: center; padding: 11px 22px; border: 1px solid rgba(255,255,255,.22); background: rgba(20,20,23,.6); transition: border-color .35s, background .35s, transform .35s var(--ease); }
.btn:hover { border-color: rgba(255,255,255,.5); transform: translateY(-2px); }
.btn-primary { border-color: var(--accent); color: #f0d9da; }
.btn-primary:hover { background: rgba(200,50,58,.18); border-color: var(--accent); }
.tagline { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-family: var(--sans); }
.hero-insets { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; }
.inset { width: 118px; height: 76px; border: 1px solid rgba(255,255,255,.14); background: var(--surface) center/cover; position: relative; opacity: 1 !important; }
.inset.art-empty { background: linear-gradient(135deg, #1a1a1e, #0e0e11); }
.inset.is-loaded { }

/* ---------- about ---------- */
.about { padding-right: 160px; }
.about-body { max-width: 300px; }
.about-body p { margin-bottom: 14px; line-height: 1.55; }
.stats { display: flex; gap: 56px; margin-top: 22px; }
.stat strong { display: block; font: 600 26px/1.1 var(--serif); }
.stat span { color: var(--muted); letter-spacing: .06em; text-transform: none; font-size: 12px; white-space: nowrap; }

/* ---------- skills ---------- */
.skill-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 400px; }
.skill-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); background: rgba(20,20,23,.75); font-size: 14px; transition: border-color .35s, transform .35s var(--ease), background .35s; }
.skill-card:hover { border-color: rgba(255,255,255,.3); background: rgba(28,28,32,.9); transform: translateY(-2px); }
.skill-icon { font-size: 20px; color: var(--accentSoft); opacity: .9; }
.quote-line { margin-top: 18px; text-align: right; max-width: 400px; color: var(--muted); font-family: var(--sans); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.quote-line .stroke { margin: 0 12px 0 0; }

/* ---------- projects ---------- */
.projects { padding-left: 300px; padding-right: 230px; min-height: 300px; }
.projects .section-head h2 { margin-right: 10px; }
.filters { display: flex; gap: 4px; }
.chip { padding: 6px 12px; color: var(--muted); border-radius: 2px; transition: color .3s, background .3s; }
.chip:hover { color: var(--text); }
.chip.is-active { background: var(--accent); color: #fff; }
.view-all { margin-left: auto; color: var(--muted); letter-spacing: .1em; }
.view-all:hover { color: var(--text); }
.project-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.card { background: rgba(20,20,23,.85); border: 1px solid var(--line); overflow: hidden; transition: transform .45s var(--ease), border-color .45s, box-shadow .45s; }
.card:hover { transform: translateY(-4px); border-color: rgba(255,255,255,.25); box-shadow: 0 20px 40px -20px rgba(0,0,0,.8); }
.thumb { position: relative; display: block; width: 100%; aspect-ratio: 16/9; overflow: hidden; background: #000; }
.thumb .preview { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); border: 0; pointer-events: none; animation: fadein .6s var(--ease); }
.thumb img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.9); transition: transform .8s var(--ease), filter .5s; }
.card:hover .thumb img { transform: scale(1.06); filter: saturate(1.05); }
.play { position: absolute; inset: 0; margin: auto; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(10,10,12,.7); border: 1px solid rgba(255,255,255,.5); font-size: 16px; color: #fff; transition: transform .4s var(--ease), background .4s; }
.card:hover .play { transform: scale(1.12); background: var(--accent); border-color: var(--accent); }
.badge { position: absolute; top: 6px; left: 6px; font: 500 9px var(--sans); letter-spacing: .08em; text-transform: uppercase; padding: 3px 6px; background: rgba(10,10,12,.8); border: 1px solid rgba(255,255,255,.2); }
.card-meta { padding: 10px 12px 12px; }
.card-meta h3 { font: 500 14px/1.3 var(--serif); margin-bottom: 3px; }
.card-meta span { color: var(--muted); letter-spacing: .08em; font-size: 10px; }
.card.reveal { transition-delay: calc(var(--i) * 60ms); }

/* ---------- contact ---------- */
.contact { padding: 36px 360px 44px 100px; min-height: 360px; }
.contact-body h3 { font: 500 20px var(--serif); margin-bottom: 4px; }
.contact-body .muted { font-size: 13px; margin-bottom: 6px; }
.pay-line { font: 500 10px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
.pay-line:empty { display: none; }
.social-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.social-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); background: rgba(20,20,23,.85); text-align: left; transition: border-color .35s, transform .35s var(--ease), background .35s; }
.social-card:hover { border-color: rgba(255,255,255,.3); transform: translateY(-3px); background: rgba(28,28,32,.95); }
.social-icon { font-size: 18px; }
.brand-x .social-icon, .icon-btn.brand-x { color: #fff; } .brand-youtube .social-icon, .icon-btn.brand-youtube { color: #e0343a; } .brand-discord .social-icon, .icon-btn.brand-discord { color: #7a8cf0; } .brand-roblox .social-icon, .icon-btn.brand-roblox { color: #d4d4d4; } .brand-github .social-icon, .icon-btn.brand-github { color: #fff; }
.social-text { display: flex; flex-direction: column; line-height: 1.3; flex: 1; min-width: 0; }
.social-text strong { font: 500 13px var(--serif); }
.social-text small { color: var(--muted); font-size: 9px; letter-spacing: .06em; text-transform: none; }
.social-card .arrow { color: var(--muted); }
.footer { padding: 18px 48px; color: var(--muted); font-size: 10px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- modal / toast ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(5,5,6,.92); }
body.video-open .texture, body.video-open .art { display: none; } /* nothing composited over the player */
.modal-box { position: relative; width: min(96vw, calc((100vh - 120px) * 16 / 9), 1400px); animation: pop .4s var(--ease); }
.modal-frame { aspect-ratio: 16/9; background: #000; border: 1px solid rgba(255,255,255,.15); }
.modal-frame iframe { width: 100%; height: 100%; border: 0; }
.modal-title { margin-top: 12px; font-size: 16px; }
.modal-close { position: absolute; top: -40px; right: 0; font-size: 28px; line-height: 1; opacity: .7; }
.modal-close:hover { opacity: 1; }
@keyframes fadein { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; padding: 10px 18px; background: var(--surface); border: 1px solid var(--line); font: 500 12px var(--sans); letter-spacing: .06em; transition: .35s var(--ease); z-index: 110; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .project-grid { grid-template-columns: repeat(4, 1fr); }
  .projects { padding-left: 220px; }
  .social-grid { grid-template-columns: repeat(3, 1fr); }
  .contact { padding-right: 120px; }
}
@media (max-width: 900px) {
  .section { padding: 32px 24px; }
  .hero { padding: 32px 24px 60px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-insets { flex-direction: row; }
  .art-hero { left: 0; -webkit-mask: linear-gradient(180deg, transparent 10%, #000 60%); mask: linear-gradient(180deg, transparent 10%, #000 60%); }
  .side-note { display: none; }
  .art.is-loaded { opacity: .3 !important; }
  .art-figure { left: 30%; right: 0; top: 0; bottom: 45%; opacity: .5 !important; }
  .art-figure-projects, .art-figure-projects-b, .art-figure-skills, .art-figure-about, .art-figure-contact { display: none; } /* keep text readable over art on phones */
  .row-2 { grid-template-columns: 1fr; }
  .row-2 > .section + .section { border-left: 0; border-top: 1px solid var(--line); }
  .about { padding-right: 24px; }
  .projects { padding-left: 24px; padding-right: 24px; }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .contact { padding: 32px 24px; }
  .social-grid { grid-template-columns: repeat(2, 1fr); }
  .section-head { flex-wrap: wrap; }
  .filters { width: 100%; order: 3; flex-wrap: wrap; }
  .nav { padding: 0 20px; gap: 16px; }
  .nav-toggle { display: flex; }
  .nav-social { display: none; }
  .nav-links { position: absolute; top: 54px; left: 0; right: 0; flex-direction: column; gap: 0; background: rgba(12,12,14,.97); border-bottom: 1px solid var(--line); display: none; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 20px; border-top: 1px solid var(--line); }
  .btn-row { flex-wrap: wrap; }
}
@media (max-width: 520px) {
  .project-grid, .social-grid, .skill-grid { grid-template-columns: 1fr; }
  .stats { gap: 24px; }
  .hero-name { font-size: 48px; }
}
