/* ============================================================
   Cocoa App — shared stylesheet
   Theme system: workshop (default :root), atelier, panic
   Applied theme: data-theme="panic" on <body>
   ============================================================ */

:root {
  /* Default = workshop (balanced) */
  --bg: #f5efe6;
  --bg-alt: #ebe2d3;
  --ink: #2a1e16;
  --ink-soft: #5a4a3d;
  --ink-mute: #8a7a6d;
  --paper: #fbf7f0;
  --accent: #c85a2b;
  --accent-soft: #e8a47e;
  --rule: #d9ccba;
  --shadow: 0 1px 0 rgba(42, 30, 22, 0.04), 0 4px 24px rgba(42, 30, 22, 0.08);

  --ff-display: "Fraunces", "Cochin", "Playfair Display", Georgia, serif;
  --ff-body: "Inter", -apple-system, "Helvetica Neue", sans-serif;
  --ff-mono: "JetBrains Mono", "SF Mono", Menlo, monospace;

  --fs-hero: clamp(48px, 7vw, 96px);
  --fs-h1: clamp(36px, 4.5vw, 64px);
  --fs-h2: clamp(28px, 3vw, 44px);
  --fs-h3: 22px;
  --fs-body: 17px;
  --fs-small: 14px;

  --container: 1160px;
  --gutter: 32px;
  --radius: 6px;
}

/* ---------- ATELIER (safe) ---------- */
[data-theme="atelier"] {
  --bg: #f4efe4;
  --bg-alt: #e9e1cf;
  --ink: #1e1713;
  --ink-soft: #4a3d32;
  --ink-mute: #8a7b6b;
  --paper: #faf5ea;
  --accent: #6b4226;
  --accent-soft: #b8906c;
  --rule: #d6c9b2;
  --ff-display: "Fraunces", "Cochin", Georgia, serif;
  --ff-body: "Inter", -apple-system, sans-serif;
}

/* ---------- WORKSHOP (balanced) ---------- */
[data-theme="workshop"] {
  --bg: #f5efe6;
  --bg-alt: #ebe2d3;
  --ink: #2a1e16;
  --ink-soft: #5a4a3d;
  --ink-mute: #8a7a6d;
  --paper: #fbf7f0;
  --accent: #c85a2b;
  --accent-soft: #e8a47e;
  --rule: #d9ccba;
  --ff-display: "Fraunces", Georgia, serif;
  --ff-body: "Inter", sans-serif;
}

/* ---------- PANIC (bold) ---------- */
[data-theme="panic"] {
  --bg: #1a1310;
  --bg-alt: #241a14;
  --ink: #f5ead5;
  --ink-soft: #c9b89a;
  --ink-mute: #8a7862;
  --paper: #22180f;
  --accent: #ff7a3c;
  --accent-soft: #ffb68a;
  --rule: #3a2c20;
  --ff-display: "Fraunces", "Cochin", Georgia, serif;
  --ff-body: "Inter", sans-serif;
  --shadow: 0 1px 0 rgba(0,0,0,0.4), 0 8px 32px rgba(0,0,0,0.45);
}

/* ============================================================
   Reset + base
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ff-body);
  font-size: var(--fs-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
  min-height: 100vh;
}

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

/* Subtle paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
  background-image: radial-gradient(rgba(0,0,0,0.025) 1px, transparent 1px);
  background-size: 3px 3px;
  mix-blend-mode: multiply;
}
[data-theme="panic"] body::before,
body[data-theme="panic"]::before {
  opacity: 0.25;
  background-image: radial-gradient(rgba(255,255,255,0.03) 1px, transparent 1px);
  mix-blend-mode: screen;
}

/* ============================================================
   Typography helpers
   ============================================================ */
.display { font-family: var(--ff-display); font-weight: 400; letter-spacing: -0.02em; line-height: 1.02; }
.display em { font-style: italic; font-variation-settings: "SOFT" 100; color: var(--accent); }
.mono { font-family: var(--ff-mono); font-size: 0.85em; letter-spacing: 0.02em; }
.eyebrow {
  font-family: var(--ff-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.lead { font-size: clamp(18px, 1.5vw, 22px); line-height: 1.5; color: var(--ink-soft); }

/* ============================================================
   Layout
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
  z-index: 1;
}

section { position: relative; z-index: 1; }

.rule {
  height: 1px;
  background: var(--rule);
  border: none;
  margin: 0;
}

/* ============================================================
   Nav
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--ff-display);
  font-size: 22px;
  letter-spacing: -0.01em;
}
.brand-mark { width: 28px; height: 28px; flex-shrink: 0; color: var(--accent); }
.brand-mark .steam {
  animation: steam-rise 2.4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center center;
}
.brand-mark .s1 { animation-delay: 0s; }
.brand-mark .s2 { animation-delay: -1.6s; }
.brand-mark .s3 { animation-delay: -0.8s; }
@keyframes steam-rise {
  0%   { opacity: 0;    transform: translateY(1px); }
  15%  { opacity: 0.65; }
  75%  { opacity: 0.65; }
  100% { opacity: 0;    transform: translateY(-5px); }
}
.nav-links {
  display: flex;
  gap: 6px;
  align-items: center;
}
.nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--ink-soft);
  transition: background 120ms ease, color 120ms ease;
}
.nav-link:hover { background: var(--bg-alt); color: var(--ink); }
.nav-link.active { color: var(--ink); background: var(--bg-alt); }
@media (max-width: 640px) {
  .nav-inner { padding: 14px 16px; gap: 12px; }
  .brand { font-size: 18px; gap: 8px; }
  .brand-mark { width: 24px; height: 24px; }
  .nav-links { gap: 2px; }
  .nav-link { padding: 6px 10px; font-size: 13px; }
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 15px;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,0.15); }
.btn-ghost {
  border: 1px solid var(--rule);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--bg-alt); }
.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,0.25); }

/* Coming Soon label (shown when no store URLs are set) */
.coming-soon {
  display: inline-flex;
  align-items: center;
  height: 52px;
  padding: 0 20px;
  border-radius: 12px;
  border: 1.5px dashed var(--rule, rgba(255,255,255,0.2));
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-mute, rgba(255,255,255,0.45));
  letter-spacing: 0.02em;
  pointer-events: none;
  user-select: none;
}

/* App Store pill */
.appstore {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px 10px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 12px;
  transition: transform 120ms ease;
}
.appstore:hover { transform: translateY(-1px); }
.appstore svg { width: 28px; height: 28px; flex-shrink: 0; }
.appstore-text { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.appstore-text small { font-size: 10px; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.1em; }
.appstore-text strong { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding: clamp(60px, 10vw, 120px) 0 clamp(60px, 8vw, 96px);
  position: relative;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* Editorial hero variant — single column, large title */
.hero-grid.hero-editorial {
  grid-template-columns: 1fr;
  max-width: 900px;
}
.hero-editorial .hero-title {
  font-size: clamp(64px, 10vw, 128px);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}
.hero-eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--ink-mute);
}

.hero-title {
  font-family: var(--ff-display);
  font-size: var(--fs-hero);
  letter-spacing: -0.025em;
  line-height: 0.98;
  margin-bottom: 24px;
  font-weight: 400;
}
.hero-title em {
  font-style: italic;
  color: var(--accent);
  font-variation-settings: "SOFT" 100;
}

.hero-sub {
  font-size: clamp(17px, 1.4vw, 20px);
  color: var(--ink-soft);
  max-width: 52ch;
  line-height: 1.55;
  margin-bottom: 32px;
}
.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* ============================================================
   Sections — generic
   ============================================================ */
.section {
  padding: clamp(64px, 8vw, 120px) 0;
}
.section-head {
  max-width: 680px;
  margin: 0 auto clamp(40px, 5vw, 72px);
  text-align: center;
}
.section-head h2 {
  font-family: var(--ff-display);
  font-size: var(--fs-h2);
  letter-spacing: -0.02em;
  margin: 12px 0 16px;
  font-weight: 400;
  line-height: 1.05;
}
.section-head h2 em { font-style: italic; color: var(--accent); }

/* ============================================================
   Cards / apps grid
   ============================================================ */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.app-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 32px;
  transition: transform 140ms ease, box-shadow 140ms ease;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.app-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.app-card .icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.app-card .icon img { border-radius: 22.5%; }
.app-card h3 {
  font-family: var(--ff-display);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.app-card p { color: var(--ink-soft); }
.app-card .meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--ink-mute);
}
.app-card .arrow { transition: transform 140ms ease; }
.app-card:hover .arrow { transform: translateX(4px); }

/* ============================================================
   Feature rows
   ============================================================ */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
  padding: clamp(48px, 6vw, 96px) 0;
}
.feature-row.reverse > :first-child { order: 2; }
@media (max-width: 820px) {
  .feature-row, .feature-row.reverse { grid-template-columns: 1fr; }
  .feature-row.reverse > :first-child { order: 0; }
}
.feature-row h3 {
  font-family: var(--ff-display);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 14px 0 16px;
}
.feature-row h3 em { font-style: italic; color: var(--accent); }

/* ============================================================
   Mac app window mockup
   ============================================================ */
.mac-window {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18), 0 4px 12px rgba(0,0,0,0.08);
}
[data-theme="panic"] .mac-window { box-shadow: 0 20px 60px rgba(0,0,0,0.5); }

.mac-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(180deg, var(--bg-alt), color-mix(in srgb, var(--bg-alt) 92%, black));
  border-bottom: 1px solid var(--rule);
}
.mac-dot { width: 12px; height: 12px; border-radius: 50%; }
.mac-dot.r { background: #ff5f57; }
.mac-dot.y { background: #febc2e; }
.mac-dot.g { background: #28c840; }
.mac-title {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--ink-mute);
  font-weight: 500;
  margin-right: 50px;
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  padding: 64px 0 48px;
  border-top: 1px solid var(--rule);
  margin-top: 80px;
  color: var(--ink-soft);
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
}
@media (max-width: 720px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
.footer h5 {
  font-family: var(--ff-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-mute);
  margin-bottom: 16px;
  font-weight: 500;
}
.footer ul { list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.footer a:hover { color: var(--ink); }
.footer-bottom {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-mute);
  flex-wrap: wrap;
  gap: 12px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--ff-display);
  font-size: 20px;
  margin-bottom: 16px;
  color: var(--ink);
}
.footer-brand svg { width: 24px; height: 24px; color: var(--accent); }

/* ============================================================
   Utilities
   ============================================================ */
.wiggle {
  animation: wiggle 8s ease-in-out infinite;
  transform-origin: center;
}
@keyframes wiggle {
  0%, 100% { transform: rotate(-1deg); }
  50% { transform: rotate(1.5deg); }
}

.tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 12px;
  font-family: var(--ff-mono);
  color: var(--ink-soft);
}

/* Underline squiggle */
.squiggle {
  position: relative;
  display: inline-block;
}
.squiggle::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: -4px;
  height: 6px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 6'><path d='M0 3 Q 15 0, 30 3 T 60 3 T 90 3 T 120 3' fill='none' stroke='%23c85a2b' stroke-width='2' stroke-linecap='round'/></svg>") repeat-x;
  background-size: 120px 6px;
  opacity: 0.85;
}
[data-theme="atelier"] .squiggle::after {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 6'><path d='M0 3 Q 15 0, 30 3 T 60 3 T 90 3 T 120 3' fill='none' stroke='%236b4226' stroke-width='2' stroke-linecap='round'/></svg>");
}
[data-theme="panic"] .squiggle::after {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 6'><path d='M0 3 Q 15 0, 30 3 T 60 3 T 90 3 T 120 3' fill='none' stroke='%23ff7a3c' stroke-width='2' stroke-linecap='round'/></svg>");
}

/* ============================================================
   Page-specific styles
   ============================================================ */

/* ---- Home hero illustration area ---- */
.home-hero-art {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 520px;
  margin-left: auto;
}
.home-hero-art .icon-tile {
  position: absolute;
  border-radius: 24%;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  transition: transform 400ms cubic-bezier(.2,.9,.3,1.2);
}
.home-hero-art .icon-tile:hover { transform: scale(1.05) rotate(-2deg); }
.home-hero-art .tile-repo {
  width: 52%; height: 52%; top: 8%; left: 8%;
  background: linear-gradient(135deg, #c85a2b, #8a3a1a);
  color: #fff;
  transform: rotate(-6deg);
  z-index: 3;
}
.home-hero-art .tile-center {
  width: 38%; height: 38%; top: 14%; right: 4%;
  background: linear-gradient(135deg, #e8a47e, #c85a2b);
  transform: rotate(5deg);
  z-index: 2;
}
.home-hero-art .tile-adamant {
  width: 38%; height: 38%; bottom: 8%; right: 16%;
  background: linear-gradient(135deg, #4a2e8f, #7a4ec8);
  color: #fff;
  transform: rotate(-3deg);
  z-index: 1;
}
.home-hero-art .tile-coming {
  width: 28%; height: 28%; bottom: 14%; left: 22%;
  background: var(--paper);
  border: 2px dashed var(--rule);
  color: var(--ink-mute);
  font-family: var(--ff-mono);
  font-size: 11px;
  text-align: center;
  z-index: 2;
}
[data-theme="panic"] .home-hero-art .tile-coming { background: var(--bg-alt); border-color: var(--ink-mute); }

/* Hero floating marks */
.hero-decor {
  position: absolute;
  color: var(--accent);
  opacity: 0.15;
  pointer-events: none;
}
.hero-decor.d1 { top: 10%; left: -4%; width: 120px; transform: rotate(-18deg); }
.hero-decor.d2 { bottom: 18%; right: 2%; width: 80px; transform: rotate(22deg); }

/* ---- App icon — Repo Man ---- */
.repo-icon {
  width: 100%;
  height: 100%;
  border-radius: 24%;
  background: linear-gradient(135deg, #c85a2b 0%, #8a3a1a 100%);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.repo-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.25), transparent 50%);
}
.repo-icon svg { width: 55%; height: 55%; color: #fff; position: relative; z-index: 1; }

/* ---- Product hero ---- */
.product-hero {
  padding: clamp(60px, 8vw, 100px) 0 clamp(40px, 6vw, 80px);
  text-align: center;
}
.product-hero .product-icon {
  width: 140px;
  height: 140px;
  margin: 0 auto 32px;
}
.product-hero .product-title {
  font-family: var(--ff-display);
  font-size: clamp(56px, 8vw, 104px);
  letter-spacing: -0.03em;
  line-height: 0.95;
  margin-bottom: 16px;
  font-weight: 400;
}
.product-hero .tagline {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: clamp(22px, 2.2vw, 32px);
  color: var(--accent);
  margin-bottom: 24px;
  font-weight: 400;
}
.product-hero .lead { max-width: 600px; margin: 0 auto 36px; }

/* Product screenshot section with coloured backdrop */
.product-shot-section {
  background: var(--accent);
  padding: clamp(60px, 8vw, 120px) 0 clamp(40px, 6vw, 80px);
  position: relative;
  overflow: hidden;
}
[data-theme="panic"] .product-shot-section { background: linear-gradient(180deg, var(--accent) 0%, #d65620 100%); }
.product-shot {
  max-width: 1000px;
  margin: 0 auto;
}

/* Carousel */
.carousel-slides {
  display: grid;
}
.carousel-slide {
  grid-area: 1 / 1;
  width: 100%;
  display: block;
  border-radius: 16px;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.carousel-slide.active {
  opacity: 1;
}
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}
.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  padding: 0;
  background: rgba(255, 255, 255, 0.45);
  transition: background 0.2s, transform 0.2s;
}
.carousel-dot.active {
  background: #fff;
  transform: scale(1.35);
}

/* ---- Mac screenshot content ---- */
.app-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 440px;
  font-size: 13px;
  color: var(--ink);
  background: var(--paper);
}
.app-sidebar {
  background: color-mix(in srgb, var(--bg-alt) 60%, var(--paper));
  border-right: 1px solid var(--rule);
  padding: 16px 10px;
  font-size: 12px;
}
.app-sidebar-head {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding: 8px 10px 6px;
}
.app-sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--ink-soft);
}
.app-sidebar-item.active {
  background: var(--accent);
  color: white;
}
.app-sidebar-item .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-soft);
  flex-shrink: 0;
}
.app-sidebar-item.active .dot { background: rgba(255,255,255,0.7); }
.app-sidebar-item .count { margin-left: auto; opacity: 0.7; font-size: 11px; }

.app-main { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.app-main-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
.app-main-title { font-weight: 600; font-size: 15px; }
.app-main-sub { font-size: 12px; color: var(--ink-mute); }
.repo-list { display: flex; flex-direction: column; gap: 6px; }
.repo-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12.5px;
}
.repo-row:hover { background: var(--bg-alt); }
.repo-row .status {
  width: 8px; height: 8px; border-radius: 50%;
  background: #2ea043;
}
.repo-row .status.syncing { background: #d29922; animation: pulse 1.4s infinite; }
.repo-row .status.error { background: #f85149; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.repo-row .name { font-weight: 500; }
.repo-row .path { color: var(--ink-mute); font-family: var(--ff-mono); font-size: 11px; }
.repo-row .size { color: var(--ink-mute); font-size: 11px; }

/* ---- Feature tiles ---- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 40px;
}
.feature-tile {
  padding: 28px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 14px;
}
.feature-tile .fi {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  display: grid; place-items: center;
  margin-bottom: 16px;
}
.feature-tile h4 {
  font-family: var(--ff-display);
  font-size: 22px;
  font-weight: 400;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.feature-tile p { font-size: 15px; color: var(--ink-soft); }

/* ---- How it works steps ---- */
.steps-list {
  display: grid;
  gap: 32px;
  max-width: 780px;
  margin: 0 auto;
}
.step-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 24px;
  align-items: start;
}
.step-num {
  font-family: var(--ff-display);
  font-size: 48px;
  line-height: 1;
  color: var(--accent);
  font-style: italic;
  font-weight: 400;
}
.step-item h4 {
  font-family: var(--ff-display);
  font-size: 24px;
  font-weight: 400;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.step-item p { color: var(--ink-soft); }

/* ---- FAQ ---- */
.faq-list { max-width: 780px; margin: 0 auto; }
.faq-item {
  border-bottom: 1px solid var(--rule);
  padding: 20px 0;
}
.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--ff-display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.01em;
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.faq-q .caret {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  display: grid; place-items: center;
  transition: transform 180ms;
}
.faq-item.open .faq-q .caret { transform: rotate(45deg); background: var(--accent); color: white; border-color: var(--accent); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 240ms ease, padding 240ms ease;
  color: var(--ink-soft);
  font-size: 16px;
}
.faq-item.open .faq-a { max-height: 400px; padding-top: 12px; }
.faq-a a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ---- System Status ---- */
.status-loading { font-family: var(--ff-mono); font-size: 13px; color: var(--ink-mute); }
.status-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 28px;
  font-size: 15px;
  font-weight: 500;
}
.status-banner.ok       { background: rgba(34,197,94,0.1);  border: 1px solid rgba(34,197,94,0.25); }
.status-banner.incident { background: rgba(239,68,68,0.1);  border: 1px solid rgba(239,68,68,0.25); }
.status-banner-text { flex: 1; }
.status-banner-link { font-size: 13px; font-weight: 400; color: var(--ink-mute); white-space: nowrap; }
.status-banner-link:hover { color: var(--accent); }

@keyframes status-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  60%       { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.up          { background: #22c55e; animation: status-pulse 2.4s ease infinite; }
.status-dot.down        { background: #ef4444; }
.status-dot.maintenance { background: #f59e0b; }

.status-group { margin-bottom: 24px; }
.status-group-name {
  font-family: var(--ff-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
  padding-bottom: 8px;
}
.status-monitor {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 10px;
  margin-bottom: 6px;
}
.status-monitor-name { flex: 1; font-weight: 500; font-size: 15px; }
.status-monitor-ping { font-family: var(--ff-mono); font-size: 12px; color: var(--ink-mute); }
.status-uptime { font-family: var(--ff-mono); font-size: 12px; font-weight: 500; }
.status-uptime.up          { color: #22c55e; }
.status-uptime.down        { color: #ef4444; }
.status-uptime.maintenance { color: #f59e0b; }

/* ---- Product Manuals ---- */
.manual-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  margin-bottom: 8px;
}
.manual-card-info { flex: 1; }
.manual-card-name { font-weight: 600; font-size: 16px; }
.manual-card-platform { font-family: var(--ff-mono); font-size: 12px; color: var(--ink-mute); margin-top: 3px; }

/* ---- Changelog ---- */
.changelog { max-width: 780px; margin: 0 auto; }
.changelog-entry {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 32px;
  padding: 24px 0;
  border-bottom: 1px solid var(--rule);
}
@media (max-width: 640px) {
  .changelog-entry { grid-template-columns: 1fr; gap: 8px; }
}
.changelog-date {
  font-family: var(--ff-mono);
  font-size: 13px;
  color: var(--ink-mute);
  padding-top: 4px;
}
.changelog-version {
  display: inline-block;
  margin-bottom: 8px;
  font-family: var(--ff-display);
  font-size: 22px;
  letter-spacing: -0.01em;
}
.changelog-version .tag { margin-left: 8px; vertical-align: middle; }
.changelog ul { list-style: none; margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.changelog ul li { padding-left: 16px; position: relative; color: var(--ink-soft); font-size: 15px; }
.changelog ul li::before {
  content: "";
  position: absolute;
  left: 0; top: 10px;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

/* ---- Developer page ---- */
.dev-hero {
  padding: clamp(60px, 8vw, 100px) 0 clamp(40px, 6vw, 64px);
  text-align: center;
}
.dev-intro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 48px;
}
.dev-intro-card {
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
}
.dev-intro-card .mono { color: var(--ink-mute); font-size: 11px; letter-spacing: 0.1em; }
.dev-intro-card h4 { font-family: var(--ff-display); font-size: 22px; font-weight: 400; margin: 10px 0 6px; }
.dev-intro-card p { font-size: 14px; color: var(--ink-soft); }

/* Plugin grid */
.plugin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 40px;
}
.plugin-chip {
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.plugin-chip .glyph {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--bg-alt);
  display: grid; place-items: center;
  font-family: var(--ff-mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  flex-shrink: 0;
}
.plugin-chip .pname { font-weight: 500; font-size: 14px; }
.plugin-chip .pmeta { font-family: var(--ff-mono); font-size: 11px; color: var(--ink-mute); }

/* Code block */
.code-block {
  background: #1a1310;
  color: #f5ead5;
  border-radius: 12px;
  padding: 24px 28px;
  font-family: var(--ff-mono);
  font-size: 13px;
  line-height: 1.65;
  overflow-x: auto;
  box-shadow: var(--shadow);
  position: relative;
}
.code-block .code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #3a2c20;
}
.code-block .code-head span:first-child {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c9b89a;
}
.code-block .code-head .tag { background: rgba(255,122,60,0.15); color: #ff7a3c; border-color: rgba(255,122,60,0.3); }
.code-block pre { margin: 0; }
.code-block .kw { color: #ff9eb5; }
.code-block .str { color: #a5d6a7; }
.code-block .cmt { color: #8a7862; font-style: italic; }
.code-block .fn { color: #82aaff; }
.code-block .num { color: #ffb68a; }

/* ---- Support page ---- */
.support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 48px;
}
.support-card {
  padding: 32px 28px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 14px;
  transition: transform 140ms, box-shadow 140ms;
}
.support-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.support-card .si {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  display: grid; place-items: center;
  margin-bottom: 18px;
}
.support-card h4 {
  font-family: var(--ff-display);
  font-size: 22px;
  font-weight: 400;
  margin-bottom: 6px;
}
.support-card p { font-size: 14px; color: var(--ink-soft); margin-bottom: 14px; }
.support-card a.link {
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Contact form */
.contact-form {
  max-width: 640px;
  margin: 64px auto 0;
  padding: 40px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 16px;
  display: grid;
  gap: 16px;
}
.contact-form label { font-size: 13px; color: var(--ink-soft); display: flex; flex-direction: column; gap: 6px; }
.contact-form input, .contact-form textarea, .contact-form select {
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 8px;
  font: inherit;
  color: var(--ink);
  transition: border-color 120ms;
}
.contact-form input:focus, .contact-form textarea:focus, .contact-form select:focus {
  outline: none;
  border-color: var(--accent);
}
.contact-form textarea { min-height: 120px; resize: vertical; }

/* ---- App Store promo ---- */
.promo-hero {
  min-height: 80vh;
  padding: clamp(80px, 10vw, 140px) 0;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  position: relative;
  overflow: hidden;
  text-align: center;
}
[data-theme="atelier"] .promo-hero { background: var(--accent); color: var(--paper); }
[data-theme="panic"] .promo-hero { background: linear-gradient(180deg, #ff7a3c, #d65620); }
.promo-hero .container { position: relative; z-index: 2; }
.promo-hero .product-icon {
  width: 160px; height: 160px; margin: 0 auto 32px;
}
.promo-hero h1 {
  font-family: var(--ff-display);
  font-size: clamp(56px, 9vw, 120px);
  letter-spacing: -0.03em;
  line-height: 0.95;
  font-weight: 400;
  margin-bottom: 12px;
}
.promo-hero h1 em { font-style: italic; }
.promo-hero .tagline {
  font-family: var(--ff-display);
  font-style: italic;
  font-size: clamp(24px, 2.8vw, 36px);
  margin-bottom: 32px;
  opacity: 0.95;
}
.promo-hero .lead { color: rgba(255,255,255,0.9); margin: 0 auto 36px; max-width: 540px; }
.promo-hero .appstore { background: rgba(0,0,0,0.85); color: #fff; }
.promo-hero .meta-row {
  margin-top: 40px;
  display: flex;
  gap: 32px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 13px;
  font-family: var(--ff-mono);
  letter-spacing: 0.05em;
  opacity: 0.85;
}
.promo-hero .meta-row span { display: flex; align-items: center; gap: 6px; }

/* big decorative circles */
.orbit {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  pointer-events: none;
}
.orbit.o1 { width: 400px; height: 400px; top: -100px; left: -100px; }
.orbit.o2 { width: 260px; height: 260px; bottom: -80px; right: 10%; }
.orbit.o3 { width: 120px; height: 120px; top: 30%; right: -40px; }

/* Promo screenshots row */
.promo-shots {
  background: var(--bg);
  padding: clamp(60px, 8vw, 100px) 0;
}
.promo-shots-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 820px) {
  .promo-shots-row { grid-template-columns: 1fr; }
}
.promo-shot {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  display: flex;
  flex-direction: column;
}
.promo-shot .shot-cap {
  padding: 14px 18px;
  font-size: 13px;
  color: var(--ink-soft);
  border-top: 1px solid var(--rule);
  background: var(--bg-alt);
}
.promo-shot .shot-body {
  flex: 1;
  background: repeating-linear-gradient(
    45deg,
    var(--bg-alt) 0 10px,
    color-mix(in srgb, var(--bg-alt) 70%, var(--paper)) 10px 20px
  );
  display: grid;
  place-items: center;
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Floating paper label */
.paper-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 6px 14px;
  border-radius: 999px;
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
  transform: rotate(-1deg);
}
.paper-tag .pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulseRing 2s infinite;
}
@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---- Legal pages (privacy, terms) ---- */
.legal-hero {
  padding: clamp(60px, 8vw, 100px) 0 clamp(40px, 5vw, 64px);
  border-bottom: 1px solid var(--rule);
}
.legal-body {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(48px, 6vw, 80px) var(--gutter);
}
.legal-body h2 {
  font-family: var(--ff-display);
  font-size: clamp(22px, 2.5vw, 30px);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 40px 0 12px;
  line-height: 1.1;
}
.legal-body h2:first-child { margin-top: 0; }
.legal-body p {
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 16px;
}
.legal-body ul {
  margin: 0 0 16px 20px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.7;
}
.legal-body ul li { margin-bottom: 6px; }
.legal-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.legal-meta {
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: 8px;
  letter-spacing: 0.05em;
}
