@font-face {
  font-family: "Inter";
  src: url("./fonts/inter-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Hanken Grotesk";
  src: url("./fonts/hanken-grotesk-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* Shared with the app: warm clay, apricot, cream, mist, and powder blue. */
  --clay: #b45d3f;
  --apricot: #dd8d4c;
  --cream: #e5d09d;
  --mist: #d2dddb;
  --powder-blue: #b0cde3;
  --ink: color-mix(in srgb, var(--clay) 20%, black);

  --paper: var(--mist);
  --muted: color-mix(in srgb, var(--ink) 68%, var(--mist));
  --rule: color-mix(in srgb, var(--clay) 38%, var(--mist));
  --accent: color-mix(in srgb, var(--clay) 82%, black);
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont,
    "Helvetica Neue", sans-serif;
  --display: "Hanken Grotesk", var(--sans);
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

.about {
  width: min(100% - 48px, 760px);
  margin: 0 auto;
  padding: clamp(64px, 10vw, 128px) 0 clamp(80px, 12vw, 160px);
}

.definition {
  padding-bottom: clamp(56px, 9vw, 96px);
  border-bottom: 1px solid var(--rule);
}

.translation,
.part-of-speech,
.meanings,
.story p {
  margin-top: 0;
}

.translation {
  margin-bottom: 48px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.translation span {
  font-weight: 400;
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(4rem, 14vw, 8rem);
  font-weight: 650;
  letter-spacing: -0.065em;
  line-height: 0.85;
}

.pronunciation {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.25em;
  font-weight: 400;
  letter-spacing: 0;
  white-space: nowrap;
}

.part-of-speech {
  margin-bottom: 32px;
  padding-top: 20px;
  color: var(--muted);
  font-size: 0.875rem;
  font-style: italic;
}

.meanings {
  max-width: 650px;
  margin-bottom: 0;
  padding-left: 1.4em;
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  line-height: 1.55;
}

.meanings li {
  padding-left: 0.4em;
}

.meanings li + li {
  margin-top: 12px;
}

.example {
  color: var(--muted);
  font-style: italic;
}

.story {
  padding-top: clamp(56px, 9vw, 96px);
}

.story p {
  margin-bottom: 1.5em;
  font-size: clamp(1.125rem, 2.5vw, 1.375rem);
  letter-spacing: -0.018em;
  line-height: 1.58;
}

.demo {
  margin: clamp(56px, 9vw, 88px) 0;
}

.demo h2 {
  margin: 0 0 24px;
  font-family: var(--display);
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.code-window,
.terminal {
  overflow: hidden;
  border: 1px solid var(--clay);
  border-radius: 6px;
}

.code-window {
  background: color-mix(in srgb, var(--cream) 38%, white);
}

.terminal {
  margin-top: 16px;
  background: var(--ink);
  color: var(--mist);
}

.window-label {
  padding: 9px 14px;
  border-bottom: 1px solid var(--clay);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.code-window pre {
  margin: 0;
  padding: clamp(20px, 4vw, 28px);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: clamp(0.875rem, 2.5vw, 1rem);
  line-height: 1.7;
}

.syntax-keyword {
  color: var(--accent);
  font-weight: 700;
}

.syntax-function {
  color: color-mix(in srgb, var(--apricot) 72%, black);
}

.syntax-string,
.syntax-docstring {
  color: color-mix(in srgb, var(--clay) 72%, black);
}

.syntax-docstring {
  font-style: italic;
}

.terminal-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 80px;
  border-bottom: 1px solid color-mix(in srgb, var(--clay) 70%, black);
  color: var(--powder-blue);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
}

.terminal-dots {
  position: absolute;
  left: 14px;
  display: flex;
  gap: 6px;
}

.terminal-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--clay);
}

.terminal-dots i:nth-child(2) {
  background: var(--apricot);
}

.terminal-dots i:nth-child(3) {
  background: var(--cream);
}

.terminal-body {
  min-height: 330px;
  padding: clamp(20px, 4vw, 28px);
  font-family: var(--mono);
  font-size: clamp(0.78rem, 2.3vw, 0.9rem);
  line-height: 1.6;
}

.terminal-command {
  display: flex;
  align-items: baseline;
  min-width: 0;
  color: var(--cream);
  font-weight: 600;
}

.prompt,
.line-marker {
  flex: 0 0 1.25em;
  color: var(--apricot);
}

.typed-command {
  display: inline-block;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
  animation: type-command 0.55s steps(5, end) 0.35s forwards;
}

.cursor {
  width: 0.5em;
  height: 1.05em;
  margin-left: 0.15em;
  background: var(--cream);
  animation: blink 0.7s steps(1) infinite, hide-cursor 0.01s 0.91s forwards;
  transform: translateY(0.14em);
}

.terminal-line {
  opacity: 0;
  transform: translateY(5px);
  animation: reveal-line 0.3s ease-out forwards;
}

.terminal-thinking {
  display: flex;
  margin-top: 18px;
  color: var(--powder-blue);
  animation-delay: 1.2s;
}

.terminal-thinking .line-marker {
  animation: spin-marker 1.2s linear 1.2s 1;
}

.terminal-tool {
  margin-top: 16px;
  animation-delay: 2.15s;
}

.tool-heading {
  display: flex;
  color: var(--cream);
}

.terminal-tool code {
  display: block;
  margin: 8px 0 0 1.25em;
  padding: 8px 10px;
  overflow-wrap: anywhere;
  border-left: 2px solid var(--clay);
  background: color-mix(in srgb, var(--ink) 90%, var(--clay));
  color: var(--mist);
  font-family: inherit;
  line-height: 1.5;
}

.tool-output {
  margin: 7px 0 0 1.25em;
  color: var(--powder-blue);
}

.terminal-response {
  display: grid;
  grid-template-columns: 1.25em minmax(0, 1fr);
  margin-top: 22px;
  color: var(--mist);
  animation-delay: 3.25s;
}

.terminal-response .line-marker {
  color: var(--apricot);
}

.terminal-response strong,
.terminal-response span {
  display: block;
}

.terminal-response strong {
  margin-bottom: 5px;
  color: var(--cream);
}

@keyframes type-command {
  to {
    width: 5ch;
  }
}

@keyframes reveal-line {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes hide-cursor {
  to {
    visibility: hidden;
  }
}

@keyframes spin-marker {
  to {
    transform: rotate(360deg);
  }
}

.story .lede {
  margin-bottom: 1.8em;
  color: var(--accent);
  font-family: var(--display);
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
}

.story p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: clamp(56px, 9vw, 96px);
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.875rem;
}

.legal {
  width: min(100% - 48px, 760px);
  margin: 0 auto;
  padding: 32px 0 72px;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}

.site-nav .wordmark {
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 650;
  letter-spacing: -0.045em;
  text-decoration: none;
}

.site-nav span {
  display: flex;
  gap: 20px;
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 650;
}

.legal article {
  padding-top: clamp(48px, 8vw, 80px);
}

.legal-header {
  margin-bottom: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--rule);
}

.legal .eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legal h1 {
  font-size: clamp(3rem, 9vw, 5.5rem);
  line-height: 0.95;
}

.legal .updated {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.legal h2 {
  margin: 2.2em 0 0.7em;
  font-family: var(--display);
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  letter-spacing: -0.025em;
}

.legal article > p,
.legal li {
  font-size: 1rem;
  line-height: 1.7;
}

.legal ul {
  padding-left: 1.4em;
}

.legal li + li {
  margin-top: 0.55em;
}

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

@media (prefers-reduced-motion: reduce) {
  .typed-command {
    width: auto;
    animation: none;
  }

  .cursor {
    display: none;
    animation: none;
  }

  .terminal-line,
  .terminal-thinking .line-marker {
    opacity: 1;
    animation: none;
    transform: none;
  }
}

@media (max-width: 520px) {
  .about,
  .legal {
    width: min(100% - 32px, 760px);
  }

  .site-footer {
    flex-direction: column;
    gap: 10px;
  }

  .translation {
    margin-bottom: 40px;
  }

  h1 {
    font-size: clamp(3.5rem, 19vw, 5rem);
  }

  .pronunciation {
    display: block;
    margin-top: 0.8em;
    font-size: 0.3em;
  }
}

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