/* ============================================================
   MATTMRE.COM — VOLCANIC BRUTALIST
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@300;400;500;600&display=swap');

:root {
  /* default VOLCANIC palette — overridden by data-palette */
  --bg: #0a0706;
  --bg-deep: #050302;
  --surface: #161210;
  --surface-2: #1f1813;
  --line: #2a221c;
  --line-hot: #3a2820;
  --ink: #ece4d3;
  --ink-dim: #8a7d68;
  --ink-faint: #4a4239;
  --hot: #e63824;
  --hot-deep: #a31f12;
  --hot-glow: #ff5a2a;
  --gilt: #d4a574;
  --gilt-deep: #8a6d44;
}

[data-palette="steel"] {
  --bg: #07090c;
  --bg-deep: #030507;
  --surface: #0f1318;
  --surface-2: #161c24;
  --line: #1f2730;
  --line-hot: #2a3540;
  --ink: #e0e6ee;
  --ink-dim: #7a8694;
  --ink-faint: #404a55;
  --hot: #6aa4d4;
  --hot-deep: #2f6da3;
  --hot-glow: #88c0ee;
  --gilt: #b8c4d4;
  --gilt-deep: #6a7585;
}

[data-palette="obsidian"] {
  --bg: #050505;
  --bg-deep: #000000;
  --surface: #0c0a0a;
  --surface-2: #14110f;
  --line: #1d1715;
  --line-hot: #2c1f1c;
  --ink: #d8d0c0;
  --ink-dim: #75695a;
  --ink-faint: #3a342e;
  --hot: #c01818;
  --hot-deep: #7a0a0a;
  --hot-glow: #ff3020;
  --gilt: #b88e54;
  --gilt-deep: #6a4f2a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); }
html { scroll-behavior: smooth; }
body {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.6s ease, color 0.6s ease;
}

/* ============================================================
   PRIMITIVES
   ============================================================ */

.mono { font-family: 'JetBrains Mono', 'Courier New', monospace; }
.display {
  font-family: 'Bebas Neue', 'Arial Narrow', sans-serif;
  letter-spacing: 0.005em;
  line-height: 0.85;
  font-weight: 400;
}

.uppercase { text-transform: uppercase; }
.label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

a { color: inherit; text-decoration: none; }

.hot { color: var(--hot); }
.gilt { color: var(--gilt); }
.dim { color: var(--ink-dim); }

/* ============================================================
   GRAIN OVERLAY
   ============================================================ */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.10;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.95 0 0 0 0 0.9 0 0 0 0 0.8 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ember canvas sits between grain and content */
#embers {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  pointer-events: none;
  opacity: 0.7;
}

html.android-lite #intro-overlay {
  display: none;
}

/* ============================================================
   INTRO OVERLAY
   ============================================================ */
#intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1.1s cubic-bezier(.7,0,.3,1);
}
#intro-overlay.fading { opacity: 0; pointer-events: none; }
#intro-overlay.gone { display: none; }

#intro-overlay video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s ease;
}
#intro-overlay video.ready { opacity: 1; }

.intro-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 30%, rgba(0,0,0,0.85) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.4) 0%, transparent 30%, transparent 70%, rgba(0,0,0,0.9) 100%);
  pointer-events: none;
}

.intro-chrome {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 36px;
  color: #ece4d3;
  pointer-events: none;
}
.intro-chrome > * { pointer-events: auto; }

.intro-mark {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.28em;
  display: flex;
  justify-content: space-between;
  opacity: 0.75;
}
.intro-mark .corner-tick {
  display: inline-flex; gap: 8px; align-items: center;
}
.intro-mark .corner-tick::before { content:''; width:6px; height:6px; background: #e63824; display:inline-block; box-shadow: 0 0 10px #e63824; }

.intro-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(64px, 14vw, 220px);
  line-height: 0.85;
  letter-spacing: 0.02em;
  text-align: center;
  margin: auto;
  opacity: 0;
  transform: translateY(20px);
  animation: intro-rise 1.4s cubic-bezier(.2,.8,.2,1) 0.4s forwards;
}
.intro-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.4em;
  color: #d4a574;
  text-align: center;
  margin-top: 18px;
  opacity: 0;
  animation: intro-rise 1.2s ease 1.1s forwards;
}

@keyframes intro-rise {
  to { opacity: 1; transform: translateY(0); }
}

.intro-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.intro-skip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #ece4d3;
  background: transparent;
  border: 1px solid rgba(236,228,211,0.35);
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.intro-skip:hover {
  background: #e63824;
  border-color: #e63824;
  color: #fff;
}

.intro-progress {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.24em;
  color: rgba(236,228,211,0.6);
  display: flex;
  align-items: center;
  gap: 16px;
}
.intro-progress-bar {
  width: 220px;
  height: 1px;
  background: rgba(236,228,211,0.18);
  position: relative;
  overflow: hidden;
}
.intro-progress-bar::after {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  background: #e63824;
  box-shadow: 0 0 12px #e63824;
  width: var(--p, 0%);
  transition: width 0.1s linear;
}

/* ============================================================
   NAV
   ============================================================ */
header.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  background: linear-gradient(180deg, var(--bg-deep) 0%, transparent 100%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  transition: background 0.4s ease, border-color 0.4s ease;
}
.nav-mark {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 0.08em;
  display: flex; align-items: center; gap: 10px;
}
.nav-mark::before {
  content: ''; width: 8px; height: 8px;
  background: var(--hot);
  box-shadow: 0 0 12px var(--hot);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}
.nav-mark .slash { color: var(--hot); margin: 0 6px; }

.nav-links {
  display: flex; gap: 6px; align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase;
}
.nav-links a {
  padding: 8px 12px;
  color: var(--ink-dim);
  transition: color 0.2s ease;
  display: inline-flex; gap: 6px; align-items: baseline;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--hot); }
.nav-links a .num { color: var(--ink-faint); font-size: 9px; }
.nav-links a:hover .num { color: var(--gilt); }

.nav-progress {
  position: fixed;
  top: 65px; left: 0; right: 0;
  height: 1px;
  background: var(--line);
  z-index: 31;
}
.nav-progress::after {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--hot);
  box-shadow: 0 0 8px var(--hot);
  width: var(--scroll, 0%);
}

/* ============================================================
   LAYOUT
   ============================================================ */
main { position: relative; z-index: 3; }

section {
  position: relative;
  padding: 120px 28px;
  max-width: 1440px;
  margin: 0 auto;
}

.section-head {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
  margin-bottom: 64px;
}
.section-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--hot);
  display: flex; gap: 14px;
}
.section-tag .num { color: var(--ink-dim); }
.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(48px, 6vw, 92px);
  line-height: 0.9;
  letter-spacing: 0.01em;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100vh;
  padding: 120px 28px 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.halo-stage {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.halo {
  width: min(75vmin, 720px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 60%, rgba(255,90,42,0.30) 0%, rgba(230,56,36,0.15) 30%, transparent 60%),
    conic-gradient(from 90deg, transparent 0deg, var(--hot) 80deg, var(--gilt) 180deg, var(--hot) 280deg, transparent 360deg);
  filter: blur(40px);
  opacity: 0.55;
  animation: halo-spin 28s linear infinite;
  transform-origin: center;
}
.halo-ring {
  position: absolute;
  width: min(56vmin, 540px);
  aspect-ratio: 1;
  border: 1px solid var(--line-hot);
  border-radius: 50%;
}
.halo-ring.r2 { width: min(72vmin, 700px); border-color: var(--line); opacity: 0.6; }
.halo-ring.r3 { width: min(40vmin, 380px); border-color: var(--hot-deep); opacity: 0.4; }

@keyframes halo-spin {
  to { transform: rotate(360deg); }
}

.hero-content {
  position: relative; z-index: 2;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

.hero-meta {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 32px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.hero-meta .hot { color: var(--hot); }

.wordmark {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(80px, 19vw, 320px);
  line-height: 0.78;
  letter-spacing: -0.005em;
  font-weight: 400;
  text-align: center;
  position: relative;
  background: linear-gradient(180deg, var(--ink) 0%, var(--ink) 60%, var(--gilt) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 40px rgba(230,56,36,0.18));
  white-space: nowrap;
  max-width: 100%;
}
.wordmark .dot {
  display: inline-block;
  width: 0.18em;
  height: 0.18em;
  margin: 0 0.05em 0.08em;
  background: var(--hot);
  border-radius: 50%;
  -webkit-text-fill-color: var(--hot);
  vertical-align: middle;
  box-shadow: 0 0 30px var(--hot), 0 0 60px var(--hot-deep);
  animation: pulse 2.4s ease-in-out infinite;
}

.hero-tagline {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(20px, 2.4vw, 38px);
  letter-spacing: 0.12em;
  text-align: center;
  margin-top: 24px;
  color: var(--gilt);
}
.hero-tagline .sep { color: var(--hot); margin: 0 14px; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: 96px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.hero-stat {
  background: var(--bg);
  padding: 24px 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.hero-stat .label { color: var(--ink-faint); }
.hero-stat .value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 38px;
  line-height: 1;
  color: var(--ink);
}
.hero-stat .value .accent { color: var(--hot); }
.hero-stat .meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-dim);
  text-transform: uppercase;
}

.scroll-hint {
  position: absolute;
  bottom: 24px; left: 50%; transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--ink-dim);
  text-transform: uppercase;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.scroll-hint .bar {
  width: 1px; height: 40px;
  background: linear-gradient(180deg, var(--ink-dim), transparent);
  animation: scroll-bar 2s ease-in-out infinite;
}
@keyframes scroll-bar {
  0%, 100% { transform: scaleY(1); opacity: 1; }
  50% { transform: scaleY(0.5); opacity: 0.4; }
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: start;
}
.about-portrait {
  position: relative;
  aspect-ratio: 3/4;
  background: var(--surface);
  overflow: hidden;
  border: 1px solid var(--line);
}
.about-portrait img {
  width: 100%; height: 100%; object-fit: cover;
  filter: contrast(1.05) saturate(0.9);
}
.about-portrait::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, var(--bg) 100%),
              linear-gradient(0deg, transparent 60%, rgba(230,56,36,0.1) 100%);
  pointer-events: none;
}
.portrait-tag {
  position: absolute;
  bottom: 18px; left: 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gilt);
  display: flex; flex-direction: column; gap: 4px;
}
.portrait-tag .row { display: flex; gap: 10px; }
.portrait-tag .k { color: var(--ink-faint); }

.bio {
  font-size: 19px;
  line-height: 1.7;
  color: var(--ink);
  font-weight: 300;
}
.bio p + p { margin-top: 1.2em; }
.bio strong { color: var(--hot); font-weight: 600; }
.bio em { color: var(--gilt); font-style: normal; }

.bio-creed {
  margin-top: 32px;
  padding: 24px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 24px;
}
.creed-item .label { display: block; margin-bottom: 4px; color: var(--hot); }
.creed-item .v { font-family: 'Bebas Neue', sans-serif; font-size: 22px; letter-spacing: 0.03em; }

/* ============================================================
   NOW
   ============================================================ */
.now-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.now-cell {
  background: var(--surface);
  padding: 36px 32px;
  display: flex; flex-direction: column; gap: 18px;
  position: relative;
  transition: background 0.3s ease;
}
.now-cell:hover { background: var(--surface-2); }
.now-cell::before {
  content: attr(data-idx);
  position: absolute;
  top: 14px; right: 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.18em;
}
.now-cell .glyph {
  width: 28px; height: 28px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.now-cell .glyph svg { width: 100%; height: 100%; stroke: var(--hot); fill: none; stroke-width: 1.5; }
.now-cell h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  letter-spacing: 0.02em;
  line-height: 1;
}
.now-cell p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-dim);
}
.now-cell .meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gilt);
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* ============================================================
   WORK / PROJECTS
   ============================================================ */
.work-list { display: flex; flex-direction: column; gap: 32px; }

.project {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 32px;
  align-items: stretch;
  position: relative;
}
.project-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 72px;
  line-height: 1;
  color: var(--ink-faint);
  padding-top: 4px;
  transition: color 0.3s ease;
}
.project:hover .project-num { color: var(--hot); }

.project-body {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.3s ease, transform 0.4s cubic-bezier(.2,.8,.2,1);
}
.project:hover .project-body {
  border-color: var(--hot-deep);
  transform: translateX(-4px);
}

.project-preview {
  position: relative;
  aspect-ratio: 1200/600;
  overflow: hidden;
  background: var(--bg-deep);
}
.project-preview img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s cubic-bezier(.2,.8,.2,1);
}
.project:hover .project-preview img { transform: scale(1.04); }
.project-preview::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 60%, var(--surface) 100%);
  pointer-events: none;
}

.project-meta {
  padding: 28px 32px;
  display: flex; flex-direction: column;
  gap: 14px;
}
.project-stack {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--gilt);
  text-transform: uppercase;
  display: flex; gap: 14px; flex-wrap: wrap;
}
.project-stack .dot { color: var(--ink-faint); }
.project h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 38px;
  line-height: 0.95;
  letter-spacing: 0.01em;
}
.project .tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--hot);
  text-transform: uppercase;
}
.project p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-dim);
}
.project-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.project-cta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--ink);
  text-transform: uppercase;
  display: inline-flex; gap: 10px; align-items: center;
  transition: color 0.2s ease, gap 0.2s ease;
}
.project-cta::after { content: '→'; color: var(--hot); transition: transform 0.2s ease; }
.project-cta:hover { color: var(--hot); gap: 14px; }
.project-stats {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-block {
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.contact-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 75% 50%, rgba(230,56,36,0.18) 0%, transparent 50%),
    radial-gradient(circle at 15% 80%, rgba(212,165,116,0.10) 0%, transparent 40%);
  pointer-events: none;
}
.contact-inner { position: relative; padding: 64px 56px; z-index: 1; }

.contact-cta {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(48px, 7vw, 110px);
  line-height: 0.88;
  letter-spacing: 0.005em;
  margin-bottom: 32px;
  max-width: 900px;
}
.contact-cta .l2 { color: var(--hot); }
.contact-cta .l3 { color: var(--gilt); }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
}
.contact-cell {
  background: var(--surface);
  padding: 28px 24px;
  display: flex; flex-direction: column; gap: 10px;
  transition: background 0.2s ease;
}
.contact-cell:hover { background: var(--surface-2); }
.contact-cell .v {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.contact-cell:hover .v { color: var(--hot); }
.contact-cell .meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  position: relative;
  z-index: 3;
  padding: 40px 28px 30px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
footer .hot { color: var(--hot); }
footer .sigil { display: inline-flex; gap: 6px; align-items: center; }
footer .sigil::before { content:''; width:5px;height:5px; background:var(--hot); box-shadow: 0 0 8px var(--hot); }
footer .footer-sigil {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: inherit; letter-spacing: inherit;
  text-transform: inherit;
}
footer .footer-sigil:hover { color: var(--hot); }

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

.reveal-mask {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.1s cubic-bezier(.2,.8,.2,1);
}
.reveal-mask.in { clip-path: inset(0 0 0 0); }

/* ============================================================
   TWEAKS PANEL
   ============================================================ */
.tweaks-panel {
  position: fixed;
  right: 18px; bottom: 18px;
  z-index: 50;
  width: 260px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}
.tweaks-panel.hidden { display: none; }
.tweaks-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  cursor: move;
  background: var(--bg-deep);
}
.tweaks-head b { color: var(--hot); font-weight: 600; letter-spacing: 0.22em; }
.tweaks-x {
  background: none; border: 0; color: var(--ink-dim);
  font-family: inherit; font-size: 14px; cursor: pointer; padding: 0 4px;
}
.tweaks-x:hover { color: var(--hot); }
.tweaks-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 14px; }
.tweaks-section { color: var(--ink-faint); font-size: 10px; letter-spacing: 0.22em; }
.tweaks-row { display: flex; flex-direction: column; gap: 6px; }
.tweaks-label { color: var(--ink-dim); }
.tweaks-radio { display: flex; gap: 0; border: 1px solid var(--line); }
.tweaks-radio button {
  flex: 1; background: transparent; border: 0; border-right: 1px solid var(--line);
  color: var(--ink-dim); font-family: inherit; font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; padding: 7px 4px; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.tweaks-radio button:last-child { border-right: 0; }
.tweaks-radio button:hover { color: var(--ink); }
.tweaks-radio button.on { background: var(--hot); color: #fff; }
.tweaks-toggle {
  display: flex; justify-content: space-between; align-items: center;
}
.tweaks-toggle button {
  position: relative; width: 36px; height: 18px; border-radius: 9px;
  background: var(--line); border: 0; padding: 0; cursor: pointer;
  transition: background 0.15s ease;
}
.tweaks-toggle button[aria-checked="true"] { background: var(--hot); }
.tweaks-toggle button i {
  position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--ink); transition: transform 0.15s ease;
}
.tweaks-toggle button[aria-checked="true"] i { transform: translateX(18px); }
.tweaks-btn {
  background: transparent; border: 1px solid var(--line); color: var(--ink);
  font-family: inherit; font-size: 10px; letter-spacing: 0.22em;
  text-transform: uppercase; padding: 9px 10px; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.tweaks-btn:hover { background: var(--hot); border-color: var(--hot); color: #fff; }

/* ============================================================
   PREFERS-REDUCED-MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .halo { animation: none; }
  #embers { display: none; }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  section { padding: 80px 20px; }
  .section-head { grid-template-columns: 1fr; gap: 18px; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-portrait { aspect-ratio: 4/3; max-height: 540px; }
  .now-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .project { grid-template-columns: 60px 1fr; gap: 16px; }
  .project-num { font-size: 44px; }
  .project-body { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-inner { padding: 36px 24px; }
  .nav-links { display: none; }
  .intro-chrome { padding: 20px 18px; }
  .intro-progress-bar { width: 120px; }
  footer { flex-direction: column; gap: 8px; text-align: center; }
}

@media (max-width: 640px) {
  section { padding: 72px 16px; }
  .hero { padding: 108px 16px 72px; }
  .hero-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .project {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .project-num {
    font-size: 36px;
    padding-top: 0;
  }
  .project-body,
  .project-preview,
  .project-meta {
    min-width: 0;
    width: 100%;
  }
  .project-meta {
    padding: 24px 22px;
  }
  .project-stack,
  .project .tag,
  .project-stats,
  .contact-cell .v {
    overflow-wrap: anywhere;
  }
  .project-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .intro-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }
}
