/* ==========================================================================
   Cihla - web
   Design tokens lifted from the iOS app (Cihla/Theme/Theme.swift) via
   docs/WEBSITE_DESIGN_BRIEF.md. Two-colour system: warm neutrals carry
   everything, terracotta is the only accent.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Fonts - self-hosted variable woff2, latin + latin-ext (Czech diacritics)
   -------------------------------------------------------------------------- */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 100%;
  font-display: swap;
  src: url('../fonts/archivo-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 100%;
  font-display: swap;
  src: url('../fonts/archivo-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/intertight-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/intertight-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('../fonts/jetbrainsmono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('../fonts/jetbrainsmono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --------------------------------------------------------------------------
   2. Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Palette - "Clay", exact values from Theme.swift */
  --bg: #EFE8DB;
  --surface: #F7F2E7;
  --ink: #1A1410;
  --ink-soft: #5A4B3F;
  --line: #D9CFBF;
  --brick: #C8553D;
  --brick-deep: #9B3F2E;
  --brick-shade: #7A2F22;
  --ok: #3F6B4E;
  --warn: #B86A1F;

  /* Brick tints */
  --brick-08: rgba(200, 85, 61, 0.08);
  --brick-10: rgba(200, 85, 61, 0.10);
  --brick-12: rgba(200, 85, 61, 0.12);
  --brick-15: rgba(200, 85, 61, 0.15);
  --brick-25: rgba(200, 85, 61, 0.25);
  --brick-40: rgba(200, 85, 61, 0.40);

  /* Ink-section inversions - bg at opacity */
  --on-ink: #EFE8DB;
  --on-ink-soft: rgba(239, 232, 219, 0.65);
  --on-ink-line: rgba(239, 232, 219, 0.14);
  --on-ink-fill: rgba(239, 232, 219, 0.05);
  --on-ink-border: rgba(239, 232, 219, 0.25);

  /* Radii */
  --radius-card: 22px;
  --radius-panel: 18px;
  --radius-md: 14px;
  --radius-sm: 11px;
  --radius-tile: 12px;

  /* Buttons */
  --btn-h-lg: 60px;
  --btn-h-md: 48px;
  --btn-h-sm: 38px;

  --border: 1px solid var(--line);

  /* Layout */
  --container: 1180px;
  --gutter: clamp(20px, 4vw, 48px);
  --section-y: clamp(72px, 8vw, 110px);
  --section-y-sm: clamp(56px, 7vw, 88px);

  /* Type */
  --font-display: 'Archivo', system-ui, sans-serif;
  --font-body: 'Inter Tight', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --------------------------------------------------------------------------
   3. Base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* sticky header clearance for in-page anchors */
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
video,
svg { display: block; max-width: 100%; }

a {
  color: var(--brick);
  text-decoration: none;
  transition: color 160ms ease;
}
a:hover { color: var(--brick-deep); }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 4px;
}

/* On ink sections the ink outline is invisible - flip it */
.s-ink :focus-visible { outline-color: var(--on-ink); }

h1, h2, h3, p, figure { margin: 0; }

.container {
  max-width: var(--container);
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: 0 0 var(--radius-md) 0;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
  color: var(--bg);
}

/* --------------------------------------------------------------------------
   4. Typography primitives
   -------------------------------------------------------------------------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.s-ink .eyebrow { color: var(--on-ink-soft); }

.display {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
}
.s-ink .display { color: var(--on-ink); }

.h-hero {
  font-size: clamp(44px, 7.5vw, 96px);
  line-height: 0.96;
  text-wrap: balance;
}
.h-section { font-size: clamp(34px, 5vw, 56px); }
.h-sub { font-size: clamp(30px, 4vw, 44px); line-height: 1.02; }

.lead {
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.55;
  color: var(--ink-soft);
}
.s-ink .lead { color: var(--on-ink-soft); }

.body-sm { font-size: 15px; line-height: 1.55; color: var(--ink-soft); }
.s-ink .body-sm { color: var(--on-ink-soft); }

.caption { font-size: 13px; line-height: 1.5; color: var(--ink-soft); }
.s-ink .caption { color: var(--on-ink-soft); }

.num {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--brick);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.num-lg { font-size: clamp(48px, 6vw, 72px); }
.num-md { font-size: clamp(40px, 4.6vw, 60px); }

.card-title { font-size: 20px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.s-ink .card-title { color: var(--on-ink); }

/* --------------------------------------------------------------------------
   5. Sections
   -------------------------------------------------------------------------- */

.section {
  padding: var(--section-y) var(--gutter);
  background: var(--bg);
}
.section--sm { padding-block: var(--section-y-sm); }

/* The signature inversion - see brief §2.2. Content, not a preference. */
.s-ink {
  background: var(--ink);
  color: var(--on-ink);
}

/* A rule that divides two same-coloured sections instead of extra padding */
.section--ruled {
  padding-top: 0;
}
.section--ruled > .container {
  border-top: var(--border);
  padding-top: var(--section-y);
}

.section-head { text-align: center; }
.section-head .display { margin-top: 14px; }
.section-head .lead {
  max-width: 52ch;
  margin: 18px auto 0;
}

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: -0.1px;
  cursor: pointer;
  border: none;
  white-space: nowrap;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.btn:hover { transform: translateY(-1px); }

.btn--lg { height: var(--btn-h-lg); padding-inline: 26px; border-radius: var(--radius-panel); font-size: 17px; }
.btn--md { height: var(--btn-h-md); padding-inline: 20px; border-radius: var(--radius-md); font-size: 15px; }
.btn--sm { height: var(--btn-h-sm); padding-inline: 14px; border-radius: var(--radius-sm); font-size: 13px; }

.btn--primary {
  background: var(--brick);
  color: #fff;
  box-shadow: 0 4px 14px rgba(200, 85, 61, 0.25);
}
.btn--primary:hover { background: #B44D36; color: #fff; }

.btn--ink { background: var(--ink); color: var(--bg); }
.btn--ink:hover { background: #2A211B; color: var(--bg); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
}
.btn--ghost:hover { border-color: var(--ink-soft); color: var(--ink); }

.s-ink .btn--ghost {
  color: var(--on-ink);
  border-color: var(--on-ink-border);
}
.s-ink .btn--ghost:hover { border-color: var(--brick); color: var(--on-ink); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.btn-row--center { justify-content: center; }

/* --------------------------------------------------------------------------
   7. Header / nav
   -------------------------------------------------------------------------- */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(239, 232, 219, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}
.header.is-scrolled { border-bottom-color: var(--line); }

.nav {
  position: relative;
  max-width: var(--container);
  margin-inline: auto;
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 32px);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 0.5px;
  color: var(--brick);
  flex: 0 0 auto;
  margin-right: auto;
}

.nav-links {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  gap: clamp(12px, 2vw, 26px);
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  padding-block: 11px;
}
.nav-links a:hover { color: var(--brick); }

.nav-burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 720px) {
  .nav-burger { display: inline-flex; }
  .nav-links {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 4px var(--gutter) 16px;
    background: var(--bg);
    border-bottom: var(--border);
    box-shadow: 0 14px 24px rgba(26, 20, 16, 0.08);
    overflow: visible;
  }
  .nav-links.is-open { display: flex; }
}

/* --------------------------------------------------------------------------
   8. Cards
   -------------------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
}
.s-ink .card {
  background: var(--on-ink-fill);
  border-color: var(--on-ink-line);
}

.card--dashed {
  background: transparent;
  border: 1.5px dashed var(--line);
}

/* Media frame - holds a photo or, until one exists, a marked placeholder */
.media {
  border-radius: var(--radius-card);
  overflow: hidden;
  border: var(--border);
  background: var(--surface);
  position: relative;
}
.s-ink .media {
  border-color: var(--on-ink-line);
  background: var(--on-ink-fill);
}
.media img,
.media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media--4x3 { aspect-ratio: 4 / 3; }
.media--3x4 { aspect-ratio: 3 / 4; }
.media--1x1 { aspect-ratio: 1 / 1; }
.media--16x9 { aspect-ratio: 16 / 9; }

/* Visible, unmissable placeholder - must not ship silently */
.media__todo {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 20px;
  border: 1.5px dashed var(--brick-40);
  border-radius: inherit;
  background: var(--brick-08);
  color: var(--ink-soft);
}
.media__todo b {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--brick);
  border: 1px dashed var(--brick-40);
  border-radius: 999px;
  padding: 6px 12px;
}
.media__todo span {
  font-size: 13px;
  line-height: 1.5;
  max-width: 34ch;
}
.s-ink .media__todo { color: var(--on-ink-soft); }

/* Step card */
.step__num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--brick);
  margin-top: 18px;
}
.step h3 { margin-top: 10px; }
.step p { margin-top: 8px; }

/* --------------------------------------------------------------------------
   9. Grids
   -------------------------------------------------------------------------- */

.grid {
  display: grid;
  gap: 22px;
}
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.grid--split {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(32px, 5vw, 56px);
  align-items: center;
}

.mt-head { margin-top: clamp(36px, 5vw, 52px); }

/* --------------------------------------------------------------------------
   10. Chips, pills
   -------------------------------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  border: var(--border);
  border-radius: 999px;
  padding: 8px 14px;
}
.chip--mono {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chip-row--center { justify-content: center; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  background: var(--surface);
}
.s-ink .status-pill {
  background: rgba(239, 232, 219, 0.08);
  border-color: var(--on-ink-line);
}
.status-pill__dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--brick);
  flex: 0 0 auto;
}
.status-pill__label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}
.s-ink .status-pill__label { color: var(--on-ink); }

/* [TBD] marker - deliberately loud so it cannot ship by accident */
.tbd {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--brick);
  border: 1px dashed var(--brick-40);
  border-radius: 999px;
  padding: 6px 12px;
  display: inline-block;
}

/* Tip card */
.tip {
  background: var(--brick-08);
  border: 1px dashed var(--brick-25);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
.tip__label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--brick);
}
.tip p {
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  margin-top: 8px;
  max-width: 56ch;
}

/* --------------------------------------------------------------------------
   11. The brick (brief §5.1)
   -------------------------------------------------------------------------- */

.brick {
  width: 132px;
  flex: 0 0 auto;
  position: relative;
}
.brick__svg {
  width: 100%;
  transform: rotate(-6deg);
  filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.22))
          drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
  transition: transform 500ms var(--ease-spring), filter 350ms ease;
  animation: brickFloat 6s ease-in-out infinite;
}
.brick.is-tapping .brick__svg {
  transform: rotate(-6deg) translateX(26px) scale(1.05);
  animation: none;
}
.brick.is-tapping .brick__svg,
.brick.is-locked .brick__svg {
  filter: drop-shadow(0 6px 18px rgba(200, 85, 61, 0.4))
          drop-shadow(0 18px 40px rgba(200, 85, 61, 0.2));
}

.brick__ripple {
  position: absolute;
  inset: 0 0 auto 0;
  aspect-ratio: 1 / 0.78;
  border-radius: 16%;
  border: 2px solid var(--brick);
  opacity: 0;
  pointer-events: none;
}
.brick.is-tapping .brick__ripple {
  animation: brickRipple 1.8s var(--ease-out) infinite;
}
.brick.is-tapping .brick__ripple:nth-of-type(2) { animation-delay: 0.6s; }
.brick.is-tapping .brick__ripple:nth-of-type(3) { animation-delay: 1.2s; }

@keyframes brickRipple {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.55); opacity: 0; }
}
@keyframes brickFloat {
  0%, 100% { transform: rotate(-6deg) translateY(-2px); }
  50% { transform: rotate(-6deg) translateY(2px); }
}

.brick-demo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 26px;
  margin-top: 36px;
}
.brick-demo__caption {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--on-ink-soft);
  margin-top: 12px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .brick-demo { align-items: center; text-align: center; }
}

/* --------------------------------------------------------------------------
   12. Phone mockup - the inversion, side by side (brief §5.3)
   -------------------------------------------------------------------------- */

.phone-wrap {
  display: flex;
  justify-content: center;
  --phone-scale: 0.8;
}

/* The mockup is drawn at true iPhone point size (402×874) so the interior
   spacing matches the app 1:1, then scaled as a whole. The negative margins
   reclaim the layout space the transform doesn't. */
@media (max-width: 900px) { .phone-wrap { --phone-scale: 0.68; } }
@media (max-width: 520px) { .phone-wrap { --phone-scale: 0.56; } }
@media (max-width: 400px) { .phone-wrap { --phone-scale: 0.48; } }

.phone {
  width: 402px;
  height: 874px;
  transform: scale(var(--phone-scale));
  transform-origin: top center;
  margin-bottom: calc(874px * (var(--phone-scale) - 1));
  margin-inline: calc(402px * (var(--phone-scale) - 1) / 2);
  border-radius: 48px;
  overflow: hidden;
  position: relative;
  background: #000;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.12);
  flex: 0 0 auto;
}
.phone__island {
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 126px;
  height: 37px;
  border-radius: 24px;
  background: #000;
  z-index: 50;
}
.phone__home {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 139px;
  height: 5px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.7);
  z-index: 60;
  transition: background 350ms ease-in-out;
}
.phone.is-open .phone__home { background: rgba(0, 0, 0, 0.25); }

.phone__screen {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 78px 30px 30px;
  background: #1A1410;
}

/* Wallpaper. Two stacked layers cross-fade on lock/unlock: CSS can't
   interpolate between gradient stacks, so animating opacity is what keeps
   the inversion a smooth transition rather than a snap. */
.phone__wall {
  position: absolute;
  inset: 0;
  transition: opacity 350ms ease-in-out;
  pointer-events: none;
}
.phone__wall--night {
  opacity: 1;
  background:
    radial-gradient(85% 55% at 18% 10%, rgba(198, 120, 74, 0.50), transparent 62%),
    radial-gradient(70% 48% at 88% 4%,  rgba(150, 64, 58, 0.52), transparent 58%),
    radial-gradient(95% 60% at 78% 96%, rgba(78, 62, 128, 0.46), transparent 62%),
    radial-gradient(110% 70% at 4% 98%, rgba(160, 62, 44, 0.40), transparent 66%),
    linear-gradient(170deg, #2B1F1A 0%, #1A1410 48%, #120D14 100%);
}
.phone__wall--day {
  opacity: 0;
  background:
    radial-gradient(85% 55% at 18% 10%, rgba(255, 214, 166, 0.92), transparent 62%),
    radial-gradient(70% 48% at 88% 4%,  rgba(255, 176, 148, 0.80), transparent 58%),
    radial-gradient(95% 60% at 78% 96%, rgba(196, 178, 235, 0.62), transparent 62%),
    radial-gradient(110% 70% at 4% 98%, rgba(255, 197, 150, 0.66), transparent 66%),
    linear-gradient(170deg, #FDF7EE 0%, #F7F2E7 48%, #EFE8DB 100%);
}
.phone.is-open .phone__wall--night { opacity: 0; }
.phone.is-open .phone__wall--day { opacity: 1; }

/* Keep the home-screen furniture above the wallpaper */
.phone__screen > *:not(.phone__wall) {
  position: relative;
  z-index: 1;
}

.phone__widget {
  border-radius: var(--radius-card);
  padding: 18px 20px;
  transition: background 350ms ease-in-out, border-color 350ms ease-in-out;
  background: rgba(20, 14, 10, 0.30);
  border: 1px solid var(--on-ink-line);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
}
.phone.is-open .phone__widget {
  background: rgba(255, 252, 246, 0.55);
  border-color: rgba(26, 20, 16, 0.10);
}

.phone__eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--on-ink-soft);
  transition: color 350ms ease-in-out;
}
.phone.is-open .phone__eyebrow { color: var(--ink-soft); }

.phone__headline {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 40px;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-top: 8px;
  color: var(--brick);
  transition: color 350ms ease-in-out;
}
.phone.is-open .phone__headline { color: var(--ink); }

.phone__meta {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  margin-top: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--on-ink-soft);
  transition: color 350ms ease-in-out;
}
.phone.is-open .phone__meta { color: var(--ink-soft); }

.phone__apps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px 14px;
  margin-top: 26px;
}
.phone__app {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.phone__icon {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 22.5%;   /* iOS icon corner ratio */
  overflow: hidden;
  /* Locked is the default state. Screen Time doesn't overlay a badge on the
     icon, it desaturates and dims the artwork itself. */
  filter: grayscale(1) brightness(0.45);
  transition: filter 350ms ease-in-out;
}
.phone.is-open .phone__icon { filter: none; }

.phone__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.phone__label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.38);
  transition: color 350ms ease-in-out, text-shadow 350ms ease-in-out;
}
.phone.is-open .phone__label {
  color: var(--ink);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.55);
}

/* The hourglass iOS puts beside a limited app's name */
.phone__hg {
  width: 8px;
  height: 9px;
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.82);
}
.phone.is-open .phone__hg { display: none; }

.phone__dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: auto;
}
.phone__dots i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(239, 232, 219, 0.3);
  transition: background 350ms ease-in-out;
}
.phone__dots i:first-child { background: rgba(239, 232, 219, 0.9); }
.phone.is-open .phone__dots i { background: rgba(26, 20, 16, 0.25); }
.phone.is-open .phone__dots i:first-child { background: var(--ink); }

.phone__dock {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  border-radius: 30px;
  padding: 16px 18px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 350ms ease-in-out, border-color 350ms ease-in-out;
  background: rgba(239, 232, 219, 0.06);
  border: 1px solid rgba(239, 232, 219, 0.12);
}
.phone.is-open .phone__dock {
  background: rgba(255, 255, 255, 0.5);
  border-color: var(--line);
}
.phone__dock-icon {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 350ms ease-in-out, border-color 350ms ease-in-out;
  background: rgba(239, 232, 219, 0.1);
  border: 1px solid var(--on-ink-line);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(239, 232, 219, 0.7);
}
.phone__dock-icon svg { width: 48%; height: 48%; display: block; }
.phone.is-open .phone__dock-icon {
  background: rgba(26, 20, 16, 0.06);
  border-color: var(--line);
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   13. The wall (brief §5.2)
   -------------------------------------------------------------------------- */

.wall-card {
  background: var(--on-ink-fill);
  border: 1px solid var(--on-ink-line);
  border-radius: var(--radius-md);
  padding: 14px;
}
.wall-card__head {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wall-card__head .eyebrow { font-size: 10px; }

.wall {
  aspect-ratio: 2.28;
  display: flex;
  flex-direction: column;
  gap: 1.5px;
  overflow: hidden;
}
.wall__row {
  display: flex;
  gap: 1.5px;
  flex: 1 1 0;
}
.wall__row--offset {
  width: 108.34%;
  margin-left: -4.17%;
}
.wall__brick {
  flex: 1 1 0;
  border-radius: 1px;
  background: transparent;
}
.wall__brick--on {
  box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.18),
              inset 0 -0.5px 0 rgba(122, 47, 34, 0.28);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.wall.is-built .wall__brick--on {
  opacity: 1;
  transform: translateY(0);
}

.stat-row {
  display: flex;
  gap: clamp(24px, 4vw, 48px);
  margin-top: 32px;
  flex-wrap: wrap;
}
.stat__label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--on-ink-soft);
  margin-top: 8px;
}

/* --------------------------------------------------------------------------
   14. Comparison table
   -------------------------------------------------------------------------- */

.table-scroll {
  margin-top: clamp(20px, 5vw, 52px);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-hint {
  display: none;
  margin-top: 26px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}
@media (max-width: 720px) {
  .table-hint { display: block; }
}

.cmp {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 15px;
}
@media (max-width: 720px) {
  .cmp { min-width: 560px; font-size: 14px; }
}

.cmp th {
  text-align: left;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: var(--border);
}
.cmp td {
  padding: 16px;
  color: var(--ink-soft);
  border-bottom: var(--border);
  vertical-align: top;
}
.cmp tbody tr:last-child td { border-bottom: none; }

.cmp th:first-child { border-bottom: var(--border); }
.cmp th[scope='row'],
.cmp .cmp__row-label {
  color: var(--ink);
  font-weight: 500;
  font-family: var(--font-body);
  font-size: inherit;
  letter-spacing: -0.005em;
  text-transform: none;
}

/* Cihla's column - tinted, rounded at the ends */
.cmp .cmp__own { background: var(--brick-08); }
.cmp thead .cmp__own {
  color: var(--brick);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.cmp tbody tr:last-child .cmp__own {
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.cmp__yes { color: var(--brick); font-weight: 600; }
.cmp__note { color: var(--ink-soft); font-size: 13px; }

/* --------------------------------------------------------------------------
   15. FAQ accordion
   -------------------------------------------------------------------------- */

.faq {
  margin-top: 32px;
  border-top: var(--border);
}
.faq__item { border-bottom: var(--border); }

.faq__q {
  width: 100%;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.faq__q:hover { color: var(--brick); }

.faq__q span { flex: 1; }
.faq__sign {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--brick);
  width: 20px;
  text-align: center;
  flex: 0 0 auto;
}

.faq__a {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
  padding: 0 40px 22px 0;
  max-width: 62ch;
}
.faq__a[hidden] { display: none; }

/* --------------------------------------------------------------------------
   16. Spec / row list
   -------------------------------------------------------------------------- */

.spec {
  margin-top: 18px;
  border-top: var(--border);
}
.spec__row {
  display: flex;
  gap: 16px;
  padding: 14px 0;
  border-bottom: var(--border);
}
.spec__row:last-child { border-bottom: none; }
.spec__key { flex: 0 0 40%; font-size: 15px; color: var(--ink-soft); }
.spec__val { flex: 1; font-size: 15px; font-weight: 500; color: var(--ink); }

.reassure {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
  border-top: var(--border);
  padding-top: 22px;
}
.reassure div { font-size: 15px; color: var(--ink-soft); }
.reassure div:first-child { color: var(--ink); }
.s-ink .reassure { border-top-color: var(--on-ink-line); }
.s-ink .reassure div { color: var(--on-ink-soft); }
.s-ink .reassure div:first-child { color: var(--on-ink); }

/* --------------------------------------------------------------------------
   17. Reasons - glass grid over a photo
   -------------------------------------------------------------------------- */

.reasons {
  position: relative;
  overflow: hidden;
  padding: var(--section-y-sm) var(--gutter) clamp(28px, 4vw, 40px);
}
.reasons__bg {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: clamp(230px, 27vw, 300px);
  background: rgba(239, 232, 219, 0.06);
}
.reasons__bg img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 720px) {
  .reasons__bg { bottom: 68%; }
}
.reasons__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(26, 20, 16, 0.7) 0%,
    rgba(26, 20, 16, 0.2) 18%,
    rgba(26, 20, 16, 0) 40%);
  pointer-events: none;
}
.reasons__inner {
  position: relative;
  max-width: var(--container);
  margin-inline: auto;
}
.reasons__spacer { height: clamp(160px, 20vw, 260px); }

.reasons__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 1px;
  background: rgba(239, 232, 219, 0.22);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(239, 232, 219, 0.16);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.reasons__cell {
  min-width: 0;
  background: rgba(26, 20, 16, 0.55);
  padding: clamp(24px, 3vw, 34px) clamp(18px, 2.2vw, 28px);
}
.reasons__cell h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(22px, 2.2vw, 28px);
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--on-ink);
  margin-top: 18px;
}
.reasons__cell p {
  font-size: 15px;
  line-height: 1.5;
  color: rgba(239, 232, 219, 0.8);
  margin-top: 10px;
  max-width: 30ch;
}

/* --------------------------------------------------------------------------
   18. Product page
   -------------------------------------------------------------------------- */

.crumb {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.crumb a { color: var(--ink-soft); }
.crumb a:hover { color: var(--brick); }

.product {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
  gap: clamp(32px, 5vw, 56px);
  margin-top: 22px;
  align-items: start;
}
.product__gallery {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.product__thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

/* Gallery thumbnail - a real button, so it is keyboard- and AT-reachable */
.thumb {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  aspect-ratio: 1;
  cursor: pointer;
  position: relative;
  transition: border-color 160ms ease, transform 160ms ease;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 160ms ease;
}
.thumb:hover { border-color: var(--ink-soft); transform: translateY(-1px); }
.thumb[aria-current='true'] {
  border-color: var(--brick);
  border-width: 1.5px;
}
/* Selected thumb reads as selected without relying on the border alone */
.thumb[aria-current='true']::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 2px var(--brick);
  pointer-events: none;
}

#gallery-main { transition: opacity 200ms ease; }
#gallery-main.is-swapping { opacity: 0; }

.product__buy {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.product__buy h1 { margin-top: 18px; font-size: clamp(38px, 5.4vw, 60px); }

.price-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin-top: 26px;
  flex-wrap: wrap;
}
.price-now {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(40px, 5.4vw, 60px);
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--brick);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.s-ink .price-now { font-size: clamp(44px, 6vw, 72px); }
.price-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  margin-top: 10px;
}
.s-ink .price-meta { color: var(--on-ink-soft); }

/* Struck-through reference price sitting beside the current one */
.price-was {
  font-size: 18px;
  color: var(--ink-soft);
  text-decoration: line-through;
  padding-bottom: 8px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.s-ink .price-was { color: var(--on-ink-soft); }

.price-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  background: var(--brick);
  border-radius: 999px;
  padding: 8px 12px;
  margin-bottom: 8px;
  white-space: nowrap;
}

.price-note {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin-top: 8px;
}
.s-ink .price-note { color: var(--on-ink-soft); }

/* Tier selector */
.tiers {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}
.tier {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: 18px 20px;
  border-radius: var(--radius-panel);
  font-family: var(--font-body);
  background: transparent;
  border: 1.5px solid var(--line);
  transition: background 160ms ease, border-color 160ms ease;
}
.tier[aria-checked='true'] {
  background: var(--brick-08);
  border-color: var(--brick);
}
.s-ink .tier { border-color: var(--on-ink-border); }
.s-ink .tier[aria-checked='true'] {
  background: rgba(239, 232, 219, 0.08);
  border-color: var(--brick);
}

.tier__dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  flex: 0 0 auto;
  border: 1.5px solid var(--line);
  transition: border 160ms ease;
}
.tier[aria-checked='true'] .tier__dot { border: 5px solid var(--brick); }
.s-ink .tier__dot { border-color: rgba(239, 232, 219, 0.4); }

.tier__main { flex: 1; min-width: 0; }
.tier__name { display: block; font-size: 16px; font-weight: 600; color: var(--ink); }
.tier__note { display: block; font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.tier__side { text-align: right; flex: 0 0 auto; }
.tier__total {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.tier__each {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 2px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.s-ink .tier__name,
.s-ink .tier__total { color: var(--on-ink); }
.s-ink .tier__note,
.s-ink .tier__each { color: var(--on-ink-soft); }

.tier__badge {
  position: absolute;
  top: -10px;
  right: 16px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--bg);
  background: var(--ink);
  border-radius: 999px;
  padding: 5px 10px;
}
.s-ink .tier__badge { background: var(--brick); color: #fff; }

/* Sticky mobile buy bar */
.buybar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  align-items: center;
  gap: 14px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(239, 232, 219, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: var(--border);
}
.buybar__spacer { height: 0; }
.buybar__label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--brick);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.buybar__price {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin-top: 3px;
}
.buybar__was {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: line-through;
  margin-left: 4px;
}
@media (max-width: 720px) {
  .buybar { display: flex; }
  .buybar__spacer { height: 84px; }
}

/* --------------------------------------------------------------------------
   19. Footer
   -------------------------------------------------------------------------- */

.footer {
  background: var(--ink);
  color: var(--on-ink);
  padding: var(--section-y-sm) var(--gutter) 40px;
}
.footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: clamp(28px, 4vw, 48px);
}
.footer__col-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--on-ink-soft);
}
.footer__links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
.footer__links a { font-size: 14px; color: var(--on-ink); }
.footer__links a:hover { color: var(--brick); }

.footer__tag {
  font-size: 13px;
  line-height: 1.5;
  color: var(--on-ink-soft);
  margin-top: 12px;
  max-width: 26ch;
}

.newsletter {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  max-width: 300px;
  flex-wrap: wrap;
}
.newsletter input[type='email'] {
  flex: 1 1 160px;
  height: var(--btn-h-md);
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--on-ink-border);
  background: transparent;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--on-ink);
}
.newsletter input::placeholder { color: rgba(239, 232, 219, 0.45); }

.consent {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 12px;
  max-width: 300px;
  cursor: pointer;
}
.consent input {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--brick);
  flex: 0 0 auto;
}
.consent span {
  font-size: 12px;
  line-height: 1.5;
  color: var(--on-ink-soft);
}

.footer__bottom {
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid rgba(239, 232, 219, 0.12);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}
.footer__bottom span {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--on-ink-soft);
}

/* --------------------------------------------------------------------------
   20. Scroll-in entrances
   -------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 400ms var(--ease-out), transform 400ms var(--ease-out);
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   21. Reduced motion - non-negotiable (brief §7)
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  html { scroll-behavior: auto; }

  .reveal { opacity: 1; transform: none; }
  .wall__brick--on { opacity: 1; transform: none; }
  .brick__ripple { opacity: 0.35; }
  .brick.is-tapping .brick__ripple:nth-of-type(3) { opacity: 0; }
}
