/* jormy.com: shared styles (nav, tiles, buttons, footer).
   The look parodies a big tech homepage; everything here is our own. */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --bg-dark: #000000;
  --text: #1d1d1f;
  --text-soft: #6e6e73;
  --text-on-dark: #f5f5f7;
  --text-soft-on-dark: #a1a1a6;
  --accent: #0a6cff;
  --accent-hover: #0a5ad6;
  --link: #0a66d6;
  --link-on-dark: #3d9bff;
  --nav-bg: rgba(250, 250, 252, 0.8);
  --nav-text: #1d1d1f;
  --rule: #d2d2d7;
  --slot: rgba(0, 0, 0, 0.04);
  --slot-line: rgba(0, 0, 0, 0.18);
  --slot-on-dark: rgba(255, 255, 255, 0.05);
  --slot-line-on-dark: rgba(255, 255, 255, 0.22);

  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --nav-h: 44px;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --bg-alt: #101012;
    --bg-dark: #1c1c1e;
    --text: #f5f5f7;
    --text-soft: #a1a1a6;
    --link: #3d9bff;
    --nav-bg: rgba(22, 22, 23, 0.8);
    --nav-text: #e8e8ed;
    --rule: #424245;
    --slot: rgba(255, 255, 255, 0.05);
    --slot-line: rgba(255, 255, 255, 0.22);
  }
}
:root[data-theme="dark"] {
  --bg: #000000;
  --bg-alt: #101012;
  --bg-dark: #1c1c1e;
  --text: #f5f5f7;
  --text-soft: #a1a1a6;
  --link: #3d9bff;
  --nav-bg: rgba(22, 22, 23, 0.8);
  --nav-text: #e8e8ed;
  --rule: #424245;
  --slot: rgba(255, 255, 255, 0.05);
  --slot-line: rgba(255, 255, 255, 0.22);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ---- global nav ---- */
.gnav {
  position: relative; z-index: 50;
  height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.gnav-inner {
  max-width: 1024px; height: 100%; margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.gnav a { color: var(--nav-text); opacity: 0.85; font-size: 12px; letter-spacing: -0.01em; }
.gnav a:hover { opacity: 1; text-decoration: none; }
.gnav .wordmark { font-size: 17px; font-weight: 600; letter-spacing: -0.03em; opacity: 1; }
.wordmark .dot { color: var(--accent); }
.gnav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0; flex: 1; justify-content: space-evenly; }
.gnav-menu { display: none; background: none; border: 0; color: var(--nav-text); font-size: 20px; padding: 4px 8px; cursor: pointer; }

@media (max-width: 734px) {
  .gnav ul { display: none; }
  .gnav-menu { display: block; }
  .gnav.open ul {
    display: flex; flex-direction: column; position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: var(--bg); padding: 12px 32px 24px; gap: 4px;
  }
  .gnav.open ul a { font-size: 24px; font-weight: 600; opacity: 1; }
}

/* ---- ribbon ---- */
.ribbon { background: var(--bg-alt); text-align: center; font-size: 14px; padding: 14px var(--gutter); color: var(--text); }

/* ---- hero tiles (full width) ---- */
.hero {
  text-align: center; padding: 52px var(--gutter) 0; overflow: hidden;
  background: var(--bg-alt); color: var(--text); margin-bottom: 12px;
}
.hero.light { background: var(--bg); }
.hero.dark { background: var(--bg-dark); color: var(--text-on-dark); }
.hero h2 { font-size: 56px; line-height: 1.07; font-weight: 600; letter-spacing: -0.005em; margin: 0; }
.hero .sub { font-size: 28px; line-height: 1.14; font-weight: 400; margin: 6px 0 0; }
.hero h2 .faint { opacity: 0.12; font-weight: 500; margin-left: 0.04em; }
.hero .note { font-size: 17px; color: var(--text-soft); margin: 8px 0 0; }
.hero.dark .note { color: var(--text-soft-on-dark); }
.hero .ctas { margin-top: 18px; display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.hero .media-slot { margin: 36px auto 0; max-width: 980px; height: 440px; border-bottom: 0; border-radius: 18px 18px 0 0; }

@media (max-width: 734px) {
  .hero h2 { font-size: 40px; }
  .hero .sub { font-size: 21px; }
  .hero .media-slot { height: 300px; }
}

/* ---- buttons ---- */
.btn {
  display: inline-block; border-radius: 980px; padding: 11px 21px; font-size: 17px; line-height: 1.18;
  border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; font: inherit;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--link); border-color: var(--link); }
.hero.dark .btn.ghost, .tile.dark .btn.ghost, .nt-section.dark .btn.ghost { color: var(--link-on-dark); border-color: var(--link-on-dark); }
.hero.dark .btn.ghost:hover, .tile.dark .btn.ghost:hover, .nt-section.dark .btn.ghost:hover { background: var(--link-on-dark); color: #fff; }
.btn.ghost:hover { background: var(--link); color: #fff; }
.btn.small { padding: 6px 14px; font-size: 14px; }
.btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

/* ---- grid tiles ---- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 12px; margin-bottom: 12px; }
.tile {
  text-align: center; padding: 48px var(--gutter) 0; min-height: 580px; overflow: hidden;
  background: var(--bg-alt); color: var(--text); display: flex; flex-direction: column;
}
.tile.dark { background: var(--bg-dark); color: var(--text-on-dark); }
.tile h3 { font-size: 40px; line-height: 1.1; font-weight: 600; margin: 0; }
.tile .sub { font-size: 21px; line-height: 1.19; margin: 6px 0 0; }
.tile .note { font-size: 14px; color: var(--text-soft); margin: 8px 0 0; }
.tile.dark .note { color: var(--text-soft-on-dark); }
.tile .ctas { margin-top: 16px; display: flex; justify-content: center; gap: 12px; }
.tile .media-slot { margin: auto auto 0; width: 100%; max-width: 480px; height: 300px; border-radius: 14px 14px 0 0; border-bottom: 0; }
.soon { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: #bf4800; margin-bottom: 6px; }
.tile.dark .soon, .hero.dark .soon { color: #ff9f4d; }

@media (max-width: 734px) {
  .tiles { grid-template-columns: 1fr; padding: 0; }
  .tile { min-height: 480px; }
  .tile h3 { font-size: 32px; }
}

/* ---- image placeholders (the user supplies real images later) ---- */
.media-slot {
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: var(--slot); border: 1.5px dashed var(--slot-line); color: var(--text-soft);
  font-size: 13px; letter-spacing: 0; padding: 12px;
}
.dark .media-slot { background: var(--slot-on-dark); border-color: var(--slot-line-on-dark); color: var(--text-soft-on-dark); }
.media-slot:has(img) { border: 0; padding: 0; background: none; overflow: hidden; }
.media-slot img { width: 100%; height: 100%; object-fit: cover; }

/* ---- footer ---- */
.gfoot { background: var(--bg-alt); color: var(--text-soft); font-size: 12px; line-height: 1.33; letter-spacing: -0.01em; }
.gfoot-inner { max-width: 1024px; margin: 0 auto; padding: 17px var(--gutter) 21px; }
.gfoot .fineprint { border-bottom: 1px solid var(--rule); padding-bottom: 12px; }
.gfoot .fineprint p { margin: 0 0 8px; }
.gfoot .directory { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--rule); }
.gfoot h4 { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--text); }
.gfoot ul { list-style: none; margin: 0; padding: 0; }
.gfoot li { margin-bottom: 8px; }
.gfoot a { color: var(--text-soft); }
.gfoot a:hover { color: var(--text); }
.gfoot .legal { padding-top: 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; }

@media (max-width: 734px) {
  .gfoot .directory { grid-template-columns: 1fr 1fr; }
}

/* ---- the region bar (assets/regionbar.js) ---- */
.regionbar { background: var(--bg-alt); border-bottom: 1px solid var(--rule); }
.regionbar-inner {
  max-width: 1024px; margin: 0 auto; padding: 12px var(--gutter);
  display: flex; align-items: center; gap: 24px;
}
.regionbar-text { margin: 0; flex: 1; font-size: 14px; line-height: 1.3; color: var(--text); max-width: 440px; }
.regionbar-controls { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.regionbar-pick {
  position: relative; display: flex; align-items: center; width: 340px; height: 44px;
  background: var(--bg); border-radius: 10px; cursor: pointer;
}
.regionbar-check { position: absolute; left: 16px; font-size: 17px; color: var(--text); pointer-events: none; }
.regionbar-pick::after {
  content: ""; position: absolute; right: 18px; top: 16px; width: 7px; height: 7px;
  border-right: 1.5px solid var(--text); border-bottom: 1.5px solid var(--text);
  transform: rotate(45deg); pointer-events: none;
}
.regionbar-pick select {
  appearance: none; -webkit-appearance: none; width: 100%; height: 100%; border: 0; background: transparent;
  padding: 0 44px 0 44px; font: inherit; font-size: 17px; color: var(--text); cursor: pointer; border-radius: 10px;
}
.regionbar-go {
  height: 40px; padding: 0 18px; border: 0; border-radius: 8px; background: var(--text); color: var(--bg);
  font: inherit; font-size: 15px; cursor: pointer; white-space: nowrap;
}
.regionbar-close { border: 0; background: none; color: var(--text); font-size: 20px; padding: 6px 8px; cursor: pointer; }

@media (max-width: 734px) {
  .regionbar-inner { flex-wrap: wrap; gap: 10px; }
  .regionbar-text { flex: 1 1 100%; max-width: none; padding-right: 36px; }
  .regionbar-inner { position: relative; }
  .regionbar-close { position: absolute; top: 6px; right: 6px; }
  .regionbar-controls { flex: 1 1 100%; margin-left: 0; }
  .regionbar-pick { flex: 1; width: auto; min-width: 0; }
}

/* the "you liar" popup */
dialog.liar {
  border: 0; border-radius: 18px; padding: 32px 36px 28px; text-align: center; max-width: min(360px, calc(100vw - 32px));
  background: var(--bg); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
dialog.liar::backdrop { background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(4px); }
.liar-title { font-size: 24px; font-weight: 600; margin: 0 0 20px; }

/* footer notes for nintype users: the user writes these */
.placeholder-note {
  border: 1.5px dashed #d9822b; border-radius: 10px; padding: 12px 14px; margin: 12px 0;
  color: var(--text); background: rgba(217, 130, 43, 0.08);
}

/* ---- the phone frame: generic, iPhone-but-not (no notch, no island, no buttons) ----
   <div class="phone [tilt|tilt-left]" style="--phone-w: 300px">
     <div class="phone-screen">
       <video src="..." poster="..." autoplay muted loop playsinline></video>
       (or <div class="phone-empty">label</div> until the recording exists)
     </div>
   </div>
   The screen keeps the iPhone X recording's shape (1125 x 2436). */
.phone-stage { perspective: 1600px; display: flex; justify-content: center; }
.phone {
  --phone-w: 300px;
  --phone-edge: #2a2a2d;
  width: var(--phone-w); max-width: 100%;
  padding: calc(var(--phone-w) * 0.035);
  border-radius: calc(var(--phone-w) * 0.15);
  background: linear-gradient(145deg, #3a3a3e, #121214 55%, #222225);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.14),
    0 30px 60px -20px rgba(0, 0, 0, 0.45);
  transform-style: preserve-3d;
}
.phone-screen {
  position: relative; overflow: hidden; aspect-ratio: 1125 / 2436;
  border-radius: calc(var(--phone-w) * 0.118);
  background: #000;
}
.phone-screen video, .phone-screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.phone-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 20%; font-size: 13px; line-height: 1.4; color: rgba(255, 255, 255, 0.55); letter-spacing: 0;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(80, 140, 255, 0.28), transparent 60%),
    radial-gradient(100% 50% at 50% 100%, rgba(255, 90, 170, 0.22), transparent 60%),
    #0b0b0d;
}
/* tilted: a turn in 3D, with stacked shadows standing in for the phone's side */
.phone.tilt, .phone.tilt-left {
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.14),
    1px 0 0 var(--phone-edge), 2px 0 0 var(--phone-edge), 3px 0 0 var(--phone-edge),
    4px 0 0 var(--phone-edge), 5px 0 0 var(--phone-edge), 6px 0 0 #1a1a1c,
    40px 40px 70px -24px rgba(0, 0, 0, 0.5);
  transform: rotateY(-22deg) rotateX(8deg) rotateZ(2deg);
}
.phone.tilt-left {
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.14),
    -1px 0 0 var(--phone-edge), -2px 0 0 var(--phone-edge), -3px 0 0 var(--phone-edge),
    -4px 0 0 var(--phone-edge), -5px 0 0 var(--phone-edge), -6px 0 0 #1a1a1c,
    -40px 40px 70px -24px rgba(0, 0, 0, 0.5);
  transform: rotateY(22deg) rotateX(8deg) rotateZ(-2deg);
}
/* a faint sheen over the glass */
.phone-screen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0) 38%);
}
/* in a tile or hero, the phone sits at the bottom, cut off like a product shot */
.phone-peek { margin: 36px auto 0; height: 440px; overflow: hidden; display: flex; justify-content: center; align-items: flex-start; }
.tile .phone-peek { margin-top: auto; padding-top: 28px; height: 330px; }
@media (max-width: 734px) { .phone-peek { height: 360px; } }
@media (max-width: 734px) {
  .phone { --phone-w: min(240px, 62vw) !important; }
  .phone.tilt, .phone.tilt-left { --phone-w: min(220px, 58vw) !important; }
}

/* cropped phone: only the bottom --show of the screen, the top edge fading out */
.phone.crop {
  --show: 0.5;
  padding-top: 0; border-top-left-radius: 0; border-top-right-radius: 0;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
}
.phone.crop .phone-screen { aspect-ratio: 1125 / calc(2436 * var(--show)); border-top-left-radius: 0; border-top-right-radius: 0; }
.phone.crop .phone-screen video, .phone.crop .phone-screen img { object-position: bottom; }

/* ---- text pages (privacy, support, contact): one readable column ---- */
.doc { max-width: 680px; margin: 0 auto; padding: 64px var(--gutter) 96px; }
.doc h1 { font-size: 40px; line-height: 1.1; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 8px; }
.doc .doc-date { color: var(--text-soft); font-size: 14px; margin: 0 0 40px; }
.doc section { margin-bottom: 32px; }
.doc h2 { font-size: 21px; font-weight: 600; margin: 0 0 8px; }
.doc p, .doc li { font-size: 17px; line-height: 1.5; color: var(--text-soft); margin: 0 0 10px; }
.doc ul { padding-left: 20px; margin: 0 0 10px; }
@media (max-width: 734px) { .doc { padding-top: 40px; } .doc h1 { font-size: 32px; } }
/* A fact still to confirm in a draft (remove each before launch). */
.check { display: inline-block; font-size: 13px; line-height: 1.3; color: #ff9f4d; border: 1px dashed #ff9f4d; border-radius: 6px; padding: 1px 6px; }
.check::before { content: "\26A0  "; }

/* ---- the contact form (support and contact pages) ---- */
.contact { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.contact label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text); }
.contact .optional { color: var(--text-soft); font-weight: normal; }
.contact input, .contact textarea, .contact select {
  font: inherit; font-size: 16px; color: var(--text); background: var(--bg-alt); border: 1px solid var(--rule);
  border-radius: 10px; padding: 10px 12px;
}
.contact textarea { resize: vertical; min-height: 140px; }
.contact input:focus, .contact textarea:focus, .contact select:focus { outline: 2px solid var(--link); outline-offset: 1px; }
.contact .btn { align-self: flex-start; }
.contact .trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { margin-top: 14px; padding: 10px 14px; border-radius: 10px; font-size: 15px; }
.form-note.ok { background: rgba(48, 209, 88, 0.12); color: #30d158; }
.form-note.err { background: rgba(255, 105, 97, 0.12); color: #ff6961; }

/* ---- review mode: while Apple reviews the app, the live Worker puts class="review" on <html>
   (SITE_MODE in wrangler.jsonc). No jormy top bar and no region bar; the Nintype bar says "by Jormy".
   The editor's "Review look" button toggles it locally. ---- */
html.review .gnav { display: none; }
.pnav-title .by { color: var(--text-soft); font-weight: 400; margin-left: 4px; }
html:not(.review) .pnav-title .by { display: none; }
