/* Mesa marketing site. Palette and type follow ios/Mesa/Views/Theme.swift (dark values). */

@font-face {
  font-family: "Archivo";
  src: url("fonts/Archivo.ttf") format("truetype");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Fragment Mono";
  src: url("fonts/FragmentMono-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #121210;
  --surface: #1c1b18;
  --ink: #eeece6;
  --secondary: #a6a299;
  --rule: #2a2924;
  --line: #6f6b63;
  --accent: #d6763c;
  --positive: #a2b69c;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "Fragment Mono", ui-monospace, Menlo, monospace;
  --gutter: clamp(20px, 5vw, 72px);
  --max: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, dl, dd, ol, ul, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* Type */
h1 {
  font-weight: 560; font-size: clamp(40px, 6.4vw, 84px); line-height: 1.02;
  letter-spacing: -0.03em; text-wrap: balance;
}
h2 {
  font-weight: 540; font-size: clamp(30px, 3.9vw, 52px); line-height: 1.06;
  letter-spacing: -0.025em; text-wrap: balance;
}
h3 { font-weight: 560; font-size: 19px; line-height: 1.3; letter-spacing: -0.01em; }
p { text-wrap: pretty; }
.eyebrow { color: var(--secondary); font-size: 15px; }
.num { font-family: var(--mono); font-size: 13px; color: var(--accent); margin-right: 10px; }
.lede { color: var(--secondary); font-size: clamp(18px, 1.5vw, 21px); line-height: 1.5; max-width: 34em; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 28px;
  padding: 16px var(--gutter);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 15px; letter-spacing: 0.18em; }
.logo svg { width: 27px; height: 16px; fill: var(--accent); }
.top nav { display: flex; gap: 26px; margin-left: auto; }
.top nav a { text-decoration: none; color: var(--secondary); font-size: 15px; transition: color .2s; }
.top nav a:hover { color: var(--ink); }

.button {
  display: inline-block; text-decoration: none;
  background: var(--ink); color: var(--bg);
  font-weight: 560; font-size: 16px; padding: 14px 22px; border-radius: 999px;
  transition: background .2s, transform .2s;
}
.button:hover { background: #fff; transform: translateY(-1px); }
.button.small { font-size: 14px; padding: 9px 16px; }
.text-link { color: var(--ink); text-underline-offset: 5px; text-decoration-color: var(--line); transition: text-decoration-color .2s; }
.text-link:hover { text-decoration-color: var(--accent); }

/* Phone screenshots: real captures, a hairline and a soft floor of light, no fake hardware. */
.phone { width: min(100%, 340px); justify-self: center; }
.phone img {
  width: 100%; height: auto;
  border-radius: 13.5% / 6.2%;
  border: 1px solid #34322c;
  box-shadow: 0 0 0 6px #0b0b0a, 0 0 0 7px var(--rule), 0 40px 90px -30px rgba(214, 118, 60, .22), 0 30px 60px -20px rgba(0, 0, 0, .8);
}
.phone figcaption { margin-top: 22px; text-align: center; font-family: var(--mono); font-size: 12px; color: var(--line); }

/* Hero */
.hero {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(48px, 8vw, 112px) var(--gutter) clamp(56px, 7vw, 96px);
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: clamp(32px, 6vw, 96px); align-items: center;
}
.hero-copy > * { animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
.hero-copy > :nth-child(2) { animation-delay: .08s; }
.hero-copy > :nth-child(3) { animation-delay: .16s; }
.hero-copy > :nth-child(4) { animation-delay: .24s; }
.hero h1 { margin: 18px 0 26px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin-top: 36px; }
.hero-phone { animation: rise 1.1s .2s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* The day's curve */
.day { border-top: 1px solid var(--rule); padding-top: clamp(56px, 7vw, 104px); }
.day-head {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 6vw, 96px); align-items: end;
}
.day-head p { color: var(--secondary); max-width: 32em; }
.curve { position: relative; margin-top: clamp(40px, 5vw, 72px); }
.curve svg { width: 100%; height: clamp(220px, 30vw, 400px); }
.curve .grid { stroke: var(--rule); stroke-width: 1; vector-effect: non-scaling-stroke; }
.curve .cap { stroke: var(--line); stroke-width: 1; stroke-dasharray: 5 5; vector-effect: non-scaling-stroke; }
.curve .area { fill: url(#fill); }
.curve .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 0; }
.tick { position: absolute; font-family: var(--mono); font-size: 12px; color: var(--secondary); }
.cap-label { left: var(--gutter); top: calc(5.5% + 8px); }
.peak-label { left: 82.5%; top: 24.4%; transform: translate(-50%, -34px); color: var(--ink); white-space: nowrap; }
.hours { display: flex; justify-content: space-between; padding: 12px var(--gutter) 0; border-top: 1px solid var(--rule); font-family: var(--mono); font-size: 12px; color: var(--line); margin-top: -1px; }

/* Features */
.feature, .sources, .access, .care, .start {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(72px, 10vw, 152px) var(--gutter) 0;
}
.feature { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.feature.flip .feature-copy { order: 2; }
.feature h2, .section-head h2 { margin: 16px 0 22px; }
.feature-copy > p:not(.eyebrow), .section-head > p:not(.eyebrow) { color: var(--secondary); max-width: 33em; }
.aside { margin-top: 26px; padding-left: 16px; border-left: 2px solid var(--accent); font-size: 16px; }

.rows { margin-top: 36px; border-top: 1px solid var(--rule); }
.rows > div { display: grid; grid-template-columns: 10.5em 1fr; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--rule); }
.rows dt { font-weight: 540; }
.rows dd { color: var(--secondary); }

/* Sources */
.section-head { max-width: 44em; }
.sources-body { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .6fr); gap: clamp(32px, 6vw, 96px); align-items: start; margin-top: 48px; }
table { width: 100%; border-collapse: collapse; font-size: 17px; }
thead th { text-align: left; font-family: var(--mono); font-weight: 400; font-size: 12px; color: var(--line); padding: 0 16px 12px 0; }
tbody tr { border-top: 1px solid var(--rule); }
tbody tr:last-child { border-bottom: 1px solid var(--rule); }
tbody th { text-align: left; font-weight: 540; padding: 22px 16px 22px 0; white-space: nowrap; }
tbody th::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--positive); margin-right: 12px; vertical-align: 2px; }
tbody td { padding: 22px 16px 22px 0; color: var(--secondary); }
tbody td:nth-child(2) { color: var(--ink); white-space: nowrap; }
.table-note { margin-top: 20px; color: var(--line); font-size: 15px; max-width: 34em; }
.phone.compact { width: min(100%, 270px); }

/* Roles: each column is the one before it, plus more. */
.roles { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 52px; align-items: start; }
.roles li { border-top: 1px solid var(--line); padding: 20px 28px 0 0; position: relative; }
.roles li::before { content: ""; position: absolute; left: 0; top: -1px; height: 3px; background: var(--accent); transform: translateY(-1px); }
.roles li:nth-child(1)::before { width: 33%; }
.roles li:nth-child(2)::before { width: 66%; }
.roles li:nth-child(3)::before { width: 100%; }
.roles p { color: var(--secondary); margin-top: 8px; max-width: 22em; }

/* Data care */
.care-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 clamp(24px, 4vw, 56px); margin-top: 44px; }
.care-list li { border-top: 1px solid var(--rule); padding: 22px 0 34px; }
.care-list p { color: var(--secondary); margin-top: 8px; font-size: 16px; }

/* Steps and call to action */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(20px, 3vw, 40px); margin-top: 48px; }
.steps li { border-top: 1px solid var(--rule); padding-top: 18px; }
.steps .num { display: block; font-size: 13px; margin: 0 0 22px; }
.steps p { color: var(--secondary); margin-top: 8px; font-size: 16px; }

.cta {
  margin-top: clamp(72px, 10vw, 140px);
  padding: clamp(48px, 7vw, 96px) clamp(24px, 5vw, 72px);
  background: var(--surface); border: 1px solid var(--rule); border-radius: 6px;
  text-align: center; display: grid; justify-items: center; gap: 18px;
  background-image: radial-gradient(120% 90% at 50% 120%, rgba(214, 118, 60, .16), transparent 60%);
}
.cta svg { width: 54px; height: 32px; fill: var(--accent); margin-bottom: 6px; }
.cta p { color: var(--secondary); max-width: 30em; }
.cta .button { margin-top: 14px; }

/* Footer */
.foot {
  max-width: var(--max); margin: clamp(72px, 9vw, 120px) auto 0;
  padding: 28px var(--gutter) 56px; border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: auto 1fr 1fr; gap: 16px 48px; align-items: start;
  color: var(--line); font-size: 14px;
}

/* Scroll reveal. Content is visible without script. */
.wait { opacity: 0; transform: translateY(22px); }
.wait.in { opacity: 1; transform: none; transition: opacity .9s cubic-bezier(.2, .7, .2, 1), transform .9s cubic-bezier(.2, .7, .2, 1); }
.day.wait .line { stroke-dashoffset: 1; }
.day.wait .area { opacity: 0; }
.day.in .line { stroke-dashoffset: 0; transition: stroke-dashoffset 2.4s .2s cubic-bezier(.4, 0, .2, 1); }
.day.in .area { opacity: 1; transition: opacity 1.2s 1.6s; }

@media (max-width: 900px) {
  .top nav { display: none; }
  .top .button { margin-left: auto; }
  .hero, .feature, .sources-body, .day-head { grid-template-columns: 1fr; }
  .feature.flip .feature-copy { order: 0; }
  .phone { width: min(78%, 320px); margin-top: 12px; }
  .care-list { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .roles { grid-template-columns: 1fr; gap: 28px; }
  .foot { grid-template-columns: 1fr; }
  .peak-label { left: auto; right: var(--gutter); transform: translateY(-34px); }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .rows > div { grid-template-columns: 1fr; gap: 2px; }
  .care-list, .steps { grid-template-columns: 1fr; }
  table, tbody, tr, th, td { display: block; }
  thead { display: none; }
  tbody tr { padding: 18px 0; }
  tbody th, tbody td { padding: 0; white-space: normal; }
  tbody td { margin-top: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .wait { opacity: 1; transform: none; }
  .day.wait .line { stroke-dashoffset: 0; }
  .day.wait .area { opacity: 1; }
}
