/*
 * LexiFloat — the website.
 *
 * The app's visual system, ported. Every colour here is copied from
 * android/app/src/main/java/com/lexifloat/ui/Theme.kt; nothing is invented for the web.
 * Ink on paper: one warm ground, one raised surface, one accent, hairlines instead of
 * boxes, and a serif reserved for the word itself.
 *
 * No webfonts, no analytics, no third-party requests of any kind. An app that ships
 * without the internet permission should not have a marketing site that phones home.
 */

/* ---------------------------------------------------------------- tokens: light */
:root {
  --ink:            #16191D;
  --paper:          #FAF7F2;
  --paper-raised:   #FFFFFF;
  --accent:         #1C4E6B;
  --on-accent:      #FFFFFF;
  --muted:          #5A636E;
  --hairline:       #E7E1D6;
  --outline:        #CFC6B8;
  --tint:           #F2ECE1;

  --highlight:      #F6E7C4;
  --on-highlight:   #4A3A12;
  --example-tint:   #F4F1EA;
  --example-rule:   #CFC6B8;
  --synonym:        #E3EDF3;
  --on-synonym:     #1C4E6B;
  --antonym:        #F4E6E2;
  --on-antonym:     #7A3B2B;
  --note:           #EAF1E8;
  --on-note:        #33512F;
  --note-rule:      #6E9668;

  --shadow-card: 0 1px 2px rgba(22,25,29,.04), 0 12px 32px rgba(22,25,29,.09);
  --shadow-dot:  0 6px 18px rgba(22,25,29,.22);

  /* the app's Space object, one rhythm used everywhere */
  --s-tight: 8px;
  --s-row: 14px;
  --s-gutter: 20px;
  --s-section: 28px;
  --s-block: 40px;

  --font-display: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --measure: 66ch;
  color-scheme: light;
}

/* Not the light palette inverted: a dark reading surface wants a little blue in the
   black and a text colour short of pure white, or long passages glare. */
@media (prefers-color-scheme: dark) {
  :root {
    --ink:          #E9E5DE;
    --paper:        #11151A;
    --paper-raised: #181D23;
    --accent:       #8FBFDC;
    --on-accent:    #07131C;
    --muted:        #A6AEB8;
    --hairline:     #2C333C;
    --outline:      #3C444E;
    --tint:         #222831;

    --highlight:    #3D3419;
    --on-highlight: #F0DFB6;
    --example-tint: #1E242B;
    --example-rule: #3C444E;
    --synonym:      #1B2B36;
    --on-synonym:   #9FCBE4;
    --antonym:      #322220;
    --on-antonym:   #E0AC9B;
    --note:         #1C2620;
    --on-note:      #A9CFA2;
    --note-rule:    #6E9668;

    --shadow-card: 0 1px 2px rgba(0,0,0,.4), 0 14px 36px rgba(0,0,0,.5);
    --shadow-dot:  0 6px 18px rgba(0,0,0,.55);
    color-scheme: dark;
  }
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

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

img, svg { max-width: 100%; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 var(--s-gutter); }
.measure { max-width: var(--measure); }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--on-accent);
  padding: 10px 16px; z-index: 20;
}
.skip:focus { left: 8px; top: 8px; }

/* ------------------------------------------------------------- the type scale */
/* DisplayStyle, HeadwordStyle, RubricStyle. A wordmark does not need to be large to
   be the loudest thing on a page; it needs to be the only serif at that size. */
.rubric {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--muted);
  margin: 0 0 var(--s-tight);
}
.micro { font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 500; }

.display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.08;
  font-size: clamp(2.05rem, 1.3rem + 3.1vw, 3.1rem);
  margin: 0;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -.015em;
  font-size: clamp(1.45rem, 1.2rem + 1.1vw, 1.85rem);
  line-height: 1.2;
  margin: 0 0 var(--s-row);
}
.lede { font-size: 1.16rem; line-height: 1.6; color: var(--muted); margin: var(--s-gutter) 0 0; }

/* --------------------------------------------------------------------- masthead */
.masthead {
  border-bottom: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(120%) blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.masthead__inner {
  display: flex; align-items: center; gap: var(--s-gutter);
  min-height: 62px; flex-wrap: wrap;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 600; font-size: 21px;
  letter-spacing: -.02em; color: var(--ink); text-decoration: none;
}
.wordmark__mark { width: 26px; height: 26px; display: block; color: var(--accent); }
.nav { margin-left: auto; display: flex; gap: 20px; flex-wrap: wrap; }
.nav a {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 500;
  color: var(--muted); text-decoration: none; padding: 4px 0;
  border-bottom: 1px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------------------------------------------------------------------- layout */
.band { padding: clamp(46px, 7vw, 84px) 0; border-bottom: 1px solid var(--hairline); }
.band--tint { background: var(--tint); }
.band--flush { border-bottom: 0; }

.hero { padding: clamp(34px, 5.5vw, 70px) 0 clamp(40px, 6vw, 76px); }
.hero__grid {
  display: grid; gap: clamp(34px, 5vw, 56px);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 900px) {
  .hero__grid { grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); }
}

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: var(--s-section); }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; font-size: 14.5px; font-weight: 500;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
}
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { filter: brightness(1.08); }
.btn--quiet { border-color: var(--outline); color: var(--ink); background: transparent; }
.btn--quiet:hover { background: var(--paper-raised); }

.status-line {
  margin-top: var(--s-row); font-size: 13.5px; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--note-rule);
  display: inline-block; margin-right: 2px;
}

/* ------------------------------------------------ the stage: a lookup, in place */
/* The hero is the product's whole thesis: the definition arrives on top of what you
   are already reading, and you never leave the page. */
.stage { position: relative; padding: 6px 0 34px; }

.reading {
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: var(--s-gutter) var(--s-gutter) 92px;
  color: var(--muted);
  font-size: 15px; line-height: 1.75;
  box-shadow: 0 1px 2px rgba(22,25,29,.03);
}
.reading__meta { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.reading mark {
  background: var(--highlight); color: var(--on-highlight);
  padding: 1px 3px; border-radius: 3px;
}

.entry {
  position: relative;
  margin: -74px 54px 0 auto;
  width: min(100%, 396px);
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  padding: var(--s-gutter);
}
.entry__head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.entry__word {
  font-family: var(--font-display); font-weight: 600; font-size: 31px; line-height: 1.13;
  letter-spacing: -.013em; margin: 0; color: var(--ink);
}
.entry__summary { margin: var(--s-tight) 0 0; color: var(--ink); font-size: 15.5px; }

.pill {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  background: var(--tint); color: var(--muted);
  font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 500;
}
.ipa {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 10px; padding: 5px 11px; border-radius: 8px;
  background: var(--tint); color: var(--muted);
  font-family: var(--font-mono); font-size: 12.5px;
}
.ipa__hint { font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; opacity: .75; }

.senses { list-style: none; margin: var(--s-row) 0 0; padding: 0; }
.sense { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--hairline); }
.sense__n {
  font-family: var(--font-mono); font-size: 12px; color: var(--muted); padding-top: 2px;
  min-width: 12px;
}
.sense__def { margin: 0; font-size: 15px; color: var(--ink); }
.sense__gloss { margin: 3px 0 0; font-size: 13.5px; color: var(--muted); }

.example {
  margin: var(--s-tight) 0 0; padding: 9px 12px;
  background: var(--example-tint);
  border-left: 2px solid var(--example-rule);
  border-radius: 0 8px 8px 0;
  font-size: 14px; color: var(--muted); font-style: italic;
}
.example mark { background: var(--highlight); color: var(--on-highlight); font-style: normal; padding: 0 2px; }

.pills { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: var(--s-tight) 0 0; padding: 0; }
.pills li {
  padding: 4px 10px; border-radius: 999px; font-size: 13px;
  background: var(--synonym); color: var(--on-synonym);
}
.pills--antonym li { background: var(--antonym); color: var(--on-antonym); }
.entry__rubric { margin: var(--s-row) 0 0; }

.dot {
  position: absolute; right: -4px; bottom: 122px;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center;
  box-shadow: var(--shadow-dot);
}
.dot svg { width: 22px; height: 22px; }
@media (max-width: 620px) {
  .entry { margin-right: 34px; }
  .dot { right: 0; bottom: 96px; }
}

/* ------------------------------------------------------- the permission receipt */
.receipt {
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 13px;
}
.receipt__head {
  padding: 10px var(--s-gutter);
  border-bottom: 1px solid var(--hairline);
  background: var(--tint);
  color: var(--muted);
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  overflow-x: auto; white-space: nowrap;
}
.receipt__line {
  display: flex; gap: 12px; align-items: baseline;
  padding: 9px var(--s-gutter); border-bottom: 1px solid var(--hairline);
  color: var(--ink);
  overflow-x: auto;
}
.receipt__line:last-child { border-bottom: 0; }
.receipt__what { color: var(--muted); font-family: var(--font-body); font-size: 12.5px; margin-left: auto; white-space: nowrap; }
.receipt__line--absent { background: var(--note); color: var(--on-note); }
.receipt__line--absent .receipt__what { color: var(--on-note); }
.receipt__tick { color: var(--muted); }

/* ------------------------------------------------------------------- the ledger */
/* A colophon, not a scoreboard: the numbers are what fits in the file, so they are
   set like a specification sheet rather than blown up as hero statistics. */
.ledger { border-top: 1px solid var(--hairline); margin-top: var(--s-section); }
.ledger__row {
  display: flex; gap: var(--s-gutter); align-items: baseline;
  padding: 11px 0; border-bottom: 1px solid var(--hairline);
}
.ledger__key { color: var(--muted); font-size: 13.5px; flex: 1; }
.ledger__val { font-family: var(--font-mono); font-size: 15px; letter-spacing: -.01em; }

/* ------------------------------------------------------------------- feature rows */
.rows { margin-top: var(--s-block); border-top: 1px solid var(--hairline); }
.row {
  display: grid; gap: 6px var(--s-block);
  grid-template-columns: 1fr;
  padding: var(--s-section) 0;
  border-bottom: 1px solid var(--hairline);
}
@media (min-width: 760px) {
  .row { grid-template-columns: 160px minmax(0, 1fr); }
}
.row__label { padding-top: 4px; }
.row__title {
  font-family: var(--font-display); font-size: 20px; font-weight: 600;
  letter-spacing: -.01em; margin: 0 0 4px;
}
.row__body { margin: 0; color: var(--muted); max-width: var(--measure); }

/* -------------------------------------------------------------------- documents */
.doc { padding: clamp(34px, 5vw, 56px) 0 var(--s-block); }
.doc__head { border-bottom: 1px solid var(--hairline); padding-bottom: var(--s-section); }
.doc__sub { color: var(--muted); margin: var(--s-tight) 0 0; }

.doc-lede {
  background: var(--note); color: var(--on-note);
  border-radius: 14px; padding: 18px 20px;
  margin: var(--s-section) 0 0; max-width: var(--measure);
  font-size: 1.05rem;
}
.doc h2 {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 500;
  color: var(--muted); margin: var(--s-block) 0 var(--s-tight);
}
.doc h3 {
  font-family: var(--font-display); font-size: 19px; font-weight: 600;
  margin: var(--s-section) 0 var(--s-tight);
}
.doc p, .doc li { color: var(--muted); max-width: var(--measure); }
.doc p { margin: 0 0 var(--s-row); }
.doc ul { margin: 0 0 var(--s-row); padding-left: 20px; }
.doc li { margin-bottom: 6px; }
.doc li::marker { color: var(--accent); }
.doc strong { color: var(--ink); font-weight: 600; }

.stamp {
  margin-top: var(--s-block); padding-top: var(--s-row);
  border-top: 1px solid var(--hairline);
  font-size: 13px; color: var(--muted);
}

.infoline {
  display: flex; gap: var(--s-gutter); align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--hairline);
  max-width: var(--measure);
}
.infoline__k { color: var(--muted); font-size: 14px; flex: 1; }
.infoline__v { font-size: 14.5px; color: var(--ink); }

.mailcard {
  display: block; text-decoration: none;
  background: var(--paper-raised); border: 1px solid var(--hairline);
  border-radius: 14px; padding: 16px 18px; margin-bottom: 12px;
  max-width: var(--measure);
}
.mailcard:hover { border-color: var(--accent); }
.mailcard__addr {
  font-family: var(--font-display); font-size: 19px; color: var(--accent);
  margin: 2px 0 0; word-break: break-word;
}
.mailcard__note { color: var(--muted); font-size: 13.5px; margin: 6px 0 0; }

/* ---------------------------------------------------------------------- footer */
.footer { padding: var(--s-block) 0 var(--s-block); color: var(--muted); font-size: 13.5px; }
.footer__grid { display: flex; flex-wrap: wrap; gap: var(--s-section) var(--s-block); }
.footer__col { min-width: 150px; }
.footer__links { list-style: none; margin: 0; padding: 0; }
.footer__links li { margin-bottom: 6px; }
.footer__links a { color: var(--ink); text-decoration: none; }
.footer__links a:hover { text-decoration: underline; }
.footer__fine { margin-top: var(--s-block); padding-top: var(--s-row); border-top: 1px solid var(--hairline); max-width: 76ch; }

/* ---------------------------------------------------------------------- motion */
/* One orchestrated moment: the page is a reading surface, and the card arrives on
   top of it the way it does in the app. Nothing else moves. */
@media (prefers-reduced-motion: no-preference) {
  .stage .reading { animation: rise .5s cubic-bezier(.2,.7,.3,1) both; }
  .stage .entry   { animation: rise .58s cubic-bezier(.2,.7,.3,1) .16s both; }
  .stage .dot     { animation: pop .42s cubic-bezier(.2,.9,.3,1) .5s both; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
  @keyframes pop  { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
}

/* ------------------------------------------------------------------- utilities */
/* A short, closed set. They exist so that no page carries a style attribute, which
   is what lets the Content-Security-Policy header forbid inline styles outright. */
.u-flush { margin: 0; }
.u-muted { color: var(--muted); }
.u-mt-section { margin-top: var(--s-section); }

/* On a phone the masthead wraps to two rows, and a sticky two-row header is a fifth
   of the screen spent on a header. It scrolls away there instead. */
@media (max-width: 620px) {
  .masthead { position: static; }
  .masthead__inner { padding-top: 10px; padding-bottom: 10px; min-height: 0; }
  .nav { margin-left: 0; gap: 16px; }
}

/* ------------------------------------------------------------------- breadcrumbs */
.crumbs {
  display: block;
  padding-top: var(--s-row);
  font-size: 12px;
  color: var(--muted);
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs__sep { opacity: .5; }
.crumbs span[aria-current] { color: var(--ink); }

/* ----------------------------------------------------------------------- figures */
.figure { margin: var(--s-section) 0 0; max-width: 100%; }
.figure img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--hairline); border-radius: 14px;
  background: var(--paper-raised);
}
.figure__cap {
  margin-top: var(--s-tight);
  font-size: 13px; color: var(--muted); max-width: var(--measure);
}

/* --------------------------------------------------------------- comparison table */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table {
  border-collapse: collapse; width: 100%; min-width: 620px;
  font-size: 14.5px; text-align: left;
}
.table__cap {
  caption-side: bottom; padding-top: var(--s-row);
  font-size: 13px; color: var(--muted); text-align: left;
}
.table th, .table td {
  padding: 13px var(--s-row) 13px 0;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}
.table thead th {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  font-weight: 500; color: var(--muted); border-bottom-color: var(--outline);
}
.table tbody th { font-weight: 600; color: var(--ink); width: 30%; }
.table td { color: var(--muted); }
.table td:last-child { color: var(--ink); }

/* --------------------------------------------------------------------------- FAQ */
/* Questions are real headings and answers are visible prose — not a disclosure widget.
   A reader who arrived from a search for one question should see its answer without
   opening anything, and so should whatever quoted it. */
.faq { margin-top: var(--s-block); border-top: 1px solid var(--hairline); }
.faq__item { padding: var(--s-section) 0; border-bottom: 1px solid var(--hairline); }
.faq__q {
  font-family: var(--font-display); font-size: 19px; font-weight: 600;
  letter-spacing: -.01em; margin: 0 0 6px;
}
.faq__a { margin: 0; color: var(--muted); max-width: var(--measure); }
@media (min-width: 860px) {
  .faq__item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: var(--s-block); }
  .faq__q { margin: 0; }
}

/* ------------------------------------------------------------------------ byline */
.byline {
  margin-top: var(--s-block); padding-top: var(--s-row);
  border-top: 1px solid var(--hairline);
  font-size: 13px; color: var(--muted); max-width: var(--measure);
}
.byline a { color: var(--muted); }

/* Inline code, used in the prose for permission names and commands. */
code {
  font-family: var(--font-mono); font-size: .9em;
  background: var(--tint); color: var(--ink);
  padding: 1px 5px; border-radius: 4px;
}
