/* Cranial's website. The palette is the app's: its pastel phase colors
   (in, hold, out), the night of its icon, and rounded type throughout. */

:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --ink: #1b2233;
  --muted: #5d6679;
  --line: #e2e6ee;
  --night: #121722;
  --in: #96b9eb;      /* sky, breathing in */
  --hold: #ebcf96;    /* sand, holding */
  --out: #96ebc8;     /* sage, breathing out */
  --in-ink: #30507f;
  --out-ink: #2d6b52;
  --accent: #3d6fb8;
  --radius: 24px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e121b;
    --surface: #171d2a;
    --ink: #eef1f7;
    --muted: #a3acbd;
    --line: #262e3f;
    --in-ink: #b8d0f3;
    --out-ink: #b5eed6;
    --accent: #9cbdf0;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

a { color: var(--accent); text-underline-offset: 3px; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* Header and footer */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  font-size: 19px;
  text-decoration: none;
}

.brand img { width: 34px; height: 34px; border-radius: 9px; }

.nav { display: flex; gap: 18px; font-size: 15px; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 72px;
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
}
.site-footer a { color: var(--muted); }

/* Home */

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  padding: 40px 0 24px;
}

.hero-icon {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(18, 23, 34, 0.18);
}

h1 {
  font-size: clamp(38px, 6vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 22px 0 16px;
}

.lead { font-size: 20px; color: var(--muted); margin: 0 0 28px; max-width: 34em; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--night);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
@media (prefers-color-scheme: dark) {
  .badge { background: var(--in); color: var(--night); }
}

.fine { color: var(--muted); font-size: 14px; margin-top: 12px; }

/* The breathing mark: the app's ring, split into in / hold / out, with a
   breathing core. It rests when motion is reduced. */
.breath-wrap {
  position: relative;
  width: min(360px, 80vw);
  aspect-ratio: 1;
  margin: 0 auto;
}
.breath {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    conic-gradient(from 215deg,
      var(--in) 0 108deg, transparent 108deg 122deg,
      var(--hold) 122deg 166deg, transparent 166deg 180deg,
      var(--out) 180deg 290deg, transparent 290deg 360deg);
  -webkit-mask: radial-gradient(circle, transparent 62%, #000 63%);
          mask: radial-gradient(circle, transparent 62%, #000 63%);
}
.breath-core {
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--in) 65%, var(--surface)), var(--in));
  animation: breathe 10s ease-in-out infinite;
  display: grid;
  place-items: center;
  /* The core is pastel in both appearances, so its text stays dark. */
  color: #1f3350;
  font-weight: 700;
  font-size: 20px;
}
.breath-core::after { content: "Breathe in"; animation: cue 10s step-end infinite; }

@keyframes breathe {
  0%, 100% { transform: scale(0.72); }
  50% { transform: scale(1); }
}
@keyframes cue {
  0% { content: "Breathe in"; }
  50% { content: "Breathe out"; }
}
@media (prefers-reduced-motion: reduce) {
  .breath-core { animation: none; transform: scale(0.86); }
  .breath-core::after { animation: none; content: "Breathe"; }
}

/* Sections */

section { padding: 48px 0 8px; }
h2 { font-size: clamp(26px, 3.6vw, 34px); letter-spacing: -0.01em; margin: 0 0 10px; }
.section-lead { color: var(--muted); margin: 0 0 28px; max-width: 40em; }

.shots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: start;
}
.shots figure { margin: 0; }
.shots img {
  width: 100%;
  height: auto;
  border-radius: 34px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(18, 23, 34, 0.12);
  display: block;
}
.shots figcaption { color: var(--muted); font-size: 14px; text-align: center; margin-top: 12px; }

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.card h3 { margin: 12px 0 6px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; }
.dot.in { background: var(--in); }
.dot.hold { background: var(--hold); }
.dot.out { background: var(--out); }

.note {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  color: var(--muted);
  font-size: 15px;
}

/* Text pages */

.page { max-width: 720px; padding: 24px 0 0; }
.page h1 { font-size: clamp(34px, 5vw, 46px); margin-top: 8px; }
.page h2 { font-size: 22px; margin: 34px 0 8px; }
.page p, .page li { color: var(--ink); }
.page .updated { color: var(--muted); font-size: 14px; margin-top: -6px; }
.page ul { padding-left: 1.2em; }
.page details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 18px;
  margin: 10px 0;
}
.page summary { font-weight: 600; cursor: pointer; }
.page details p { margin: 10px 0 2px; color: var(--muted); }

/* Phones */

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 16px; text-align: left; }
  .breath-wrap { width: min(260px, 70vw); }
  .shots { grid-template-columns: repeat(3, 72vw); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
  .shots figure { scroll-snap-align: start; }
  .features { grid-template-columns: 1fr; }
  .nav { gap: 14px; }
}
