/* ==========================================================
   jasonslittle.com — shared styles
   Colours live in :root. Change --accent to restyle the site.
   ========================================================== */

:root {
  --bg: #0b0c0e;
  --surface: #131418;
  --surface-2: #1a1c21;
  --line: #262931;
  --text: #ecedf0;
  --muted: #9aa0ab;
  --faint: #6b717c;
  --accent: #e5383b;
  --accent-soft: rgba(229, 56, 59, 0.14);

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, video { display: block; max-width: 100%; }

a { color: inherit; }

::selection { background: var(--accent); color: #fff; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- type ---------- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
}

h1 { font-size: clamp(40px, 7vw, 80px); }
h2 { font-size: clamp(28px, 4vw, 40px); }
h3 { font-size: 20px; letter-spacing: -0.01em; }

p { margin: 0 0 1em; }

.label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.label::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
}

.lede {
  font-size: clamp(18px, 2vw, 21px);
  color: var(--muted);
  max-width: 640px;
}

.muted { color: var(--muted); }

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 12, 14, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand span { color: var(--accent); }
.nav ul {
  list-style: none;
  display: flex;
  gap: clamp(14px, 3vw, 32px);
  margin: 0;
  padding: 0;
}
.nav a.link {
  text-decoration: none;
  font-size: 14px;
  color: var(--muted);
  transition: color 0.15s;
}
.nav a.link:hover { color: var(--text); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid var(--line);
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--faint); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #f04649; }
.btn svg { width: 16px; height: 16px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* ---------- sections ---------- */

section { padding: clamp(72px, 10vw, 120px) 0; }
section + section { border-top: 1px solid var(--line); }

.section-head { margin-bottom: 48px; max-width: 720px; }
.section-head h2 + p { margin-top: 16px; }

/* ---------- home hero ---------- */

.hero {
  padding: clamp(80px, 14vw, 160px) 0 clamp(64px, 9vw, 110px);
  position: relative;
}
.hero .wrap { position: relative; z-index: 1; }
.hero-art {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(62%, 980px);
  background-size: cover;
  background-position: center;
  opacity: 0.5;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 55%), linear-gradient(0deg, transparent 0%, #000 30%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 0%, #000 55%), linear-gradient(0deg, transparent 0%, #000 30%);
  mask-composite: intersect;
  pointer-events: none;
}
.hero h1 span { color: var(--faint); }
.hero .lede { margin-top: 28px; }

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin-top: 40px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}
.meta-row b { color: var(--text); font-weight: 500; }

/* ---------- featured project ---------- */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: border-color 0.2s;
}
.feature:hover { border-color: var(--faint); }
.feature .media { position: relative; min-height: 100%; aspect-ratio: 16 / 10; background: #000; }
.feature .media img,
.feature .media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.feature .body { padding: clamp(24px, 4vw, 44px); display: flex; flex-direction: column; }
.feature .body p { color: var(--muted); }
.feature .more {
  margin-top: auto;
  padding-top: 20px;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.feature:hover .more { gap: 12px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 22px; padding: 0; list-style: none; }
.tags li {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6fd08c;
  margin-bottom: 14px;
}
.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(111, 208, 140, 0.15);
}

/* ---------- project grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
}
.card.empty {
  background: transparent;
  border-style: dashed;
  color: var(--faint);
  justify-content: center;
}
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 15px; margin: 0; }

/* ---------- about / skills ---------- */

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); }

.skills { display: grid; gap: 24px; }
.skills h3 {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 10px;
  font-weight: 500;
}
.skills p { margin: 0; }

/* ---------- case study ---------- */

.cs-hero { position: relative; padding: 0; border-bottom: 1px solid var(--line); }
.cs-hero .bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.38;
}
.cs-hero .bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11,12,14,0.35) 0%, var(--bg) 100%);
}
.cs-hero .wrap { position: relative; padding-top: clamp(80px, 12vw, 150px); padding-bottom: clamp(56px, 8vw, 90px); }
.cs-hero .logo { width: min(380px, 80%); margin-bottom: 28px; }
.back { display: inline-block; font-size: 14px; color: var(--muted); text-decoration: none; margin-bottom: 36px; }
.back:hover { color: var(--text); }

.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 48px;
}
.facts div { background: var(--surface); padding: 18px 20px; }
.facts dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 4px;
}
.facts dd { margin: 0; font-weight: 500; font-size: 15px; }

.video-frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  aspect-ratio: 16 / 9;
}
.video-frame video { width: 100%; height: 100%; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.features .card { min-height: 0; }
.features .num { font-family: var(--font-mono); font-size: 12px; color: var(--accent); margin-bottom: 18px; }

.maps { display: grid; gap: 20px; }
.map {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.map:nth-child(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
.map:nth-child(even) img { order: 2; }
.map img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 9; }
.map .body { padding: clamp(24px, 4vw, 40px); align-self: center; }
.map .body p { color: var(--muted); margin: 10px 0 0; }

.tech { display: grid; gap: 0; border-top: 1px solid var(--line); }
.tech details { border-bottom: 1px solid var(--line); }
.tech summary {
  list-style: none;
  cursor: pointer;
  padding: 24px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}
.tech summary::-webkit-details-marker { display: none; }
.tech summary h3 { font-size: clamp(18px, 2.2vw, 22px); }
.tech summary .why { color: var(--muted); font-size: 15px; margin-top: 6px; }
.tech summary .plus {
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--muted);
  transition: transform 0.2s;
}
.tech details[open] .plus { transform: rotate(45deg); color: var(--accent); border-color: var(--accent); }
.tech .detail { padding: 0 0 28px; color: var(--muted); max-width: 760px; }
.tech .detail ul { margin: 0; padding-left: 20px; }
.tech .detail li { margin-bottom: 6px; }

.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.gallery figure { margin: 0; }
.gallery img { border-radius: var(--radius); border: 1px solid var(--line); width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.gallery figcaption { font-size: 14px; color: var(--faint); margin-top: 10px; }

.learned { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.learned .card { min-height: 0; }

.cta {
  text-align: center;
  background: radial-gradient(ellipse at center, var(--accent-soft), transparent 65%);
}
.cta .btn-row { justify-content: center; }

/* ---------- footer ---------- */

footer { border-top: 1px solid var(--line); padding: 36px 0; color: var(--faint); font-size: 14px; }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--text); }

/* ---------- reveal on scroll ---------- */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .feature, .map, .map:nth-child(even), .split { grid-template-columns: 1fr; }
  .map:nth-child(even) img { order: 0; }
  .features { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .gallery, .learned { grid-template-columns: 1fr; }
  .hero-art { width: 100%; opacity: 0.22; }
}
@media (max-width: 520px) {
  .nav ul { gap: 14px; }
  .nav .hide-sm { display: none; }
  .grid { grid-template-columns: 1fr; }
}
