:root {
  --paper: #f3efe7;
  --chip: rgba(35, 31, 32, 0.07);
  --ink: #231f20;
  --ink-2: #4d4648;
  --ink-3: #827a75;
  --rule: rgba(35, 31, 32, 0.15);
  --accent: #2f5e9e;
  --sheen-a: #2b4d8f;
  --sheen-b: #45397d;
  --sheen-c: #1f6a6c;
  --sheen-blend: screen;
  --sheen-opacity: 0.45;
  --shadow: rgba(35, 31, 32, 0.34);
  --terminal: #1b1819;

  --font-brand: "Avenir Next", Avenir, "Nunito Sans", "Segoe UI", system-ui, sans-serif;
  --font-text: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --max: 1200px;
  --section-space: clamp(112px, 15vw, 196px);
  --gutter: clamp(16px, 4vw, 48px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121011;
    --chip: rgba(238, 232, 222, 0.08);
    --ink: #eee8de;
    --ink-2: #c3bbb1;
    --ink-3: #8a827b;
    --rule: rgba(238, 232, 222, 0.15);
    --accent: #3f6fb5;
    --sheen-a: #9fb3e0;
    --sheen-b: #b3a6d6;
    --sheen-c: #9fcfc6;
    --sheen-blend: multiply;
    --sheen-opacity: 0.45;
    --shadow: rgba(0, 0, 0, 0.7);
    --terminal: #1f1c1d;
  }
}

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

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Paper grain sits behind content so panels and the window stay clean. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url("/grain.svg");
  opacity: 0.22;
}

@media (prefers-color-scheme: dark) {
  body::before {
    opacity: 0.3;
    filter: invert(1);
  }
}

a {
  color: inherit;
}

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

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-brand);
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 20;
  padding: 0.6em 1em;
  background: var(--ink);
  color: var(--paper);
  font: 600 0.9rem var(--font-brand);
  border-radius: 8px;
}

.skip:focus {
  top: 12px;
}

/* The raven is masked from raven.svg so it takes the page's colors. */
.raven {
  display: block;
  aspect-ratio: 1718 / 1376;
  background: var(--ink);
  -webkit-mask: url("/raven.svg") center / contain no-repeat;
  mask: url("/raven.svg") center / contain no-repeat;
}

.raven--mark {
  width: 34px;
  flex: none;
}

/* A wire spans its full-width container's bottom edge; a perch's bottom edge is the raven's feet. */
.wire {
  position: relative;
}

.wire::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--ink);
}

.perch .raven {
  position: relative;
  z-index: 1;
  width: 100%;
  /* The feet sit at 1210 of the raven's 1376-unit height; margins resolve against width. */
  margin-bottom: calc(-100% * 166 / 1718);
}

.raven--hero {
  isolation: isolate;
}

.raven--hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 36%, var(--sheen-a) 45%, var(--sheen-b) 50%, var(--sheen-c) 55%, transparent 64%) 100% 0 / 300% 100% no-repeat;
  mix-blend-mode: var(--sheen-blend);
  opacity: var(--sheen-opacity);
}

/* Navigation */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.3) blur(14px);
  backdrop-filter: saturate(1.3) blur(14px);
  border-bottom: 1px solid var(--rule);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: var(--max);
  height: 64px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wordmark {
  display: inline-flex;
  align-items: flex-end;
  gap: 8px;
  font: 700 1.6rem/1 var(--font-brand);
  letter-spacing: -0.03em;
  text-decoration: none;
}

.wordmark--quiet {
  font-size: 1.3rem;
}

.wordmark--quiet .raven--mark {
  width: 28px;
}

.nav nav {
  margin-left: auto;
}

.nav-links {
  display: flex;
  gap: clamp(16px, 2.4vw, 32px);
}

.nav-links a {
  font: 500 0.95rem var(--font-brand);
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.95em 1.5em;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: 600 1.02rem/1 var(--font-brand);
  letter-spacing: -0.005em;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 10px 24px -14px var(--shadow);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 18px 30px -16px var(--shadow);
}

.button:active {
  transform: translateY(0);
}

.button--small {
  padding: 0.7em 1.15em;
  font-size: 0.92rem;
}

.button-icon {
  width: 1.15em;
  height: 1.15em;
}

.link-out {
  font: 600 1.02rem var(--font-brand);
  text-decoration: none;
  color: var(--ink-2);
}

.link-out::after {
  content: "↗";
  display: inline-block;
  margin-left: 0.35em;
  transition: transform 0.25s var(--ease);
}

.link-out:hover {
  color: var(--ink);
}

.link-out:hover::after {
  transform: translate(2px, -2px);
}

.meta {
  font: 500 0.9rem var(--font-brand);
  color: var(--ink-3);
}

/* Hero */

.hero {
  /* The landing raven starts off to the side; its tail still hangs below the wire. */
  overflow-x: clip;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: end;
  gap: clamp(24px, 5vw, 72px);
  max-width: var(--max);
  margin-inline: auto;
  padding: clamp(48px, 9vw, 120px) var(--gutter) 0;
}

.hero-copy {
  display: grid;
  gap: 28px;
  padding-bottom: clamp(40px, 6vw, 72px);
}

h1 {
  font-size: clamp(2.05rem, 4.6vw, 3.6rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
}

.hero .perch {
  justify-self: end;
  width: 112%;
  max-width: 660px;
  margin-right: -6%;
}

/* Sections */

.section {
  max-width: var(--max);
  margin-inline: auto;
  padding: var(--section-space) var(--gutter) 0;
  /* Section links land on the heading, below the sticky navigation, rather than the top padding. */
  scroll-margin-top: calc(112px - var(--section-space));
}

.section--demo {
  padding-top: clamp(96px, 11vw, 144px);
}

.section-head {
  display: grid;
  gap: 16px;
}

h2 {
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

h3 {
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.section-lede {
  max-width: 36em;
  line-height: 1.6;
  color: var(--ink-2);
}

.section-lede code {
  padding: 0.1em 0.35em;
  border-radius: 5px;
  background: var(--chip);
}

/* Native app capture */

.showcase {
  margin: 0;
}

.app-screenshot {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 32px 36px var(--shadow));
}

/* Models */

.models {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 32px clamp(32px, 5vw, 72px);
  margin-top: clamp(24px, 3vw, 36px);
}

.model-panel {
  display: grid;
  gap: 12px;
}

.model-panel h3 {
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.spec li {
  padding: 10px 0;
  border-top: 1px solid var(--rule);
  font: 500 1.05rem/1.4 var(--font-brand);
}

.spec li:last-child {
  border-bottom: 1px solid var(--rule);
}

/* Terminal */

.terminal-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
}

.terminal {
  overflow-x: auto;
  margin: 0;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid rgba(238, 232, 222, 0.08);
  border-radius: 14px;
  background: var(--terminal);
  box-shadow: 0 40px 70px -40px var(--shadow);
  color: #ede7dc;
  font: 400 0.9rem/1.75 var(--font-mono);
  scrollbar-color: #4a4446 transparent;
}

.terminal code {
  font-size: inherit;
}

.terminal .prompt {
  color: #9db7e8;
  user-select: none;
}

/* Closing */

.closing {
  display: grid;
  justify-items: center;
  gap: 28px;
  padding: clamp(128px, 16vw, 208px) 0 clamp(96px, 12vw, 144px);
  text-align: center;
}

.closing .wire {
  justify-self: stretch;
  display: flex;
  justify-content: center;
  margin-bottom: clamp(56px, 7vw, 80px);
}

.closing .perch {
  width: clamp(150px, 20vw, 220px);
}

.closing .actions {
  justify-content: center;
  padding-inline: var(--gutter);
}

/* Footer */

.footer {
  border-top: 1px solid var(--rule);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 32px;
  max-width: var(--max);
  margin-inline: auto;
  padding: 28px var(--gutter) 40px;
  font-size: 0.95rem;
  color: var(--ink-3);
}

.footer-inner p:last-child {
  margin-left: auto;
}

/* Motion */

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * {
    animation: rise 0.9s var(--ease) both;
  }

  .hero-copy > :nth-child(2) { animation-delay: 0.08s; }
  .hero-copy > :nth-child(3) { animation-delay: 0.18s; }
  .hero-copy > :nth-child(4) { animation-delay: 0.28s; }
  .hero-copy > :nth-child(5) { animation-delay: 0.36s; }

  .hero .raven {
    transform-origin: 62% 88%;
    animation: land 1.6s var(--ease) 0.3s both;
  }

  .hero::after {
    animation: dip 1.6s var(--ease) 0.3s both;
  }

  .raven--hero::after {
    animation: sheen 12s ease-in-out 2s infinite;
  }

  .reveal [data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  }

  .reveal [data-reveal].is-visible {
    opacity: 1;
    transform: none;
  }

  .model-panel:nth-child(2) { transition-delay: 0.1s; }


}

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

@keyframes land {
  0% {
    opacity: 0;
    transform: translate(16%, -30%) rotate(10deg) scale(0.94);
  }
  55% {
    opacity: 1;
    transform: translate(0, -1.2%) rotate(-1deg);
  }
  70% {
    transform: translate(0, 0.9%) rotate(0);
  }
  85% {
    transform: translate(0, -0.3%);
  }
  100% {
    transform: none;
  }
}

@keyframes dip {
  0%, 56% { transform: none; }
  70% { transform: translateY(4px); }
  85% { transform: translateY(-1px); }
  100% { transform: none; }
}

@keyframes sheen {
  0% { background-position: 100% 0; }
  45%, 100% { background-position: 0 0; }
}

/* Layout */

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

  .hero-copy {
    padding-bottom: 8px;
  }

  .hero .perch {
    width: min(82%, 460px);
    margin-right: 0;
  }

  .terminal-layout,
  .models {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .nav-links {
    display: none;
  }

  .nav-inner {
    justify-content: space-between;
  }

  .terminal {
    font-size: 0.8rem;
  }

  .footer-inner p:last-child {
    margin-left: 0;
  }
}
