:root {
  --bg: #f4f3ef;
  --surface: #ffffff;
  --ink: #141414;
  --muted: #6d6b66;
  --line: rgba(20, 20, 20, 0.09);
  --accent: #ff5a2b;
  --chip: rgba(20, 20, 20, 0.06);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px -12px rgba(0, 0, 0, 0.12);
  --device: #0e0e10;
  --device-rim: #3b3b3f;
  --radius: 22px;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, "Segoe UI", Roboto, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0c0d;
    --surface: #17171a;
    --ink: #f1f0ec;
    --muted: #9b9993;
    --line: rgba(255, 255, 255, 0.09);
    --chip: rgba(255, 255, 255, 0.08);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 40px -16px rgba(0, 0, 0, 0.6);
    --device: #050506;
    --device-rim: #4a4a50;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: saturate(1.6) blur(18px);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -0.01em; text-decoration: none; }
.brand svg { width: 26px; height: 22px; }
.top nav { display: flex; gap: 6px; }
.top nav a { text-decoration: none; font-size: 15px; padding: 6px 12px; border-radius: 99px; color: var(--muted); }
.top nav a:hover, .top nav a[aria-current] { color: var(--ink); background: var(--chip); }

/* ---------- Type ---------- */
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.03em; line-height: 1.05; }
.display { font-size: clamp(44px, 8vw, 92px); font-weight: 700; letter-spacing: -0.045em; }
.display em { font-style: normal; color: var(--accent); }
.lede { font-size: clamp(18px, 2vw, 22px); color: var(--muted); margin: 18px 0 0; max-width: 34ch; letter-spacing: -0.01em; }
.eyebrow { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px; border-radius: 99px; border: 0; cursor: pointer;
  background: var(--ink); color: var(--bg); font-weight: 600; font-size: 15px; text-decoration: none;
  transition: transform .15s ease, opacity .15s ease;
}
.btn:hover { opacity: .88; }
.btn:active { transform: scale(.97); }
.btn.ghost { background: var(--chip); color: var(--ink); }
.btn.small { height: 34px; padding: 0 14px; font-size: 14px; }
.btn.danger { background: transparent; color: #e5484d; box-shadow: inset 0 0 0 1px currentColor; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- Device frames ---------- */
.device {
  --r: 0.687;
  position: relative; flex: none;
  aspect-ratio: var(--ar, 1398 / 2034);
  background: var(--device);
  border-radius: 12.5% / calc(12.5% * var(--r));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    0 0 0 1.5px var(--device-rim),
    0 40px 60px -30px rgba(0, 0, 0, 0.45);
}
.device.inner {
  /* hinge side */
  background: linear-gradient(90deg, #26262a 0, var(--device) 2.2%);
}
.device > img, .device > .screen {
  position: absolute;
  top: calc(3.2% * var(--r)); left: 3.2%;
  width: 93.6%; height: calc(100% - 6.4% * var(--r));
  object-fit: cover;
  border-radius: 9.6% / calc(9.6% * var(--r));
  background: #1c1c1e;
}
/* Real bezel: screenshot sits in the measured screen hole, bezel PNG on top. */
.device.bezel {
  aspect-ratio: auto; background: none; border-radius: 0; box-shadow: none;
  filter: drop-shadow(0 28px 28px rgba(0, 0, 0, 0.28));
}
.device.bezel > img:first-child, .device.bezel > .screen {
  top: var(--sy); left: var(--sx); width: var(--sw); height: var(--sh);
  /* No rounding: the bezel on top shapes the corners, and the hinge side is square. */
  border-radius: 0;
}
.device.bezel > .bezel-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  background: none; border-radius: 0; object-fit: fill; pointer-events: none;
}
.card .stage .device.bezel { box-shadow: none; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.2)); }
.screen.placeholder { background: linear-gradient(160deg, #ffb38a, #ff5a2b 45%, #6b2bff); }
.screen.placeholder.b { background: linear-gradient(200deg, #9ad1ff, #3c6bff 50%, #151a44); }

.duo { display: flex; align-items: flex-end; gap: 4%; }

/* ---------- Hero ---------- */
.hero { padding: clamp(48px, 9vw, 120px) 0 clamp(40px, 6vw, 80px); display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.hero .actions { display: flex; gap: 10px; margin-top: 32px; flex-wrap: wrap; }
.hero-art { display: flex; justify-content: center; }
.hero-art .duo { gap: 22px; }
.hero-art a { text-decoration: none; }
.hero-caption { margin-top: 22px; display: flex; align-items: center; gap: 12px; justify-content: center; font-size: 15px; }
.hero-caption img { width: 32px; height: 32px; }

/* ---------- Grid ---------- */
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 24px 0 22px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(28px, 4vw, 40px); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 0; background: var(--chip); padding: 7px 14px; border-radius: 99px; font-size: 14px; cursor: pointer; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; padding-bottom: 96px; }
.grid.featured { grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); padding-bottom: 40px; }
.grid.featured .stage { height: 340px; }
.card {
  display: flex; flex-direction: column; text-decoration: none;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; transition: transform .25s cubic-bezier(.2,.7,.2,1);
}
.card:hover { transform: translateY(-4px); }
.card .stage {
  height: 270px; display: flex; align-items: flex-end; justify-content: center;
  padding: 32px 24px 0; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 100%, var(--chip), transparent 70%);
}
.card .stage .device { box-shadow: inset 0 0 0 1px rgba(255,255,255,.07), 0 0 0 1px var(--device-rim); }
.card .meta { display: flex; gap: 14px; align-items: center; padding: 18px 20px 20px; border-top: 1px solid var(--line); }
.card .meta div { min-width: 0; }
.card h3 { font-size: 17px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card p { margin: 2px 0 0; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.badge {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em; vertical-align: middle;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.app-head .badge { margin-bottom: 10px; }
.badge.quiet { color: var(--muted); background: var(--chip); text-transform: capitalize; }
.card .stage { position: relative; }
.card .stage .badge { position: absolute; top: 14px; left: 14px; background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.avail { margin-top: 16px; }
.avail .seg button { padding: 6px 14px; font-size: 13px; }
label.check { display: flex; gap: 10px; align-items: center; margin-top: 16px; font-size: 15px; cursor: pointer; }
label.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }

.icon { width: 56px; height: 56px; border-radius: 22.5%; flex: none; box-shadow: 0 0 0 0.5px var(--line); background: var(--chip); object-fit: cover; }
.icon.lg { width: 112px; height: 112px; }

.empty { text-align: center; padding: 64px 0 120px; color: var(--muted); }

/* ---------- App page ---------- */
.app-head { display: flex; gap: 28px; align-items: center; padding: 56px 0 40px; flex-wrap: wrap; }
.app-head h1 { font-size: clamp(34px, 5vw, 56px); }
.app-head .by { margin: 6px 0 0; color: var(--muted); font-size: 18px; }
.app-head .tag { margin: 12px 0 0; font-size: 20px; letter-spacing: -0.01em; max-width: 46ch; }
.app-head .actions { display: flex; gap: 10px; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.facts { display: flex; gap: 8px; flex-wrap: wrap; }
.fact { font-size: 13px; padding: 5px 11px; border-radius: 99px; background: var(--chip); color: var(--muted); }

.shelf { padding: 28px 0 8px; border-top: 1px solid var(--line); }
.shelf h2 { font-size: 22px; letter-spacing: -0.02em; margin-bottom: 4px; }
.rail { display: flex; gap: 28px; overflow-x: auto; padding: 24px 4px 56px; scroll-snap-type: x mandatory; scrollbar-width: none; align-items: flex-end; }
.rail::-webkit-scrollbar { display: none; }
.rail figure { margin: 0; position: relative; scroll-snap-align: start; }
.rail figcaption { margin-top: 14px; font-size: 14px; color: var(--muted); text-align: center; max-width: 100%; }
.shot-btn { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; transition: transform .25s cubic-bezier(.2,.7,.2,1); }
.shot-btn:hover { transform: translateY(-3px); }
.shot-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 8px; border-radius: 24px; }

.lightbox {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(24px) saturate(1.3); -webkit-backdrop-filter: blur(24px) saturate(1.3);
  animation: lb-in .2s ease;
}
@keyframes lb-in { from { opacity: 0; } }
.lb-stage { margin: 0 0 60px; }
.lb-close, .lb-nav {
  position: absolute; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--chip); color: var(--ink); display: grid; place-items: center;
}
.lb-close { top: 18px; right: 18px; width: 40px; height: 40px; font-size: 16px; }
.lb-nav { top: 50%; width: 48px; height: 48px; font-size: 28px; line-height: 1; transform: translateY(-50%); }
.lb-nav.prev { left: 18px; }
.lb-nav.next { right: 18px; }
.lb-bar {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; gap: 16px; align-items: center; white-space: nowrap; font-size: 15px;
}
@media (max-width: 600px) { .lb-bar { flex-direction: column; gap: 8px; } }

.about { display: grid; grid-template-columns: 1fr 300px; gap: 48px; padding: 40px 0 96px; border-top: 1px solid var(--line); }
.about .desc { white-space: pre-line; max-width: 68ch; }
.about .desc.clamp { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.about aside { display: grid; gap: 12px; align-content: start; }
.panel { background: var(--surface); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.panel h3 { font-size: 17px; letter-spacing: -0.01em; margin-bottom: 6px; }
.panel p { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-weight: 600; margin-top: 8px; }

.notice { margin-top: 24px; padding: 12px 16px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 12%, transparent); font-size: 15px; }

/* ---------- Forms ---------- */
.form-page { padding: 56px 0 120px; display: grid; grid-template-columns: 1fr; max-width: 760px; }
.form-page h1 { font-size: clamp(36px, 5vw, 56px); }
.step { margin-top: 40px; }
.step > h2 { font-size: 20px; letter-spacing: -0.02em; margin-bottom: 14px; display: flex; gap: 10px; align-items: center; }
.step > h2 span { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--bg); font-size: 14px; display: inline-grid; place-items: center; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fields .full { grid-column: 1 / -1; }
label.f { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.input, label.f input, label.f textarea, label.f select {
  width: 100%; height: 48px; padding: 0 16px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface); font-size: 16px; font-weight: 400; color: var(--ink);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
label.f textarea { height: auto; min-height: 150px; padding: 12px 16px; resize: vertical; line-height: 1.5; }
.input:focus, label.f input:focus, label.f textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 4px var(--chip); }
.lookup { display: flex; gap: 10px; }
.lookup .input { flex: 1; }
.results { display: grid; gap: 6px; margin-top: 10px; }
.result { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; }
.result:hover { border-color: var(--ink); }
.result .icon { width: 40px; height: 40px; }
.result small { display: block; color: var(--muted); }

.icon-pick { display: flex; gap: 16px; align-items: center; }
.icon-pick .icon { width: 80px; height: 80px; }

.drop {
  border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 28px; text-align: center;
  color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; font-size: 15px;
}
.drop.over, .drop:hover { border-color: var(--ink); background: var(--chip); }
.drop strong { color: var(--ink); }
.shots { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 18px; align-items: flex-end; }
.shot-item { display: grid; gap: 10px; justify-items: center; }
.seg { display: inline-flex; background: var(--chip); border-radius: 99px; padding: 3px; }
.seg button { border: 0; background: none; padding: 4px 10px; border-radius: 99px; font-size: 12px; cursor: pointer; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.tools { display: flex; gap: 4px; }
.shot-item .caption { width: 130px; height: 32px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; text-align: center; }
.tools button { border: 0; background: var(--chip); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 13px; line-height: 1; }
.hint { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.error { color: #e5484d; font-size: 15px; margin-top: 14px; min-height: 1.5em; }
.submit-row { display: flex; gap: 12px; align-items: center; margin-top: 36px; flex-wrap: wrap; }

.done { text-align: left; padding: 32px; }
.done .lede { max-width: 52ch; }
.done .copy { display: flex; gap: 8px; margin-top: 16px; }
.done .copy input { flex: 1; font-size: 14px; }

/* ---------- Admin ---------- */
.row { display: flex; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.row .grow { flex: 1; min-width: 200px; }
.row .thumbs { display: flex; gap: 6px; align-items: flex-end; }
.row-actions { display: flex; gap: 8px; flex: none; }
.relink { flex-basis: 100%; display: flex; gap: 10px; align-items: center; font-size: 13px; }
.relink .input { flex: 1; height: 38px; font-size: 13px; }

footer { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 13px; color: var(--muted); }
footer a { color: var(--ink); text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 1fr; }
  .icon.lg { width: 88px; height: 88px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
