/* Clearhead — marketing site
   The palette is lifted from the app's Palette.swift, not re-picked, so the
   site and the product cannot drift apart. Seven colours, each with one job. */

:root {
  color-scheme: light;

  --paper:    #FCFBF6;
  --card:     #FFFFFF;
  --ink:      #201E1B;
  --ink-soft: rgba(32, 30, 27, 0.62);
  --ink-faint:rgba(32, 30, 27, 0.34);
  --morning:  #F9E8A2;
  --calm:     #B4E1EB;
  --deep:     #78A4CB;
  --sun:      #F2D338;
  --hairline: rgba(32, 30, 27, 0.10);
  --shadow:   rgba(107, 91, 74, 0.13);

  --measure: 34rem;
  --serif: 'Lora', Georgia, 'Times New Roman', serif;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* A faint paper grain, the same idea as the app's Texture.swift — generated,
   so it costs no request. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

main, .site-head, .site-foot { position: relative; z-index: 1; }

a { color: var(--ink); }

/* ---------- Header ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(252, 251, 246, 0.86);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--hairline);
}

.head-inner {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0.95rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  flex: none;
}

.sun { width: 22px; height: 22px; flex: none; }
.sun circle { fill: var(--sun); }
.sun .rays line { stroke: var(--sun); stroke-width: 2; stroke-linecap: round; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-nav a:hover { color: var(--ink); }

.nav-cta {
  padding: 0.5rem 1.05rem;
  border-radius: 100px;
  background: var(--ink);
  color: var(--paper) !important;
  font-weight: 600;
  white-space: nowrap;
}

.nav-cta:hover { opacity: 0.88; }

@media (max-width: 640px) {
  .head-inner { padding: 0.8rem 1.1rem; gap: 0.8rem; }
  .site-nav { gap: 0.95rem; font-size: 0.86rem; }
  /* Legal lives in the footer on a small screen; the CTA is what matters here. */
  .site-nav a[href="/privacy"], .site-nav a[href="/terms"] { display: none; }
}

/* ---------- Hero ---------- */

.hero {
  max-width: 62rem;
  margin: 0 auto;
  padding: 5rem 1.5rem 3.5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3.5rem;
  align-items: start;
}

.hero h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(2.4rem, 6.4vw, 3.9rem);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.022em;
  max-width: 18ch;
}

.hero .lede {
  margin: 0;
  font-size: clamp(1.08rem, 2.2vw, 1.32rem);
  line-height: 1.62;
  color: var(--ink-soft);
  max-width: var(--measure);
}

/* ---------- The message, shown rather than described ---------- */

.proof { margin: 2rem 0 0; max-width: 26rem; }

.bubble {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  padding: 1.05rem 1.25rem;
  box-shadow: 0 8px 26px var(--shadow);
}

.bubble .from {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.bubble .dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--sun);
  flex: none;
}

.bubble p { margin: 0; font-size: 1.02rem; line-height: 1.55; }

.proof figcaption {
  margin: 0.85rem 0 0;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--ink-faint);
}

/* ---------- Signup ---------- */

.signup { margin: 3.25rem 0 0; max-width: 30rem; }

.signup form {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.signup input[type="email"] {
  flex: 1 1 15rem;
  min-width: 0;
  padding: 0.92rem 1.1rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 100px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.signup input[type="email"]::placeholder { color: var(--ink-faint); }

.signup input[type="email"]:focus {
  outline: none;
  border-color: var(--deep);
  box-shadow: 0 0 0 3px rgba(120, 164, 203, 0.28);
}

.signup button {
  padding: 0.92rem 1.6rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--paper);
  background: var(--ink);
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.signup button:hover { opacity: 0.88; }
.signup button:active { transform: translateY(1px); }

.signup .fine {
  margin: 0.8rem 0 0;
  font-size: 0.86rem;
  color: var(--ink-faint);
}

/* ---------- Flash messages ---------- */

.flash {
  margin: 0 0 1.5rem;
  padding: 0.85rem 1.15rem;
  border-radius: 14px;
  font-size: 0.95rem;
  border: 1px solid var(--hairline);
}

.flash.good  { background: var(--morning); }
.flash.info  { background: var(--calm); }
.flash.bad   { background: var(--card); color: #8A3A2E; border-color: rgba(138, 58, 46, 0.25); }

/* ---------- Sections ---------- */

.band {
  border-top: 1px solid var(--hairline);
  padding: 4.5rem 0;
}

.wrap {
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.band h2 {
  margin: 0 0 2.6rem;
  font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -0.018em;
  max-width: 20ch;
}

.steps {
  display: grid;
  gap: 2.2rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li { counter-increment: step; }

.steps li::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  margin-bottom: 0.9rem;
  border-radius: 50%;
  background: var(--morning);
  font-size: 0.92rem;
  font-weight: 600;
}

.steps h3 {
  margin: 0 0 0.45rem;
  font-size: 1.14rem;
  font-weight: 600;
}

.steps p { margin: 0; color: var(--ink-soft); font-size: 0.99rem; }

/* ---------- Privacy band ---------- */

.privacy-band { background: var(--card); }

/* Same rail as every other band. Constraining the wrap instead would indent
   this section alone and break the left edge the page is built on. */
.privacy-band .wrap { max-width: 62rem; }

.privacy-band h2 { margin-bottom: 1.2rem; }

.privacy-band p {
  margin: 0 0 1.05rem;
  color: var(--ink-soft);
  max-width: var(--measure);
}

.privacy-band p:last-child { margin-bottom: 0; }

/* ---------- Prose pages ---------- */

.prose {
  max-width: 42rem;
  margin: 0 auto;
  padding: 4rem 1.5rem 2rem;
}

.prose h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(2rem, 5vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.prose .updated {
  margin: 0 0 2.5rem;
  color: var(--ink-faint);
  font-size: 0.92rem;
  font-style: italic;
}

.prose h2 {
  margin: 2.6rem 0 0.7rem;
  font-size: 1.24rem;
  font-weight: 600;
}

.prose p, .prose li { color: var(--ink-soft); }
.prose li { margin-bottom: 0.5rem; }

/* ---------- Footer ---------- */

.site-foot {
  margin-top: 1rem;
  border-top: 1px solid var(--hairline);
  background: var(--card);
}

.foot-inner {
  max-width: 68rem;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 2.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 3rem;
}

.foot-tag {
  margin: 0.85rem 0 0;
  max-width: 15rem;
  font-size: 0.92rem;
  font-style: italic;
  color: var(--ink-faint);
}

.foot-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 2rem;
}

.foot-label {
  margin: 0 0 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.foot-cols a {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 0.94rem;
  color: var(--ink-soft);
  text-decoration: none;
}

.foot-cols a:hover { color: var(--ink); text-decoration: underline; }

.foot-base {
  border-top: 1px solid var(--hairline);
  padding: 1.8rem 1.5rem 2.4rem;
  text-align: center;
}

.foot-line {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-style: italic;
  color: var(--ink-soft);
}

.foot-note { margin: 0; font-size: 0.82rem; color: var(--ink-faint); }

@media (max-width: 760px) {
  .foot-inner { grid-template-columns: 1fr; gap: 2.5rem; padding-top: 2.8rem; }
}

/* This site is light-only by design. The *app* ships a designed dark palette,
   but a marketing page has one job in one light, and a warm paper ground is the
   product's whole first impression — inverting it for half the visitors buys
   nothing and costs the thing people are meant to recognise. `color-scheme`
   below stops the browser from auto-darkening form controls anyway. */

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Visually hidden, still read aloud. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Visually hidden, still read aloud. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- The device ----------
   A CSS phone rather than a screenshot, for two reasons: it stays honest when
   the app's own palette moves (both are the same seven tokens), and it can
   show the one thing a screenshot cannot — the message arriving.

   The loop is deliberately slow and runs once every 9 seconds. This is an app
   about drinking; a flashy demo reel would be the wrong register entirely. */

.device-stage {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 1rem;
}

.device {
  position: relative;
  width: 274px;
  height: 570px;
  flex: none;
  border-radius: 44px;
  background: #14120F;
  padding: 11px;
  box-shadow:
    0 2px 5px rgba(32, 30, 27, 0.4),
    0 22px 48px rgba(107, 91, 74, 0.28);
}

.screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 34px;
  overflow: hidden;
  background: var(--paper);
  font-size: 11px;
  line-height: 1.45;
}

.island {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 78px;
  height: 23px;
  border-radius: 12px;
  background: #14120F;
  z-index: 6;
}

.status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 18px 0;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink);
}

.status .bars { display: flex; gap: 2px; align-items: flex-end; }
.status .bars i { display: block; width: 3px; background: var(--ink); border-radius: 1px; }
.status .bars i:nth-child(1) { height: 4px; }
.status .bars i:nth-child(2) { height: 6px; }
.status .bars i:nth-child(3) { height: 8px; }
.status .bars i:nth-child(4) { height: 10px; }

.app { padding: 14px 16px 0; }

.app-title {
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 6px 0 1px;
}

.app-date { font-size: 10px; font-style: italic; color: var(--ink-faint); }

.app-head { display: flex; justify-content: space-between; align-items: flex-start; }

.avatar {
  width: 30px; height: 30px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--calm);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}

.risk-card {
  margin-top: 13px;
  padding: 12px 13px 14px;
  border-radius: 14px;
  background: var(--calm);
}

.risk-card .tag {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(32, 30, 27, 0.55);
}

.risk-card .line {
  margin-top: 5px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.stat-card {
  margin-top: 11px;
  padding: 12px 13px 13px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--hairline);
  box-shadow: 0 4px 12px rgba(107, 91, 74, 0.07);
}

.stat-card .tag {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--deep);
}

.stats { display: flex; gap: 10px; margin-top: 10px; }
.stats div { flex: 1; }

.stats .n {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.stats .n.accent { color: var(--deep); }
.stats .l { font-size: 8.5px; color: var(--ink-soft); line-height: 1.3; margin-top: 2px; }

.tabbar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 58px;
  background: var(--sheet);
  border-top: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 10px 8px;
  font-size: 8px;
  color: var(--ink-faint);
}

.tabbar span { display: block; text-align: center; }
.tabbar .on { color: var(--ink); font-weight: 600; }

.tabbar .fab {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 300;
  margin-bottom: 10px;
}

/* The message arriving — the whole point of the device being animated. */

.banner {
  position: absolute;
  top: 12px; left: 10px; right: 10px;
  z-index: 5;
  padding: 9px 11px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(32, 30, 27, 0.07);
  box-shadow: 0 8px 22px rgba(107, 91, 74, 0.22);
  opacity: 0;
  transform: translateY(-70px);
  animation: banner-in 9s ease-in-out infinite;
}

.banner .from {
  display: flex; align-items: center; gap: 5px;
  font-size: 8px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-faint);
}

.banner .from b {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--sun);
  display: block; flex: none;
}

.banner .msg { margin-top: 4px; font-size: 10.5px; line-height: 1.4; }
.banner .when { margin-left: auto; font-weight: 500; letter-spacing: 0; text-transform: none; }

@keyframes banner-in {
  0%, 6%    { opacity: 0; transform: translateY(-70px) scale(0.96); }
  13%, 52%  { opacity: 1; transform: translateY(0) scale(1); }
  60%, 100% { opacity: 0; transform: translateY(-70px) scale(0.96); }
}

/* The screen dims very slightly while the banner is up, the way iOS does. */
.screen-dim {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: rgba(32, 30, 27, 0.05);
  opacity: 0;
  pointer-events: none;
  animation: dim 9s ease-in-out infinite;
}

@keyframes dim {
  0%, 6%    { opacity: 0; }
  13%, 52%  { opacity: 1; }
  60%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .banner { opacity: 1; transform: none; animation: none; }
  .screen-dim { display: none; }
}

/* Below the fold the hero becomes one column, and the device goes first. */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .device-stage { padding-top: 2.5rem; justify-content: flex-start; }
}


/* Names the category in the first line, because the headline below it earns
   attention rather than spending it on explaining what kind of app this is. */
.eyebrow {
  margin: 0 0 0.9rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--deep);
}

/* ---------- The device ----------
   The screen is a real screenshot from the real app running on a real
   simulator, not a CSS drawing of one. Anything else is a promise the app has
   to keep later, and this one keeps itself honest — reshoot it and the site
   updates.

   The frame around it is drawn, because a frame is chrome and does not need to
   be photographed: a titanium rail, the antenna break, the action button and
   volume pair on the left, power on the right. */

.device-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 0.5rem;
}

.device {
  position: relative;
  width: 296px;
  flex: none;
  border-radius: 54px;
  padding: 10px;
  /* Brushed titanium: a hard specular edge on each side, not a flat grey. */
  background:
    linear-gradient(145deg, #6E6E73 0%, #2B2B2E 14%, #1A1A1C 50%, #2B2B2E 86%, #77777C 100%);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.16),
    0 1px 2px rgba(0, 0, 0, 0.5),
    0 28px 60px rgba(107, 91, 74, 0.32),
    0 8px 20px rgba(107, 91, 74, 0.18);
}

/* Side buttons. Absolutely positioned on the rail, same metal as the frame. */
.device::before,
.device::after {
  content: "";
  position: absolute;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, #55555A, #234, #55555A);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.2);
}

/* Left rail: action button, then the volume pair, drawn as one run with gaps. */
.device::before {
  left: -3px;
  top: 108px;
  height: 34px;
}

.device::after {
  right: -3px;
  top: 132px;
  height: 74px;
}

.device .rail-volume,
.device .rail-action {
  position: absolute;
  left: -3px;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, #55555A, #234, #55555A);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.2);
}

.device .rail-action { top: 158px; height: 30px; }
.device .rail-volume { top: 200px; height: 58px; }

.screen {
  position: relative;
  display: block;
  width: 100%;
  border-radius: 45px;
  overflow: hidden;
  background: var(--paper);
  /* The glass edge where the display meets the bezel. */
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.55);
}

.screen img {
  display: block;
  width: 100%;
  height: auto;
}

/* The message arriving — the one thing a screenshot cannot show. */

.banner {
  position: absolute;
  top: 14px; left: 11px; right: 11px;
  z-index: 5;
  padding: 10px 12px 11px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateY(-78px);
  animation: banner-in 9s cubic-bezier(0.32, 0.72, 0, 1) infinite;
}

.banner .from {
  display: flex; align-items: center; gap: 6px;
  margin: 0;
  font-size: 8.5px; font-weight: 700;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: rgba(32, 30, 27, 0.5);
}

.banner .from b {
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--sun);
  display: block; flex: none;
}

.banner .msg {
  margin: 5px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: #201E1B;
}

.banner .when { margin-left: auto; font-weight: 500; letter-spacing: 0; text-transform: none; }

@keyframes banner-in {
  0%, 6%    { opacity: 0; transform: translateY(-78px) scale(0.94); }
  13%, 52%  { opacity: 1; transform: translateY(0) scale(1); }
  60%, 100% { opacity: 0; transform: translateY(-78px) scale(0.94); }
}

.device-stage figcaption {
  margin: 1.4rem 0 0;
  max-width: 17rem;
  text-align: center;
  font-size: 0.88rem;
  font-style: italic;
  color: var(--ink-faint);
}

@media (prefers-reduced-motion: reduce) {
  .banner { opacity: 1; transform: none; animation: none; }
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .device-stage { align-items: flex-start; padding-top: 1rem; }
  .device-stage figcaption { text-align: left; }
}

.prose-cta { margin-top: 2.5rem; }
.prose-cta a { display: inline-block; text-decoration: none; }
.prose a { color: var(--ink); }

/* A grid child defaults to a min-content floor, so the hero column refused to
   shrink below the width of the signup row and pushed the whole page sideways
   on a phone. minmax(0,…) plus min-width:0 removes that floor. */
.hero-copy { min-width: 0; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .signup form { flex-direction: column; align-items: stretch; }
  .signup input[type="email"], .signup button { flex: none; width: 100%; }
  .hero { padding-top: 3rem; }
}
