/* ─────────────────────────────────────────────────────────────
   WALL FRAMES — monochrome, viewfinder / lab-instrument
   pure #000 ↔ #f4f4f4 · Geist (display) + Geist Mono (technical)
   ───────────────────────────────────────────────────────────── */

:root {
  --bg: #000;
  --fg: #f4f4f4;
  --fg-dim: #8e8e90;
  --fg-faint: #4a4a4d;
  --line: #1a1a1c;
  --line-bright: #2c2c30;
  --invert-bg: #f4f4f4;
  --invert-fg: #000;
  --font-display: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
  --col-w: 560px;
}

*, *::before, *::after { box-sizing: border-box; }
* { -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--fg);
  font-family: var(--font-display);
  font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  overflow-x: hidden;
  /* sharp baseline grid feel */
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 80px 80px;
  background-position: -1px -1px;
  background-attachment: fixed;
}
body::before {
  /* fade the grid out near top/bottom for elegance */
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse at center, transparent 0%, var(--bg) 78%);
}

/* film grain overlay */
.grain {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 100;
  opacity: 0.08;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.45 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
}

/* ── topbar ─────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  border-bottom: 1px solid var(--line-bright);
}
.topbar-row {
  max-width: var(--col-w); margin: 0 auto;
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.12em;
}
.topbar-brand { display: flex; align-items: center; gap: 9px; }
.brand-mark {
  width: 9px; height: 9px;
  background: var(--fg);
  display: inline-block;
  box-shadow: 0 0 8px rgba(255,255,255,0.4);
}
.brand-text { font-weight: 500; color: var(--fg); }
.topbar-meta { display: flex; align-items: center; gap: 12px; color: var(--fg-dim); }
.meta-item { display: inline-flex; align-items: center; gap: 6px; }
.dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--fg); display: inline-block;
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.meta-divider { width: 1px; height: 11px; background: var(--line-bright); }

/* ── stage / column ─────────────────────────────── */
.stage {
  flex: 1; width: 100%;
  max-width: var(--col-w);
  margin: 0 auto;
  padding: 36px 20px 80px;
  position: relative; z-index: 2;
}

/* ── step transitions ───────────────────────────── */
.step { display: none; }
.step.is-active {
  display: block;
  animation: step-in 380ms var(--ease) both;
}
@keyframes step-in {
  from { opacity: 0; transform: translateY(10px); filter: blur(2px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}

/* ── step head ──────────────────────────────────── */
.step-head { margin-bottom: 28px; }
.step-num {
  display: inline-block;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em;
  color: var(--fg-dim);
  border: 1px solid var(--line-bright);
  padding: 4px 8px 3px;
  margin-bottom: 14px;
}
.step-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 6vw, 36px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0 0 8px;
}
.step-sub {
  color: var(--fg-dim);
  font-size: 14px;
  margin: 0;
  letter-spacing: 0.005em;
}

/* ── frame with viewfinder corner brackets ─────── */
.frame { position: relative; }
.corner {
  position: absolute; width: 14px; height: 14px;
  border: 1px solid var(--fg);
  pointer-events: none;
}
.corner.tl { top: -1px; left: -1px;  border-right: 0; border-bottom: 0; }
.corner.tr { top: -1px; right: -1px; border-left: 0;  border-bottom: 0; }
.corner.bl { bottom: -1px; left: -1px;  border-right: 0; border-top: 0; }
.corner.br { bottom: -1px; right: -1px; border-left: 0;  border-top: 0; }

/* ── dropzone ───────────────────────────────────── */
.dropzone {
  display: flex; align-items: center; justify-content: center;
  min-height: 320px;
  border: 1px dashed var(--line-bright);
  cursor: pointer;
  user-select: none; -webkit-user-select: none;
  transition: border-color 220ms var(--ease), background 220ms var(--ease);
  outline: none;
}
.dropzone:hover,
.dropzone:focus-visible,
.dropzone.is-hover {
  border-color: var(--fg-dim);
  background: rgba(255, 255, 255, 0.014);
}
.dropzone:focus-visible .corner { border-color: var(--fg); }
.dz-inner {
  text-align: center;
  padding: 36px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.dz-cross {
  position: relative;
  width: 26px; height: 26px;
}
.dz-cross span {
  position: absolute; background: var(--fg);
  display: block;
}
.dz-cross span:nth-child(1) { top: 50%; left: 0; right: 0; height: 1px; transform: translateY(-50%); }
.dz-cross span:nth-child(2) { left: 50%; top: 0; bottom: 0; width: 1px; transform: translateX(-50%); }
.dz-label {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.22em;
  color: var(--fg);
}
.dz-meta {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.16em;
  color: var(--fg-faint);
}

/* ── touch-only camera/library actions ──────────── */
.touch-actions {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
@media (pointer: coarse) {
  .touch-actions { display: grid; }
}

.step-foot {
  margin-top: 22px;
  font-size: 10px; letter-spacing: 0.18em;
  color: var(--fg-faint);
  text-align: center;
}

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}

/* ── preview frame (image / video) ──────────────── */
.preview {
  margin-bottom: 30px;
  background: #050505;
  overflow: hidden;
}
.preview img,
.preview video {
  width: 100%; display: block;
  max-height: 380px;
  object-fit: contain;
  background: #050505;
}

/* ── controls ──────────────────────────────────── */
.control { margin-bottom: 24px; }
.control-label {
  display: flex; align-items: baseline; gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.18em;
  color: var(--fg-dim);
  margin-bottom: 10px;
}
.control-aside {
  color: var(--fg-faint);
  font-size: 10px;
  letter-spacing: 0.12em;
  margin-left: auto;
}

/* ── option grids ──────────────────────────────── */
.opt-grid { display: grid; gap: 6px; }
.opt-grid.four { grid-template-columns: repeat(4, 1fr); }
.opt-grid.two  { grid-template-columns: 1fr 1fr; }
@media (max-width: 480px) {
  .opt-grid.four { grid-template-columns: 1fr 1fr; }
}

.opt {
  appearance: none;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line-bright);
  padding: 14px 12px;
  font-family: var(--font-display);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  display: flex; flex-direction: column; gap: 3px;
  min-height: 52px;
  transition:
    background 160ms var(--ease),
    color 160ms var(--ease),
    border-color 160ms var(--ease),
    transform 100ms var(--ease);
}
.opt:hover { border-color: var(--fg-dim); }
.opt:focus-visible { outline: 1px solid var(--fg); outline-offset: 2px; }
.opt:active { transform: scale(0.985); }
.opt.is-selected {
  background: var(--invert-bg);
  color: var(--invert-fg);
  border-color: var(--invert-bg);
}
.opt-name { font-weight: 500; letter-spacing: -0.005em; }
.opt-sub  { font-size: 10px; letter-spacing: 0.1em; opacity: 0.65; }
.opt.is-selected .opt-sub { opacity: 0.55; }

/* ── prompt textarea (also framed with corners) ── */
.prompt-wrap { padding: 0; }
.prompt-input {
  display: block;
  width: 100%;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line-bright);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 13px; line-height: 1.65;
  letter-spacing: 0.01em;
  resize: vertical;
  min-height: 92px;
  outline: none;
  transition: border-color 160ms var(--ease), background 160ms var(--ease);
}
.prompt-input::placeholder { color: var(--fg-faint); }
.prompt-input:focus {
  border-color: var(--fg-dim);
  background: rgba(255,255,255,0.012);
}

/* ── chips ─────────────────────────────────────── */
.chips {
  display: flex; gap: 6px;
  margin-top: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 6px;
  /* bleed off-screen for nice mobile horizontal-scroll feel */
  margin-left: -20px; margin-right: -20px;
  padding-left: 20px; padding-right: 20px;
  scroll-snap-type: x proximity;
  mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  appearance: none; background: transparent;
  color: var(--fg-dim);
  border: 1px solid var(--line-bright);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
  scroll-snap-align: start;
  transition: color 140ms var(--ease), border-color 140ms var(--ease), background 140ms var(--ease);
  min-height: 32px;
}
.chip::before { content: '+ '; opacity: 0.5; }
.chip:hover {
  color: var(--fg);
  border-color: var(--fg-dim);
}
.chip:active { background: rgba(255,255,255,0.05); }

/* ── buttons ───────────────────────────────────── */
.action-bar {
  margin-top: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.btn {
  appearance: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid var(--fg);
  padding: 18px 22px;
  text-decoration: none;
  text-align: center;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 12px;
  min-height: 56px;
  position: relative;
  overflow: hidden;
  transition: background 180ms var(--ease), color 180ms var(--ease), transform 80ms var(--ease);
  color: var(--fg);
  background: transparent;
}
.btn:active { transform: scale(0.99); }
.btn:focus-visible { outline: 1px solid var(--fg); outline-offset: 3px; }

.btn-primary {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.btn-primary:hover { background: #fff; }

.btn-secondary {
  background: transparent;
  color: var(--fg);
  border-color: var(--line-bright);
}
.btn-secondary:hover {
  border-color: var(--fg-dim);
  background: rgba(255,255,255,0.025);
}

.btn-sub {
  font-size: 10px;
  letter-spacing: 0.16em;
  opacity: 0.55;
}
.btn-label { letter-spacing: -0.005em; }

/* generate button shimmer */
.btn-generate::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(
    105deg,
    transparent 38%,
    rgba(0, 0, 0, 0.16) 50%,
    transparent 62%
  );
  transform: translateX(-110%);
  animation: shimmer 4.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes shimmer {
  0%   { transform: translateX(-110%); }
  55%  { transform: translateX(110%); }
  100% { transform: translateX(110%); }
}

.link {
  appearance: none; background: transparent;
  color: var(--fg-dim);
  border: 0; cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  padding: 12px;
  text-align: center;
  transition: color 140ms var(--ease);
}
.link:hover { color: var(--fg); }

/* ── progress step ─────────────────────────────── */
.progress-inner {
  text-align: center;
  padding: 64px 0 48px;
}
.arc {
  width: 56px; height: 56px;
  margin: 0 auto 32px;
  color: var(--fg);
  animation: arc-rotate 1.4s linear infinite;
}
.arc svg { width: 100%; height: 100%; }
@keyframes arc-rotate { to { transform: rotate(360deg); } }

.progress-label {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.32em;
  color: var(--fg-dim);
  margin-bottom: 10px;
}
.progress-clock {
  font-size: 56px; font-weight: 300;
  letter-spacing: 0.04em;
  margin-bottom: 20px;
  font-variant-numeric: tabular-nums;
}
.progress-hint {
  font-size: 13px;
  color: var(--fg-faint);
  letter-spacing: 0.02em;
}

/* ── result step ───────────────────────────────── */
.meta-row {
  font-size: 10px; letter-spacing: 0.18em;
  color: var(--fg-dim);
  margin: 0 0 24px;
  text-align: center;
}

.tv-info {
  margin-top: 28px;
  border: 1px solid var(--line-bright);
  padding: 14px 16px;
  background: rgba(255,255,255,0.012);
}
.tv-info summary {
  cursor: pointer; color: var(--fg-dim);
  font-size: 11px; letter-spacing: 0.18em;
  list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.tv-info summary::-webkit-details-marker { display: none; }
.tv-info[open] summary { color: var(--fg); margin-bottom: 12px; }
.tv-info ul {
  margin: 8px 0 0; padding: 0; list-style: none;
}
.tv-info li {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: baseline; gap: 12px;
  font-size: 13px;
  color: var(--fg-dim);
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.tv-info li:first-child { border-top: 0; padding-top: 6px; }
.tv-info li .mono {
  color: var(--fg);
  font-size: 10px;
  letter-spacing: 0.16em;
}

/* ── error step ───────────────────────────────── */
.error-num {
  color: var(--fg);
  border-color: var(--fg);
}
.error-msg {
  font-size: 13px;
  color: var(--fg);
  background: var(--line);
  border-left: 2px solid var(--fg);
  padding: 14px 16px;
  margin: 0 0 24px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── privacy checkbox ─────────────────────────── */
.privacy {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--line-bright);
  cursor: pointer;
  margin-bottom: 12px;
  transition: border-color 160ms var(--ease), background 160ms var(--ease);
}
.privacy:hover { border-color: var(--fg-dim); }
.privacy input { position: absolute; opacity: 0; pointer-events: none; }
.privacy-check {
  width: 16px; height: 16px;
  border: 1px solid var(--fg-dim);
  flex-shrink: 0; margin-top: 3px;
  position: relative;
  transition: background 140ms var(--ease), border-color 140ms var(--ease);
}
.privacy input:checked + .privacy-check {
  background: var(--fg);
  border-color: var(--fg);
}
.privacy input:checked + .privacy-check::after {
  content: '';
  position: absolute; left: 4px; top: 0;
  width: 4px; height: 9px;
  border: solid var(--bg);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.privacy-text { display: flex; flex-direction: column; gap: 2px; }
.privacy-title { font-size: 14px; font-weight: 500; color: var(--fg); }
.privacy-sub { font-size: 11px; color: var(--fg-dim); }

/* ── gallery grid ─────────────────────────────── */
/* Full-bleed: gallery breaks out of the 560px content column so the
   tiles can actually be seen on a wide viewport. */
.gallery {
  margin-top: 72px;
  padding: 44px 20px 0;
  border-top: 1px solid var(--line-bright);
  position: relative;
  left: 50%;
  right: 50%;
  width: 100vw;
  margin-left: -50vw;
  margin-right: -50vw;
}
.gallery-head {
  max-width: 1280px;
  margin: 0 auto 28px;
  text-align: left;
}
.gallery-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0 0 8px;
}
.gallery-sub {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--fg-dim);
  margin: 0;
}
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  max-width: 1280px;
  margin: 0 auto;
}
@media (min-width: 640px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
@media (min-width: 1024px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}
.gallery-tile {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #050505;
  border: 1px solid var(--line-bright);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 160ms var(--ease), transform 100ms var(--ease);
}
.gallery-tile:hover {
  border-color: var(--fg);
}
.gallery-tile:active { transform: scale(0.995); }
.gallery-tile video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
/* viewfinder corner brackets on each tile (decorative) */
.gallery-tile::before,
.gallery-tile::after {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  border: 1px solid var(--fg);
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms var(--ease);
}
.gallery-tile::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.gallery-tile::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.gallery-tile:hover::before, .gallery-tile:hover::after { opacity: 1; }
.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--fg-faint);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  padding: 32px 16px;
  border: 1px dashed var(--line-bright);
}

/* ── report form ──────────────────────────────── */
.report-form { margin-top: 18px; }
.report-thanks {
  margin-top: 18px;
  text-align: center;
  font-size: 10px; letter-spacing: 0.22em;
  color: var(--fg-dim);
  border: 1px solid var(--line-bright);
  padding: 14px;
}

/* ── footer ───────────────────────────────────── */
.footbar {
  text-align: center;
  padding: 24px 20px 30px;
  font-size: 9px;
  color: var(--fg-faint);
  letter-spacing: 0.22em;
  border-top: 1px solid var(--line);
  position: relative; z-index: 2;
  background: var(--bg);
  display: flex; flex-wrap: wrap;
  align-items: center; justify-content: center;
  gap: 10px;
}
.foot-divider { color: var(--fg-faint); }
.foot-link {
  color: var(--fg-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--line-bright);
  padding-bottom: 1px;
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}
.foot-link:hover {
  color: var(--fg);
  border-bottom-color: var(--fg);
}

/* ── selection / misc ──────────────────────────── */
::selection { background: var(--fg); color: var(--bg); }

/* reduce motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0ms !important;
  }
}
