/* linguamark.com
   A cool grey desk with white reading sheets; the extension's terracotta is the only colour,
   used for what the extension itself adds to a page: glosses, underlines, buttons. */

:root {
  --desk: #f2f3f0;
  --sheet: #ffffff;
  --ink: #1c2127;
  --muted: #5c636c;
  --line: #dcdfd9;
  --line-strong: #c6cac3;
  --accent: #a0523c;
  --accent-deep: #7f3c2a;
  --gloss-bg: #f6e8e1;
  --gloss-ink: #7f3c2a;
  --saved: #b7791f;
  --ok: #3f7d58;

  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC",
    "Microsoft YaHei", "Segoe UI", sans-serif;
  --serif: Charter, "Bitstream Charter", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --s-1: 0.875rem;
  --s0: 1.0625rem;
  --s1: 1.25rem;
  --s2: 1.625rem;
  --s3: 2.25rem;

  --wide: 68rem;
  --text: 36rem;
}

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

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

body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font: var(--s0) / 1.75 var(--sans);
}

a {
  color: var(--accent-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

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

img {
  max-width: 100%;
  height: auto;
}

h1,
h2 {
  margin: 0;
  line-height: 1.25;
  text-wrap: balance;
}

h2 {
  font-size: var(--s2);
  letter-spacing: -0.01em;
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 0.4em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--sheet);
  font: 0.85em / 1.6 var(--mono);
  text-align: center;
}

code {
  padding: 0.05em 0.3em;
  border-radius: 4px;
  background: #e6e8e3;
  font: 0.88em var(--mono);
}

.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: #fff;
  z-index: 10;
}

.skip:focus {
  top: 1rem;
}

/* Header & footer ----------------------------------------------------------- */

.top-in,
.foot-in,
main > section,
main > article,
.steps {
  width: min(100% - 2.5rem, var(--wide));
  margin-inline: auto;
}

.top-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand img {
  border-radius: 6px;
}

.top nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: var(--s-1);
}

.top nav a {
  color: var(--muted);
  text-decoration: none;
}

.top nav a:hover,
.top nav a[aria-current="page"] {
  color: var(--ink);
}

.top nav a[aria-current="page"] {
  text-decoration: underline 2px var(--accent);
  text-underline-offset: 0.5em;
}

.top nav .top-install {
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
}

.top nav .top-install:hover {
  background: var(--accent-deep);
  color: #fff;
}

.foot {
  margin-top: 6rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--s-1);
}

.foot-in {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1.75rem 3rem;
}

.foot p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.foot img {
  border-radius: 4px;
}

.foot-links {
  gap: 1.25rem !important;
}

.foot a {
  color: var(--muted);
}

/* Buttons ---------------------------------------------------------------- */

.install {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.75rem 0 0;
}

.install.is-center {
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: var(--s-1);
  line-height: 1.4;
  text-decoration: none;
}

.btn-main {
  background: var(--accent);
  color: #fff;
}

.btn-main:hover {
  background: var(--accent-deep);
  color: #fff;
}

.btn-alt {
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
  background: var(--sheet);
}

.btn-alt:hover {
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

/* Hero ---------------------------------------------------------------------- */

.hero {
  padding-block: 4.5rem 1rem;
}

.hero-text {
  max-width: 40rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.lede {
  margin: 1.25rem 0 0;
  max-width: var(--text);
  color: var(--muted);
  font-size: var(--s1);
  line-height: 1.7;
}

/* The demo is a page of English the way the extension leaves it: the memorable part of the site. */
.demo {
  position: relative;
  margin-top: 3.5rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--sheet);
  box-shadow: 0 24px 60px -32px rgba(28, 33, 39, 0.28);
}

.demo-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.levels {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.levels-label {
  margin-right: 0.6rem;
  color: var(--muted);
  font-size: var(--s-1);
}

.levels button {
  padding: 0.3rem 0.85rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 600 var(--s-1) / 1.5 var(--sans);
  cursor: pointer;
}

.levels button:hover {
  color: var(--ink);
  background: var(--desk);
}

.levels button[aria-checked="true"] {
  background: var(--ink);
  color: #fff;
}

.demo-count {
  margin: 0;
  color: var(--muted);
  font-size: var(--s-1);
}

.demo-page {
  padding: 2.25rem clamp(1.25rem, 5vw, 3.5rem) 2.5rem;
  font: 1.375rem / 2.15 var(--serif);
  color: #23272d;
}

.demo-p {
  margin: 0;
  max-width: 54rem;
}

.demo-p + .demo-p {
  margin-top: 1.25rem;
}

.w {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline dotted 1.5px var(--accent);
  text-underline-offset: 0.3em;
  cursor: pointer;
}

.w:hover {
  color: var(--accent-deep);
}

.w.is-saved {
  text-decoration: underline solid 2px var(--saved);
}

.g {
  display: inline-block;
  max-width: 8em;
  margin-left: 0.3em;
  padding: 0 0.4em;
  border-radius: 4px;
  background: var(--gloss-bg);
  color: var(--gloss-ink);
  font: 0.6em / 1.7 var(--sans);
  white-space: nowrap;
  vertical-align: 0.15em;
  overflow: hidden;
  transition: max-width 0.35s ease, opacity 0.25s ease, margin 0.35s ease, padding 0.35s ease;
}

/* Words at or below the reader's level read like plain text */
.w-wrap.is-plain .w {
  text-decoration-color: transparent;
  cursor: text;
  pointer-events: none;
}

.w-wrap.is-plain .g {
  max-width: 0;
  margin-left: 0;
  padding-inline: 0;
  opacity: 0;
}

.demo-note {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: var(--s-1);
}

.demo-status {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  translate: -50% 0;
  margin: 0;
  padding: 0;
  font-size: var(--s-1);
}

.demo-status:not(:empty) {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
}

.demo-status button {
  margin-left: 0.5rem;
  padding: 0;
  border: 0;
  background: none;
  color: #f3c9b9;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* Lookup card, modelled on the extension's */
.card {
  position: absolute;
  z-index: 5;
  width: min(22rem, calc(100% - 1.5rem));
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--sheet);
  box-shadow: 0 18px 40px -16px rgba(28, 33, 39, 0.35);
  font-size: var(--s-1);
  line-height: 1.6;
}

.card-head {
  position: relative;
  padding-right: 2rem;
}

.card-title {
  margin: 0;
  font: 700 1.25rem / 1.3 var(--serif);
}

.card-meta {
  margin: 0.15rem 0 0;
  color: var(--muted);
  white-space: pre;
}

.card-close {
  position: absolute;
  top: -0.35rem;
  right: -0.4rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.card-close:hover {
  background: var(--desk);
  color: var(--ink);
}

.card-brief {
  margin: 0.75rem 0 0;
  color: var(--accent-deep);
  font-weight: 700;
  font-size: var(--s0);
}

.card-full {
  margin: 0.15rem 0 0;
  color: var(--muted);
}

.card-ctx {
  margin: 0.75rem 0 0;
  padding: 0.6rem 0.75rem;
  border-left: 3px solid var(--gloss-bg);
  background: #fafaf8;
}

.card-ctx p {
  margin: 0;
}

.card-en {
  font-family: var(--serif);
}

.card-zh {
  margin-top: 0.3rem !important;
  color: var(--muted);
}

.card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.btn-small {
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--sheet);
  color: var(--ink);
  font: 600 var(--s-1) / 1.4 var(--sans);
  cursor: pointer;
}

.btn-small.is-main {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.btn-small.is-main.is-on {
  border-color: var(--saved);
  background: #fdf4e3;
  color: #7a4f12;
}

/* Feature sections ---------------------------------------------------------- */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 2.5rem 4rem;
  align-items: center;
  padding-block: 5.5rem 0;
}

.feature.is-flip .feature-text {
  order: 2;
}

.feature-text {
  max-width: 30rem;
}

.feature-text p,
.plain p {
  margin: 1rem 0 0;
}

.aside {
  color: var(--muted);
  font-size: var(--s-1);
}

.feature figure {
  margin: 0;
}

.shot {
  display: block;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--sheet);
  box-shadow: 0 16px 40px -28px rgba(28, 33, 39, 0.3);
}

.shot.is-card {
  max-width: min(100%, 26rem);
  margin-inline: auto;
}

.shot.is-tall {
  max-height: 34rem;
  width: auto;
  margin-inline: auto;
}

.shot.is-narrow {
  max-height: 30rem;
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}

.pair .shot.is-tall {
  max-height: 30rem;
}

.modes,
.facts {
  margin: 1.25rem 0 0;
}

.modes div,
.facts div {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1rem;
  padding-block: 0.65rem;
  border-top: 1px solid var(--line);
}

.modes dt,
.facts dt {
  font-weight: 700;
}

.modes dd,
.facts dd {
  margin: 0;
  color: var(--muted);
}

.facts div {
  grid-template-columns: 9rem 1fr;
}

/* Plain text sections ------------------------------------------------------- */

.plain {
  padding-block: 5.5rem 0;
}

.plain > * {
  max-width: 46rem;
}

.keys {
  margin-top: 1.25rem;
  border-collapse: collapse;
  width: 100%;
  max-width: 34rem;
}

.keys th,
.keys td {
  padding: 0.6rem 0;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: baseline;
}

.keys th {
  width: 9rem;
  font-weight: 400;
  white-space: nowrap;
}

.keys td {
  color: var(--muted);
}

.closing {
  margin-top: 6rem;
  padding: 3.5rem 1.5rem;
  border-radius: 16px;
  background: var(--ink);
  color: #e9ebe7;
  text-align: center;
}

.closing h2 {
  color: #fff;
}

.closing p {
  margin: 0.75rem auto 0;
  max-width: 32rem;
}

.closing a:not(.btn) {
  color: #f3c9b9;
}

.closing .btn-alt {
  background: transparent;
  color: #fff;
  box-shadow: inset 0 0 0 1.5px #5c636c;
}

.closing .btn-alt:hover {
  box-shadow: inset 0 0 0 1.5px #fff;
}

/* Inner pages --------------------------------------------------------------- */

.page-head {
  padding-block: 4rem 1rem;
}

.page-head h1 {
  font-size: clamp(2.25rem, 6vw, 3.25rem);
  letter-spacing: -0.02em;
}

/* Practice page */
.status {
  margin-top: 1.75rem;
  max-width: 40rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted);
  border-radius: 8px;
  background: var(--sheet);
}

.status[data-state="ready"] {
  border-left-color: var(--ok);
}

.status[data-state="missing"] {
  border-left-color: var(--accent);
}

.status p {
  margin: 0;
}

.status-text {
  font-weight: 600;
}

.status[data-state="ready"] .status-text::before {
  content: "✓ ";
  color: var(--ok);
}

.status-help {
  margin-top: 0.25rem !important;
  color: var(--muted);
  font-size: var(--s-1);
}

.status .install {
  margin-top: 0.9rem;
}

.step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem 3.5rem;
  padding-block: 3rem;
  border-top: 1px solid var(--line);
}

.step-num {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin: 0 0 0.75rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: var(--s-1);
}

.step-text h2 {
  font-size: var(--s1);
}

.step-text > p {
  margin: 0.75rem 0 0;
}

.practice {
  margin-top: 1.25rem;
  padding: 1.1rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--sheet);
  font: 1.125rem / 2 var(--serif);
}

.practice p {
  margin: 0;
}

.step-figure {
  margin: 0;
}

.step-figure img {
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--sheet);
}

.step-figure figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: var(--s-1);
}

/* Privacy policy: the article sits in the page column like every other page; its text keeps a reading measure */
.prose > * {
  max-width: 46rem;
}

.prose h1 span {
  display: block;
  color: var(--muted);
  font-size: 0.5em;
  font-weight: 600;
  letter-spacing: 0;
}

.prose h2 {
  margin-top: 3rem;
}

.prose h3 {
  margin: 2rem 0 0;
  font-size: var(--s1);
  line-height: 1.4;
}

.prose p,
.prose ul {
  margin: 1rem 0 0;
}

.prose li + li {
  margin-top: 0.5rem;
}

.prose hr {
  margin: 2.5rem 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* Small screens ------------------------------------------------------------- */

@media (max-width: 52rem) {
  .feature,
  .step {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature.is-flip .feature-text {
    order: 0;
  }

  .feature {
    padding-top: 4rem;
  }
}

@media (max-width: 34rem) {
  .top nav {
    gap: 1rem;
  }

  .top nav .top-install {
    display: none;
  }

  .hero {
    padding-top: 3rem;
  }

  .demo-bar {
    padding: 0.75rem;
  }

  .levels-label {
    display: none;
  }

  .levels button {
    padding-inline: 0.7rem;
  }

  .demo-page {
    font-size: 1.1875rem;
    line-height: 2.1;
  }

  .facts div {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  .install .btn {
    flex: 1 1 100%;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .g {
    transition: none;
  }
}
