@import "./tokens.css";

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
p,
ol,
ul,
figure,
pre {
  margin: 0;
}

a {
  color: inherit;
}

code,
pre {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

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

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* Header */

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

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

.brand__mark {
  width: 26px;
  height: 26px;
}

.brand__mark rect {
  fill: var(--surface-raised);
  stroke: var(--border-strong);
}

.brand__mark path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand__name {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

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

.site-nav a {
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  transition: color 120ms ease;
}

.site-nav a:hover {
  color: var(--text);
}

/* Hero */

.hero {
  padding-top: 56px;
  padding-bottom: 44px;
}

.hero__word {
  margin-bottom: 20px;
  font-family: var(--font-book);
  font-size: 15px;
  font-style: italic;
}

.hero__word a {
  color: var(--string);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 4px;
}

.hero__word a:hover {
  text-decoration-color: var(--accent);
}

.hero h1 {
  max-width: 14em;
  font-size: clamp(2.25rem, 1.4rem + 3.4vw, 3.5rem);
  font-weight: 650;
  line-height: 1.06;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hero__lead {
  max-width: 36em;
  margin-top: 24px;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  line-height: 1.6;
  text-wrap: pretty;
}

.hero__lead code {
  color: var(--text);
}


.prompts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.prompt {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.prompt__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.prompt__title {
  font-size: 14px;
  font-weight: 600;
}

.prompt__text {
  color: var(--string);
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.prompt__note {
  margin-top: auto;
  color: var(--muted);
  font-size: 14px;
}

.prompt__step {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
}

.hero__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.link-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 48px;
  padding-inline: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition:
    border-color 120ms ease,
    background-color 120ms ease;
}

.link-button--primary {
  border-color: var(--accent);
  color: var(--accent);
}

.link-button:hover {
  border-color: var(--border-strong);
  background: var(--surface-raised);
}

.link-button--primary:hover {
  border-color: var(--accent);
}

.hero__meta {
  margin-top: 20px;
  color: var(--muted);
  font-size: 14px;
}

.copy {
  flex: none;
  min-width: 64px;
  height: 34px;
  padding-inline: 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-raised);
  color: var(--muted);
  font: 500 13px/1 var(--font-sans);
  cursor: pointer;
  transition:
    color 120ms ease,
    border-color 120ms ease;
}

.copy:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.copy[data-state="copied"] {
  color: var(--accent);
}

/* Sections */

.section {
  padding-top: 96px;
}

.section__title {
  margin-bottom: 32px;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 1.875rem);
  font-weight: 650;
  letter-spacing: -0.025em;
}

h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.steps,
.features {
  display: grid;
  gap: 1px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--border);
  list-style: none;
}

.steps {
  grid-template-columns: repeat(3, 1fr);
}

.steps--four {
  grid-template-columns: repeat(4, 1fr);
}

.features {
  grid-template-columns: repeat(3, 1fr);
}

.features--two {
  grid-template-columns: repeat(2, 1fr);
}

.step,
.feature {
  padding: 24px;
  background: var(--bg);
}

.step p,
.feature p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
}

.step code,
.feature code,
.start__notes code,
.hero__lead code {
  color: var(--text);
}

.step__number {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-bottom: 16px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
}

.section__more {
  margin-top: 20px;
  font-size: 15px;
}

/* The shift: three short statements, the last one mexxi's answer. */

.shift {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 0;
  list-style: none;
}

.shift__item {
  padding: 20px 0 0;
  border-top: 2px solid var(--border-strong);
  font-size: 17px;
  line-height: 1.55;
  text-wrap: pretty;
}

.shift__item--mexxi {
  border-top-color: var(--accent);
}

.shift__label {
  margin-bottom: 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.shift__item--mexxi .shift__label {
  color: var(--accent);
}

/* Names: a page from a small dictionary, the one light surface on the page. */

.names__intro {
  max-width: 40em;
  margin-bottom: 32px;
  color: var(--muted);
  font-size: 16px;
}

.names__intro .section__title {
  margin-bottom: 12px;
  color: var(--text);
}

.dictionary {
  columns: 2 22em;
  column-gap: 48px;
  margin: 0;
  padding: 32px 36px;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  list-style: none;
}

.entry {
  break-inside: avoid;
  padding-block: 12px;
  border-bottom: 1px solid var(--ink-rule);
  font-family: var(--font-book);
  line-height: 1.45;
}

.entry:last-child {
  border-bottom: none;
}

.entry__head {
  color: var(--ink-muted);
}

.entry__word {
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
}

.entry__pos {
  font-style: italic;
}

.entry__meaning {
  margin-top: 2px;
  font-size: 17px;
}

.entry__meaning::before {
  content: "“";
}

.entry__meaning::after {
  content: "”";
}

.entry__job {
  margin-top: 4px;
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 14px;
}

.entry__job code {
  margin-right: 4px;
  color: var(--ink);
  font-weight: 600;
}

/* Get started */

.start {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 40px;
  align-items: start;
}

.start__needs h3 + .needs {
  margin-top: 8px;
}

.needs + h3 {
  margin-top: 24px;
}

.needs {
  display: grid;
  gap: 8px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 15px;
}

.needs strong,
.needs code,
.start__then code {
  color: var(--text);
}

.start__steps .prompts {
  grid-template-columns: 1fr;
  margin-top: 0;
}

.start__then {
  margin-top: 16px;
  color: var(--muted);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.text-link {
  justify-self: start;
  color: var(--text);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 4px;
  transition: text-decoration-color 120ms ease;
}

.text-link:hover {
  text-decoration-color: var(--accent);
}

/* Footer */

.site-footer {
  margin-top: 120px;
  border-top: 1px solid var(--border);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding-block: 32px;
  color: var(--muted);
  font-size: 13px;
}

.site-footer a {
  display: inline-block;
  padding-block: 6px;
  color: var(--muted);
  text-decoration: none;
  transition: color 120ms ease;
}

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

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

/* Responsive */

@media (max-width: 960px) {
  .steps--four {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  .steps,
  .steps--four,
  .shift {
    grid-template-columns: 1fr;
  }

  .prompts {
    grid-template-columns: 1fr;
  }

  .features {
    grid-template-columns: repeat(2, 1fr);
  }

  .start {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  :root {
    --gutter: 16px;
  }

  .hero {
    padding-top: 40px;
  }

  .link-button {
    flex: 1;
    justify-content: center;
  }

  .link-button--primary {
    flex-basis: 100%;
  }

  .section {
    padding-top: 72px;
  }

  .features {
    grid-template-columns: 1fr;
  }

  .step,
  .feature {
    padding: 20px;
  }

  .dictionary {
    padding: 20px;
  }
}

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

.demo__intro {
  max-width: 62ch;
  margin: 0 0 1.5rem;
  color: var(--muted);
}

.demo__card {
  margin: 0 0 1.5rem;
}

.demo__card-shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 374px));
  gap: 12px;
}

.demo__card-shots img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
}

.demo__card-label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 14px;
}

.demo__card figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

/* Each question spans both columns, so on a phone its two answers still sit
   side by side instead of stacking under three narrow columns. */
.compare {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border: 1px solid var(--border);
  font-size: 15px;
}

.compare thead th {
  padding: 12px 16px;
  background: var(--surface-raised);
  text-align: left;
  font-weight: 600;
}

.compare thead th:last-child {
  color: var(--accent);
}

.compare tbody {
  border-top: 1px solid var(--border);
}

.compare tbody th {
  padding: 14px 16px 2px;
  text-align: left;
  font-weight: 600;
}

.compare td {
  padding: 4px 16px 14px;
  vertical-align: top;
}

.demo__links {
  margin-top: 1rem;
  color: var(--muted);
}

@media (max-width: 560px) {
  .compare {
    font-size: 14px;
  }

  .compare thead th,
  .compare tbody th,
  .compare td {
    padding-left: 10px;
    padding-right: 10px;
  }
}
