/* ============================================
   Project Cicada — Portfolio
   Tokens
   ============================================ */
:root {
  --bg: #0a0a0a;
  --bg-alt: #0e0e0e;
  --text: #f0f0f0;
  --muted: #a0a0a0;
  --muted-dim: #4a4a4a;
  --accent: #d8d8d8;
  --accent-dim: #55555a;
  --line: rgba(240, 240, 240, 0.09);
  --line-strong: rgba(240, 240, 240, 0.16);

  --font-display: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

html {
  overflow-x: hidden;
  width: 100%;
  touch-action: pan-y;
  scrollbar-gutter: stable;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
  touch-action: pan-y;
}

a { color: inherit; }

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

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

/* Scroll progress rail with per-section dots */
.rail {
  position: fixed;
  right: clamp(18px, 3.5vw, 40px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.rail__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted-dim);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s ease, transform 0.3s ease;
}

.rail__dot::after {
  content: attr(data-label);
  position: absolute;
  right: 18px;
  transform: translateX(6px);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.rail__dot { position: relative; }

.rail__dot:hover::after,
.rail__dot:focus-visible::after {
  opacity: 1;
  transform: translateX(0);
}

.rail__dot.is-active {
  background: var(--accent);
  transform: scale(1.6);
}

.rail__dot:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}

/* ============================================
   Hero
   ============================================ */
.hero {
  position: relative;
  min-height: var(--vh100, 100svh);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  overflow: hidden;
  isolation: isolate;
}

.hero__grid {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, black 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, black 10%, transparent 75%);
}

/* The drifting grid sits on a child so the mask above stays fixed while only
   this layer moves. Animating transform keeps it on the compositor — the old
   background-position animation repainted a viewport-sized masked element on
   every frame, forever, competing with scrolling for the main thread. */
.hero__grid::before {
  content: "";
  position: absolute;
  /* Oversized a full tile past each edge so the wrap never exposes a seam. */
  inset: -128px;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  animation: grid-drift 40s linear infinite;
}

@keyframes grid-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(64px, 128px, 0); }
}

.hero__glow {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, rgba(240, 240, 240, 0.06) 0%, transparent 45%);
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-style: normal;
  font-size: clamp(3rem, 10vw, 8rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  opacity: 0;
  animation: rise 1s ease forwards 0.2s;
}

.hero__title em {
  font-style: normal;
  font-weight: 600;
  color: var(--text);
}

.hero__byline {
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--muted);
  opacity: 0;
  animation: rise 0.9s ease forwards 0.4s;
}

.hero__byline a {
  text-decoration: none;
  border-bottom: 1px solid var(--muted-dim);
  transition: border-color 0.25s ease, color 0.25s ease;
}

.hero__byline a:hover { color: var(--text); border-color: var(--accent); }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Same as `rise`, but keeps the -50% centering offset intact — plain `rise`
   would overwrite .hero__scroll's transform and cancel out its centering. */
@keyframes rise-centered {
  from { opacity: 0; transform: translate(-50%, 14px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.hero__scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0;
  animation: rise-centered 0.9s ease forwards 1s;
}

.hero__scroll span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero__scroll-line {
  width: 1px;
  height: 34px;
  background: linear-gradient(var(--muted-dim), transparent);
  position: relative;
  overflow: hidden;
}

.hero__scroll-line::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 34px;
  background: linear-gradient(var(--text), transparent);
  animation: scroll-drip 2.2s ease-in-out infinite;
}

/* Drives the drip with transform rather than `top`: animating `top` ran a
   layout pass on every frame for as long as the page was open. */
@keyframes scroll-drip {
  0% { transform: translateY(-34px); }
  70%, 100% { transform: translateY(34px); }
}

/* ============================================
   Project sections
   ============================================ */
.project {
  position: relative;
  min-height: var(--vh100, 100svh);
  display: flex;
  align-items: center;
  padding: 120px clamp(24px, 6vw, 80px);
  border-top: 1px solid var(--line);
}

.project__inner {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}

/* Layout side (media left vs. right) is pinned per-project by id, not by DOM
   position — nth-of-type would silently re-mirror sections whenever the
   markup order changes. */
#project-1 .project__inner { grid-template-columns: 1fr 1.5fr; }
#project-1 .project__media { order: 2; }
#project-1 .project__body { order: 1; }

/* If/Then Habits: match the page background to the app's own dark tone so the
   phone frame doesn't sit on a visibly mismatched black. */
#project-2 { background: #16171b; }

.project__media {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(240, 240, 240, 0.24);
  background: #050505;
  width: 100%;
}

/* ---------- Media variant: desktop app screenshot, real ratio ---------- */
/* Source images are pre-cropped to strip the OS window's rounded-corner
   shadow, so this ratio maps 1:1 onto the cropped shots with no CSS crop. */
.project__media--app { aspect-ratio: 966 / 736; }

/* ---------- Media variant: browser compare screenshot, real ratio, no crop ---------- */
.project__media--compare { aspect-ratio: 1919 / 912; }

.project__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.project__media img.is-loaded { opacity: 1; }

.project__media-fallback {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background:
    repeating-linear-gradient(135deg, var(--line) 0, var(--line) 1px, transparent 1px, transparent 14px);
  color: var(--muted-dim);
}

.project__media.no-image .project__media-fallback { display: flex; }

.project__media-fallback svg { opacity: 0.5; }

.project__media-fallback code {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: rgba(0,0,0,0.4);
  padding: 4px 10px;
  border-radius: 3px;
}

/* ---------- Media stack: multiple media blocks stacked vertically ---------- */
.project__media-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.project__media-stack .project__media { width: 100%; }

/* ---------- Media variant: phone screenshots in a device frame ---------- */
.project__media--phone {
  aspect-ratio: 1320 / 2868;
  height: clamp(500px, calc(var(--vh100, 100svh) * 0.78), 780px);
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  justify-self: center;
  border: none;
  background: none;
  overflow: visible;
}

.iphone-frame {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 10px;
  border-radius: 46px;
  background: #232325;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.iphone-frame__screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 36px;
  overflow: hidden;
  background: #000;
}

.iphone-frame__screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.iphone-frame__island {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 28%;
  max-width: 92px;
  height: 24px;
  border-radius: 14px;
  background: #000;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  z-index: 2;
}

.iphone-frame__btn {
  position: absolute;
  background: linear-gradient(90deg, #2a2a2c, #46464a);
  border-radius: 3px;
}

.iphone-frame__btn--action { left: -3px; top: 15%; width: 3px; height: 26px; }
.iphone-frame__btn--vol-up { left: -3px; top: 24%; width: 3px; height: 44px; }
.iphone-frame__btn--vol-down { left: -3px; top: 33%; width: 3px; height: 44px; }
.iphone-frame__btn--power { right: -3px; top: 26%; width: 3px; height: 60px; }

/* ---------- Carousel ---------- */
.carousel { position: absolute; inset: 0; }

.carousel__track {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.carousel__slide.is-active { opacity: 1; pointer-events: auto; }

.carousel__slide img {
  width: 100%;
  height: 100%;
}

.carousel__dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
  padding: 6px 10px;
  border-radius: 100px;
  background: rgba(5, 5, 5, 0.55);
  backdrop-filter: blur(6px);
}

.carousel__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: none;
  background: var(--muted-dim);
  cursor: pointer;
  padding: 0;
  transition: background 0.25s ease, transform 0.25s ease;
}

.carousel__dot.is-active {
  background: var(--accent);
  transform: scale(1.4);
}

.carousel__dot:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

.carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(5, 5, 5, 0.55);
  backdrop-filter: blur(6px);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.25s ease, background 0.25s ease;
}

.project__media:hover .carousel__arrow { opacity: 1; }

.carousel__arrow:focus-visible { opacity: 1; outline: 1px solid var(--accent); }

.carousel__arrow:hover { background: rgba(5, 5, 5, 0.85); }

.carousel__arrow--prev { left: 12px; }
.carousel__arrow--next { right: 12px; }

/* Phone frame: push arrows clear of the device, into the open margin beside it */
.project__media--phone .carousel__arrow--prev { left: -54px; }
.project__media--phone .carousel__arrow--next { right: -54px; }

/* ---------- Compare crossfade (before / after) ---------- */
.compare {
  position: absolute;
  inset: 0;
}

.compare__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  -webkit-user-drag: none;
  transition: opacity 0.2s ease;
}

/* !important needed: overrides the generic .project__media img.is-loaded
   rule, which otherwise forces both before/after images to opacity 1 once
   loaded and defeats the crossfade. */
.compare__img--before { opacity: 1 !important; }
.compare__img--after { opacity: 0 !important; }

[data-compare].is-on .compare__img--before { opacity: 0 !important; }
[data-compare].is-on .compare__img--after { opacity: 1 !important; }

/* ---------- Essentialist on/off toggle ---------- */
.project__title-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.project__title-row .project__title,
.project__title-row .project__eyebrow { margin-bottom: 0; }

.ess-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  position: relative;
  top: 0;
  left: 8px;
}

.ess-toggle__track {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 100px;
  background: #ff0000;
  box-shadow: 0 0 10px 1px rgba(255, 0, 0, 0.45);
  overflow: hidden;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

/* Sweeping highlight to draw the eye before the extension has been toggled on */
.ess-toggle__track::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.65) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: ess-shimmer 2.4s ease-in-out infinite;
}

@keyframes ess-shimmer {
  0% { transform: translateX(-120%); }
  55% { transform: translateX(120%); }
  100% { transform: translateX(120%); }
}

.ess-toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.ess-toggle.is-on .ess-toggle__track { background: var(--accent); box-shadow: none; }
.ess-toggle.is-on .ess-toggle__track::after { animation: none; opacity: 0; }
.ess-toggle.is-on .ess-toggle__thumb { transform: translateX(18px); background: #0a0a0a; }
.ess-toggle.is-on .ess-toggle__label { color: var(--text); }

.ess-toggle:hover .ess-toggle__track { filter: brightness(1.15); }
.ess-toggle:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }

.ess-toggle__label { min-width: 66px; text-align: left; }

.project__index {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.project__index b { color: var(--accent); font-weight: 500; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 100px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
}

.status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted-dim);
}

.status--live { color: #b7e3b0; border-color: rgba(183,227,176,0.25); }
.status--live::before { background: #7fd473; box-shadow: 0 0 6px 1px rgba(127,212,115,0.7); }

.status--dev { color: var(--accent); border-color: rgba(216,216,216,0.3); }
.status--dev::before { background: var(--accent); box-shadow: 0 0 6px 1px rgba(216,216,216,0.6); }

.project__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.1rem, 4vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

/* ---------- Hook-first layout: eyebrow + big hook line + optional subline ---------- */
.project__eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.project__hook {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 4.6vw, 3.7rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}

.project__sub {
  color: var(--muted);
  font-size: 16.5px;
  max-width: 42ch;
  margin-bottom: 32px;
}

.project__desc {
  color: var(--muted);
  font-size: 16.5px;
  max-width: 46ch;
  margin-bottom: 32px;
}

.project__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.project__tags span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.project__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 4px;
  transition: color 0.25s ease, gap 0.25s ease;
  width: fit-content;
}

.project__link:hover { color: var(--accent); gap: 12px; }

.project__link--cta {
  color: #fff;
  background: #ff0000;
  border: none;
  border-bottom: none;
  border-radius: 6px;
  padding: 10px 18px;
  box-shadow: 0 0 16px 1px rgba(255, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.25s ease, gap 0.25s ease, filter 0.25s ease;
}

.project__link--cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: ess-shimmer 2.4s ease-in-out infinite;
}

.project__link--cta:hover {
  color: #fff;
  filter: brightness(1.12);
  box-shadow: 0 0 22px 3px rgba(255, 0, 0, 0.6);
  gap: 12px;
}

.project__link--cta:focus-visible {
  outline: 1px solid #fff;
  outline-offset: 3px;
}

.app-store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  background: #000;
  color: #fff;
  border: 1px solid #a6a6a6;
  border-radius: 10px;
  padding: 9px 16px 9px 14px;
  text-decoration: none;
  transition: filter 0.2s ease, transform 0.2s ease;
}

.app-store-badge svg {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  fill: #fff;
}

.app-store-badge__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.app-store-badge__text small {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.app-store-badge__text strong {
  font-family: var(--font-body);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.005em;
}

.app-store-badge:hover {
  filter: brightness(1.2);
  transform: translateY(-1px);
}

.app-store-badge:focus-visible {
  outline: 1px solid #fff;
  outline-offset: 3px;
}

.project__features {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 32px;
}

.project__features-col h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 10px;
}

.project__features-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project__features-col li {
  position: relative;
  padding-left: 16px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
  max-width: 46ch;
}

.project__features-col li::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 0.75em;
  width: 5px;
  height: 5px;
  margin-top: -2.5px;
  border-radius: 50%;
  background: var(--accent-dim);
}

/* ============================================
   Newsletter — mailing list signup
   ============================================ */
.newsletter {
  position: relative;
  min-height: var(--vh100, 100svh);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px clamp(24px, 6vw, 80px);
  border-top: 1px solid var(--line);
}

.newsletter__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 640px;
}

.newsletter__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  white-space: nowrap;
  margin-bottom: 20px;
}

.newsletter__desc {
  color: var(--muted);
  font-size: 16.5px;
  max-width: 46ch;
  margin: 0 auto 36px;
}

.newsletter-form-container {
  width: 100%;
  max-width: 360px;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.newsletter-form-input {
  font-family: var(--font-body);
  color: var(--text);
  font-size: 14px;
  margin: 0 0 12px;
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-strong);
  box-sizing: border-box;
  border-radius: 6px;
  padding: 11px 14px;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.newsletter-form-input::placeholder { color: var(--muted-dim); }

.newsletter-form-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
}

.newsletter-form-button,
.newsletter-loading-button {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0a0a0a;
  background: var(--text);
  display: flex;
  width: 100%;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.25s ease;
}

.newsletter-form-button:hover { opacity: 0.85; }

.newsletter-loading-button {
  display: none;
  cursor: default;
}

.newsletter-success,
.newsletter-error {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 6px;
}

.newsletter-success-message {
  font-family: var(--font-body);
  color: var(--text);
  font-size: 14px;
}

.newsletter-error-message {
  font-family: var(--font-body);
  color: #e08a8a;
  font-size: 14px;
}

.newsletter-back-button {
  display: none;
  margin: 14px auto 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-align: center;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.25s ease;
}

.newsletter-back-button:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 56px clamp(24px, 6vw, 80px) 44px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}

.site-footer__mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
}

.site-footer__links {
  display: flex;
  gap: 28px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-footer__links a {
  text-decoration: none;
  color: var(--muted);
  transition: color 0.25s ease;
}

.site-footer__links a:hover { color: var(--accent); }

.site-footer__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-dim);
  letter-spacing: 0.04em;
}

/* Reveal-on-scroll */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   Product pages (/digitalwellnesssuite, /if-then-habits, /essentialist)
   Document-flow layout, not full-viewport paging — these are
   crawlable content pages, not scroll-snap sections.
   ============================================ */
.pdp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px clamp(24px, 6vw, 80px);
  font-family: var(--font-mono);
  font-size: 13px;
}

.pdp-nav__back {
  color: var(--muted);
  text-decoration: none;
}

.pdp-nav__back:hover { color: var(--text); }

.pdp-nav__switch {
  display: flex;
  gap: 20px;
}

.pdp-nav__switch a {
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.pdp-nav__switch a:hover { color: var(--accent); }

.pdp-hero {
  padding: 40px clamp(24px, 6vw, 80px) 100px;
  max-width: 1360px;
  margin: 0 auto;
}

.pdp-hero__grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}

.pdp-hero__meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.pdp-body {
  padding: 0 clamp(24px, 6vw, 80px) 40px;
  max-width: 1360px;
  margin: 0 auto;
}

.pdp-section {
  padding: 48px 0;
  border-top: 1px solid var(--line);
}

.pdp-section h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

.pdp-section p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
  max-width: 65ch;
}

.pdp-section p + p { margin-top: 14px; }

.pdp-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px 40px;
  margin-top: 8px;
}

.pdp-faq {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 720px;
}

.pdp-faq details {
  border-top: 1px solid var(--line);
  padding: 18px 0;
}

.pdp-faq details:last-child { border-bottom: 1px solid var(--line); }

.pdp-faq summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  list-style: none;
}

.pdp-faq summary::-webkit-details-marker { display: none; }

.pdp-faq summary::before {
  content: "+";
  display: inline-block;
  width: 18px;
  color: var(--muted);
}

.pdp-faq details[open] summary::before { content: "\2212"; }

.pdp-faq p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
  margin-top: 12px;
  padding-left: 18px;
  max-width: 62ch;
}

.pdp-cta-band {
  text-align: center;
  padding: 64px 24px;
  border-top: 1px solid var(--line);
}

.pdp-cta-band h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  margin-bottom: 24px;
}

@media (max-width: 760px) {
  .pdp-hero__grid { grid-template-columns: 1fr; }
  .pdp-nav__switch { display: none; }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 860px) {
  .project { padding: 90px 24px; }
  .project__inner,
  .project:nth-of-type(even) .project__inner,
  #project-1 .project__inner {
    grid-template-columns: 1fr;
  }
  .project:nth-of-type(even) .project__media,
  .project:nth-of-type(even) .project__body,
  #project-1 .project__media,
  #project-1 .project__body {
    order: initial;
  }
  .rail { display: none; }

  /* backdrop-filter re-blurs its background every frame while it scrolls
     underneath — cheap on desktop GPUs, expensive enough on mobile to
     visibly stutter scrolling. Drop to a plain translucent fill instead. */
  .carousel__dots,
  .carousel__arrow {
    backdrop-filter: none;
    background: rgba(5, 5, 5, 0.85);
  }

  .ess-toggle { top: 1px; }

  .project__body {
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 480px;
    margin-inline: auto;
  }

  .project__title-row {
    justify-content: center;
    width: 100%;
  }

  .project__eyebrow,
  .project__hook,
  .project__sub,
  .project__desc {
    max-width: 100%;
  }

  .project__link {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-inline: 0;
  }

  .project__tags {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .hero__title { font-size: 2.6rem; }
  .newsletter__title { white-space: normal; font-size: clamp(1.6rem, 7vw, 2.2rem); }
}
