/* ------------------------------------------------------------------
   Matthew R. Smith — matthewrandallsmith.com
   Vanilla CSS. No framework, no build step.
   Dark cosmic edition: deep-space palette, starfield canvas behind
   content, gold starlight accent.
------------------------------------------------------------------- */

:root {
  --space: #060a13;
  --space-2: #0a1020;
  --card: rgba(17, 24, 42, 0.72);
  --card-edge: rgba(154, 168, 205, 0.16);
  --ink: #eaeef8;
  --ink-soft: #b9c1d4;
  --muted: #828ba1;
  --hairline: rgba(154, 168, 205, 0.14);
  --accent: #d9b878;
  --accent-bright: #edd8a8;
  --accent-deep: #b8934e;
  --gold-glow: rgba(217, 184, 120, 0.16);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --wrap: 1060px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }
html, body { overflow-x: clip; }

body {
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background:
    linear-gradient(180deg, #070c17 0%, var(--space) 40%, #05080f 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

/* ---------- cosmic backdrop ---------- */

.cosmos {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.cosmos canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.nebula {
  position: absolute;
  inset: -8%;
  background:
    radial-gradient(58rem 38rem at 78% -8%, rgba(96, 122, 212, 0.2), transparent 65%),
    radial-gradient(44rem 32rem at 6% 24%, rgba(150, 110, 212, 0.11), transparent 62%),
    radial-gradient(30rem 22rem at 60% 42%, rgba(76, 104, 190, 0.07), transparent 60%),
    radial-gradient(60rem 44rem at 90% 86%, rgba(62, 148, 164, 0.09), transparent 65%),
    radial-gradient(38rem 26rem at 24% 108%, rgba(217, 184, 120, 0.07), transparent 60%);
  animation: nebula-drift 70s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes nebula-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-1.5%, 1.5%, 0) scale(1.06); }
}

/* Fine film grain — premium texture over the gradients. */
.grain {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

/* ---------- accessibility ---------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #14100a;
  padding: 0.6rem 1rem;
  border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: rgba(217, 184, 120, 0.32); color: #fdf9ef; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6, 10, 19, 0.6);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.site-header.scrolled {
  border-bottom-color: var(--hairline);
  background: rgba(6, 10, 19, 0.78);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.1rem;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 560;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark-dot { color: var(--accent); }

.nav-list {
  display: flex;
  gap: clamp(1.1rem, 3vw, 2.2rem);
  list-style: none;
}
.nav-list a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.2s var(--ease);
}
.nav-list a:hover { color: var(--accent-bright); }

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

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: calc(92svh - 4rem); /* full-viewport opening moment */
  padding-block: clamp(4rem, 10vw, 7rem) clamp(5.5rem, 12vw, 9rem);
}

/* Boom-style scroll invitation at the base of the opening frame. */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: clamp(1.4rem, 4vw, 2.6rem);
  transform: translateX(-50%);
  text-decoration: none;
}
.scroll-cue-ring {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(185, 193, 212, 0.32);
  color: var(--ink-soft);
  font-size: 1.05rem;
  background: rgba(6, 10, 19, 0.35);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease),
              background 0.3s var(--ease);
}
.scroll-cue:hover .scroll-cue-ring {
  border-color: var(--accent);
  color: var(--accent-bright);
  background: rgba(217, 184, 120, 0.07);
}
@media (prefers-reduced-motion: no-preference) {
  .js .scroll-cue { animation: cue-drift 2.6s ease-in-out 2s infinite; }
}
@keyframes cue-drift {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 7px); }
}

.hero-inner {
  position: relative;
  z-index: 1;
  will-change: transform, opacity;
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.4rem;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 480;
  font-size: clamp(2.4rem, 6.6vw, 4.35rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  max-width: 18ch;
  text-shadow: 0 2px 24px rgba(4, 7, 14, 0.7);
}
.hero h1 em {
  font-style: italic;
  font-weight: 520;
  background: linear-gradient(100deg,
    var(--accent-deep) 0%, var(--accent) 18%, #f6e8c4 38%,
    var(--accent-bright) 50%, var(--accent) 72%, var(--accent-deep) 100%);
  background-size: 250% 100%;
  background-position: 0% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* One-time starlight shimmer across the gold headline on load. */
@media (prefers-reduced-motion: no-preference) {
  .js .hero h1 em { animation: shimmer 2.6s var(--ease) 0.9s 1 both; }
}
@keyframes shimmer {
  from { background-position: 130% 0; }
  to   { background-position: 0% 0; }
}

.lede {
  margin-top: 1.8rem;
  max-width: 58ch;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.7;
  color: var(--ink-soft);
  text-shadow: 0 1px 16px rgba(4, 7, 14, 0.8);
}

.hero-actions {
  margin-top: 2.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

/* ---------- orbital accent ---------- */

.orbit {
  position: absolute;
  top: 50%;
  right: clamp(-16rem, -10vw, -7rem);
  width: clamp(26rem, 44vw, 38rem);
  height: clamp(26rem, 44vw, 38rem);
  transform: translateY(-52%);
  z-index: 0;
  pointer-events: none;
}

.orbit-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(217, 184, 120, 0.13);
}
.orbit-ring-outer {
  inset: 0;
  border-color: rgba(154, 168, 205, 0.1);
  box-shadow: inset 0 0 60px rgba(92, 116, 200, 0.06);
}
.orbit-ring-inner {
  inset: 13%;
  animation: orbit-spin 80s linear infinite;
  will-change: transform;
}

/* Ignition: rings scale-fade in on load. */
@media (prefers-reduced-motion: no-preference) {
  .js .orbit { animation: orbit-in 1.8s var(--ease) 0.25s both; }
}
@keyframes orbit-in {
  from { opacity: 0; transform: translateY(-52%) scale(0.9); }
  to   { opacity: 1; transform: translateY(-52%) scale(1); }
}

.orbit-dot {
  position: absolute;
  top: 50%;
  left: -4px;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow:
    0 0 8px 2px rgba(237, 216, 168, 0.55),
    0 0 26px 8px rgba(217, 184, 120, 0.25);
}

@keyframes orbit-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.78rem 1.5rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 550;
  text-decoration: none;
  letter-spacing: 0.01em;
  will-change: transform;
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
              border-color 0.25s var(--ease), transform 0.22s ease-out,
              box-shadow 0.25s var(--ease);
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-bright), var(--accent) 55%, var(--accent-deep));
  color: #171106;
  box-shadow: 0 2px 18px -4px rgba(217, 184, 120, 0.35);
}
.btn-primary:hover {
  box-shadow: 0 8px 34px -6px rgba(217, 184, 120, 0.55);
}

.btn-ghost {
  border: 1px solid rgba(185, 193, 212, 0.28);
  color: var(--ink-soft);
  background: rgba(154, 168, 205, 0.04);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
  background: rgba(217, 184, 120, 0.06);
}

.btn-lg { padding: 0.95rem 1.9rem; font-size: 1rem; }

.arrow {
  display: inline-block;
  transition: transform 0.25s var(--ease);
}
.btn:hover .arrow, .card:hover .arrow { transform: translate(2px, -2px); }

/* ---------- section label ---------- */

.section-label {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.section-label::after {
  content: "";
  height: 1px;
  flex: 0 0 3rem;
  background: linear-gradient(90deg, var(--accent-deep), transparent);
}

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

.about { border-top: 1px solid var(--hairline); padding-block: clamp(3.5rem, 8vw, 6rem); }

.about-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
}

.about-body p {
  max-width: 62ch;
  color: var(--ink-soft);
}
.about-body p + p { margin-top: 1.2rem; }
.about-body p:first-child {
  font-family: var(--serif);
  font-weight: 440;
  font-size: 1.32rem;
  line-height: 1.55;
  color: var(--ink);
}

/* ---------- work: full-bleed case moments ---------- */

.work {
  border-top: 1px solid var(--hairline);
  padding-block: clamp(3.5rem, 8vw, 6rem) 0;
  overflow: clip; /* ghost numerals + atmospheres may overhang */
}

.work-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.work-sub { font-size: 0.95rem; color: var(--muted); }

.wrap-wide {
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

/* Each case is a full-viewport "moment" drifting through space. */
.case {
  position: relative;
  min-height: min(88vh, 56rem);
  display: flex;
  align-items: center;
  padding-block: clamp(4rem, 10vw, 7.5rem);
}

/* Per-project atmosphere: a vast, soft nebula tint behind each moment,
   edge-to-edge, so sections read as places — not boxes. */
.case::before {
  content: "";
  position: absolute;
  inset: -6% 0;
  pointer-events: none;
  z-index: 0;
}
.case-sevenroots::before {
  background:
    radial-gradient(70rem 42rem at 82% 30%, rgba(197, 134, 66, 0.075), transparent 65%),
    radial-gradient(48rem 34rem at 8% 85%, rgba(96, 122, 212, 0.06), transparent 65%);
}
.case-potomac::before {
  background:
    radial-gradient(70rem 44rem at 16% 34%, rgba(217, 184, 120, 0.085), transparent 65%),
    radial-gradient(52rem 36rem at 92% 80%, rgba(76, 104, 190, 0.09), transparent 65%);
}
.case-heartwood::before {
  background:
    radial-gradient(70rem 42rem at 84% 36%, rgba(94, 168, 128, 0.07), transparent 65%),
    radial-gradient(48rem 34rem at 6% 82%, rgba(150, 110, 212, 0.055), transparent 65%);
}
.case-rootedhope::before {
  background:
    radial-gradient(70rem 44rem at 18% 36%, rgba(214, 118, 154, 0.065), transparent 65%),
    radial-gradient(50rem 36rem at 90% 84%, rgba(150, 110, 212, 0.07), transparent 65%);
}

/* Ghost numeral: enormous editorial index floating behind each moment. */
.case-numeral {
  position: absolute;
  top: clamp(0.5rem, 4vw, 2.5rem);
  right: clamp(-1.5rem, -1vw, -0.5rem);
  z-index: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 340;
  font-size: clamp(9rem, 24vw, 19rem);
  line-height: 1;
  color: rgba(154, 168, 205, 0.045);
  -webkit-text-stroke: 1px rgba(154, 168, 205, 0.26);
  user-select: none;
  pointer-events: none;
}
.case-flip .case-numeral { right: auto; left: clamp(-1.5rem, -1vw, -0.5rem); }

.case-grid {
  position: relative;
  z-index: 1;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4.4fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.case-flip .case-grid { grid-template-columns: minmax(0, 4.4fr) minmax(0, 7fr); }
.case-flip .case-media { order: 2; }
.case-flip .case-copy { order: 1; }

/* --- the cinematic screenshot: floating browser frame --- */

.case-media { perspective: 1400px; }

.shot {
  position: relative;
  display: block;
  text-decoration: none;
  border-radius: 14px;
}

/* Ambient light pool the frame floats above. */
.shot-glow {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: -13%;
  height: 38%;
  background: radial-gradient(52% 62% at 50% 32%,
              rgba(217, 184, 120, 0.17), rgba(96, 122, 212, 0.09) 55%, transparent 75%);
  filter: blur(14px);
  pointer-events: none;
}

.shot-frame {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(190, 202, 232, 0.2);
  background: #0b101d;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 24px 70px -22px rgba(0, 0, 0, 0.75),
    0 60px 130px -40px rgba(0, 0, 0, 0.6),
    0 10px 60px -14px rgba(217, 184, 120, 0.12);
  will-change: transform;
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease),
              border-color 0.45s var(--ease);
}
.shot:hover .shot-frame,
.shot:focus-visible .shot-frame {
  border-color: rgba(217, 184, 120, 0.45);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 30px 80px -22px rgba(0, 0, 0, 0.8),
    0 70px 150px -40px rgba(0, 0, 0, 0.65),
    0 12px 80px -10px rgba(217, 184, 120, 0.28);
}
.shot:focus-visible { outline: none; }

/* Slim browser chrome. */
.shot-bar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.55rem 0.9rem;
  background: linear-gradient(180deg, rgba(30, 38, 62, 0.95), rgba(18, 24, 42, 0.95));
  border-bottom: 1px solid rgba(154, 168, 205, 0.16);
}
.shot-dots { display: inline-flex; gap: 5px; }
.shot-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(154, 168, 205, 0.3);
}
.shot-dots i:first-child { background: rgba(237, 143, 143, 0.75); }
.shot-dots i:nth-child(2) { background: rgba(235, 200, 130, 0.75); }
.shot-dots i:last-child { background: rgba(140, 205, 155, 0.75); }
.shot-url {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: rgba(6, 10, 19, 0.5);
  border: 1px solid rgba(154, 168, 205, 0.12);
  border-radius: 999px;
  padding: 0.14rem 0.75rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shot-frame img {
  display: block;
  width: 100%;
  height: auto;
  transform: scale(1.005); /* hide edge seams under the border radius */
}
/* On phones a full desktop screenshot shrinks to a tiny, awkward whole page.
   Crop to a legible top slice (the site's hero) so it reads as intentional. */
@media (max-width: 600px) {
  .shot-frame img {
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: top center;
  }
}

/* Glass sheen sweeping the screenshot on hover. */
.shot-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 42%,
              rgba(235, 240, 255, 0.09) 50%, transparent 58%);
  transform: translateX(-70%);
  transition: transform 0.9s var(--ease);
  pointer-events: none;
}
.shot:hover .shot-frame::after { transform: translateX(70%); }

/* --- case copy: big confident type, no box --- */

.case-kicker {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1.3rem;
}

.tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-bright);
  background: rgba(217, 184, 120, 0.1);
  border: 1px solid rgba(217, 184, 120, 0.22);
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
}
.tag-soon {
  color: #cbd4ea;
  background: rgba(154, 168, 205, 0.1);
  border-color: rgba(154, 168, 205, 0.26);
}

.case-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-shadow: 0 2px 20px rgba(4, 7, 14, 0.7);
}
.case-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s var(--ease);
}
.case-title a:hover { color: var(--accent-bright); }

.case-desc {
  margin-top: 1.1rem;
  max-width: 46ch;
  font-size: clamp(0.98rem, 1.3vw, 1.08rem);
  line-height: 1.7;
  color: var(--ink-soft);
}

.case-link {
  margin-top: 1.6rem;
  font-size: 0.9rem;
  font-weight: 550;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.case-link:hover { color: var(--accent-bright); }
.case-link:hover .arrow { transform: translate(2px, -2px); }

/* --- Rooted Hope: abstract nebula panel (site in progress) --- */

.shot-frame-abstract {
  aspect-ratio: 16 / 10.6;
  background:
    radial-gradient(38rem 26rem at 74% 18%, rgba(214, 118, 154, 0.34), transparent 62%),
    radial-gradient(30rem 24rem at 16% 80%, rgba(150, 110, 212, 0.3), transparent 64%),
    radial-gradient(24rem 18rem at 42% 42%, rgba(96, 122, 212, 0.22), transparent 60%),
    radial-gradient(46rem 34rem at 50% 110%, rgba(217, 184, 120, 0.14), transparent 65%),
    linear-gradient(165deg, #131024, #0a0916 70%);
}
.rooted-nebula {
  position: absolute;
  inset: 0;
  display: block;
}
/* Fine star-speckle inside the panel. */
.rooted-nebula::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 24%, rgba(255,255,255,0.8), transparent 100%),
    radial-gradient(1px 1px at 32% 68%, rgba(255,255,255,0.55), transparent 100%),
    radial-gradient(1.6px 1.6px at 55% 18%, rgba(255,244,224,0.75), transparent 100%),
    radial-gradient(1px 1px at 68% 52%, rgba(255,255,255,0.5), transparent 100%),
    radial-gradient(1.2px 1.2px at 84% 34%, rgba(255,255,255,0.65), transparent 100%),
    radial-gradient(1px 1px at 22% 46%, rgba(255,255,255,0.45), transparent 100%),
    radial-gradient(1.4px 1.4px at 44% 84%, rgba(255,244,224,0.6), transparent 100%),
    radial-gradient(1px 1px at 76% 78%, rgba(255,255,255,0.5), transparent 100%),
    radial-gradient(1.2px 1.2px at 92% 62%, rgba(255,255,255,0.55), transparent 100%),
    radial-gradient(1px 1px at 6% 64%, rgba(255,255,255,0.4), transparent 100%);
}
/* A slow ring + warm seed star: something taking root, about to bloom. */
.rooted-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 46%;
  aspect-ratio: 1;
  margin: -23% 0 0 -23%;
  border-radius: 50%;
  border: 1px solid rgba(233, 205, 141, 0.28);
  box-shadow: inset 0 0 40px rgba(214, 118, 154, 0.12);
  animation: rooted-breathe 7s ease-in-out infinite;
}
.rooted-seed {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: #f6e2c8;
  box-shadow:
    0 0 10px 3px rgba(246, 226, 200, 0.7),
    0 0 42px 14px rgba(214, 118, 154, 0.35),
    0 0 90px 30px rgba(150, 110, 212, 0.22);
}
@keyframes rooted-breathe {
  0%, 100% { transform: scale(1); opacity: 0.75; }
  50%      { transform: scale(1.07); opacity: 1; }
}

/* ---------- from the lab: ATLAS (experiment, display-only — no link) ---------- */

.lab {
  position: relative;
  /* Dashed rule: the lab-notebook counterpart to the products' solid hairlines. */
  border-top: 1px dashed rgba(154, 168, 205, 0.24);
  padding-block: clamp(3.5rem, 8vw, 6rem) clamp(4rem, 9vw, 7rem);
  overflow: clip;
}

/* Lab atmosphere: a quieter nebula in candlestick green + instrument gold. */
/* z-index -1 keeps the tint behind the content WITHOUT wrapping the grid in
   a stacking context — the ATLAS mark relies on mix-blend-mode reaching the
   page backdrop, so nothing between it and the root may isolate. */
.lab::before {
  content: "";
  position: absolute;
  inset: -6% 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(60rem 38rem at 20% 22%, rgba(94, 168, 128, 0.06), transparent 65%),
    radial-gradient(48rem 34rem at 90% 44%, rgba(217, 184, 120, 0.065), transparent 65%),
    radial-gradient(52rem 36rem at 14% 70%, rgba(217, 184, 120, 0.05), transparent 65%),
    radial-gradient(50rem 36rem at 88% 94%, rgba(150, 110, 212, 0.055), transparent 65%);
}

.lab-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  margin-top: clamp(2.2rem, 6vw, 3.6rem);
}

/* The ATLAS mark floats free in space — no browser chrome; it's a mark, not a site. */
.lab-mark {
  position: relative;
  display: block;
  max-width: 30rem;
  margin-inline: auto;
}

.lab-mark img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  /* The artwork sits on pure black: screen-blending drops the plate out
     entirely so the mark floats in the starfield; the mask mops up the
     faint JPEG noise toward the edges. */
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(88% 98% at 50% 50%, #000 52%, transparent 78%);
  mask-image: radial-gradient(88% 98% at 50% 50%, #000 52%, transparent 78%);
}

/* Soft gold halo pooling behind the globe. */
.lab-halo {
  position: absolute;
  inset: 6% 10%;
  background: radial-gradient(46% 44% at 50% 44%,
              rgba(217, 184, 120, 0.16), rgba(94, 168, 128, 0.07) 55%, transparent 76%);
  filter: blur(18px);
  pointer-events: none;
}

/* Faint orbit ring echoing the hero's — one small satellite on a slow pass. */
.lab-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(104%, 24.5rem);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(217, 184, 120, 0.14);
  box-shadow: inset 0 0 50px rgba(92, 116, 200, 0.05);
  pointer-events: none;
  will-change: transform;
}
@media (prefers-reduced-motion: no-preference) {
  .lab-ring { animation: lab-orbit 90s linear infinite; }
}
@keyframes lab-orbit {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}
.lab-ring-dot {
  position: absolute;
  top: 50%;
  left: -3px;
  width: 5px;
  height: 5px;
  margin-top: -2.5px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow:
    0 0 7px 2px rgba(237, 216, 168, 0.45),
    0 0 20px 6px rgba(217, 184, 120, 0.18);
}

/* Experiment tag: dashed, cool green — deliberately unlike the gold product tags. */
.tag-lab {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #a9d9bc;
  background: rgba(94, 168, 128, 0.09);
  border: 1px dashed rgba(94, 168, 128, 0.4);
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
}

/* Quiet status line in place of a link — this one is display-only. */
.lab-status {
  margin-top: 1.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.lab-status-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8fd3a6;
  box-shadow: 0 0 8px 2px rgba(143, 211, 166, 0.35);
}
@media (prefers-reduced-motion: no-preference) {
  .lab-status-dot { animation: lab-pulse 2.8s ease-in-out infinite; }
}
@keyframes lab-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* Three experiments now share the lab: same grid, alternating flips, so the
   set staggers like the case moments above. Generous air between them. */
.lab-grid + .lab-grid { margin-top: clamp(4rem, 10vw, 7rem); }
.lab-grid-flip { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
.lab-grid-flip .lab-copy { order: 1; }
.lab-grid-flip .lab-media { order: 2; }

/* Each ring keeps its own tempo (and the middle one reverses) so the
   three never march in step. */
@media (prefers-reduced-motion: no-preference) {
  .lab-ring-reverse { animation-direction: reverse; animation-duration: 72s; }
  .lab-ring-slow { animation-duration: 110s; }
  .lab-ring-med { animation-direction: reverse; animation-duration: 96s; }
}

/* --- Concierge: a voice, rendered as light (no logo — a crafted mark) --- */

.concierge-mark { max-width: 27rem; }
.concierge-mark .lab-halo {
  inset: 16% 10%;
  background: radial-gradient(48% 46% at 50% 50%,
              rgba(217, 184, 120, 0.17), rgba(96, 122, 212, 0.07) 56%, transparent 78%);
}
.concierge-mark .lab-ring { width: min(96%, 22.5rem); }

.voice {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 11.5;
}

/* Call-signal rings rippling out from the voice — a placed call, answered. */
.voice-rings { position: absolute; inset: 0; pointer-events: none; }
.voice-rings i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(74%, 17.5rem);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(233, 205, 141, 0.5);
  /* Static base = three faint concentric rings: the reduced-motion render. */
  transform: translate(-50%, -50%) scale(var(--s, 0.6));
  opacity: 0.14;
}
.voice-rings i:nth-child(1) { --s: 0.52; opacity: 0.18; }
.voice-rings i:nth-child(2) { --s: 0.76; opacity: 0.12; }
.voice-rings i:nth-child(3) { --s: 1;    opacity: 0.07; }
@media (prefers-reduced-motion: no-preference) {
  .voice-rings i {
    animation: voice-ping 5.6s cubic-bezier(0.2, 0.55, 0.45, 1) infinite;
    will-change: transform, opacity;
  }
  .voice-rings i:nth-child(2) { animation-delay: -1.87s; }
  .voice-rings i:nth-child(3) { animation-delay: -3.73s; }
}
@keyframes voice-ping {
  0%   { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
  16%  { opacity: 0.3; }
  100% { transform: translate(-50%, -50%) scale(1.05); opacity: 0; }
}

/* The waveform itself: thin gold bars of starlight, speech-shaped.
   Bar heights (--h) sketch the static silhouette; motion only scales
   transform, so the whole mark stays on the compositor. */
.voice-wave {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.05vw, 11px);
  height: clamp(6rem, 13vw, 9rem);
  filter: drop-shadow(0 0 18px rgba(217, 184, 120, 0.32));
}
.voice-wave i {
  width: clamp(3px, 0.5vw, 5px);
  height: calc(var(--h) * 1%);
  border-radius: 999px;
  background: linear-gradient(180deg,
              var(--accent-bright), var(--accent) 55%, var(--accent-deep));
  box-shadow: 0 0 8px rgba(217, 184, 120, 0.45);
  transform-origin: 50% 50%;
}
.voice-wave i:nth-child(1)  { --h: 12;  --t: 2.3s;  --p: -0.2s; }
.voice-wave i:nth-child(2)  { --h: 28;  --t: 1.9s;  --p: -1.1s; }
.voice-wave i:nth-child(3)  { --h: 20;  --t: 2.6s;  --p: -0.6s; }
.voice-wave i:nth-child(4)  { --h: 46;  --t: 2.1s;  --p: -1.7s; }
.voice-wave i:nth-child(5)  { --h: 64;  --t: 1.8s;  --p: -0.4s; }
.voice-wave i:nth-child(6)  { --h: 40;  --t: 2.4s;  --p: -1.3s; }
.voice-wave i:nth-child(7)  { --h: 82;  --t: 2.0s;  --p: -0.9s; }
.voice-wave i:nth-child(8)  { --h: 58;  --t: 1.7s;  --p: -1.5s; }
.voice-wave i:nth-child(9)  { --h: 100; --t: 2.2s;  --p: -0.1s; }
.voice-wave i:nth-child(10) { --h: 62;  --t: 1.9s;  --p: -1.9s; }
.voice-wave i:nth-child(11) { --h: 86;  --t: 2.5s;  --p: -0.7s; }
.voice-wave i:nth-child(12) { --h: 44;  --t: 2.0s;  --p: -1.2s; }
.voice-wave i:nth-child(13) { --h: 70;  --t: 1.8s;  --p: -0.3s; }
.voice-wave i:nth-child(14) { --h: 34;  --t: 2.3s;  --p: -1.6s; }
.voice-wave i:nth-child(15) { --h: 52;  --t: 2.1s;  --p: -0.8s; }
.voice-wave i:nth-child(16) { --h: 24;  --t: 1.9s;  --p: -1.4s; }
.voice-wave i:nth-child(17) { --h: 12;  --t: 2.4s;  --p: -0.5s; }
@media (prefers-reduced-motion: no-preference) {
  .voice-wave i {
    animation: voice-speak var(--t) ease-in-out var(--p) infinite;
    will-change: transform;
  }
}
@keyframes voice-speak {
  0%, 100% { transform: scaleY(1); }
  50%      { transform: scaleY(0.42); }
}

/* --- Weekend Sprouts: the real newsletter badge, seated in the starfield --- */

.sprout-mark { max-width: 22rem; }
/* Warm gold pool behind the badge, a touch wider than the disc so the light
   spills into the surrounding space rather than stopping at a hard edge. */
.sprout-mark .lab-halo {
  inset: -4% -4%;
  background: radial-gradient(50% 50% at 50% 50%,
              rgba(217, 184, 120, 0.22), rgba(94, 168, 128, 0.08) 58%, transparent 78%);
}
.sprout-mark .lab-ring { width: min(104%, 22rem); }

/* The badge: the full-colour logo clipped to a disc so the white corners
   disappear and it reads as a minted coin floating in the field. */
.badge {
  position: relative;
  z-index: 1;
  display: block;
  width: min(78%, 17rem);
  aspect-ratio: 1;
  margin-inline: auto;
  border-radius: 50%;
  /* Thin gold rim + soft outer glow bridge the bright disc into the dark. */
  box-shadow:
    0 0 0 1px rgba(217, 184, 120, 0.5),
    0 0 22px -2px rgba(217, 184, 120, 0.4),
    0 18px 48px -12px rgba(0, 0, 0, 0.7);
  will-change: transform;
}
.badge img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  /* Trim a hair so the artwork's outer rim tucks fully inside the disc. */
  transform: scale(1.02);
}
/* Whisper-soft inner seat: a bright hairline + a faint edge vignette so the
   disc settles into the theme without recolouring the logo. */
.badge-seat {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    inset 0 0 26px -6px rgba(6, 10, 19, 0.55);
  background: radial-gradient(circle at 50% 46%,
              transparent 62%, rgba(6, 10, 19, 0.26) 100%);
}

/* Motion: the disc breathes on a slow, gentle float — the same quiet register
   as the ATLAS orbit and Concierge rings. Transform only, so it stays on the
   compositor, and the global reduced-motion kill switch leaves it still. */
@media (prefers-reduced-motion: no-preference) {
  .badge { animation: badge-float 9s ease-in-out infinite; }
}
@keyframes badge-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-6px) scale(1.012); }
}

/* --- Song Library: a vinyl record of gold light (crafted, distinct mark) --- */

.record-mark { max-width: 25rem; }
.record-mark .lab-halo {
  inset: 2% 2%;
  background: radial-gradient(48% 48% at 50% 48%,
              rgba(217, 184, 120, 0.2), rgba(150, 110, 212, 0.07) 56%, transparent 78%);
}
.record-mark .lab-ring { width: min(102%, 23rem); }

.record {
  position: relative;
  z-index: 1;
  display: block;
  width: min(82%, 20rem);
  margin-inline: auto;
}
.record svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 0 18px rgba(217, 184, 120, 0.26));
}

/* The disc body: a dark platter with a faint gold rim. */
.rec-disc { stroke: rgba(217, 184, 120, 0.34); stroke-width: 1.4; }

/* Grooves: thin concentric threads of gold light, most faint, a couple bright,
   so the platter reads as pressed vinyl catching starlight. */
.rec-groove {
  fill: none;
  stroke: rgba(217, 184, 120, 0.16);
  stroke-width: 1;
}
.rec-groove-bright { stroke: rgba(233, 205, 141, 0.4); }

/* A short sheen arc so the slow spin is legible without a hard label mark. */
.rec-sheen {
  fill: none;
  stroke: url(#rec-gold);
  stroke-width: 2.2;
  stroke-linecap: round;
  opacity: 0.5;
}

/* Centre label + spindle. */
.rec-label-ring { fill: none; stroke: rgba(120, 88, 44, 0.55); stroke-width: 1; }
.rec-spindle { fill: #0a0f1a; stroke: rgba(255, 255, 255, 0.14); stroke-width: 0.8; }

/* Ambient neighbours: faint stars echoing the field behind. */
.rec-star { fill: rgba(223, 228, 242, 0.7); }

/* Tonearm + needle spark, fixed while the platter turns beneath it. */
.rec-arm-line { stroke: url(#rec-gold); stroke-width: 2; stroke-linecap: round; opacity: 0.75; }
.rec-arm-pivot { fill: #b8934e; stroke: rgba(246, 232, 196, 0.5); stroke-width: 1; }
.rec-arm-head { fill: #f2e3bd; }
.rec-spark-cross { stroke: rgba(255, 246, 226, 0.6); stroke-width: 1; stroke-linecap: round; }
.rec-spark-core { fill: #fff6e2; }

/* Motion: the platter turns slowly; the needle spark twinkles in place.
   Transform + opacity only — compositor-friendly — and the global
   reduced-motion kill switch leaves a fully drawn, still record. */
.record-spin { transform-box: view-box; transform-origin: 150px 150px; }
@media (prefers-reduced-motion: no-preference) {
  .record-spin {
    animation: record-spin 14s linear infinite;
    will-change: transform;
  }
  .record-spark { animation: record-twinkle 3.2s ease-in-out infinite; }
  .rec-star { animation: record-twinkle var(--t, 4.4s) ease-in-out var(--p, 0s) infinite; }
}
.rec-star.s1 { --t: 4.2s; --p: -0.7s; }
.rec-star.s2 { --t: 5.1s; --p: -2.4s; }
.rec-star.s3 { --t: 4.7s; --p: -1.3s; }
.rec-star.s4 { --t: 5.4s; --p: -3.1s; }
@keyframes record-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes record-twinkle {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

@media (max-width: 900px) {
  .lab-grid { grid-template-columns: 1fr; gap: 1rem; }
  /* Same rhythm as the cases on mobile: copy leads, imagery follows. */
  .lab-copy { order: 1; }
  .lab-media { order: 2; }
  .lab-mark { max-width: 21rem; }
  .lab-halo { filter: blur(14px); }
  .lab-grid + .lab-grid { margin-top: clamp(3rem, 12vw, 4.5rem); }
  .concierge-mark { max-width: 19rem; }
  .voice-wave { height: clamp(4.75rem, 20vw, 6rem); }
  .sprout-mark { max-width: 19rem; }
  .badge { width: min(82%, 15rem); }
  .record-mark { max-width: 20rem; }
}

/* ---------- contact ---------- */

.contact {
  position: relative;
  overflow: clip;
  border-top: 1px solid var(--hairline);
  padding-block: clamp(3.5rem, 8vw, 6rem) clamp(6.5rem, 12vw, 10rem);
  text-align: left;
}

.contact .wrap { position: relative; z-index: 1; }

/* Planet horizon: a vast rim-lit arc rising behind the closing CTA. */
.contact::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(-1 * max(220vw, 100rem) + clamp(4rem, 8vw, 6.5rem));
  width: max(220vw, 100rem);
  height: max(220vw, 100rem);
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 0%, #0b1122 0%, #05070d 42%);
  border-top: 1px solid rgba(233, 205, 141, 0.4);
  box-shadow:
    0 -1px 18px rgba(233, 205, 141, 0.28),
    0 -18px 80px -12px rgba(217, 184, 120, 0.22),
    0 -60px 160px -30px rgba(96, 122, 212, 0.18);
  pointer-events: none;
}

.contact-lede {
  font-family: var(--serif);
  font-weight: 460;
  font-size: clamp(1.5rem, 3.4vw, 2.15rem);
  line-height: 1.3;
  margin-block: 1.6rem 2rem;
  max-width: 26ch;
}

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

.site-footer { border-top: 1px solid var(--hairline); }

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-block: 1.6rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- reveal motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(28px) scale(0.985);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  }
  .js .reveal.in {
    opacity: 1;
    transform: none;
  }
  .js .d1.in { transition-delay: 0.1s; }
  .js .d2.in { transition-delay: 0.2s; }
  .js .d3.in { transition-delay: 0.3s; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

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

@media (max-width: 900px) {
  .case { min-height: 0; padding-block: clamp(3.5rem, 12vw, 5.5rem); }
  .case-grid,
  .case-flip .case-grid { grid-template-columns: 1fr; gap: 1.9rem; }
  /* Copy leads, imagery follows — same rhythm on every moment. */
  .case-media, .case-flip .case-media { order: 2; }
  .case-copy, .case-flip .case-copy { order: 1; }
  .case-numeral {
    font-size: clamp(7rem, 30vw, 11rem);
    top: 0.2rem;
    right: -0.6rem;
  }
  .case-flip .case-numeral { left: auto; right: -0.6rem; }
  .shot-glow { display: none; } /* keep mobile compositing cheap */
}

@media (max-width: 820px) {
  .about-grid { grid-template-columns: 1fr; gap: 1.6rem; }
  .orbit {
    right: -12rem;
    top: 38%;
    width: 24rem;
    height: 24rem;
    opacity: 0.65;
  }
}

@media (max-width: 560px) {
  .hero h1 br { display: none; }
}

@media (max-width: 480px) {
  body { font-size: 1rem; }
  .hero { padding-block: 4rem 4.5rem; min-height: calc(88svh - 4rem); }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .work-head { flex-direction: column; gap: 0.5rem; }
  .orbit { right: -14rem; opacity: 0.5; }
  .shot-url { font-size: 0.66rem; }
}

/* ============================================================
   Loom — Agent Runtime (Core Systems centerpiece)
   ============================================================ */

/* Featured treatment: the crown-jewel system leads the section a
   touch larger and more present than the marks beneath it. */
.lab-feature { align-items: center; }
.lab-feature .case-title { font-size: clamp(2.1rem, 4.6vw, 3rem); }
.lab-feature .case-desc { font-size: 1.05rem; max-width: 40rem; }
.lab-feature .tag-lab {
  color: var(--accent-bright);
  border-color: rgba(217, 184, 120, 0.5);
}
.lab-feature .lab-mark { max-width: 26rem; }

.loom-mark .lab-halo {
  inset: 4% 6%;
  background: radial-gradient(48% 46% at 50% 48%,
              rgba(217, 184, 120, 0.24), rgba(217, 184, 120, 0.08) 55%, transparent 78%);
  filter: blur(20px);
}
.loom-mark .lab-ring { width: min(102%, 22.5rem); }
.loom { position: relative; z-index: 1; display: block; width: 100%; }

@media (prefers-reduced-motion: no-preference) {
  /* threads catch the light in a slow, staggered shimmer */
  .loom-warp line { opacity: 0.85; animation: loom-shimmer 5s ease-in-out infinite; }
  .loom-warp line:nth-child(2) { animation-delay: 0.5s; }
  .loom-warp line:nth-child(3) { animation-delay: 1s; }
  .loom-warp line:nth-child(4) { animation-delay: 1.5s; }
  .loom-warp line:nth-child(5) { animation-delay: 2s; }
  /* light flows along the woven weft threads */
  .loom-weft .weft { stroke-dasharray: 5 11; animation: loom-flow 6s linear infinite; }
  .loom-weft .w2 { animation-duration: 4.6s; }
  .loom-weft .w3 { animation-duration: 7.2s; }
  /* the shuttle travels the middle thread; the core breathes */
  .loom-shuttle { animation: loom-shuttle 3.8s ease-in-out infinite; }
  .loom-core { transform-box: fill-box; transform-origin: center; animation: loom-corepulse 3.2s ease-in-out infinite; }
  .loom-core-glow { transform-box: fill-box; transform-origin: center; animation: loom-coreglow 3.2s ease-in-out infinite; }
  .loom-nodes circle { animation: loom-shimmer 4s ease-in-out infinite; }
}
@keyframes loom-flow { to { stroke-dashoffset: -32; } }
@keyframes loom-shimmer { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
@keyframes loom-corepulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.28); } }
@keyframes loom-coreglow { 0%, 100% { opacity: 0.7; } 50% { opacity: 1; } }
@keyframes loom-shuttle { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(120px); } }

/* Lab-style application cards (Sprouts / Song Library / Docket) sit below
   the screenshot cases in the Applications section — give the first one
   the same breathing room the cases have between them. */
.work .lab-grid:first-of-type { margin-top: clamp(3.5rem, 9vw, 6rem); }
