/* Cross-document transition: section switches fade the middle content instead
   * of flashing a whole new page. Ignored by browsers without support. */
@view-transition {
  navigation: auto;
}

:root {
  --bg: #060a16;
  --pe-tabbar-h: calc(56px + env(safe-area-inset-bottom, 0px));
  --pe-accent: #4d8dff;
  --panel: #0a1224;
  --panel-2: #0e1a31;
  --ink: #dfe8ff;
  --ink-strong: #f4f8ff;
  --ink-soft: #a6b8d8;
  --ink-muted: #7889a9;
  --line: rgba(110, 150, 220, 0.26);
  --line-soft: rgba(110, 150, 220, 0.14);
  --blue: #4d8dff;
  --blue-deep: #1d4ed8;
  --ok: #23d39c;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 12% -10%, rgba(56, 112, 224, 0.18), transparent 46%),
    radial-gradient(circle at 88% 0%, rgba(24, 78, 168, 0.14), transparent 40%);
  background-repeat: no-repeat;
  color: var(--ink-soft);
  font: 400 14px/1.8 Iosevka, ui-monospace, "SF Mono", Menlo, monospace;
}

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

a:hover {
  text-decoration: underline;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

header.site {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 56px;
  border-bottom: 1px solid var(--line-soft);
  padding: 0 20px;
  font-size: 12px;
  letter-spacing: 0.06em;
}

header.site .brand {
  color: var(--ink-strong);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

header.site .spacer {
  flex: 1;
}

header.site a.nav {
  color: var(--ink-soft);
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
}

header.site a.nav:hover {
  border-color: var(--line);
  color: var(--ink);
  text-decoration: none;
}

main {
  padding: 52px 0 72px;
}

h1 {
  margin: 0 0 14px;
  font: 500 30px/1.32 inherit;
  color: var(--ink-strong);
  letter-spacing: -0.01em;
}

h2 {
  margin: 40px 0 12px;
  font: 500 18px/1.4 inherit;
  color: var(--ink-strong);
}

h3 {
  margin: 24px 0 8px;
  font: 500 14px/1.5 inherit;
  color: var(--ink);
}

p {
  margin: 0 0 14px;
  max-width: 76ch;
}

.lead {
  font-size: 15px;
  color: var(--ink);
}

.muted {
  color: var(--ink-muted);
  font-size: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font: 500 13px/1 inherit;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.btn:hover {
  border-color: var(--blue);
  text-decoration: none;
}

.btn.primary {
  background: var(--blue-deep);
  border-color: var(--blue);
  color: #fff;
}

.btn.primary:hover {
  filter: brightness(1.1);
}

.btn[disabled] {
  opacity: 0.6;
  cursor: default;
}

/* Horizontal paywall: two full-width rows with identical weight. What differs is
   only the scope line — Pro unlocks lessons, Exam includes Pro plus AI and exams. */
.plans {
  display: grid;
  grid-template-columns: 1fr;
  /* Both passes read as the same size: the shorter row stretches to the taller one. */
  grid-auto-rows: 1fr;
  gap: 10px;
  margin: 16px auto 10px;
  max-width: 820px;
}

.plan {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr) 208px;
  gap: 18px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid rgba(240, 164, 58, 0.5);
  border-radius: 12px;
  background: var(--panel);
  /* Yellow outer glow, identical on both cards. */
  box-shadow: 0 0 0 1px rgba(240, 164, 58, 0.1), 0 0 22px rgba(240, 164, 58, 0.22);
}

.plan-head {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.plan .name {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  font: 500 10.5px/1.2 inherit;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  white-space: nowrap;
}

.plan .name > * {
  flex: 0 0 auto;
}

.plan-tag {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  background: rgba(255, 255, 255, 0.03);
}

/* The paid AI/exam tier gets the one loud chip on the page. */
.plan-tag.hot {
  border-color: #f0a43a;
  color: #1a1204;
  background: linear-gradient(180deg, #ffc46b, #ef9c2c);
  box-shadow: 0 0 12px rgba(240, 164, 58, 0.35);
  font-weight: 600;
}

.plan .price {
  margin: 0;
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
  color: var(--ink-strong);
}

.plan .price small {
  display: block;
  margin: 3px 0 0;
  font-size: 9.5px;
  color: var(--ink-muted);
}

.plan-body {
  min-width: 0;
}

.plan-line {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.plan-points {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-soft);
}

.plan-points li::before {
  content: "· ";
  color: #f0a43a;
}

.plan-cta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.plan .btn {
  width: 100%;
  justify-content: center;
  min-height: 38px;
  font-size: 12px;
  font-weight: 600;
  background: linear-gradient(180deg, #ffc46b, #ef9c2c);
  border-color: #f0a43a;
  color: #1a1204;
}

.plan .btn:hover {
  filter: brightness(1.06);
}

.plan .muted {
  margin: 0;
  font-size: 9.5px;
  line-height: 1.4;
  text-align: center;
}

/* Kept for older markup/campaign pages: same surface and the same yellow glow as Pro. */
.plan.exam {
  border-color: rgba(240, 164, 58, 0.5);
  background: var(--panel);
  box-shadow: 0 0 0 1px rgba(240, 164, 58, 0.1), 0 0 22px rgba(240, 164, 58, 0.22);
}

.plan.exam .price { font-size: 28px; }
.plan.exam .name { color: var(--ink-muted); }

.free-strip {
  max-width: 820px;
  margin: 0 auto 10px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-muted);
}

.free-strip a {
  color: var(--blue);
  white-space: nowrap;
}

table.cmp {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 13px;
}

table.cmp th,
table.cmp td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
}

table.cmp th {
  color: var(--ink-strong);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.notice {
  margin: 18px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 6px;
  background: var(--panel-2);
  font-size: 12px;
}

footer.site {
  border-top: 1px solid var(--line-soft);
  padding: 26px 20px 40px;
  font-size: 12px;
  color: var(--ink-muted);
}

footer.site .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

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

@media (max-width: 700px) {
  h1 {
    font-size: 23px;
  }

  main {
    padding: 34px 0 48px;
  }

  header.site {
    gap: 8px;
    padding: 0 12px;
  }

  header.site a.nav {
    display: none;
  }
}

/* ── mobile app shell: fixed top header + middle content + fixed tab bar ── */
.pe-tabbar {
  display: none;
}

/* Mobile-only kicker inside the Pro card. */
.pro-mobile-kicker {
  display: none;
}

@media (max-width: 720px) {
  body {
    padding-bottom: var(--pe-tabbar-h);
  }

  header.site {
    position: sticky;
    top: 0;
    z-index: 40;
    height: 50px;
    gap: 8px;
    padding: 0 12px;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
  }

  header.site .brand {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    letter-spacing: 0.04em;
  }

  main {
    /* The middle pane owns the space between the two fixed bars. */
    min-height: calc(100dvh - 50px - var(--pe-tabbar-h));
    padding: 18px 0 32px;
  }

  .wrap {
    padding: 0 14px;
  }

  h1 {
    font-size: 20px;
    margin-bottom: 8px;
  }

  h2 {
    font-size: 16px;
    margin: 26px 0 8px;
  }

  .lead {
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 4px;
  }

  footer.site {
    padding-bottom: 16px;
  }

  .pe-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 41;
    display: flex;
    height: var(--pe-tabbar-h);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: color-mix(in srgb, var(--panel) 94%, transparent);
    border-top: 1px solid var(--line-soft);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .pe-tabbar a:link,
  .pe-tabbar a:visited {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font: 500 10px/1.2 Iosevka, ui-monospace, monospace;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-muted);
    text-decoration: none;
  }

  .pe-tabbar a.is-active:link,
  .pe-tabbar a.is-active:visited {
    color: var(--pe-accent);
  }

  .pe-tabbar a.is-active {
    box-shadow: inset 0 2px 0 var(--pe-accent);
  }

  /* ── tab bar icons (same marks as the explorer shell) ── */
  .pe-tabbar a:link,
  .pe-tabbar a:visited {
    flex-direction: column;
    gap: 4px;
    padding-top: 3px;
  }

  .pe-tab-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 19px;
    color: inherit;
  }

  .pe-tab-ico svg {
    width: 19px;
    height: 19px;
    opacity: 0.9;
  }

  .pe-tab-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* ── pricing: horizontal rows stack; name left, price right, one line of scope ── */
  body.pe-page-pricing .plans {
    grid-template-columns: 1fr;
    /* Stacked cards keep their natural height on phones. */
    grid-auto-rows: auto;
    gap: 8px;
    margin: 10px 0 8px;
    max-width: none;
  }

  body.pe-page-pricing .plan {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 13px 13px 12px;
    border-radius: 11px;
  }

  body.pe-page-pricing .plan-head {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
  }

  body.pe-page-pricing .plan .name {
    font-size: 9.5px;
    letter-spacing: 0.08em;
  }

  body.pe-page-pricing .plan .price {
    font-size: 24px;
    text-align: right;
  }

  body.pe-page-pricing .plan .price small {
    display: inline;
    margin: 0 0 0 4px;
    font-size: 8.5px;
  }

  body.pe-page-pricing .plan-line {
    font-size: 11.5px;
    line-height: 1.5;
  }

  body.pe-page-pricing .plan-points {
    font-size: 11.5px;
    line-height: 1.55;
  }

  body.pe-page-pricing .plan .btn {
    min-height: 34px;
    font-size: 11px;
  }

  body.pe-page-pricing .plan .muted {
    text-align: left;
    font-size: 8.5px;
    line-height: 1.35;
  }

  body.pe-page-pricing .free-strip {
    margin: 0 0 8px;
    padding: 8px 10px;
    font-size: 10.5px;
  }

  /* Scroll inside a wrapper: a max-content table would widen the whole page
     and break the fixed-shell layout. */
  body.pe-page-pricing .cmp-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  body.pe-page-pricing table.cmp {
    min-width: 420px;
    font-size: 12px;
  }

  body.pe-page-pricing table.cmp th,
  body.pe-page-pricing table.cmp td {
    padding: 8px 10px;
  }

  body.pe-page-pricing .notice {
    padding: 10px 12px;
    font-size: 11.5px;
  }

  body.pe-page-pricing dl {
    font-size: 12.5px;
  }

  /* Inconspicuous friendly-link line in the about page footer */
  footer.site .pe-friends {
    margin-top: -10px;
    font-size: 11px;
    opacity: 0.72;
  }

  footer.site .pe-friends .pe-friends-label {
    opacity: 0.85;
  }
}

/* Non-English visitors get the localized paywall only; the long English
   explainer and comparison table remain part of the English page. */
html:not([lang="en"]) .en-only { display: none; }

/* Four-product pricing: the plan name sits in a 168px column, so long product
   names wrap there instead of spilling over the bullet list. */
.plan .name {
  white-space: normal;
  flex-wrap: wrap;
  font-size: 9.5px;
  letter-spacing: 0.07em;
  line-height: 1.4;
}
.plan .name > span.plan-tag { font-size: 7.5px; }
.plan .plan-body { min-width: 0; }
.plan [data-plan].is-owned {
  background: transparent;
  color: var(--pe-accent);
  border-color: var(--pe-accent);
}
