/* =========================================================
   Davide Spaggiari — personal site
   Design system
   ========================================================= */

:root {
  --bg-dark: #0a0a0a;
  --bg-dark-2: #111110;
  --bg-light: #f5f2ec;
  --bg-light-2: #ebe6dc;
  --fg-dark: #0a0a0a;
  --fg-light: #f5f2ec;
  --fg-dim-dark: rgba(245, 242, 236, 0.62);
  --fg-dim-light: rgba(10, 10, 10, 0.62);
  --hairline-dark: rgba(245, 242, 236, 0.12);
  --hairline-light: rgba(10, 10, 10, 0.12);

  /* Accent — oklch ambra dorata, hue variable via tweak */
  --accent-h: 75;
  --accent: oklch(0.78 0.13 var(--accent-h));
  --accent-dim: oklch(0.78 0.13 var(--accent-h) / 0.18);

  --font-serif: 'Fraunces', 'Instrument Serif', Georgia, serif;
  --font-sans: 'Geist', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --fx: 1; /* effects intensity multiplier, 0..1.3 */

  --radius: 14px;
  --radius-lg: 22px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg-dark);
  color: var(--fg-light);
  font-family: var(--font-sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}
html { overflow-x: clip; }

body {
  min-height: 100vh;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; background: none; border: none; color: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

::selection {
  background: var(--accent);
  color: var(--bg-dark);
}

/* ================= Cursor removed ================= */
.cursor-dot, .cursor-ring { display: none !important; }

/* ================= Grain ================= */
.grain {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: calc(0.08 * var(--fx));
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.7 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ================= Aurora ================= */
.aurora {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: calc(0.9 * var(--fx));
  transition: opacity 600ms;
  --mx: 50%; --my: 30%;
  background:
    radial-gradient(600px circle at var(--mx) var(--my), oklch(0.78 0.13 var(--accent-h) / 0.22), transparent 60%),
    radial-gradient(900px circle at calc(var(--mx) + 10%) calc(var(--my) + 20%), oklch(0.65 0.14 calc(var(--accent-h) + 180) / 0.14), transparent 65%);
  filter: blur(40px);
}
body.on-light .aurora { opacity: 0; }

/* ================= Scroll progress ================= */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 10000;
  transition: background 300ms;
}

/* ================= Nav ================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 22px clamp(20px, 5vw, 64px);
  display: flex; align-items: center; justify-content: space-between;
  transition: background 400ms var(--ease-out), backdrop-filter 400ms, padding 400ms;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg-dark) 72%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  padding-top: 14px; padding-bottom: 14px;
  border-bottom: 1px solid var(--hairline-dark);
}
body.on-light .nav.scrolled {
  background: color-mix(in srgb, var(--bg-light) 72%, transparent);
  border-bottom: 1px solid var(--hairline-light);
}
body.on-light .nav { color: var(--fg-dark); }

.nav-brand {
  font-family: var(--font-serif);
  font-size: 26px;
  letter-spacing: -0.01em;
  font-style: italic;
  font-weight: 400;
}
.nav-brand span { color: var(--accent); }

.nav-links {
  display: flex; gap: clamp(14px, 2.5vw, 32px);
  align-items: center;
  font-size: 13px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.nav-links a { position: relative; padding: 6px 2px; opacity: 0.78; transition: opacity 200ms; }
.nav-links a:hover { opacity: 1; }
.nav-links a::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 0; height: 1px; background: currentColor;
  transition: width 260ms var(--ease-out);
}
.nav-links a:hover::after { width: 100%; }

.nav-cta {
  padding: 9px 16px !important;
  border: 1px solid var(--hairline-dark);
  border-radius: 999px;
  opacity: 1 !important;
  background: var(--accent-dim);
  color: var(--fg-light);
  transition: background 240ms, border-color 240ms, color 240ms;
}
.nav-cta:hover { background: var(--accent); color: var(--bg-dark); border-color: var(--accent); }
.nav-cta::after { display: none; }
body.on-light .nav-cta { color: var(--fg-dark); border-color: var(--hairline-light); }

@media (max-width: 720px) {
  .nav-links a:not(.nav-cta) { display: none; }
  /* Tighter vertical spacing on mobile \u2014 reduces big empty gaps between sections */
  section { padding: clamp(44px, 7vh, 72px) clamp(18px, 5vw, 32px); }
  .hero { padding-top: clamp(72px, 12vh, 100px); min-height: auto; }
  .hero-title { margin-top: 18px !important; }
  .hero-tagline { margin-top: 14px; }
  .hero-footer { padding-top: 18px; margin-top: 24px; }
  .hero-photo { margin: 18px 0 0 !important; }
  #lyteboard { padding-top: clamp(32px, 5vh, 56px); padding-bottom: clamp(40px, 6vh, 64px); }
  #experience { padding-top: clamp(32px, 5vh, 56px); }
  #skills { padding-bottom: clamp(44px, 6vh, 64px); }
  #values { padding-top: clamp(36px, 5vh, 56px); padding-bottom: clamp(44px, 6vh, 64px); }
  .confindustria { padding-top: clamp(40px, 6vh, 64px) !important; padding-bottom: clamp(36px, 5vh, 56px) !important; }
  .contact { padding-top: clamp(44px, 6vh, 64px) !important; }
}

/* ================= Section primitives ================= */
section {
  position: relative;
  padding: clamp(90px, 14vh, 160px) clamp(20px, 5vw, 64px);
  z-index: 1;
}
.section-dark { background: var(--bg-dark); color: var(--fg-light); }
.section-light { background: var(--bg-light); color: var(--fg-dark); }

.container { max-width: 1280px; margin: 0 auto; }
.container-narrow { max-width: 860px; margin: 0 auto; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.6;
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before {
  content: ''; width: 22px; height: 1px; background: currentColor; opacity: 0.6;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.02;
}
h1 { font-size: clamp(58px, 11vw, 172px); }
h2 { font-size: clamp(40px, 6.5vw, 84px); line-height: 1; }
h3 { font-size: clamp(24px, 2.6vw, 34px); line-height: 1.1; }

.subhead {
  font-family: var(--font-sans);
  font-size: clamp(16px, 1.25vw, 19px);
  max-width: 62ch;
  line-height: 1.55;
  opacity: 0.78;
  font-weight: 400;
}

/* ================= Reveal ================= */
[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out);
  transition-delay: var(--delay, 0ms);
}
[data-reveal].in {
  opacity: 1;
  transform: translateY(0);
}

/* ================= Hero ================= */
.hero {
  min-height: 100svh;
  padding-top: clamp(120px, 18vh, 180px);
  padding-bottom: clamp(40px, 8vh, 80px);
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative;
}

.hero-meta {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.55;
  gap: 20px;
  flex-wrap: wrap;
}

.hero-main {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: end;
  margin: auto 0;
  padding: clamp(20px, 5vh, 60px) 0;
}

@media (max-width: 900px) {
  .hero-main { grid-template-columns: 1fr; gap: 48px; align-items: start; }
}

.hero-title {
  font-size: clamp(40px, 6vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  font-style: italic;
  max-width: 18ch;
}
.hero-title .line { display: block; overflow: hidden; }
.hero-title .word {
  display: inline-block;
  transform: translateY(110%);
  animation: heroRise 1.2s var(--ease-out) forwards;
}
.hero-title .word.delay-1 { animation-delay: 120ms; }
.hero-title .word.delay-2 { animation-delay: 240ms; }
.hero-title em {
  font-style: normal;
  color: var(--accent);
}
@keyframes heroRise {
  to { transform: translateY(0); }
}

.hero-photo {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,0.8), 0 0 0 1px var(--hairline-dark);
  will-change: transform;
}
.hero-photo img {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.05);
  transition: transform 600ms var(--ease-out);
  will-change: transform;
}
.hero-photo:hover img { transform: scale(1.1); }
.hero-photo::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,0.5));
  pointer-events: none;
}

.hero-tagline {
  font-family: var(--font-sans);
  font-size: clamp(15px, 1.15vw, 17px);
  line-height: 1.5;
  opacity: 0.72;
  max-width: 42ch;
  margin-top: 24px;
}
.hero-tagline strong { color: var(--accent); font-weight: 500; }

.hero-footer {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 32px; flex-wrap: wrap;
  padding-top: 32px;
  border-top: 1px solid var(--hairline-dark);
}
.hero-footer-item {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.6;
  display: flex; flex-direction: column; gap: 6px;
}
.hero-footer-item strong { font-family: var(--font-sans); font-size: 16px; font-weight: 500; opacity: 1; text-transform: none; letter-spacing: -0.01em; }

.scroll-indicator {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase;
  opacity: 0.5;
}
.scroll-indicator .line {
  width: 40px; height: 1px; background: currentColor; position: relative; overflow: hidden;
}
.scroll-indicator .line::after {
  content: ''; position: absolute; inset: 0;
  background: var(--accent);
  animation: scrollPulse 2.2s var(--ease-in-out) infinite;
}
@keyframes scrollPulse {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

/* ================= Buttons ================= */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 14px 26px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 14px; font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid currentColor;
  transition: background 260ms var(--ease-out), color 260ms var(--ease-out), transform 260ms var(--ease-out);
  position: relative;
  overflow: hidden;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg-dark);
  border-color: var(--accent);
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost:hover { background: currentColor; color: var(--bg-dark); }
body.on-light .btn-ghost:hover { color: var(--bg-light); }

.btn .arrow {
  display: inline-block;
  transition: transform 260ms var(--ease-out);
}
.btn:hover .arrow { transform: translateX(4px); }

/* ================= Lyteboard block ================= */
.lyteboard-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 5vw, 80px);
  align-items: center;
}
@media (max-width: 900px) { .lyteboard-wrap { grid-template-columns: 1fr; } }

.lyteboard-mockup {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #1a1a1a, #0a0a0a);
  border: 1px solid var(--hairline-dark);
  padding: 20px;
  overflow: hidden;
  box-shadow: 0 40px 100px -40px rgba(0,0,0,0.9);
}
.lyteboard-mockup::before {
  content: '';
  position: absolute; inset: -40% -20% auto auto;
  width: 80%; height: 80%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 60%);
  opacity: 0.3;
  filter: blur(40px);
}
.lyteboard-window {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  height: 100%;
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  position: relative;
  font-family: var(--font-mono);
  font-size: 11px;
}
.lyteboard-window-bar {
  display: flex; gap: 6px; margin-bottom: 4px;
}
.lyteboard-window-bar span {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
}
.lyteboard-grid {
  display: grid; grid-template-columns: 80px 1fr; gap: 12px; flex: 1;
  font-size: 10px;
}
.lyteboard-nav { display: flex; flex-direction: column; gap: 6px; opacity: 0.6; }
.lyteboard-nav span { padding: 5px 8px; border-radius: 6px; }
.lyteboard-nav span.active { background: var(--accent-dim); color: var(--accent); opacity: 1; }
.lyteboard-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lyteboard-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
  min-height: 0;
}
.lyteboard-card .thumb {
  aspect-ratio: 1/1; border-radius: 4px;
  background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
  position: relative;
  overflow: hidden;
}
.lyteboard-card .thumb::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(-45deg, transparent 0 6px, rgba(255,255,255,0.04) 6px 7px);
}
.lyteboard-card.accent .thumb { background: linear-gradient(135deg, var(--accent), oklch(0.6 0.13 var(--accent-h))); }
.lyteboard-tag {
  font-size: 9px; opacity: 0.5; letter-spacing: 0.06em; text-transform: uppercase;
}
.lyteboard-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  display: inline-block; margin-right: 6px;
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse { 50% { opacity: 0.4; } }

.lyteboard-content .eyebrow { color: var(--accent); opacity: 1; }
.lyteboard-content h2 { margin: 18px 0 22px; font-style: italic; }
.lyteboard-content .subhead { margin-bottom: 28px; }
.lyteboard-cta { display: flex; gap: 16px; flex-wrap: wrap; }

/* ================= Experience timeline ================= */
.exp-header {
  display: grid; grid-template-columns: 1fr auto; gap: 40px;
  align-items: end; margin-bottom: clamp(48px, 8vh, 80px);
}
@media (max-width: 720px) { .exp-header { grid-template-columns: 1fr; } }

.exp-list {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--hairline-light);
}
.exp-item {
  display: grid;
  grid-template-columns: 120px 1fr 1fr 40px;
  gap: clamp(20px, 4vw, 60px);
  padding: clamp(28px, 4vh, 48px) 0;
  border-bottom: 1px solid var(--hairline-light);
  align-items: start;
  transition: padding 400ms var(--ease-out);
  cursor: default;
  position: relative;
}
.exp-item:hover {
  padding-left: 12px;
}
.exp-item::before {
  content: '';
  position: absolute; left: -12px; top: 50%;
  width: 0; height: 1px; background: var(--accent);
  transition: width 500ms var(--ease-out);
}
.exp-item:hover::before { width: 6px; }

@media (max-width: 760px) {
  .exp-item { grid-template-columns: 1fr; gap: 10px; }
  .exp-item:hover { padding-left: 0; }
}

.exp-date {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.55;
  padding-top: 8px;
}
.exp-role {
  font-family: var(--font-serif);
  font-size: clamp(26px, 2.6vw, 34px);
  line-height: 1.1;
  font-style: italic;
}
.exp-company {
  font-family: var(--font-sans);
  font-size: 14px;
  opacity: 0.6;
  margin-top: 6px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.exp-desc {
  font-size: 15px; opacity: 0.72; line-height: 1.55;
}
.exp-arrow {
  font-family: var(--font-mono);
  font-size: 20px;
  opacity: 0.3;
  transition: transform 400ms var(--ease-out), opacity 400ms;
  justify-self: end;
}
.exp-item:hover .exp-arrow { opacity: 1; transform: rotate(-45deg); color: var(--accent); }

.exp-item.current .exp-date::before {
  content: '●';
  color: var(--accent);
  margin-right: 8px;
  font-size: 10px;
  animation: pulse 2s infinite;
  vertical-align: middle;
}

/* ================= Skills ================= */
.skills-header { margin-bottom: clamp(48px, 8vh, 72px); max-width: 800px; }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  align-items: stretch;
}
/* Desktop: force 3 cards top row + 2 centered cards bottom row, equal height */
@media (min-width: 980px) {
  .skills-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  .skills-grid > * { grid-column: span 2; }
  /* The 4th card (index 3) starts at column 2, so cards 4 & 5 occupy cols 2-3 and 4-5, centered */
  .skills-grid > *:nth-child(4) { grid-column: 2 / span 2; }
  .skills-grid > *:nth-child(5) { grid-column: 4 / span 2; }
}
.skills-grid > * { display: flex; }
.skill-card { width: 100%; height: 100%; display: flex; flex-direction: column; }
.skill-card .skill-list { margin-top: auto; padding-top: 14px; }
.skill-card {
  padding: 32px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--hairline-dark);
  position: relative;
  overflow: hidden;
  transition: transform 400ms var(--ease-out), border-color 400ms, background 400ms;
}
.skill-card::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), var(--accent-dim), transparent 60%);
  opacity: 0;
  transition: opacity 400ms;
}
.skill-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.05);
}
.skill-card:hover::before { opacity: 1; }
.skill-card > * { position: relative; z-index: 1; }

.skill-card-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  border: 1px solid var(--hairline-dark);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--accent);
  margin-bottom: 22px;
}
.skill-card h3 {
  font-size: 22px;
  font-style: italic;
  margin-bottom: 14px;
  line-height: 1.15;
}
.skill-card .skill-list {
  display: flex; flex-wrap: wrap; gap: 6px;
  list-style: none;
  margin-top: 14px;
}
.skill-card .skill-list li {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border: 1px solid var(--hairline-dark);
  border-radius: 999px;
  opacity: 0.75;
  transition: opacity 200ms, border-color 200ms;
}
.skill-card:hover .skill-list li { opacity: 1; }
.skill-card p {
  font-size: 14px; line-height: 1.55; opacity: 0.7;
}

/* ================= Values ================= */
.values-intro { max-width: 820px; margin-bottom: clamp(60px, 10vh, 96px); }
.values-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 0;
  border-top: 1px solid var(--hairline-light);
}
.value {
  padding: 40px 36px 40px 0;
  border-bottom: 1px solid var(--hairline-light);
  position: relative;
}
.value:not(:last-child) { padding-right: 40px; }
.value-num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  opacity: 0.5;
  margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
}
.value-num::after { content: ''; flex: 1; height: 1px; background: currentColor; opacity: 0.15; max-width: 80px; }
.value h3 {
  font-size: clamp(22px, 2.2vw, 30px);
  font-style: italic;
  margin-bottom: 14px;
  line-height: 1.15;
}
.value p {
  font-size: 15px; line-height: 1.6; opacity: 0.75;
}

/* ================= Confindustria ================= */
.confindustria {
  text-align: center;
  padding: clamp(72px, 11vh, 120px) clamp(20px, 5vw, 64px) clamp(48px, 7vh, 72px);
}
.confindustria-inner {
  max-width: 760px; margin: 0 auto;
  padding: clamp(40px, 6vw, 72px);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--hairline-dark);
  backdrop-filter: blur(20px);
  position: relative;
}
.confindustria-logo {
  width: 80px; height: 80px; border-radius: 16px;
  margin: 0 auto 28px;
  overflow: hidden;
  border: 1px solid var(--hairline-dark);
  background: #fff;
}
.confindustria-logo img { width: 100%; height: 100%; object-fit: contain; }
.confindustria .eyebrow { justify-content: center; margin-bottom: 20px; }
.confindustria h2 {
  font-size: clamp(32px, 4.5vw, 56px);
  font-style: italic;
  margin-bottom: 20px;
}
.confindustria p {
  font-size: 16px; opacity: 0.72; line-height: 1.55;
  max-width: 54ch; margin: 0 auto;
}

/* ================= Values (compact top on desktop to tighten gap with Skills above) ================= */
#values { padding-top: clamp(56px, 8vh, 96px); }

/* ================= Contact ================= */
.contact {
  padding-top: clamp(56px, 8vh, 88px);
  padding-bottom: clamp(72px, 10vh, 110px);
}
.contact-grid {
  display: grid; grid-template-columns: 1fr 1.1fr;
  gap: clamp(48px, 6vw, 96px);
  align-items: start;
}
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }

.contact-intro h2 {
  font-style: italic;
  margin-bottom: 24px;
}
.contact-intro p {
  font-size: 17px; line-height: 1.6; opacity: 0.74; max-width: 42ch;
  margin-bottom: 32px;
}
.contact-direct {
  display: flex; flex-direction: column; gap: 14px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline-dark);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.contact-direct a { display: inline-flex; align-items: center; gap: 10px; opacity: 0.8; transition: color 200ms, opacity 200ms; }
.contact-direct a:hover { color: var(--accent); opacity: 1; }

form.contact-form {
  display: flex; flex-direction: column; gap: 20px;
  padding: clamp(28px, 3.5vw, 40px);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--hairline-dark);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

.form-field { display: flex; flex-direction: column; gap: 8px; }
.form-field label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.55;
}
.form-field input, .form-field textarea, .form-field select {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--hairline-dark);
  border-radius: 10px;
  color: var(--fg-light);
  font-family: var(--font-sans);
  font-size: 15px;
  transition: border-color 240ms, background 240ms;
  resize: vertical;
}
.form-field textarea { min-height: 120px; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255,255,255,0.06);
}
.form-field input::placeholder, .form-field textarea::placeholder { color: rgba(255,255,255,0.3); }

.form-submit {
  padding: 15px 24px;
  background: var(--accent);
  color: var(--bg-dark);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.005em;
  border: none;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform 240ms var(--ease-out), background 240ms;
  align-self: flex-start;
  margin-top: 4px;
}
.form-submit:hover { transform: translateY(-2px); background: oklch(0.82 0.13 var(--accent-h)); }
.form-submit:disabled { opacity: 0.6; cursor: wait; transform: none; }

.form-success {
  padding: 16px 18px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 10px;
  color: var(--accent);
  font-size: 14px;
  display: flex; align-items: center; gap: 12px;
}

/* ================= Footer ================= */
footer {
  padding: 48px clamp(20px, 5vw, 64px);
  border-top: 1px solid var(--hairline-dark);
  display: flex; justify-content: space-between; align-items: center;
  gap: 20px; flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  opacity: 0.55;
  text-transform: uppercase;
}

/* ================= Tweaks Panel ================= */
.tweaks-panel {
  position: fixed;
  right: 20px; top: 50%;
  transform: translateY(-50%);
  width: 300px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 22px;
  background: rgba(15, 15, 15, 0.9);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--hairline-dark);
  border-radius: 16px;
  color: var(--fg-light);
  z-index: 9997;
  font-family: var(--font-sans);
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.8);
}
.tweaks-panel h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-bottom: 14px;
}
.tweaks-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-style: italic;
  margin-bottom: 6px;
}
.tweaks-subtitle {
  font-size: 12px; opacity: 0.55; margin-bottom: 20px;
}
.tweak-group { margin-bottom: 22px; }
.tweak-group:last-child { margin-bottom: 0; }

.tweak-radio { display: flex; gap: 6px; }
.tweak-radio button {
  flex: 1;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--hairline-dark);
  border-radius: 8px;
  background: transparent;
  color: var(--fg-light);
  cursor: pointer;
  transition: all 200ms;
}
.tweak-radio button.active {
  background: var(--accent);
  color: var(--bg-dark);
  border-color: var(--accent);
}

.tweak-select {
  width: 100%;
  padding: 9px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--hairline-dark);
  border-radius: 8px;
  color: var(--fg-light);
  font-family: var(--font-sans);
  font-size: 13px;
}

.tweak-slider { width: 100%; }
.tweak-slider-labels {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  opacity: 0.5;
  margin-top: 6px;
}

.tweaks-close {
  position: absolute; top: 14px; right: 14px;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--hairline-dark);
  font-size: 12px; color: var(--fg-light);
  cursor: pointer;
}
.tweaks-close:hover { background: rgba(255,255,255,0.1); }

@media (max-width: 720px) {
  .tweaks-panel {
    right: 12px; left: 12px; width: auto;
    top: auto; bottom: 12px; transform: none;
    max-height: 70vh;
  }
}
