/* Pipit: Precision studio dark emerald aesthetic. Loaded after site.css.
   Tokens come from Pipit's design system: deep studio green (#0C261E, #133B2E) and precision mint (#8EDDB8). */
:root.pipit {
  --paper: #0c261e;
  --ink: #f2f6f4;
  --ink-2: #b9ccc3;
  --ink-3: #8fa79c;
  --line: rgb(142 221 184 / 0.15);
  --link: #8eddb8;
  --card: #133b2e;
  --surface-alt: #1e4a3b;
  --device: #061712;
  --icon-edge: rgb(142 221 184 / 0.18);
  --brand: #8eddb8;
  --on-brand: #0c261e;
  --chip: #255947;
  --glow-color: rgb(142 221 184 / 0.2);
  --shadow-card: 0 0 0 1px rgb(142 221 184 / 0.1), 0 16px 40px -12px rgb(0 0 0 / 0.7);
}

@media (prefers-color-scheme: dark) {
  :root.pipit {
    --paper: #0c261e;
    --ink: #f2f6f4;
    --ink-2: #b9ccc3;
    --ink-3: #8fa79c;
    --line: rgb(142 221 184 / 0.15);
    --link: #8eddb8;
    --card: #133b2e;
    --surface-alt: #1e4a3b;
  }
}

.pipit .dark {
  background: var(--paper);
  color: var(--ink);
}

.pipit .top.wrap { width: auto; margin: 0; padding-inline: var(--gutter); }

/* ---------- Hero & Compressor Console ---------- */
.stage.pipit-stage {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 500px at 75% 20%, rgb(35 107 84 / 0.35), transparent 70%),
    radial-gradient(1000px 600px at 15% 0%, rgb(20 60 47 / 0.3), transparent 75%),
    var(--paper);
}

.pipit-stage .stage-in {
  display: grid;
  gap: 48px;
  padding-block: var(--hero-top-space) clamp(56px, 7vw, 104px);
}

.pipit-stage h1 {
  font-size: clamp(2.375rem, 0.9rem + 4.9vw, 7.5rem);
}

@media (min-width: 960px) {
  .pipit-stage .stage-in {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.96fr);
    column-gap: clamp(48px, 6vw, 112px);
    align-items: start;
  }
}

/* Compressor Console Card */
.pipit-console {
  position: relative;
  isolation: isolate;
  background: linear-gradient(180deg, rgb(19 59 46 / 0.85) 0%, rgb(11 36 28 / 0.95) 100%);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(20px, 3.5vw, 36px);
  box-shadow: var(--shadow-card), 0 0 60px -20px var(--glow-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.console-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.console-title {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* Compare Toggle Pill */
.compare-toggle {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.35);
  border: 1px solid var(--line);
}
.compare-btn {
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-2);
  background: none;
  border: 0;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}
.compare-btn.active {
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: 0 0 12px -2px var(--glow-color);
}

/* Viewfinder Photo Display */
.viewfinder-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 18px;
  overflow: hidden;
  background: #000000;
  border: 1px solid rgb(142 221 184 / 0.2);
}
.viewfinder-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Viewfinder Corner Overlays */
.vf-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  pointer-events: none;
  border: 3px solid var(--brand);
}
.vf-tl { top: 12px; left: 12px; border-right: 0; border-bottom: 0; border-top-left-radius: 6px; }
.vf-tr { top: 12px; right: 12px; border-left: 0; border-bottom: 0; border-top-right-radius: 6px; }
.vf-bl { bottom: 12px; left: 12px; border-right: 0; border-top: 0; border-bottom-left-radius: 6px; }
.vf-br { bottom: 12px; right: 12px; border-left: 0; border-top: 0; border-bottom-right-radius: 6px; }

/* HUD Badges */
.vf-hud-top {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 14px;
  border-radius: 999px;
  background: rgb(12 38 30 / 0.85);
  border: 1px solid var(--line);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--brand);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  white-space: nowrap;
}
.vf-hud-bottom {
  position: absolute;
  bottom: 14px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 14px;
  border-radius: 12px;
  background: rgb(12 38 30 / 0.85);
  border: 1px solid var(--line);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Preset Chips */
.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.preset-btn {
  position: relative;
  isolation: isolate;
  cursor: pointer;
  margin: 0;
}
.preset-btn input {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.preset-btn span {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-2);
  background: rgb(255 255 255 / 0.04);
  border: 1px solid rgb(255 255 255 / 0.08);
  transition: all 0.25s var(--ease-out);
}
.preset-btn input:focus-visible + span { outline: 2px solid currentColor; outline-offset: 3px; }
.preset-btn input:checked ~ span {
  background: rgb(142 221 184 / 0.2);
  color: var(--ink);
  border-color: var(--brand);
  box-shadow: 0 0 16px -4px var(--glow-color);
}
.preset-btn:hover span {
  color: var(--ink);
  border-color: rgb(142 221 184 / 0.35);
}

/* Continuous Slider */
.slider-control {
  margin-top: 18px;
}
.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.kb-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  outline: none;
  background: rgb(255 255 255 / 0.12);
  -webkit-appearance: none;
  appearance: none;
}
.kb-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand);
  cursor: pointer;
  box-shadow: 0 0 10px var(--glow-color);
}

/* Live Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
  padding: 16px 14px;
  border-radius: 16px;
  background: rgb(0 0 0 / 0.28);
  border: 1px solid rgb(255 255 255 / 0.06);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.stat-item dt {
  font-size: 0.75rem;
  color: var(--ink-3);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.stat-item dd {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
}
.stat-item dd.highlight {
  color: var(--brand);
}

/* Note box */
.console-note-card {
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgb(142 221 184 / 0.08);
  border-left: 3px solid var(--brand);
}
.console-note-card p {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-2);
}
.pipit-console .fine {
  margin-top: 14px;
  font-size: 0.75rem;
  color: var(--ink-3);
  text-align: center;
}

/* ---------- Specifications & Canvas Modes ---------- */
.specs-section {
  padding-block: var(--section);
  background: linear-gradient(180deg, var(--paper) 0%, #103328 50%, var(--paper) 100%);
}
.specs-grid {
  display: grid;
  gap: 24px;
  list-style: none;
  padding: 0;
  margin: 0;
}
@media (min-width: 720px) {
  .specs-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.spec-card {
  position: relative;
  padding: 28px;
  border-radius: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 4px 20px rgb(0 0 0 / 0.3);
  display: flex;
  flex-direction: column;
}
.spec-ratio-box {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: #081a14;
  border: 1px solid rgb(142 221 184 / 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  overflow: hidden;
}
.spec-canvas {
  height: 86%;
  aspect-ratio: var(--ratio);
  display: grid;
  place-items: center;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  background: #e4ede8;
  outline: 1px solid var(--brand);
}
.spec-inner-photo {
  width: 100%;
  max-width: none;
  height: auto;
  display: block;
  transition: transform 280ms ease-in-out;
}
.specs-grid[data-mode="crop"] .spec-inner-photo {
  /* Scale the 1032 × 773 sample until its height fills the target canvas. */
  transform: scale(calc(1032 / 773 / var(--ratio)));
}
.spec-card h3 {
  font-size: 1.25rem;
  color: #ffffff;
  margin-bottom: 6px;
}
.spec-metric {
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--brand);
  margin-bottom: 10px;
}
.spec-card p {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-2);
}

/* Canvas Mode Switcher inside specs */
.canvas-mode-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 36px;
}
.canvas-mode-btn {
  padding: 8px 20px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--card);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.2s;
}
.canvas-mode-btn.active {
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: 0 0 16px -4px var(--glow-color);
}

/* ---------- Formats & Batch Showcase ---------- */
.formats-section {
  padding-block: var(--section);
  border-top: 1px solid var(--line);
}
.formats-grid {
  display: grid;
  gap: 24px;
  margin-top: 40px;
}
@media (min-width: 900px) {
  .formats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.format-card {
  padding: 28px;
  border-radius: 22px;
  background: var(--card);
  border: 1px solid var(--line);
}
.format-card h3 { font-size: 1.25rem; color: #ffffff; margin-bottom: 10px; }
.format-card p { font-size: 0.9375rem; line-height: 1.6; color: var(--ink-2); }

/* Batch Processing Hero Card */
.batch-wide-card {
  margin-top: 36px;
  padding: clamp(28px, 4vw, 44px);
  border-radius: 28px;
  background: linear-gradient(180deg, #163f31 0%, #0e2920 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  display: grid;
  gap: 28px;
  align-items: center;
}
@media (min-width: 860px) {
  .batch-wide-card {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.batch-copy h3 {
  font-size: 1.75rem;
  color: #ffffff;
  margin-bottom: 12px;
}
.batch-copy p {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-2);
}

/* 10x10 Matrix Grid */
.batch-matrix-box {
  background: #081a14;
  border-radius: 18px;
  padding: 20px;
  border: 1px solid rgb(142 221 184 / 0.15);
}
.matrix-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px;
}
.matrix-dot {
  aspect-ratio: 1;
  border-radius: 3px;
  background: rgb(142 221 184 / 0.18);
  transition: background-color 0.4s, transform 0.2s;
}
.matrix-dot.done {
  background: var(--brand);
  box-shadow: 0 0 6px var(--brand);
}
.matrix-status {
  margin-top: 16px;
  font-family: monospace;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--brand);
  display: flex;
  justify-content: space-between;
}

/* Honest section dashes */
.pipit .nots li::before { background: var(--brand); }
