/* Birch and pine, with a little earth: oat, sage and coffee-cherry clay.
   Core tokens match ios/BirchKit/Sources/BirchKit/Theme.swift. */
:root {
  --ground: #f6f7f6;
  --wash: #f9fbf9;
  --surface: #ffffff;
  --hairline: #d3d8d9;
  --tick: #c3c9cb;
  --tick-major: #858c91;
  --text: #22282c;
  --text-secondary: #596167;
  --label: #6a7278;
  --line: #4a5257;
  --pine: #2f5f4c;
  --pine-tint: #e2ebe6;
  --on-pine: #ffffff;

  --oat: #f2eee6;
  --sand: #eadfcd;
  --sun: #f5e4c8;
  --sage: #b9cdbf;
  --leaf: #dbe7dd;
  --clay: #b8644a;
  --clay-deep: #8a4631;
  --mist: #e9f1ec;

  --shadow: rgba(34, 40, 44, 0.22);
  --margin: clamp(24px, 7vw, 96px);
  --inset: clamp(24px, 5vw, 72px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #111514;
    --wash: #161b19;
    --surface: #1a1f1e;
    --hairline: #2f3638;
    --tick: #3e4648;
    --tick-major: #7c858a;
    --text: #e4e8e8;
    --text-secondary: #a3abb0;
    --label: #8f989d;
    --line: #b4bbbf;
    --pine: #8fc3a9;
    --pine-tint: #243a31;
    --on-pine: #111514;

    --oat: #181d1a;
    --sand: #2a2a22;
    --sun: #2c2a1f;
    --sage: #3a5546;
    --leaf: #22322a;
    --clay: #d98d6e;
    --clay-deep: #a65f45;
    --mist: #1f2b25;

    --shadow: rgba(0, 0, 0, 0.55);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background: linear-gradient(var(--wash), var(--ground) 520px) var(--ground);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Paper grain over everything, faint enough to feel rather than see. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .3 0 0 0 0 .24 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  body::after { mix-blend-mode: screen; opacity: 0.35; }
}

a { color: inherit; }

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--margin);
}

.label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--label);
}

.label.pine { color: var(--pine); }
.label.clay { color: var(--clay); }

/* Header */

.top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 36px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand svg { color: var(--pine); }

.brand .steam {
  stroke: var(--sage);
  animation: steam 3.4s ease-in-out infinite;
}

.brand .steam + .steam { animation-delay: 1.1s; }

@keyframes steam {
  0% { opacity: 0; transform: translateY(2px); }
  40% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-3px); }
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 96px;
  align-items: center;
  padding: 48px 0 120px;
}

h1 {
  margin: 14px 0 22px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", system-ui, sans-serif;
  font-size: clamp(52px, 8.4vw, 92px);
  line-height: 1.02;
  font-weight: 300;
  letter-spacing: -0.035em;
}

/* A hand-drawn clay stroke under "pour" that draws itself in. */
.mark {
  position: relative;
  white-space: nowrap;
}

.mark svg {
  position: absolute;
  left: -2%;
  bottom: -0.1em;
  width: 104%;
  height: 0.28em;
  overflow: visible;
}

.mark path {
  fill: none;
  stroke: var(--clay);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 320;
  stroke-dashoffset: 320;
  animation: draw 1.1s 0.7s cubic-bezier(.6, 0, .2, 1) forwards;
}

@keyframes draw { to { stroke-dashoffset: 0; } }

.lede {
  max-width: 29em;
  margin: 0 0 34px;
  font-size: 18px;
  color: var(--text-secondary);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 28px 0 24px;
  border-radius: 27px;
  background: var(--pine);
  color: var(--on-pine);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 14px 30px -18px var(--pine);
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.facts li {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--oat);
  font-size: 13px;
  color: var(--text-secondary);
}

.facts li::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 8px 1px 0;
  border-radius: 50%;
  background: var(--sage);
}

.facts li:nth-child(2)::before { background: var(--clay); opacity: .7; }
.facts li:nth-child(3)::before { background: var(--pine); opacity: .6; }

/* The phone sits in morning light, under a coffee branch. */
.stage {
  position: relative;
  width: 300px;
}

.stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 560px;
  height: 560px;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 34%, var(--sun) 0%, transparent 58%),
    radial-gradient(circle at 70% 72%, var(--leaf) 0%, transparent 55%);
}

.branch {
  position: absolute;
  z-index: 0;
  top: -70px;
  left: -270px;
  width: 460px;
  color: var(--line);
  transform-origin: 97% 97%;
  animation: sway 9s ease-in-out infinite;
}

.branch.under {
  top: auto;
  left: auto;
  right: -170px;
  bottom: -10px;
  width: 260px;
  transform: scaleX(-1) rotate(8deg);
  transform-origin: center;
  animation: none;
}

/* The branch is one <symbol>; these custom properties reach inside it. */
.branch {
  aspect-ratio: 400 / 340;
  --b-leaf: var(--leaf);
  --b-cherry: var(--clay);
  --b-cherry-line: var(--clay-deep);
}

@keyframes sway {
  0%, 100% { transform: rotate(-1.4deg); }
  50% { transform: rotate(1.6deg); }
}

.phone {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  border-radius: 44px;
  box-shadow: 0 0 0 1px var(--hairline), 0 40px 80px -40px var(--shadow);
}

/* Load-in: the hero rises in order. */
.rise {
  animation: rise 0.9s cubic-bezier(.2, .7, .2, 1) both;
  animation-delay: calc(var(--i, 0) * 90ms);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
}

/* The gauge, as a divider */

.gauge {
  position: relative;
  height: 40px;
  margin: 0 calc(-1 * var(--margin));
  background:
    repeating-linear-gradient(90deg, var(--tick-major) 0 1px, transparent 1px 100px) center bottom 14px / 100% 14px no-repeat,
    repeating-linear-gradient(90deg, var(--tick) 0 1px, transparent 1px 20px) center bottom 14px / 100% 6px no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
}

.gauge::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 14px;
  width: 1.5px;
  height: 24px;
  background: var(--pine);
}

/* Sections */

section { padding: 120px 0; }

h2 {
  margin: 10px 0 0;
  font-size: clamp(30px, 4.6vw, 44px);
  line-height: 1.12;
  font-weight: 300;
  letter-spacing: -0.025em;
}

/* Methods, as rows like the app's home screen */

.methods {
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--hairline);
}

.methods li {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 18px 16px 18px 8px;
  border-bottom: 1px solid var(--hairline);
  border-radius: 2px;
  transition: background-color .4s ease;
}

.methods li:hover { background: var(--oat); }

.methods svg {
  width: 48px;
  height: 48px;
  color: var(--line);
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}

.methods li:hover svg { transform: translateY(-3px); }

.methods svg .water { fill: var(--leaf); stroke: none; }
.methods svg .coffee { fill: var(--sand); stroke: none; }
.methods svg .counter { stroke: var(--tick); }

.methods .name { font-size: 19px; }

.methods .tagline {
  font-size: 13px;
  color: var(--text-secondary);
}

.methods .time {
  text-align: right;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.methods .time span {
  display: block;
  font-size: 11px;
  color: var(--label);
}

/* Features, on an oat board */

.board {
  position: relative;
  padding: 96px var(--inset) 104px;
  border-radius: 36px;
  background:
    radial-gradient(ellipse 60% 50% at 100% 0%, var(--sun), transparent 70%),
    radial-gradient(ellipse 50% 60% at 0% 100%, var(--leaf), transparent 70%),
    var(--oat);
  overflow: hidden;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 56px;
  margin-top: 56px;
}

.feature .phone {
  max-width: 280px;
  border-radius: 36px;
}

.feature:nth-child(2) { margin-top: 48px; }

.feature h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0 8px;
  font-size: 19px;
  font-weight: 400;
}

.feature h3::before {
  content: "";
  width: 18px;
  height: 10px;
  border-radius: 0 100% 0 100%;
  background: var(--sage);
  transform: rotate(-20deg);
}

.feature:nth-child(2) h3::before { background: var(--clay); opacity: .75; }
.feature:nth-child(3) h3::before { background: var(--pine); opacity: .7; }

.feature p {
  margin: 0;
  font-size: 15px;
  color: var(--text-secondary);
}

/* The closing band, in pine with a sprig */

.quiet {
  position: relative;
  margin: 120px 0 0;
  padding: 96px var(--inset);
  border-radius: 36px;
  background:
    radial-gradient(ellipse 70% 90% at 50% 120%, rgba(143, 195, 169, .35), transparent 70%),
    #2f5f4c;
  color: var(--mist);
  text-align: center;
  overflow: hidden;
}

@media (prefers-color-scheme: dark) {
  .quiet { background: radial-gradient(ellipse 70% 90% at 50% 120%, rgba(143, 195, 169, .18), transparent 70%), #1c3a2e; }
}

.quiet p {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: clamp(22px, 3.2vw, 30px);
  line-height: 1.3;
  font-weight: 300;
  letter-spacing: -0.015em;
}

.quiet .label { color: #a9d0bc; display: block; margin-bottom: 16px; }

.quiet .branch {
  top: auto;
  right: auto;
  bottom: -40px;
  left: -60px;
  width: 280px;
  color: #a9d0bc;
  opacity: .5;
  animation-duration: 11s;
}

.quiet .branch { --b-leaf: rgba(169, 208, 188, .12); --b-cherry-line: transparent; }

.quiet .branch.right {
  left: auto;
  right: -60px;
  bottom: auto;
  top: -50px;
  transform: scale(-1, -1);
  transform-origin: center;
  animation: none;
}

/* Footer */

footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  padding: 56px 0 72px;
  font-size: 13px;
  color: var(--label);
}

footer nav { display: flex; gap: 24px; }

footer a { text-decoration: none; }

footer a:hover { color: var(--text); }

/* Privacy page */

.doc {
  position: relative;
  max-width: 640px;
  padding: 40px 0 72px;
}

.doc h1 { font-size: clamp(40px, 6vw, 56px); }

.doc h2 {
  margin: 40px 0 8px;
  font-size: 19px;
  font-weight: 400;
  letter-spacing: 0;
}

.doc p { margin: 0 0 16px; color: var(--text-secondary); }

.doc .updated { color: var(--label); font-size: 13px; }

.doc > *:not(.branch) { position: relative; z-index: 1; }

.doc-branch.branch {
  top: -40px;
  left: auto;
  right: -360px;
  width: 340px;
}

/* Phone width */

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 72px; padding-top: 16px; }
  .stage { width: min(280px, 72vw); margin: 0 auto; }
  .stage::before { width: 440px; height: 440px; }
  .branch { width: 300px; left: -150px; top: -60px; }
  .branch.under { width: 180px; right: -110px; }
  .features { grid-template-columns: 1fr; gap: 56px; }
  .feature:nth-child(2) { margin-top: 0; }
  .feature .phone { margin: 0 auto; max-width: 280px; }
  .board, .quiet { border-radius: 28px; }
  section { padding: 80px 0; }
  .board { padding-top: 64px; padding-bottom: 72px; }
  .quiet { margin-top: 80px; padding-top: 72px; padding-bottom: 72px; }
  .doc-branch { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .mark path { stroke-dashoffset: 0; }
}
