/* Baritone: same paper, ink and green as the mail app. No JavaScript; motion is CSS only. */

@font-face {
  font-family: 'Newsreader';
  src: url('/fonts/newsreader-latin-opsz-normal.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  src: url('/fonts/newsreader-latin-opsz-italic.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #faf8f4;
  --surface: #ffffff;
  --ink: #1d1c1a;
  --ink-2: #57544f;
  --ink-3: #8c8880;
  --line: #ece8e1;
  --line-strong: #ddd8cf;
  --accent: #2f5d50;
  --accent-soft: #e6efea;
  --on-accent: #f3efe6;
  --mark-bg: #2f5d50;
  --mark-fg: #f3efe6;
  --grain: 0.035;
  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --gutter: clamp(20px, 5vw, 64px);
  --max: 1240px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141413;
    --surface: #1c1c1a;
    --ink: #eceae5;
    --ink-2: #b5b1a9;
    --ink-3: #7f7b74;
    --line: #2a2926;
    --line-strong: #393733;
    --accent: #8fbfa8;
    --accent-soft: #1f2b26;
    --on-accent: #141413;
    --grain: 0.05;
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Paper grain, so the page feels like stock rather than a screen. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 6px;
}

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

/* ---------- Top bar ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(16px, env(safe-area-inset-top)) var(--gutter) 16px;
  border-bottom: 1px solid transparent;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: -0.01em;
}

.mark {
  width: 30px;
  height: 30px;
  flex: none;
}
.mark rect {
  fill: var(--mark-bg);
}
.mark g {
  stroke: var(--mark-fg);
}
.mark-sm {
  width: 20px;
  height: 20px;
}

.nav {
  display: flex;
  gap: clamp(18px, 3vw, 32px);
}
.nav a {
  position: relative;
  color: var(--ink-2);
  font-size: 14px;
  text-decoration: none;
  transition: color 160ms ease;
}
.nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 260ms var(--ease);
}
@media (hover: hover) {
  .nav a:hover {
    color: var(--ink);
  }
  .nav a:hover::after {
    transform: scaleX(1);
  }
}

/* The bar picks up a frosted paper background once you scroll. */
@supports (animation-timeline: scroll()) {
  .top {
    animation: bar linear both;
    animation-timeline: scroll(root);
    animation-range: 0 140px;
  }
  @keyframes bar {
    to {
      background: color-mix(in srgb, var(--paper) 80%, transparent);
      -webkit-backdrop-filter: blur(16px) saturate(1.2);
      backdrop-filter: blur(16px) saturate(1.2);
      border-bottom-color: var(--line);
    }
  }
}

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

.hero {
  position: relative;
  min-height: calc(100vh - 62px);
  min-height: calc(100svh - 62px);
  display: flex;
  align-items: center;
  margin-top: -1px;
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(40px, 8vh, 96px) var(--gutter) clamp(170px, 28vh, 280px);
}

.eyebrow,
.section-label {
  margin: 0 0 clamp(14px, 2.4vh, 22px);
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  margin-left: -0.045em;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(78px, 16vw, 232px);
  line-height: 0.88;
  letter-spacing: -0.045em;
  font-optical-sizing: auto;
  white-space: nowrap;
}
h1 span {
  display: inline-block;
  animation: letter 1100ms var(--ease) both;
}
h1 span:nth-child(1) { animation-delay: 80ms; }
h1 span:nth-child(2) { animation-delay: 125ms; }
h1 span:nth-child(3) { animation-delay: 170ms; }
h1 span:nth-child(4) { animation-delay: 215ms; }
h1 span:nth-child(5) { animation-delay: 260ms; }
h1 span:nth-child(6) { animation-delay: 305ms; }
h1 span:nth-child(7) { animation-delay: 350ms; }
h1 span:nth-child(8) { animation-delay: 395ms; }

.lede {
  max-width: 22ch;
  margin: clamp(18px, 3vh, 30px) 0 clamp(32px, 5vh, 52px);
  color: var(--ink-2);
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(24px, 3.1vw, 40px);
  line-height: 1.2;
  letter-spacing: -0.012em;
  animation: rise 1000ms var(--ease) 420ms both;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 26px;
  animation: rise 1000ms var(--ease) 520ms both;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 22px 0 25px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 220ms var(--ease), box-shadow 220ms var(--ease);
}
.cta svg,
.big-mail svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 240ms var(--ease);
}
.cta svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.6;
}
@media (hover: hover) {
  .cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 34px -16px color-mix(in srgb, var(--accent) 75%, transparent);
  }
  .cta:hover svg {
    transform: translateX(3px);
  }
}
.cta:active {
  transform: scale(0.98);
}

.text-link {
  color: var(--ink-2);
  font-size: 15px;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: 2px;
  transition: color 160ms ease, background-size 260ms var(--ease);
}
@media (hover: hover) {
  .text-link:hover {
    color: var(--ink);
    background-size: 0 1px;
    background-position: 100% 100%;
  }
}

/* ---------- Waves: a low note, held ---------- */

.waves {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(36px, 7vh, 80px);
  height: clamp(130px, 22vh, 240px);
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  animation: fade 1800ms ease 500ms both;
}

.wave {
  position: absolute;
  inset: 0 auto 0 0;
  width: 200%;
  height: 100%;
  overflow: visible;
}
.wave path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
}
.w1 {
  opacity: 0.55;
  animation: drift 32s linear infinite;
}
.w2 {
  opacity: 0.28;
  animation: drift 21s linear infinite;
}
.w3 {
  opacity: 0.16;
  animation: drift 14s linear infinite;
}

/* ---------- Statement ---------- */

.statement {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(90px, 16vh, 170px) var(--gutter);
  border-top: 1px solid var(--line);
}

.statement-text {
  position: relative;
  max-width: 24ch;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(34px, 5.4vw, 76px);
  line-height: 1.08;
  letter-spacing: -0.028em;
}
.statement-text em {
  color: var(--accent);
  font-style: italic;
}

/* ---------- Principles ---------- */

.principles {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(60px, 10vh, 110px) var(--gutter) clamp(80px, 14vh, 150px);
  border-top: 1px solid var(--line);
}

.principle-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 64px);
  margin: clamp(18px, 3vh, 30px) 0 0;
  padding: 0;
  list-style: none;
}

.principle {
  padding-top: 26px;
  border-top: 1px solid var(--line-strong);
}
.num {
  display: block;
  margin-bottom: 22px;
  color: var(--accent);
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  letter-spacing: 0.02em;
}
.principle h2 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 2.4vw, 34px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.principle p {
  max-width: 34ch;
  margin: 0;
  color: var(--ink-2);
  font-size: 16px;
}

/* ---------- Closing ---------- */

.closing {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(80px, 14vh, 150px) var(--gutter) clamp(90px, 16vh, 170px);
  border-top: 1px solid var(--line);
  overflow: hidden;
}

.ghost-mark {
  position: absolute;
  right: calc(var(--gutter) - 4%);
  top: 50%;
  width: clamp(240px, 34vw, 460px);
  height: auto;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--accent);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.14;
  pointer-events: none;
}

.closing-title {
  position: relative;
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(64px, 11vw, 160px);
  line-height: 0.92;
  letter-spacing: -0.04em;
}
.closing-text {
  position: relative;
  max-width: 30ch;
  margin: clamp(18px, 3vh, 28px) 0 clamp(28px, 5vh, 44px);
  color: var(--ink-2);
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(21px, 2.2vw, 28px);
  line-height: 1.3;
}

.big-mail {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--accent);
  font-family: var(--serif);
  font-size: clamp(26px, 3.4vw, 46px);
  letter-spacing: -0.015em;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1.5px no-repeat;
  padding-bottom: 6px;
  transition: background-size 320ms var(--ease);
}
.big-mail svg {
  width: 0.7em;
  height: 0.7em;
  stroke-width: 1.4;
}
@media (hover: hover) {
  .big-mail:hover {
    background-size: 0 1.5px;
    background-position: 100% 100%;
  }
  .big-mail:hover svg {
    transform: translate(3px, -3px);
  }
}

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

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px var(--gutter) max(26px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 13px;
}
.foot-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.foot a {
  text-decoration: none;
  transition: color 160ms ease;
}
.foot a:hover {
  color: var(--ink);
}

/* ---------- Motion ---------- */

@keyframes letter {
  from {
    opacity: 0;
    transform: translateY(0.18em);
    filter: blur(6px);
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes drift {
  to {
    transform: translateX(-50%);
  }
}

/* Sections ease in as they scroll into view (where the browser supports it). */
@supports (animation-timeline: view()) {
  .reveal {
    animation: rise linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 28%;
  }
  .principle:nth-child(2) {
    animation-range: entry 6% cover 32%;
  }
  .principle:nth-child(3) {
    animation-range: entry 12% cover 36%;
  }
}

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
  .principle-list {
    grid-template-columns: 1fr;
    gap: 34px;
  }
  .ghost-mark {
    right: -18%;
    top: 34%;
    width: 300px;
    opacity: 0.1;
  }
}

@media (max-width: 520px) {
  .nav a:first-child {
    display: none;
  }
  .foot {
    flex-direction: column;
    align-items: flex-start;
  }
  .big-mail {
    font-size: 25px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
