/* ============================================================
   Arithmos showcase — grounded in the app's own syntax palette.
   Near-black canvas · blue numbers · green identifiers · amber units.
   ============================================================ */

:root {
  --bg:        #0b0b0f;
  --bg-elev:   #131319;
  --bg-card:   #16161e;
  --line:      rgba(255,255,255,.08);
  --line-soft: rgba(255,255,255,.05);

  --text:   #ececf1;
  --dim:    #a2a2b0;
  --faint:  #6a6a78;

  --num:  #73b3ff;   /* numbers / dates  (info)    */
  --id:   #66dba8;   /* identifiers      (success) */
  --cur:  #f4c45a;   /* currency / units (warning) */
  --warn: #f48fb1;   /* accents / pink             */
  --op:   #8a8a99;   /* operators                  */

  --accent: var(--id);
  --grad: linear-gradient(100deg, var(--id), var(--num) 70%);

  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 1120px;
  --pad: clamp(20px, 5vw, 64px);

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* radial wash + a faint ruled-paper texture, true to a notepad */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(900px 500px at 78% -8%, rgba(102,219,168,.10), transparent 60%),
    radial-gradient(800px 600px at 5% 8%, rgba(115,179,255,.08), transparent 55%);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; opacity: .35;
  background-image: repeating-linear-gradient(transparent 0 31px, var(--line-soft) 31px 32px);
  mask-image: linear-gradient(180deg, transparent, #000 12%, #000 70%, transparent);
}

a { color: inherit; text-decoration: none; }
code { font-family: var(--mono); font-size: .9em; }
img { max-width: 100%; display: block; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 14px var(--pad);
  background: rgba(11,11,15,.72);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav__brand { font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.nav__glyph { color: var(--accent); font-family: var(--mono); }
.brand-icon { border-radius: 7px; vertical-align: middle; flex: none; }
.nav__links { display: flex; gap: 26px; font-size: .94rem; color: var(--dim); }
.nav__links a { transition: color .2s; }
.nav__links a:hover { color: var(--text); }
@media (max-width: 720px) { .nav__links { display: none; } }

/* ---------- Shared section bits ---------- */
.eyebrow {
  text-transform: uppercase; letter-spacing: .18em; font-size: .76rem;
  font-weight: 600; color: var(--accent); margin-bottom: 14px;
}
h1, h2, h3 { letter-spacing: -.02em; line-height: 1.05; font-weight: 700; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.section-head { max-width: 640px; margin: 0 auto 48px; text-align: center; }
.section-head h2 { font-size: clamp(2rem, 5vw, 3rem); }
.section-sub { color: var(--dim); margin-top: 14px; font-size: 1.05rem; }

section { padding: clamp(64px, 10vw, 130px) var(--pad); max-width: var(--maxw); margin: 0 auto; }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 5vw, 72px);
  align-items: center; padding-top: clamp(48px, 8vw, 96px);
}
.hero__title { font-size: clamp(2.6rem, 7vw, 4.6rem); }
.hero__lede { color: var(--dim); font-size: clamp(1.05rem, 2vw, 1.25rem); margin: 22px 0 30px; max-width: 30em; }
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.hero__cta--alt { margin-bottom: 38px; }

.btn { padding: 13px 22px; border-radius: 999px; font-weight: 600; font-size: .98rem; transition: transform .15s, box-shadow .2s, background .2s; }
.btn--primary { background: var(--grad); color: #06140e; box-shadow: 0 8px 30px rgba(102,219,168,.25); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 38px rgba(102,219,168,.35); }
.btn--ghost { border: 1px solid var(--line); color: var(--text); }
.btn--ghost:hover { background: var(--bg-elev); border-color: rgba(255,255,255,.2); }

/* App Store badges — pre-launch teaser, paired with a "Coming soon" pill. */
.store-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px; border-radius: 12px;
  background: #000; color: #fff;
  border: 1px solid rgba(255,255,255,.22); cursor: default; user-select: none;
}
.store-badge__logo { width: 21px; height: 25px; flex: none; }
.store-badge__text { display: flex; flex-direction: column; line-height: 1.05; text-align: left; }
.store-badge__text small { font-size: .62rem; opacity: .85; }
.store-badge__text strong { font-size: 1.02rem; font-weight: 600; letter-spacing: -.01em; }
.coming-soon {
  padding: 5px 12px; border-radius: 999px;
  font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: #06140e; background: var(--grad);
}

/* The calc motif — the product's identity, in HTML */
.calcpad {
  font-family: var(--mono); font-size: .92rem;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 8px 0; max-width: 440px;
  box-shadow: 0 24px 60px rgba(0,0,0,.4);
}
.calcpad__row { display: flex; justify-content: space-between; gap: 18px; padding: 7px 18px; }
.calcpad__row + .calcpad__row { border-top: 1px solid var(--line-soft); }
.calcpad__row--total { border-top: 1px solid var(--line); margin-top: 2px; }
.calcpad .src { color: var(--text); }
.calcpad .res { color: var(--dim); font-variant-numeric: tabular-nums; }
.calcpad .num { color: var(--num); }
.calcpad .cur { color: var(--cur); }
.calcpad .warn { color: var(--warn); }
.calcpad .ok { color: var(--id); }
.calcpad .op { color: var(--op); }
.calcpad__row--total .src { color: var(--faint); }

/* ---------- Phone / device frames ---------- */
.phone {
  /* Thin titanium-style iPhone bezel. No fake notch: the captured
     screenshots already include the real status bar / Dynamic Island, so an
     overlaid notch would double up. */
  position: relative; border-radius: 48px; padding: 5px;
  background: linear-gradient(150deg, #45454c 0%, #1b1b20 38%, #0c0c0f 100%);
  box-shadow:
    0 30px 80px rgba(0,0,0,.55),
    inset 0 0 0 1px rgba(255,255,255,.14),
    inset 0 1px 1px rgba(255,255,255,.20);
}
.phone img, .phone video { border-radius: 43px; display: block; width: 100%; }
.hero__device { display: flex; justify-content: center; }
.hero__device .phone { max-width: 320px; rotate: 2deg; transition: rotate .4s; }
.hero__device .phone:hover { rotate: 0deg; }
.phone--sm { max-width: 270px; }
.phone--lg { max-width: 300px; }

/* ---------- Feature rows ---------- */
.feature {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: center;
}
.feature--rev .feature__text { order: 2; }
.feature h2 { font-size: clamp(1.8rem, 4vw, 2.7rem); }
.feature p { color: var(--dim); margin: 18px 0; font-size: 1.06rem; }
.feature__text code { background: var(--bg-elev); padding: 2px 7px; border-radius: 6px; color: var(--id); border: 1px solid var(--line); }

.ticks { list-style: none; display: grid; gap: 12px; margin-top: 24px; }
.ticks li { position: relative; padding-left: 30px; color: var(--text); }
.ticks li::before {
  content: "✓"; position: absolute; left: 0; top: -1px;
  color: var(--accent); font-weight: 700;
  width: 20px; height: 20px;
}
.ticks code { background: var(--bg-elev); padding: 1px 6px; border-radius: 5px; color: var(--cur); border: 1px solid var(--line); }

.feature__shot { display: flex; justify-content: center; }
.feature__shot--pair { position: relative; min-height: 460px; align-items: center; }
.feature__shot--pair .phone--back {
  position: absolute; right: 6%; top: 8%; rotate: 6deg; max-width: 210px; opacity: .96; z-index: 1;
}
.feature__shot--pair .phone:first-child { rotate: -4deg; z-index: 2; }

/* ---------- Themes ---------- */
.themes__stage {
  display: grid; grid-template-columns: auto 1fr; gap: clamp(24px,4vw,56px);
  align-items: center; max-width: 760px; margin: 0 auto 48px;
}
.themes__meta h3 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.themes__meta p { color: var(--dim); margin-top: 12px; font-size: 1.05rem; max-width: 26em; }
.themes__pill {
  display: inline-block; margin-top: 16px; padding: 5px 12px; border-radius: 999px;
  font-size: .76rem; font-weight: 700; letter-spacing: .04em;
  color: #06140e; background: var(--grad);
}
/* The JS toggles the `hidden` attribute for free themes; without this the
   `display: inline-block` above would override it and the pill would always show. */
.themes__pill[hidden] { display: none; }
.themes__grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  max-width: 760px; margin: 0 auto;
}
.theme-chip {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--line);
  color: var(--text); font-size: .92rem; font-weight: 600; text-align: left;
  transition: border-color .2s, transform .15s, background .2s;
}
.theme-chip:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.22); }
.theme-chip[aria-selected="true"] { border-color: var(--accent); background: var(--bg-elev); }
.theme-chip .swatch { width: 18px; height: 18px; border-radius: 6px; border: 1px solid rgba(255,255,255,.18); flex: none; }
.theme-chip .lock { margin-left: auto; font-size: .72rem; color: var(--faint); }
@media (max-width: 720px) { .themes__grid { grid-template-columns: repeat(2,1fr); } .themes__stage { grid-template-columns: 1fr; text-align: center; justify-items: center; } }

/* ---------- Platforms ---------- */
.platforms__row { display: flex; gap: clamp(20px,4vw,48px); align-items: center; justify-content: center; flex-wrap: wrap; }
.frame { border-radius: 16px; background: linear-gradient(160deg,#26262e,#0e0e13); border: 1px solid rgba(255,255,255,.1); padding: 10px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.frame img { border-radius: 8px; }
.frame--tablet { max-width: 300px; border-radius: 26px; }
.frame--tablet img { border-radius: 16px; }
.frame--mac { max-width: 620px; flex: 1 1 460px; }

/* ---------- Share & collaborate ---------- */
.collab__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-width: 1000px; margin: 0 auto; }
.collab__card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 26px; }
.collab__icon { display: inline-flex; width: 48px; height: 48px; align-items: center; justify-content: center; border-radius: 13px; background: var(--bg-elev); color: var(--accent); border: 1px solid var(--line); margin-bottom: 18px; }
.collab__icon svg { width: 25px; height: 25px; }
.collab__card h3 { font-size: 1.18rem; letter-spacing: -.01em; }
.collab__card p { color: var(--dim); margin-top: 8px; font-size: 1rem; line-height: 1.55; }
.collab__card code { background: var(--bg-elev); padding: 1px 6px; border-radius: 5px; color: var(--cur); border: 1px solid var(--line); font-size: .9em; }
@media (max-width: 760px) { .collab__grid { grid-template-columns: 1fr; } }

/* ---------- Pro ---------- */
.pro { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px,5vw,72px); align-items: center; }
.pro h2 { font-size: clamp(1.8rem,4vw,2.7rem); }
.pro p { color: var(--dim); margin: 18px 0; font-size: 1.06rem; }
.pro__shots { position: relative; min-height: 460px; display: flex; justify-content: center; align-items: center; }
.pro__shots .phone--back { position: absolute; right: 8%; top: 10%; rotate: 6deg; max-width: 210px; z-index: 1; }
.pro__shots .phone:first-child { rotate: -4deg; z-index: 2; }

/* ---------- Videos ---------- */
.videos__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 270px)); justify-content: center; gap: 22px; }
.videocard { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.videocard video { width: 100%; display: block; background: #000; aspect-ratio: 9/19.5; object-fit: cover; }
.videocard__cap { padding: 14px 16px; }
.videocard__cap h3 { font-size: 1.02rem; }
.videocard__cap p { color: var(--dim); font-size: .9rem; margin-top: 4px; }
.videos__empty { text-align: center; color: var(--faint); border: 1px dashed var(--line); border-radius: var(--radius); padding: 48px; }

/* ---------- Footer ---------- */
.footer { text-align: center; border-top: 1px solid var(--line); padding: 34px var(--pad); }
.footer__legal { color: var(--faint); font-size: .8rem; letter-spacing: .01em; }
.footer__legal a { color: var(--dim); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 1px; transition: color .2s; }
.footer__legal a:hover { color: var(--text); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ---------- Responsive stacking ---------- */
@media (max-width: 880px) {
  .hero, .feature, .pro { grid-template-columns: 1fr; }
  .feature--rev .feature__text { order: 0; }
  .hero__device { order: -1; }
  .feature__shot--pair, .pro__shots { min-height: 420px; }
}
