/* ============================================================
   SpencerWeb — style.css
   Hand-written, zero dependencies. Dark PNW theme.
   Design tokens live in :root — change colors once, they apply
   everywhere.
   ============================================================ */

:root {
  --night: #0a0e1a;          /* page background */
  --ink: #e2e8f0;            /* body text */
  --muted: #94a3b8;          /* secondary text */
  --faint: #64748b;          /* tertiary text */
  --accent: #5eead4;         /* teal glow accent */
  --accent-deep: #2dd4bf;
  --line: rgba(255, 255, 255, 0.08);
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
}

/* ---------- reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem; /* keep headings clear of the fixed nav */
}

body {
  background: var(--night);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg, canvas { display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
::selection { background: rgba(94, 234, 212, 0.3); }

.container { max-width: 72rem; margin-inline: auto; padding-inline: 1.5rem; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- glassmorphism ---------- */
.glass {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
}
.glass-strong {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ---------- navigation ---------- */
#site-nav {
  position: fixed; inset-inline: 0; top: 0; z-index: 50;
  transition: background 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}
#site-nav.scrolled {
  background: rgba(10, 14, 26, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
.nav-bar { display: flex; align-items: center; justify-content: space-between; padding-block: 1rem; }
.brand {
  font-family: var(--font-display);
  font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; color: #fff;
}
.brand .accent { color: var(--accent); }
.nav-links { display: none; align-items: center; gap: 2rem; font-size: 0.9rem; font-weight: 500; }
.nav-link { color: rgba(255, 255, 255, 0.7); transition: color 0.2s; }
.nav-link:hover, .nav-link.active { color: var(--accent); }
#menu-btn {
  display: flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border-radius: 0.6rem; color: #fff;
}
#mobile-menu {
  margin: 0 1rem; border-radius: 1rem; padding: 0.75rem;
  display: flex; flex-direction: column; gap: 0.25rem;
}
#mobile-menu.hidden { display: none; }
.mobile-link {
  display: block; padding: 0.75rem 1rem; border-radius: 0.75rem;
  font-weight: 500; color: rgba(255, 255, 255, 0.85);
}
.mobile-link:active { background: rgba(255, 255, 255, 0.08); }

@media (min-width: 768px) {
  .nav-links { display: flex; }
  #menu-btn, #mobile-menu { display: none; }
}

/* ---------- buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.75rem 1.75rem; border-radius: 9999px;
  font-weight: 600; font-size: 0.95rem;
}
.btn-primary {
  color: #06251f;
  background: linear-gradient(135deg, #5eead4, #2dd4bf);
  box-shadow: 0 0 24px rgba(45, 212, 191, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 36px rgba(45, 212, 191, 0.55);
}
.btn-ghost {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.btn-ghost:hover {
  border-color: rgba(94, 234, 212, 0.6);
  background: rgba(94, 234, 212, 0.08);
}
.btn-small { padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn-block { width: 100%; }

.link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(94, 234, 212, 0.4);
  transition: text-decoration-color 0.2s;
}
.link:hover { text-decoration-color: var(--accent); }

/* ---------- typography helpers ---------- */
.eyebrow {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--accent);
}
.section-title {
  margin-top: 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700; letter-spacing: -0.02em; color: #fff;
}
.section-sub { margin-top: 1rem; max-width: 32rem; color: var(--muted); }
.section { padding-block: 7rem 0; }
#consults.section { padding-bottom: 0; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  height: 100vh; height: 100svh; min-height: 600px;
  overflow: hidden;
}
#hero-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  touch-action: pan-y; /* horizontal drags scrub, vertical still scrolls */
  cursor: ew-resize;
}
.hero-fade {
  pointer-events: none;
  position: absolute; inset-inline: 0; bottom: 0; height: 10rem;
  background: linear-gradient(to bottom, transparent, var(--night));
}
.hero-content {
  pointer-events: none;
  position: relative; z-index: 10;
  display: flex; flex-direction: column; align-items: center;
  padding-inline: 1.5rem; text-align: center;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3.75rem, 12vw, 7rem);
  font-weight: 700; letter-spacing: -0.03em; color: #fff; line-height: 1.05;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.45);
}
.hero-tagline {
  margin-top: 1.25rem; max-width: 36rem;
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
}
.hero-ctas {
  pointer-events: auto;
  margin-top: 2rem; display: flex; flex-wrap: wrap;
  align-items: center; justify-content: center; gap: 1rem;
}
#drag-hint {
  margin-top: 2.5rem;
  font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.25em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}
.scroll-cue {
  position: absolute; bottom: 1.5rem; left: 50%; z-index: 10;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.4);
  transition: color 0.2s;
}
.scroll-cue:hover { color: rgba(255, 255, 255, 0.8); }
.scroll-cue svg { animation: bob 1.6s ease-in-out infinite; }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ---------- about ---------- */
.about-grid { margin-top: 2.5rem; display: grid; gap: 3rem; }
.about-bio p { color: rgba(203, 213, 225, 0.9); }
.about-bio p + p { margin-top: 1.25rem; }
@media (min-width: 768px) {
  .about-grid { grid-template-columns: 3fr 2fr; }
}

.card { border-radius: 1rem; padding: 1.5rem; }
.card-label {
  font-family: var(--font-display);
  font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.15em; text-transform: uppercase; color: var(--accent);
}
.chips { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; }
.chip {
  padding: 0.35rem 0.85rem; border-radius: 9999px;
  font-size: 0.8rem; font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.stats {
  margin-top: 1.5rem; padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem; color: var(--muted);
}
.stats p + p { margin-top: 0.25rem; }
.stats strong { color: #fff; }

/* ---------- projects ---------- */
.projects-grid { margin-top: 3rem; display: grid; gap: 1.5rem; }
@media (min-width: 640px) { .projects-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .projects-grid { grid-template-columns: repeat(2, 1fr); } }

.project-card {
  position: relative; overflow: hidden; border-radius: 1rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.35s, box-shadow 0.35s;
}
.project-card:hover, .project-card:focus-visible {
  transform: translateY(-6px);
  border-color: rgba(94, 234, 212, 0.35);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 24px rgba(45, 212, 191, 0.12);
}
.thumb {
  position: relative; aspect-ratio: 16 / 10;
  display: flex; align-items: flex-end; padding: 1rem;
}
/* Placeholder art: swap these gradients for real screenshots later.
   (Replace the .thumb div with <img class="thumb" src="..." />) */
.thumb-1 .thumb { background: linear-gradient(135deg, #232a63, #0f172a 55%, #10403d); }
.thumb-2 .thumb { background: linear-gradient(135deg, #58182e, #0f172a 55%, #4d2d12); }
.thumb-3 .thumb { background: linear-gradient(135deg, #0e3f3d, #0f172a 55%, #12395e); }
.thumb-4 .thumb { background: linear-gradient(135deg, #3d1a5e, #0f172a 55%, #0e4634); }
.thumb-5 .thumb { background: linear-gradient(135deg, #1e293b, #0f172a 55%, #232a63); }
.thumb-6 .thumb { background: linear-gradient(135deg, #4d2d12, #0f172a 55%, #58182e); }
.thumb-mark {
  font-family: var(--font-display);
  font-size: 3rem; font-weight: 700; line-height: 1;
  color: rgba(255, 255, 255, 0.14);
  transition: color 0.35s;
}
.project-card:hover .thumb-mark { color: rgba(94, 234, 212, 0.35); }
.card-body { padding: 1.1rem 1.25rem 1.25rem; }
.card-title { font-family: var(--font-display); font-weight: 600; color: #fff; }
.card-tags { margin-top: 0.2rem; font-size: 0.8rem; color: rgba(148, 163, 184, 0.9); }
.card-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 0.75rem;
  padding: 1.5rem; font-size: 0.9rem; line-height: 1.55;
  color: rgba(255, 255, 255, 0.9);
  background: linear-gradient(to top, rgba(6, 10, 20, 0.96) 30%, rgba(6, 10, 20, 0.7) 70%, rgba(6, 10, 20, 0.35));
  backdrop-filter: blur(6px);
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.project-card:hover .card-overlay,
.project-card:focus-visible .card-overlay,
.project-card:focus-within .card-overlay {
  opacity: 1; transform: none;
}
.card-link { font-weight: 600; color: var(--accent); }

/* ---------- consults ---------- */
.services-grid { margin-top: 3rem; display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
.service-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; color: #fff; }
.service-price { margin-top: 0.25rem; font-size: 0.9rem; font-weight: 500; color: var(--accent); }
.service-desc { margin-top: 1rem; font-size: 0.9rem; line-height: 1.6; color: var(--muted); }

.contact-panel { margin-top: 3.5rem; border-radius: 1rem; padding: 1.75rem; }
.contact-grid { display: grid; gap: 2.5rem; }
@media (min-width: 768px) {
  .contact-panel { padding: 2.5rem; }
  .contact-grid { grid-template-columns: 1fr 1fr; }
}
.contact-title {
  font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; color: #fff;
}
.contact-sub { margin-top: 0.75rem; color: var(--muted); }
.contact-alt { margin-top: 1.5rem; font-size: 0.9rem; color: var(--faint); }

/* ---------- forms ---------- */
.field + .field, form .btn { margin-top: 1rem; }
.field label {
  display: block; margin-bottom: 0.35rem;
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase;
  color: rgba(148, 163, 184, 0.9);
}
input[type="text"], input[type="email"], textarea {
  width: 100%; border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.7rem 1rem; font: inherit; font-size: 0.95rem; color: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
textarea { resize: none; }
input::placeholder, textarea::placeholder { color: rgba(148, 163, 184, 0.55); }
input:focus, textarea:focus {
  border-color: rgba(94, 234, 212, 0.6);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.15);
}
button[disabled] { opacity: 0.6; cursor: wait; }
.form-status { margin-top: 0.75rem; font-size: 0.9rem; }
.form-status:empty { display: none; }
.form-status.ok { color: var(--accent); }
.form-status.err { color: #fda4af; }

/* ---------- newsletter ---------- */
#newsletter { padding-block: 7rem; }
.newsletter-box {
  position: relative; overflow: hidden;
  border-radius: 1.5rem; padding: 3rem 1.75rem; text-align: center;
}
@media (min-width: 768px) { .newsletter-box { padding-inline: 4rem; } }
.newsletter-glow {
  pointer-events: none;
  position: absolute; top: -6rem; left: 50%;
  width: 24rem; height: 12rem;
  transform: translateX(-50%);
  background: rgba(45, 212, 191, 0.2);
  border-radius: 9999px;
  filter: blur(60px);
}
.newsletter-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600; letter-spacing: -0.02em; color: #fff;
}
.newsletter-sub { margin: 0.75rem auto 0; max-width: 28rem; color: var(--muted); }
.newsletter-form {
  margin: 1.75rem auto 0; max-width: 28rem;
  display: flex; flex-direction: column; gap: 0.75rem;
}
.newsletter-form input { flex: 1; }
.newsletter-form .btn { margin-top: 0; white-space: nowrap; }
@media (min-width: 640px) { .newsletter-form { flex-direction: row; } }
#newsletter .form-status { margin-top: 0.75rem; }

/* ---------- footer ---------- */
footer { border-top: 1px solid rgba(255, 255, 255, 0.05); padding-block: 2.5rem; }
.footer-inner {
  display: flex; flex-direction: column; align-items: center;
  justify-content: space-between; gap: 1rem;
  font-size: 0.9rem; color: var(--faint);
}
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { transition: color 0.2s; }
.footer-links a:hover { color: var(--accent); }
@media (min-width: 768px) { .footer-inner { flex-direction: row; } }

/* ---------- scroll-reveal ---------- */
.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-cue svg { animation: none; }
}

/* ---------- contact page (contact.html) ---------- */
.page-top { padding-top: 9rem; }

.field select {
  width: 100%; border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.7rem 2.5rem 0.7rem 1rem; font: inherit; font-size: 0.95rem; color: #fff;
  outline: none; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field select:focus {
  border-color: rgba(94, 234, 212, 0.6);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.15);
}
.field select:invalid { color: rgba(148, 163, 184, 0.55); }
.field select option { background: #0f172a; color: #e2e8f0; }

/* CTA variant of the contact panel on the home page */
.contact-cta { align-items: center; }
.contact-cta-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
@media (min-width: 768px) { .contact-cta-actions { align-items: flex-end; text-align: right; } }
.contact-cta-actions .contact-alt { margin-top: 0.5rem; }

/* ---------- project photos (set via projects.js "image") ---------- */
.thumb.has-image { background-size: cover; background-position: center; }
.thumb.has-image .thumb-mark { display: none; }
