/* Lexpad landing page. Tokens mirror the app's own (apps/web/src/styles/tokens.css). */

:root {
  color-scheme: light dark;
  --paper: oklch(0.965 0.012 95);
  --card: oklch(0.995 0.004 95);
  --ink: oklch(0.22 0.015 85);
  --dim: oklch(0.52 0.02 85);
  --accent: oklch(0.5 0.11 150);
  --on-accent: #fff;
  --accent-soft: oklch(0.5 0.11 150 / 0.12);
  --coral: oklch(0.62 0.16 30 / 0.6);
  --coral-strong: oklch(0.62 0.16 30);
  --line: oklch(0.88 0.012 95);
  --rule: oklch(0.9 0.01 95);
  --shadow: 0 12px 40px oklch(0.22 0.015 85 / 0.08);
  --frame: #15150f;
  /* The dark strip keeps these regardless of theme. */
  --night-paper: oklch(0.17 0.008 95);
  --night-ink: oklch(0.94 0.015 85);
  --night-dim: oklch(0.66 0.02 85);
  --night-frame: #0b0b09;
  --night-line: oklch(0.3 0.01 95);
  --container: 1120px;
  --gutter: clamp(20px, 5vw, 48px);
  --section-gap: clamp(64px, 10vw, 128px);
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --fa: Vazirmatn, system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: oklch(0.17 0.008 95);
    --card: oklch(0.21 0.009 95);
    --ink: oklch(0.94 0.015 85);
    --dim: oklch(0.66 0.02 85);
    --accent: oklch(0.76 0.11 150);
    --on-accent: oklch(0.17 0.008 95);
    --accent-soft: oklch(0.76 0.11 150 / 0.14);
    --coral: oklch(0.6 0.13 30 / 0.55);
    --line: oklch(0.3 0.01 95);
    --rule: oklch(0.26 0.01 95);
    --shadow: 0 12px 40px oklch(0 0 0 / 0.4);
    --frame: #0b0b09;
  }
}

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

html,
body {
  margin: 0;
  padding: 0;
  background: var(--paper);
}

body {
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  min-height: 100vh;
  text-wrap: pretty;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p,
figure,
dl,
dd {
  margin: 0;
}

img {
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ------------------------------------------------------------ layout */

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section {
  padding-top: var(--section-gap);
}

.section-title {
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-weight: 700;
  max-width: 20ch;
}

.lead {
  color: var(--dim);
  margin-top: 16px;
}

.lead + .lead {
  margin-top: 12px;
}

.grid {
  display: grid;
  gap: 20px;
  margin-top: 36px;
}

.grid-260 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid-240 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
}

.two-col.top {
  align-items: start;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
}

.card.small {
  border-radius: 20px;
}

.card h3 {
  font-size: 22px;
  letter-spacing: -0.01em;
  font-weight: 700;
}

.card.small h3 {
  font-size: 18px;
  letter-spacing: 0;
}

.card p.dim,
.dim {
  color: var(--dim);
}

.card.small p {
  color: var(--dim);
  margin-top: 8px;
  font-size: 15px;
}

.eyebrow {
  color: var(--dim);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.eyebrow.accent {
  color: var(--accent);
}

.mono {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--dim);
}

.fa {
  font-family: var(--fa);
  line-height: 1.8;
  text-align: right;
}

/* ------------------------------------------------------------ buttons */

.button {
  display: inline-block;
  padding: 15px 26px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 17px;
}

.button:hover {
  text-decoration: none;
  filter: brightness(1.05);
}

.button.primary {
  background: var(--accent);
  color: var(--on-accent);
}

.button.secondary {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 14px 26px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* ------------------------------------------------------------ header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.logo:hover {
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 28px);
  font-size: 15px;
}

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

.site-nav .pill {
  background: var(--ink);
  color: var(--paper);
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 600;
}

.site-nav .pill:hover {
  text-decoration: none;
  opacity: 0.9;
}

@media (max-width: 560px) {
  .site-nav .hide-narrow {
    display: none;
  }
}

/* ------------------------------------------------------------ hero */

.hero {
  padding-top: clamp(40px, 8vw, 96px);
  text-align: center;
}

.hero h1 {
  font-size: clamp(34px, 6vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 700;
  max-width: 16ch;
  margin: 0 auto;
}

.hero .subtitle {
  font-size: clamp(17px, 2vw, 21px);
  color: var(--dim);
  max-width: 44ch;
  margin: 20px auto 0;
}

.hero .button-row {
  margin-top: 32px;
}

.hero .note {
  color: var(--dim);
  font-size: 14px;
  margin-top: 14px;
}

.phones {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(10px, 3vw, 36px);
  margin-top: clamp(40px, 7vw, 80px);
  padding: 0 clamp(0px, 2vw, 24px);
}

.phone {
  flex: 1 1 0;
  min-width: 0;
  max-width: 250px;
  background: var(--frame);
  border-radius: clamp(20px, 4vw, 40px);
  padding: clamp(4px, 0.9vw, 10px);
  box-shadow: var(--shadow);
}

.phone.lead-phone {
  flex: 1.15 1 0;
  max-width: 290px;
}

.phone img {
  width: 100%;
  height: auto;
  aspect-ratio: 1206 / 2622;
  object-fit: cover;
  border-radius: clamp(16px, 3.2vw, 32px);
}

.phone img.browser-shot {
  aspect-ratio: 1179 / 1980;
  object-position: top;
}

/* ------------------------------------------------------------ how it works */

.step {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.step .body p {
  color: var(--dim);
  margin-top: 8px;
}

.mini {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mini.input {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  font-size: 20px;
}

.caret {
  width: 2px;
  height: 24px;
  background: var(--accent);
  border-radius: 1px;
}

.mini .headword {
  font-size: 20px;
  font-weight: 700;
}

.mini .example {
  color: var(--dim);
  font-size: 15px;
  border-left: 2px solid var(--line);
  padding-left: 10px;
}

.mini.cloze {
  gap: 8px;
}

.mini.cloze .sentence {
  font-size: 18px;
  line-height: 1.4;
}

.gap {
  display: inline-block;
  min-width: 5ch;
  border-bottom: 2px solid var(--accent);
  color: var(--accent);
  text-align: center;
  font-weight: 700;
}

/* ------------------------------------------------------------ RTL block */

.rtl-block {
  margin-top: clamp(48px, 7vw, 88px);
}

.rtl-block h3 {
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-weight: 700;
}

.rtl-block .lead {
  margin-top: 14px;
}

.sample {
  margin-top: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sample .headword {
  font-size: 20px;
  font-weight: 700;
}

.sample .fa.meaning {
  font-size: 19px;
}

.sample .example,
.sample .fa.example {
  color: var(--dim);
  font-size: 15px;
}

.phone.single {
  width: min(100%, 300px);
  max-width: none;
  flex: none;
  justify-self: center;
  border-radius: 40px;
  padding: 10px;
}

.phone.single img {
  border-radius: 32px;
}

/* ------------------------------------------------------------ method */

.diagram {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(20px, 3vw, 32px);
}

.bars,
.bar-labels {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(6px, 1.5vw, 14px);
}

.bars {
  align-items: end;
  height: 180px;
}

.bars > div {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
}

.bar {
  border-radius: 10px;
  background: var(--accent);
}

.bar-labels {
  margin-top: 14px;
  text-align: center;
}

.bar-labels p:first-child {
  font-weight: 700;
  font-size: 15px;
}

.bar-labels p:last-child {
  color: var(--dim);
  font-size: 13px;
}

.legend {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  flex-wrap: wrap;
}

.legend b {
  font-weight: 700;
}

.legend .correct {
  color: var(--accent);
}

.legend .wrong {
  color: var(--coral-strong);
}

/* ------------------------------------------------------------ phrases */

.phrases .text {
  order: 2;
}

.paper-card {
  order: 1;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(24px, 3vw, 36px);
  position: relative;
  overflow: hidden;
  background-image: repeating-linear-gradient(to bottom, transparent 0 31px, var(--rule) 31px 32px);
  background-position: 0 12px;
}

.paper-card .margin-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: clamp(18px, 2.4vw, 28px);
  width: 1.5px;
  background: var(--coral);
}

.paper-card .content {
  padding-left: clamp(14px, 2vw, 22px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.paper-card .headword {
  font-size: clamp(28px, 3.5vw, 38px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.paper-card .mono {
  font-size: 14px;
  margin-top: 6px;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chips.tags {
  margin-top: 12px;
}

.chips.tags span {
  font-size: 13px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink);
}

.chips.collocations {
  margin-top: 8px;
}

.chips.collocations span {
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.paper-card .meaning {
  font-size: 20px;
  font-weight: 600;
}

.paper-card .gloss {
  color: var(--dim);
  margin-top: 4px;
}

.paper-card .example {
  border-left: 2px solid var(--line);
  padding-left: 12px;
  margin-top: 10px;
}

.paper-card .example .translation {
  color: var(--dim);
  font-size: 15px;
}

.paper-card .label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dim);
}

.paper-card .expression {
  margin-top: 6px;
}

.paper-card .expression + .expression {
  margin-top: 2px;
}

/* ------------------------------------------------------------ platforms */

.platform {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.platform p.copy {
  color: var(--dim);
  font-size: 15px;
  flex: 1;
}

.platform a {
  font-weight: 600;
}

.platform .soon {
  color: var(--dim);
  font-weight: 600;
}

/* ------------------------------------------------------------ data */

.data-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(28px, 4vw, 48px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
}

.data-card dl {
  display: grid;
  gap: 16px;
}

.data-card dl > div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  align-items: baseline;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.data-card dt {
  color: var(--dim);
  font-size: 14px;
  font-weight: 600;
}

/* ------------------------------------------------------------ dark strip */

.night {
  margin-top: var(--section-gap);
  background: var(--night-paper);
  color: var(--night-ink);
  overflow: hidden;
}

.night .container {
  padding-top: clamp(56px, 8vw, 96px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(24px, 5vw, 64px);
  align-items: end;
}

.night .text {
  padding-bottom: clamp(40px, 6vw, 80px);
}

.night .lead {
  color: var(--night-dim);
}

.night .phones {
  margin-top: 0;
  padding: 0;
  gap: clamp(10px, 2.5vw, 24px);
}

.night .phone {
  max-width: 220px;
  background: var(--night-frame);
  border: 1px solid var(--night-line);
  border-bottom: none;
  border-radius: clamp(20px, 4vw, 40px) clamp(20px, 4vw, 40px) 0 0;
  padding-bottom: 0;
  box-shadow: none;
}

.night .phone.raised {
  margin-bottom: clamp(16px, 3vw, 40px);
}

.night .phone img {
  aspect-ratio: 1206 / 2200;
  object-position: top;
  border-radius: clamp(16px, 3.2vw, 32px) clamp(16px, 3.2vw, 32px) 0 0;
}

.night .phone img.browser-shot {
  aspect-ratio: 1179 / 1980;
}

/* ------------------------------------------------------------ final CTA */

.cta {
  padding-top: clamp(72px, 10vw, 128px);
  padding-bottom: clamp(72px, 10vw, 128px);
  text-align: center;
}

.cta h2 {
  font-size: clamp(30px, 5vw, 56px);
  letter-spacing: -0.025em;
  line-height: 1.05;
  font-weight: 700;
  max-width: 18ch;
  margin: 0 auto;
}

.cta .lead {
  margin: 18px auto 0;
  max-width: 40ch;
}

.cta .button-row {
  margin-top: 30px;
}

/* ------------------------------------------------------------ footer */

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

.site-footer .container {
  padding-top: 28px;
  padding-bottom: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--dim);
}

.site-footer .copyright {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-footer .copyright a {
  color: var(--ink);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
}

.site-footer nav a {
  color: var(--dim);
}

/* ------------------------------------------------------------ plain pages (android, privacy, terms, 404) */

.page {
  padding-top: clamp(40px, 8vw, 96px);
  padding-bottom: clamp(72px, 10vw, 128px);
  max-width: 720px;
}

.page h1 {
  font-size: clamp(30px, 5vw, 48px);
  letter-spacing: -0.025em;
  line-height: 1.1;
  font-weight: 700;
}

.page h2 {
  font-size: 22px;
  letter-spacing: -0.01em;
  font-weight: 700;
  margin-top: 36px;
}

.page p,
.page li {
  color: var(--dim);
  margin-top: 12px;
}

.page ul {
  padding-left: 22px;
  margin: 0;
}

.page .button-row {
  justify-content: flex-start;
  margin-top: 28px;
}

.page .updated {
  font-size: 14px;
  margin-top: 8px;
}
