:root { color-scheme: light; }

html, body { background: #F5EFE6; }
body {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  color: #1A1A1A;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Paper grain — SVG turbulence layered globally, very low opacity */
.paper-grain::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.10  0 0 0 0 0.09  0 0 0 0 0.08  0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/></svg>");
  opacity: 0.18;
  mix-blend-mode: multiply;
}
/* Subtle vignette / paper warmth */
.paper-warmth::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(198, 93, 63, 0.05), transparent 60%),
    radial-gradient(80% 60% at 100% 100%, rgba(26, 26, 26, 0.04), transparent 60%);
}

/* All page content sits above the grain */
main, header, footer { position: relative; z-index: 1; }

/* Display type */
.display {
  font-family: 'Fraunces', serif;
  font-optical-sizing: auto;
  font-variation-settings: 'opsz' 144, 'SOFT' 50;
  letter-spacing: -0.025em;
  line-height: 0.98;
}
.display-italic {
  font-style: italic;
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
}
.serif-body {
  font-family: 'Fraunces', serif;
  font-optical-sizing: auto;
  font-variation-settings: 'opsz' 24;
}

/* Wordmark */
.wordmark {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-style: italic;
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  letter-spacing: -0.045em;
}

/* Eyebrow / small caps label */
.eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  color: #6B655D;
}

/* Hairline rule */
.hairline { border-top: 1px solid #D8CDB8; }

/* Selection */
::selection { background: #C65D3F; color: #F5EFE6; }

/* Keycap — debossed paper key */
.keycap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  color: #1A1A1A;
  background: #F5EFE6;
  border: 1px solid #C8BBA1;
  border-bottom-width: 3px;
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 0 rgba(26, 26, 26, 0.04);
  padding: 0.4em 0.7em;
  line-height: 1;
  min-width: 2.4em;
  transition: transform 120ms ease, border-bottom-width 120ms ease, box-shadow 120ms ease;
}
.keycap.is-pressed,
.keycap[data-pressed="true"] {
  transform: translateY(2px);
  border-bottom-width: 1px;
  background: #EFE7DA;
  box-shadow: inset 0 1px 2px rgba(26, 26, 26, 0.08);
}
.keycap-lg { font-size: 14px; padding: 0.55em 0.9em; border-radius: 10px; }

/* Primary CTA */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: #1A1A1A;
  color: #F5EFE6;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 15px;
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid #1A1A1A;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
  will-change: transform;
}
.btn-primary:hover { background: #C65D3F; border-color: #C65D3F; }
.btn-primary:active { transform: translateY(1px); }
.btn-primary .arrow { transition: transform 200ms ease; }
.btn-primary:hover .arrow { transform: translateX(3px); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #1A1A1A;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 14px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid #1A1A1A;
  background: transparent;
  transition: background 160ms ease, color 160ms ease;
}
.btn-secondary:hover { background: #1A1A1A; color: #F5EFE6; }

/* Numerals */
.roman {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-variation-settings: 'opsz' 144;
  color: #C65D3F;
  font-weight: 400;
}

/* Cursor blink (Hero "talk" caret) */
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.caret { animation: blink 1.05s steps(1, end) infinite; }

/* Soft fade-in for sections */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.rise { animation: rise 700ms cubic-bezier(.2,.7,.2,1) both; }
.rise-delay-1 { animation-delay: 120ms; }

/* Comparison table */
table.compare { width: 100%; border-collapse: collapse; }
table.compare th, table.compare td {
  text-align: left;
  padding: 16px 14px;
  border-bottom: 1px solid #D8CDB8;
  font-size: 14px;
  vertical-align: top;
}
table.compare thead th {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #6B655D;
  border-bottom: 1px solid #1A1A1A;
}
table.compare th[scope="row"] {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 24;
  font-weight: 500;
  font-size: 16px;
  color: #1A1A1A;
  width: 28%;
}
table.compare .nib-col { background: #EFE7DA; }
table.compare .check { color: #C65D3F; font-weight: 600; }
table.compare .dash  { color: #9A9389; }

/* Underline link */
.ulink {
  color: #1A1A1A;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: #C8BBA1;
  transition: text-decoration-color 160ms ease, color 160ms ease;
}
.ulink:hover { text-decoration-color: #C65D3F; color: #C65D3F; }

/* Marginalia rule */
.rule-vert { width: 1px; background: #D8CDB8; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .caret { animation: none; opacity: 1; }
}

/* Focus ring */
:focus-visible {
  outline: 2px solid #C65D3F;
  outline-offset: 3px;
  border-radius: 4px;
}

/* Smooth anchor scroll */
html { scroll-behavior: smooth; }

/* Hero placeholder texture */
.hero-art {
  background-color: #EFE7DA;
  background-image:
    repeating-linear-gradient(135deg, rgba(26,26,26,0.045) 0 1px, transparent 1px 14px),
    radial-gradient(140% 100% at 30% 20%, rgba(198,93,63,0.10), transparent 60%);
}

/* macOS window chrome */
.mac-window {
  border-radius: 12px;
  border: 1px solid #C8BBA1;
  overflow: hidden;
  background: #F5EFE6;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 0 0 0.5px rgba(26,26,26,0.06),
    0 1px 0 rgba(26,26,26,0.04),
    0 30px 60px -30px rgba(26,26,26,0.22),
    0 60px 120px -40px rgba(26,26,26,0.12);
}
.mac-titlebar {
  height: 30px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: linear-gradient(to bottom, #EFE7DA 0%, #E8DECB 100%);
  border-bottom: 1px solid #D8CDB8;
  position: relative;
}
.mac-traffic {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.mac-traffic span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0.5px rgba(0,0,0,0.18) inset;
}
.mac-traffic .tl-close  { background: #ED6A5E; }
.mac-traffic .tl-min    { background: #F4BF50; }
.mac-traffic .tl-max    { background: #61C554; }
.mac-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #6B655D;
  letter-spacing: -0.005em;
  pointer-events: none;
  white-space: nowrap;
}
.mac-title .wordmark { font-size: 13px; }

/* Animated waveform — rounded-cap vertical bars, symmetric ramp in/out */
.wave {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.wave .bar {
  display: inline-block;
  background: currentColor;
  border-radius: 999px;
  transform-origin: center;
  will-change: transform;
  animation-iteration-count: infinite;
}
/* Small (toolbar) waveform sizing */
.wave-sm { height: 14px; gap: 2.5px; color: #1A1A1A; }
.wave-sm .bar { width: 2px; height: 100%; }
/* Large (doc) waveform sizing */
.wave-lg { height: 86px; gap: 7px; color: #1A1A1A; }
.wave-lg .bar { width: 5px; height: 100%; }

/* Per-bar amplitude — symmetric ramp with a tall center bar.
   All bars share the same animation tempo so they breathe together,
   but each has its own min/max so the cluster keeps its shape. */
.wave .bar { animation-duration: 1.4s; animation-timing-function: cubic-bezier(.45,.05,.55,.95); }
.wave .bar:nth-child(1) { animation-name: waveBeat1; }
.wave .bar:nth-child(2) { animation-name: waveBeat2; }
.wave .bar:nth-child(3) { animation-name: waveBeat3; }
.wave .bar:nth-child(4) { animation-name: waveBeat4; }
.wave .bar:nth-child(5) { animation-name: waveBeat5; }
@keyframes waveBeat1 { 0%,100% { transform: scaleY(0.10);} 50% { transform: scaleY(0.22);} }
@keyframes waveBeat2 { 0%,100% { transform: scaleY(0.30);} 50% { transform: scaleY(0.65);} }
@keyframes waveBeat3 { 0%,100% { transform: scaleY(0.55);} 50% { transform: scaleY(1.00);} }
@keyframes waveBeat4 { 0%,100% { transform: scaleY(0.34);} 50% { transform: scaleY(0.72);} }
@keyframes waveBeat5 { 0%,100% { transform: scaleY(0.14);} 50% { transform: scaleY(0.30);} }
@media (prefers-reduced-motion: reduce) {
  .wave .bar { animation: none !important; }
}

/* Step II "Speak" waveform — staggered scale around each bar's set height */
.speak-wave > span {
  transform-origin: bottom;
  will-change: transform;
  animation: speakBeat 1.1s cubic-bezier(.45,.05,.55,.95) infinite;
}
.speak-wave > span.accent { animation-name: speakBeatAccent; }
.speak-wave > span:nth-child(1)  { animation-delay: -0.05s; }
.speak-wave > span:nth-child(2)  { animation-delay: -0.42s; }
.speak-wave > span:nth-child(3)  { animation-delay: -0.18s; }
.speak-wave > span:nth-child(4)  { animation-delay: -0.55s; }
.speak-wave > span:nth-child(5)  { animation-delay: -0.10s; }
.speak-wave > span:nth-child(6)  { animation-delay: -0.38s; }
.speak-wave > span:nth-child(7)  { animation-delay: -0.62s; }
.speak-wave > span:nth-child(8)  { animation-delay: -0.22s; }
.speak-wave > span:nth-child(9)  { animation-delay: -0.48s; }
.speak-wave > span:nth-child(10) { animation-delay: -0.14s; }
.speak-wave > span:nth-child(11) { animation-delay: -0.58s; }
.speak-wave > span:nth-child(12) { animation-delay: -0.30s; }
.speak-wave > span:nth-child(13) { animation-delay: -0.46s; }
.speak-wave > span:nth-child(14) { animation-delay: -0.08s; }
@keyframes speakBeat {
  0%, 100% { transform: scaleY(0.45); }
  50%      { transform: scaleY(1.05); }
}
@keyframes speakBeatAccent {
  0%, 100% { transform: scaleY(0.65); }
  50%      { transform: scaleY(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .speak-wave > span { animation: none !important; }
}

/* Hand-drawn ink underline beneath italic "new pen." */
.ink-stroke {
  position: relative;
  display: inline-block;
}
.ink-stroke svg {
  position: absolute;
  left: -1.5%;
  right: -1.5%;
  bottom: -0.06em;
  width: 103%;
  height: 0.22em;
  pointer-events: none;
  overflow: visible;
}
.ink-stroke path {
  fill: none;
  stroke: #C65D3F;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 520;
  stroke-dashoffset: 520;
  animation: ink-draw 1.1s cubic-bezier(.65, .05, .3, 1) 0.45s forwards;
}
@keyframes ink-draw {
  to { stroke-dashoffset: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ink-stroke path { stroke-dashoffset: 0; animation: none; }
}

/* Slight serif drop-cap for privacy section */
.dropcap::first-letter {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 144;
  font-weight: 500;
  float: left;
  font-size: 4.6rem;
  line-height: 0.85;
  padding: 0.35rem 0.7rem 0 0;
  color: #C65D3F;
}
