/* Shared styles for every page. Tokens follow Vale v2 (Direction C · Teal). */
@font-face {
  font-family: "Cal Sans";
  src: url("/assets/fonts/CalSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #F7F5EF; --card: #FFFFFF; --sunk: #F0EFE8; --line: #ECEBE4; --line2: #7E8D8B;
  --ink: #0B3B3C; --ink2: #4E6467; --ink3: #6F8486;
  --accent: #0E5C5C; --on-accent: #FFFFFF; --graph: #137C77; --track: #E4EAE8;
  --hero: #133C3D; --hero-ink: #FFFFFF; --hero-sub: #B9D6D2; --hero-chip: #1E4C4D;
  --hero-line: #4A7474; --hero-action: #8FDCCB; --on-hero-action: #0B3B3C;
  --coral-tile: #FBE3DC; --coral: #A93F29;
  --mint-tile: #D9EEE8;  --mint: #0E5C5C;
  --leaf-tile: #E3EFD9;  --leaf: #4A6B1E;
  --lav-tile: #E6E4F4;   --lav: #4F4895;
  --pos-bg: #DCEFEA; --pos-line: #B5DCD2; --pos-ink: #0B4A4A;
  --bezel: #0B2627;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1A1B; --card: #152526; --sunk: #1C3031; --line: #233A3B; --line2: #577677;
    --ink: #ECF3F1; --ink2: #A9BDBC; --ink3: #8AA09F;
    --accent: #6FD0BF; --on-accent: #0B2627; --graph: #5FC3B3; --track: #1F3536;
    --hero: #1A4243; --hero-ink: #ECF3F1; --hero-sub: #A9C8C4; --hero-chip: #235253;
    --hero-line: #4A7474; --hero-action: #8FDCCB; --on-hero-action: #0B2627;
    --coral-tile: #3D241D; --coral: #F2A08C;
    --mint-tile: #173A3A;  --mint: #8FDCCB;
    --leaf-tile: #24321A;  --leaf: #B5D88E;
    --lav-tile: #25233D;   --lav: #B9B2F0;
    --pos-bg: #173A3A; --pos-line: #2C5A55; --pos-ink: #BFEDE3;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.display { font-family: "Cal Sans", -apple-system, sans-serif; font-weight: 400; letter-spacing: -0.02em; }
.muted { color: var(--ink3); }
.num { font-variant-numeric: tabular-nums; }

/* Header */
header { padding: 20px 0; }
header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand .display { font-size: 22px; letter-spacing: -0.03em; }
nav { display: flex; gap: 4px; }
nav a {
  text-decoration: none; font-size: 15px; font-weight: 600; color: var(--ink2);
  padding: 10px 14px; border-radius: 999px; min-height: 44px; display: inline-flex; align-items: center;
}
nav a:hover { background: var(--sunk); color: var(--ink); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  min-height: 52px; padding: 0 22px; border-radius: 999px;
  font-size: 16px; font-weight: 600; text-decoration: none;
  transition: transform .15s ease, opacity .15s ease;
}
.btn:active { transform: scale(.97); }
a:focus-visible, .strip:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-secondary { color: var(--ink); box-shadow: inset 0 0 0 1px var(--line2); }
.btn-secondary:hover { background: var(--sunk); }
.btn-hero { background: var(--hero-action); color: var(--on-hero-action); }
.btn-hero-ghost { color: var(--hero-ink); box-shadow: inset 0 0 0 1px var(--hero-line); }
.btn-hero-ghost:hover { background: var(--hero-chip); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 15px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Home intro */
.intro { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; padding: 48px 0 64px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  padding: 6px 12px; border-radius: 999px; background: var(--pos-bg); color: var(--pos-ink);
  box-shadow: inset 0 0 0 1px var(--pos-line);
}
.eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: var(--graph); }
h1 { font-size: clamp(44px, 7vw, 76px); line-height: 1.02; letter-spacing: -0.035em; margin: 20px 0; }
.lead { font-size: 19px; color: var(--ink2); max-width: 30em; margin: 0 0 28px; }

/* Breath rings */
.rings { position: relative; aspect-ratio: 1; width: min(100%, 400px); margin: 0 auto; }
.rings .ring { position: absolute; inset: 0; margin: auto; border-radius: 50%; }
.rings .r1 { width: 100%; height: 100%; border: 10px solid color-mix(in srgb, var(--graph) 18%, transparent); animation: breathe 8s ease-in-out infinite; }
.rings .r2 { width: 72%; height: 72%; border: 10px solid color-mix(in srgb, var(--graph) 45%, transparent); animation: breathe 8s ease-in-out infinite .4s; }
.rings .r3 { width: 36%; height: 36%; background: #F2A08C; animation: breathe 8s ease-in-out infinite .8s; }
.rings .label {
  position: absolute; left: 50%; bottom: 2%; transform: translateX(-50%);
  background: var(--card); padding: 8px 16px; border-radius: 999px; font-size: 15px; font-weight: 600;
  color: var(--ink2); white-space: nowrap;
}
@keyframes breathe { 0%, 100% { transform: scale(.88); } 50% { transform: scale(1); } }

/* Sections */
section { padding: 56px 0; }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
h2 { font-size: clamp(32px, 4.4vw, 44px); line-height: 1.08; letter-spacing: -0.03em; margin: 0; }
.sec-head p { margin: 0; color: var(--ink2); max-width: 26em; }

/* Featured app card (dark hero). An app can override --hero* in _data/apps.yml. */
.app {
  background: var(--hero); color: var(--hero-ink); border-radius: 36px; padding: 40px;
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 32px; overflow: hidden;
}
.app + .app { margin-top: 12px; }
.app-top { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.app-icon { width: 84px; height: 84px; border-radius: 19px; box-shadow: 0 0 0 1px rgba(255,255,255,.08); flex: none; }
.app h1, .app h3 { font-size: 34px; line-height: 1.1; letter-spacing: -0.02em; margin: 0; }
.app .sub { color: var(--hero-sub); margin: 4px 0 0; font-size: 15px; }
.app p.desc { color: var(--hero-sub); font-size: 17px; margin: 0 0 20px; max-width: 28em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip { background: var(--hero-chip); color: var(--hero-ink); font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 999px; }
.app-links { margin-top: 18px; font-size: 14px; display: flex; gap: 18px; flex-wrap: wrap; }
.app-links a { color: var(--hero-sub); text-underline-offset: 3px; }

.phones { position: relative; min-height: 460px; }
.phone {
  position: absolute; width: 46%; border-radius: 30px; overflow: hidden;
  box-shadow: 0 0 0 6px var(--bezel), 0 24px 60px rgba(0,0,0,.35); background: var(--bezel);
}
.phone.p1 { left: 4%; top: 30px; transform: rotate(-4deg); }
.phone.p2 { right: 4%; top: 0; transform: rotate(3deg); }
.phone.solo { left: 0; right: 0; margin: 0 auto; top: 0; transform: rotate(2deg); width: 52%; }

/* Other apps: compact tiles */
.app-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.app-tile { display: flex; flex-direction: column; gap: 16px; }
.app-tile .top { display: flex; align-items: center; gap: 14px; }
.app-tile img { width: 60px; height: 60px; border-radius: 14px; box-shadow: 0 0 0 1px var(--line); }
.app-tile h3 { font-size: 22px; line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
.app-tile .sub { margin: 2px 0 0; color: var(--ink2); font-size: 14px; }
.app-tile p { margin: 0; color: var(--ink2); font-size: 15px; flex: 1; }
.app-tile .actions { gap: 8px; }
.soon { align-self: flex-start; background: var(--sunk); color: var(--ink2); font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 999px; }

/* Cards and feature tiles */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.card { background: var(--card); border-radius: 28px; padding: 24px; }
.tile { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 18px; }
.tile svg { width: 26px; height: 26px; }
.t-coral { background: var(--coral-tile); color: var(--coral); }
.t-mint { background: var(--mint-tile); color: var(--mint); }
.t-leaf { background: var(--leaf-tile); color: var(--leaf); }
.t-lav { background: var(--lav-tile); color: var(--lav); }
.card h4 { font-size: 17px; margin: 0 0 6px; }
.card p { margin: 0; color: var(--ink2); font-size: 15px; line-height: 1.45; }

/* Screenshot strip */
.strip {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px 20px 24px;
  margin: 0 -20px; scrollbar-width: none;
}
.strip::-webkit-scrollbar { display: none; }
.strip figure { margin: 0; flex: 0 0 220px; scroll-snap-align: start; padding: 6px; }
.strip img { border-radius: 26px; box-shadow: 0 0 0 5px var(--bezel), 0 14px 30px rgba(11, 59, 60, .18); background: var(--card); }
.strip figcaption { margin-top: 12px; font-size: 15px; font-weight: 600; }
.strip figcaption span { display: block; font-weight: 400; color: var(--ink2); font-size: 14px; }

/* Principles */
.principles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.principle { display: flex; gap: 16px; align-items: flex-start; }
.principle .n { font-size: 28px; line-height: 1; color: var(--graph); min-width: 36px; }

/* Contact */
.contact { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 32px; }
.contact h3 { font-size: 32px; letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 8px; }
.contact p { font-size: 17px; }

/* App page */
.crumb { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--ink2); font-size: 15px; font-weight: 600; text-decoration: none; margin: 8px 0 16px; }
.crumb:hover { color: var(--ink); }
.crumb svg { width: 18px; height: 18px; }
.info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.info a.card { text-decoration: none; display: flex; flex-direction: column; gap: 4px; }
.info a.card:hover { box-shadow: inset 0 0 0 1px var(--line2); }
.info .card h4 { margin: 0; }

footer { padding: 40px 0 56px; color: var(--ink2); font-size: 14px; }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 24px; }
footer nav { gap: 6px; flex-wrap: wrap; }
footer nav a { font-weight: 500; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rings .ring { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

@media (max-width: 900px) {
  .intro { grid-template-columns: 1fr; padding: 24px 0 32px; gap: 32px; }
  .rings { width: min(70%, 300px); }
  .app { grid-template-columns: 1fr; padding: 28px 24px 0; border-radius: 28px; }
  .phones { min-height: 0; height: 360px; }
  .phone { width: 44%; }
  .grid, .app-grid { grid-template-columns: 1fr 1fr; }
  .contact { flex-direction: column; align-items: stretch; padding: 24px; }
  .info { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .lead { font-size: 17px; }
  .actions .btn { flex: 1 1 100%; }
  .app h1, .app h3 { font-size: 28px; }
  .app-icon { width: 68px; height: 68px; border-radius: 15px; }
  .phones { height: 300px; }
  .phone { border-radius: 22px; box-shadow: 0 0 0 4px var(--bezel), 0 18px 40px rgba(0,0,0,.35); }
  .grid, .principles, .app-grid { grid-template-columns: 1fr; }
  .strip figure { flex-basis: 70%; }
  section { padding: 40px 0; }
}
