/* Bad Inputs · direction D ("Quiet").
   Type: three sizes. 48 display (project title), 20 body, 15 small. Hierarchy comes from weight and colour.
   Dark by default, light when the system asks for it. */

:root {
  color-scheme: dark light;
  --bg: #0A0A0A;
  --ink: #EDEDED;
  --mut: #8A8A8A;
  --line: #1F1F1F;
  --card: #111111;
  --card-on: #1A1A1A;
  --card-bd: #1F1F1F;
  --card-bd-on: #EDEDED;
  --card-hover: #3A3A3A;
  --seg: #161616;
  --seg-on: #EDEDED;
  --seg-on-ink: #0A0A0A;
  --chip: #1A1A1A;
  --chip-hover: #262626;
  --btn: #EDEDED;
  --btn-ink: #0A0A0A;
  --btn-hover: #FFFFFF;
  --btn-sub: #6A6A6A;
  --screen-bg: #16171A;
  --green: #3DDC97;

  --display: 48px;
  --body: 20px;
  --small: 15px;
  --pad: max(16px, 2vw);
  --font: Geist, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #FFFFFF;
    --ink: #0A0A0A;
    --mut: #6B6B6B;
    --line: #EAEAEA;
    --card: #FAFAFA;
    --card-on: #FFFFFF;
    --card-bd: #EAEAEA;
    --card-bd-on: #0A0A0A;
    --card-hover: #CFCFCF;
    --seg: #F2F2F2;
    --seg-on: #FFFFFF;
    --seg-on-ink: #0A0A0A;
    --chip: #F2F2F2;
    --chip-hover: #E6E6E6;
    --btn: #0A0A0A;
    --btn-ink: #FFFFFF;
    --btn-hover: #262626;
    --btn-sub: #8A8A8A;
    --screen-bg: #F2F2F2;
    --green: #12A150;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--mut); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
img { display: block; max-width: 100%; }
h1, h2, p, dl, dd, figure { margin: 0; }
h2 { font-size: var(--body); font-weight: 500; }
.mut { color: var(--mut); }
.num { font-variant-numeric: tabular-nums; }

/* Header */
.site-header {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-header .brand { font-weight: 500; }
.site-header .nav { color: var(--mut); }

/* Screens */
.screen {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 4px;
  overflow: hidden;
  background: var(--screen-bg);
}
.screen img { width: 100%; height: 100%; object-fit: cover; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 60px;
  padding: 0 32px;
  border: 0;
  border-radius: 999px;
  background: var(--btn);
  color: var(--btn-ink);
  font-size: var(--body);
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s ease, transform .15s ease;
}
.btn:hover { background: var(--btn-hover); color: var(--btn-ink); }
.btn:active { transform: scale(.99); }
.btn .sub { color: var(--btn-sub); font-weight: 400; }

/* ---------- Landing ---------- */
.landing { padding: 0 max(16px, 3vw); }
.landing .wrap { max-width: 1320px; margin: 0 auto; }
.concepts {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 240px;
  padding-top: 195px;
}
.concept {
  width: 100%;
  max-width: 1083px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
}
.concept-name {
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 500;
  text-align: center;
}
.concept .screen { transition: transform .4s cubic-bezier(.2,.7,.2,1); }
.concept:hover .screen { transform: translateY(-4px); }
.landing-footer {
  padding: 160px 0 48px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
}
.landing-footer p { max-width: 560px; color: var(--mut); text-wrap: pretty; }
.landing-footer .links { display: flex; gap: 24px; }
.landing-footer .links a { color: var(--mut); }
.landing-footer .links a:hover { color: var(--ink); }

/* ---------- Project page ---------- */
.project { padding: 0 0 120px var(--pad); overflow-x: hidden; }
.project .site-header { padding-right: var(--pad); }
.project-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  grid-template-areas: "screen buy" "info buy";
  column-gap: 64px;
  row-gap: 96px;
  align-items: start;
  padding: 8px var(--pad) 0 0;
}
.project-screen { grid-area: screen; }
.project-info { grid-area: info; display: flex; flex-direction: column; gap: 96px; }
.project-buy {
  grid-area: buy;
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.title-row { display: flex; align-items: center; gap: 14px; }
.title-row h1 { font-size: var(--display); line-height: 1; letter-spacing: -0.04em; font-weight: 500; }
.visit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--mut);
  transition: background .15s ease, color .15s ease;
}
.visit:hover { background: var(--chip-hover); color: var(--ink); }
.visit svg { transition: transform .2s ease; }
.visit:hover svg { transform: translate(1px, -1px); }
.intro { display: flex; flex-direction: column; gap: 16px; }
.intro p { text-wrap: pretty; }

.choose { display: flex; flex-direction: column; gap: 12px; }
.choose-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.seg { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--seg); }
.seg button {
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--mut);
  font-size: var(--small);
  font-weight: 500;
}
.seg button[aria-checked="true"] { background: var(--seg-on); color: var(--seg-on-ink); }

.tier {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 18px;
  border-radius: 14px;
  border: 1.5px solid var(--card-bd);
  background: var(--card);
  text-align: left;
  line-height: 1.4;
  transition: border-color .15s ease, background .15s ease;
}
.tier:hover { border-color: var(--card-hover); }
.tier[aria-checked="true"] { background: var(--card-on); border-color: var(--card-bd-on); }
.tier .text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.tier .name, .tier .price { font-weight: 500; }
.tier .price { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tier .detail { color: var(--mut); }

.buy { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; }
.buy .btn { width: 100%; justify-content: space-between; padding: 0 28px; }
.buy .note { font-size: var(--small); color: var(--mut); text-align: center; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px 32px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding-top: 14px; border-top: 1px solid var(--line); }
.stat .value { font-weight: 500; font-variant-numeric: tabular-nums; }
.stat .label { color: var(--mut); }
.block { display: flex; flex-direction: column; gap: 20px; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 64px 80px; }
.acc summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 20px;
  font-weight: 500;
  pointer-events: none; /* open and fixed on desktop */
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary .chev { display: none; color: var(--mut); transition: transform .2s ease; }
.acc summary .hint { display: none; color: var(--mut); font-weight: 400; }
.rows { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); }
.rows > div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.rows dt { color: var(--mut); }
.rows dd { text-align: right; font-variant-numeric: tabular-nums; }
.rows .total { border-top-color: var(--ink); font-weight: 500; }
.rows .total dt { color: var(--ink); }
.rows .total dd { color: var(--green); }
.rows .total.is-loss dd { color: var(--mut); }
.rows .total-sub dt { color: var(--mut); }
.rows .total-sub dd { color: var(--green); }
.rows .total-sub.is-loss dd { color: var(--mut); }
.footnote { font-size: var(--small); color: var(--mut); max-width: 640px; text-wrap: pretty; }

.shots { display: flex; flex-direction: column; gap: 24px; padding-top: 120px; }
.shots-row {
  container-type: inline-size;
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 0 60px;
  scrollbar-width: none;
}
.shots-row::-webkit-scrollbar { display: none; }
.shots-row::after { content: ""; flex: 0 0 1px; }
.shot {
  flex: 0 0 calc((100cqw - 48px) / 2.5);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.shot .frame {
  aspect-ratio: 16 / 10;
  border-radius: 4px;
  overflow: hidden;
  background: var(--screen-bg);
}
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot figcaption { color: var(--mut); }

.buy-bar { display: none; }

/* ---------- Phone ---------- */
@media (max-width: 820px) {
  :root { --body: 17px; --small: 14px; }
  .site-header { height: 64px; }

  .concepts { gap: 96px; padding-top: 72px; }
  .concept { gap: 20px; }
  .concept-name { font-size: 32px; }
  .concept .screen { border-radius: 4px; }
  .concept .btn { width: 100%; height: 56px; }
  .landing-footer { padding: 96px 0 40px; flex-direction: column; align-items: flex-start; gap: 20px; }

  .project { padding: 0 0 0 16px; }
  .project .site-header { padding-right: 16px; }
  .project-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "screen" "buy" "info";
    row-gap: 56px;
    padding: 4px 16px 0 0;
  }
  .project-screen .screen { border-radius: 4px; }
  .project-buy { position: static; gap: 32px; }
  .title-row h1 { font-size: 40px; }
  .project-info { gap: 56px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Details and running costs become closed accordions */
  .facts { display: flex; flex-direction: column; gap: 0; border-bottom: 1px solid var(--line); }
  .acc summary { pointer-events: auto; cursor: pointer; padding: 16px 0; border-top: 1px solid var(--line); }
  .acc summary .chev, .acc summary .hint { display: inline; }
  .acc[open] summary .chev { transform: rotate(180deg); }
  .acc[open] { padding-bottom: 8px; }
  .acc .rows { border-bottom: 0; }

  .shots { padding-top: 56px; gap: 20px; }
  .shots-row { gap: 14px; padding-bottom: 40px; }
  .shot { flex-basis: calc((100cqw - 14px) / 1.3); gap: 12px; }
  .shot .frame { border-radius: 4px; }

  .buy-bar {
    position: sticky;
    bottom: 0;
    margin-left: -16px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--bg);
    box-shadow: 0 -1px 0 var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .buy-bar .what { display: flex; flex-direction: column; min-width: 0; }
  .buy-bar .what .price { font-weight: 500; font-variant-numeric: tabular-nums; }
  .buy-bar .what .tier-name { font-size: var(--small); color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .buy-bar .btn { height: 48px; padding: 0 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .concept:hover .screen { transform: none; }
}

/* Entrance animations: the reveal panes keep the layout of the block they sit in */
[data-enter] > [skullet-pane],
[data-enter] > [skullet-pane] > div:not([class]),
[data-enter] > [skullet-pane] > div:not([class]) > [skullet-ghost] {
  display: inherit;
  flex-direction: inherit;
  flex-wrap: inherit;
  align-items: inherit;
  justify-content: inherit;
  gap: inherit;
  width: 100%;
}

/* Page transitions (transition.js): the next page waits under the old one while a glimm band sweeps across */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
.sweep {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  pointer-events: none;
  view-transition-name: sweep;
}
@keyframes sweep-hold { to { opacity: 1; } }
/* Held open until transition.js ends it */
html[data-sweep]::view-transition-group(*) { animation: sweep-hold 100s linear both; }
html[data-sweep]::view-transition-image-pair(*) { isolation: auto; }
html[data-sweep]::view-transition-old(*),
html[data-sweep]::view-transition-new(*) { animation: none; mix-blend-mode: normal; opacity: 1; }
html[data-sweep]::view-transition-old(root) { z-index: 1; }
html[data-sweep]::view-transition-old(sweep) { display: none; }
