/* SwipeWise main stylesheet. Fonts are hosted here (SIL OFL 1.1), no external requests. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque-latin-wght.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/atkinson-hyperlegible-next-latin-wght.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/atkinson-hyperlegible-next-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #F8F8FC;
  --white: #FFFFFF;
  --lilac: #E8E7F7;
  --lilac-2: #D3D0EF;
  --indigo: #29237A;
  --indigo-hover: #1E1963;
  --ink: #1B1946;
  --muted: #4F4C7A;
  --coral: #FF6F59;
  --coral-hover: #FF5A41;
  --coral-soft: #FFE3DE;
  --butter: #FFD479;
  --butter-soft: #FFF2CF;
  --ok: #146B52;
  --ok-bg: #DFF3EA;
  --err: #A7281A;
  --err-bg: #FFE6E1;

  --r-s: 10px;
  --r-m: 18px;
  --r-l: 28px;

  --f-head: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-body: "Atkinson Hyperlegible Next", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --w: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 1.125rem;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; display: block; }
main:focus { outline: none; }

img, svg { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--f-head); color: var(--indigo); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 .5em; font-weight: 750; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.15rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
a { color: var(--indigo); text-underline-offset: .2em; text-decoration-thickness: .08em; }
a:hover { color: var(--indigo-hover); text-decoration-thickness: .14em; }
code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .92em; background: var(--lilac); padding: .1em .35em; border-radius: 6px; }
kbd { font-family: var(--f-head); font-size: .8em; font-weight: 700; background: var(--lilac); border: 1.5px solid var(--indigo); border-radius: 6px; padding: 0 .4em; line-height: 1.5; display: inline-block; }

:focus-visible {
  outline: 3px solid var(--indigo);
  outline-offset: 3px;
  border-radius: 4px;
}
.site-footer :focus-visible { outline-color: var(--butter); }

.wrap { width: 100%; max-width: calc(var(--w) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -80px; z-index: 100;
  background: var(--butter); color: var(--ink); padding: 10px 16px; border-radius: var(--r-s); font-weight: 700;
}
.skip-link:focus { top: 12px; }

/* ---------- Header ---------- */
.site-header { background: var(--paper); border-bottom: 2px solid var(--lilac-2); }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--indigo); }
.brand:hover { color: var(--indigo); }
.brand-name { font-family: var(--f-head); font-weight: 800; font-size: 1.4rem; letter-spacing: -0.02em; }
.logo-mark { flex: none; }
.lm-bg { fill: var(--indigo); }
.lm-back { fill: var(--coral); }
.lm-front { fill: var(--paper); }
.lm-check { fill: none; stroke: var(--indigo); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.site-nav a {
  display: inline-block; padding: 8px 16px; border-radius: 999px; text-decoration: none;
  font-family: var(--f-head); font-weight: 650; font-size: 1.05rem; color: var(--ink);
}
.site-nav a:hover { background: var(--lilac); color: var(--ink); }
.site-nav a[aria-current="page"] { background: var(--indigo); color: var(--paper); }

.nav-toggle {
  display: none; font: 700 1rem var(--f-head); color: var(--indigo); background: transparent;
  border: 2px solid var(--indigo); border-radius: 999px; padding: 8px 18px; min-height: 44px; cursor: pointer;
}
@media (max-width: 720px) {
  .js .nav-toggle { display: inline-flex; align-items: center; }
  .js .site-nav { display: none; width: 100%; }
  .js .site-nav.is-open { display: block; }
  .js .site-nav ul { flex-direction: column; padding-bottom: 8px; }
  .js .site-nav a { display: block; padding: 12px 16px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: .6em 1.4em; border-radius: 999px; border: 2px solid var(--indigo);
  font: 700 1.05rem/1.2 var(--f-head); text-decoration: none; cursor: pointer; text-align: center;
}
.btn-primary { background: var(--coral); color: var(--ink); border-color: var(--ink); box-shadow: 0 4px 0 var(--ink); }
.btn-primary:hover { background: var(--coral-hover); color: var(--ink); }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn-secondary { background: var(--indigo); color: var(--paper); }
.btn-secondary:hover { background: var(--indigo-hover); color: var(--paper); }
.btn-ghost { background: transparent; color: var(--indigo); }
.btn-ghost:hover { background: var(--lilac); color: var(--indigo); }
.btn-small { min-height: 40px; padding: .35em 1em; font-size: .95rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-danger { background: var(--white); color: var(--err); border-color: var(--err); }
.btn-danger:hover { background: var(--err-bg); color: var(--err); }

/* ---------- Layout helpers ---------- */
.section { padding-block: clamp(40px, 7vw, 80px); }
.section-alt { background: var(--lilac); }
.section-lead { font-size: 1.2rem; max-width: 60ch; color: var(--muted); }
.lead { font-size: 1.25rem; max-width: 56ch; }
.fine { font-size: .95rem; color: var(--muted); }
.more { margin-top: 28px; font-weight: 700; }

.grid { display: grid; gap: 20px; }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid-topics { grid-template-columns: 1fr; margin-top: 28px; }
@media (min-width: 620px) { .grid-topics { grid-template-columns: repeat(2, 1fr); } .grid-topics > :last-child:nth-child(odd) { grid-column: span 2; } }
@media (min-width: 940px) {
  .grid-topics { grid-template-columns: repeat(6, 1fr); }
  .grid-topics > * { grid-column: span 2; }
  .grid-topics > :nth-child(n+4) { grid-column: span 3; }
  .grid-topics > :last-child:nth-child(odd) { grid-column: span 3; }
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(36px, 7vw, 88px); }
.hero-grid { display: grid; gap: 40px; align-items: center; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 920px) { .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 56px; } }
.hero h1 { font-size: clamp(2.5rem, 7vw, 4.6rem); line-height: 1.02; max-width: 12ch; margin-bottom: .35em; }
.hero .lead { margin-bottom: 1.4em; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 18px; }

/* ---------- Cards and tiles ---------- */
.topic-tile, .article-card {
  position: relative; background: var(--white); border: 2px solid var(--lilac-2); border-radius: var(--r-m);
}
.topic-tile { padding: 14px 14px 20px; border-color: var(--indigo); }
.topic-tile h3, .article-card h3 { margin: 14px 0 .35em; font-size: 1.25rem; }
.topic-tile p { margin: 0 0 .6em; font-size: 1rem; color: var(--muted); }
.topic-tile .card-meta { margin: 0; }
.article-card { padding: 20px 22px 18px; display: flex; flex-direction: column; }
.article-card h3 { margin-top: 6px; }
.article-card p { font-size: 1rem; color: var(--muted); }
.card-link { color: var(--indigo); text-decoration: none; }
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card-link:focus-visible { outline: none; }
.card-link:focus-visible::after { outline: 3px solid var(--indigo); outline-offset: 3px; }
.topic-tile:hover, .article-card:hover { background: var(--lilac); border-color: var(--indigo); }
.card-topic { margin: 0 0 4px; font-size: .95rem; font-weight: 700; }
.card-topic a { position: relative; z-index: 1; color: var(--muted); }
.card-meta { margin: auto 0 0; font-size: .92rem; color: var(--muted); }

.art { display: block; width: 100%; height: auto; border-radius: 16px; }
.s-lilac { fill: var(--lilac); }
.s-lilac2 { fill: var(--lilac-2); }
.s-indigo { fill: var(--indigo); }
.s-coral { fill: var(--coral); }
.s-butter { fill: var(--butter); }
.s-paper { fill: var(--paper); }
.s-line { fill: none; stroke: var(--indigo); stroke-width: 3; stroke-dasharray: 1 9; stroke-linecap: round; }
.s-line-paper { fill: none; stroke: var(--paper); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.s-line-indigo { fill: none; stroke: var(--indigo); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.s-check { fill: none; stroke: var(--indigo); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Home: how it works ---------- */
.how-grid { display: grid; gap: 40px; align-items: start; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .how-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 64px; } }
.steps { list-style: none; counter-reset: step; margin: 24px 0; padding: 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 20px 60px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -2px; width: 42px; height: 42px; border-radius: 50%;
  background: var(--indigo); color: var(--paper); font: 800 1.2rem/42px var(--f-head); text-align: center;
}
.boxes-card { background: var(--white); border: 2.5px solid var(--indigo); border-radius: 24px; box-shadow: 8px 8px 0 var(--indigo); padding: 24px; }
.boxes-title { font: 700 1.1rem var(--f-head); color: var(--indigo); margin: 0 0 18px; }
.boxes { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; align-items: end; }
.boxes li { display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; padding: 10px 6px; border-radius: 12px; background: var(--indigo); color: var(--paper); text-align: center; font-family: var(--f-head); }
.boxes li:nth-child(1) { min-height: 70px; background: #8A86CC; color: var(--ink); }
.boxes li:nth-child(2) { min-height: 92px; background: #6862B5; }
.boxes li:nth-child(3) { min-height: 118px; background: #4B44A0; }
.boxes li:nth-child(4) { min-height: 146px; background: var(--indigo); }
.boxes li:nth-child(5) { min-height: 176px; background: var(--coral); color: var(--ink); }
.box-n { font-weight: 700; font-size: .9rem; }
.box-wait { font-weight: 800; font-size: 1.05rem; }
@media (max-width: 420px) { .box-n { font-size: .78rem; } .box-wait { font-size: .92rem; } }

.write-grid > * { max-width: 760px; }
.plain-list { padding-left: 1.2em; margin: 0 0 1.2em; }
.plain-list li { margin-bottom: .5em; }
.write-links { display: flex; flex-wrap: wrap; gap: 8px 24px; font-weight: 700; }

/* ---------- Page heads and breadcrumbs ---------- */
.page-head { padding-block: 28px 20px; }
.page-head h1 { max-width: 22ch; }
.topic-head { display: grid; gap: 28px; align-items: center; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 880px) { .topic-head { grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: 48px; } }
.topic-head p { max-width: 62ch; }
.topic-art { max-width: 320px; }

.crumbs { margin-bottom: 14px; font-size: .95rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0; padding: 0; color: var(--muted); }
.crumbs li:not(:last-child)::after { content: "/"; margin: 0 .55em; color: var(--muted); font-weight: 700; }
.crumbs a { color: var(--muted); }
.crumbs [aria-current] { color: var(--ink); }

/* ---------- Explorer ---------- */
.explorer { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin: 8px 0 20px; background: var(--white); border: 2px solid var(--lilac-2); border-radius: var(--r-m); padding: 18px; }
@media (min-width: 760px) { .explorer { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; align-items: end; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font: 700 1rem var(--f-head); color: var(--indigo); }
.field-actions { flex-direction: row; gap: 10px; flex-wrap: wrap; }
input[type="text"], input[type="email"], input[type="search"], input[type="number"], select, textarea {
  font: inherit; color: var(--ink); background: var(--white); width: 100%; min-height: 48px; padding: .55em .85em;
  border: 2px solid var(--indigo); border-radius: var(--r-s);
}
textarea { resize: vertical; min-height: 140px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }
.result-count { color: var(--muted); font-size: 1rem; margin: 0 0 20px; }
.cluster { margin-bottom: 44px; }
.cluster h2 a { text-decoration: none; }
.cluster h2 a:hover { text-decoration: underline; }
.empty-state { background: var(--white); border: 2px dashed var(--indigo); border-radius: var(--r-m); padding: 32px; max-width: 640px; }
.not-found .explorer { max-width: 640px; }

/* ---------- Article ---------- */
.article-head { padding-block: 28px 8px; }
.article-head h1 { max-width: 24ch; }
.meta { display: flex; flex-wrap: wrap; gap: 10px 32px; margin: 18px 0 0; font-size: .98rem; }
.meta div { display: flex; flex-direction: column; }
.meta dt { color: var(--muted); font-size: .85rem; }
.meta dd { margin: 0; font-weight: 700; }
.article-layout { display: grid; gap: 40px; padding-block: 24px 40px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) { .article-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; } .article-side { position: sticky; top: 16px; align-self: start; } }
.article-side { display: flex; flex-direction: column; gap: 20px; }

.prose { max-width: 70ch; }
.prose > p, .prose li { font-size: 1.1rem; }
.prose h2 { margin: 2.1em 0 .6em; font-size: clamp(1.5rem, 2.6vw, 1.9rem); }
.prose h3 { margin: 1.6em 0 .4em; font-size: 1.25rem; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .45em; }
.prose a { font-weight: 600; }
.prose section > :last-child { margin-bottom: 0; }
.prose-page { padding-bottom: 64px; }
.prose-page .prose h2:first-child { margin-top: .6em; }

.callout { background: var(--lilac); border-radius: var(--r-m); padding: 16px 20px; margin: 1.6em 0; }
.callout p { margin: 0; }
.callout-title { font: 700 1.05rem var(--f-head); color: var(--indigo); margin: 0 0 .25em !important; }
.callout-example { background: var(--butter-soft); }
.callout-warning { background: var(--coral-soft); }

.table-wrap { overflow-x: auto; margin: 1.6em 0; border: 2px solid var(--lilac-2); border-radius: var(--r-s); background: var(--white); }
.table-wrap:focus-visible { outline-offset: 2px; }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 1rem; line-height: 1.45; }
caption { text-align: left; font: 700 1rem var(--f-head); color: var(--indigo); padding: 12px 14px 4px; caption-side: top; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-top: 1px solid var(--lilac-2); }
thead th { background: var(--lilac); border-top: 0; font-family: var(--f-head); color: var(--indigo); }
tbody th { font-weight: 700; }

.checklist { list-style: none; padding-left: 0 !important; }
.checklist li { position: relative; padding-left: 34px; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: .28em; width: 22px; height: 22px; border-radius: 7px; background: var(--butter) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231B1946' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 12.5l4.2 4.2L18.5 8'/%3E%3C/svg%3E") center / 80% no-repeat;
}
.mistakes { list-style: none; padding-left: 0 !important; display: grid; gap: 12px; }
.mistakes li { background: var(--white); border: 2px solid var(--lilac-2); border-radius: var(--r-s); padding: 12px 16px; margin: 0; }
.source-list { font-size: .98rem !important; }
.source-list li { overflow-wrap: anywhere; font-size: .98rem !important; }
.review-note { margin-top: 2.4em; padding-top: 1em; border-top: 2px solid var(--lilac-2); }

.aside-title { font: 700 1.1rem var(--f-head); color: var(--indigo); margin: 0 0 .5em; letter-spacing: -0.01em; }
.toc { background: var(--white); border: 2px solid var(--lilac-2); border-radius: var(--r-m); padding: 16px 18px; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a { display: block; padding: 6px 0; font-size: 1rem; text-decoration: none; color: var(--ink); }
.toc a:hover { color: var(--indigo); text-decoration: underline; }
.practice-box { background: var(--butter); border: 2.5px solid var(--ink); border-radius: var(--r-m); box-shadow: 5px 5px 0 var(--ink); padding: 16px 18px; }
.practice-box p { font-size: 1rem; }
.practice-box .aside-title { color: var(--ink); }
.related { padding-block: 16px 64px; }

/* ---------- Contact ---------- */
.contact-layout { display: grid; gap: 40px; padding-bottom: 64px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .contact-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; } }
.contact-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; max-width: 640px; }
.field-hint { margin: 0; font-size: .92rem; color: var(--muted); }
.field-error { margin: 0; color: var(--err); font-weight: 700; font-size: .98rem; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--err); background: #FFF8F6; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.notice { border-radius: var(--r-m); padding: 18px 22px; margin-bottom: 24px; max-width: 640px; }
.notice h2 { font-size: 1.3rem; margin-bottom: .3em; }
.notice ul { margin: 0; padding-left: 1.2em; }
.notice-ok { background: var(--ok-bg); border: 2px solid var(--ok); }
.notice-ok h2 { color: var(--ok); }
.notice-error { background: var(--err-bg); border: 2px solid var(--err); }
.notice-error h2 { color: var(--err); }
.contact-side { background: var(--white); border: 2px solid var(--lilac-2); border-radius: var(--r-m); padding: 20px 22px; align-self: start; }
.contact-side p { font-size: 1rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--indigo); color: var(--paper); margin-top: 40px; padding-block: 48px 28px; flex: none; }
.site-footer a { color: var(--paper); }
.site-footer a:hover { color: var(--butter); }
.site-footer .brand-name { color: var(--paper); }
.site-footer .lm-bg { fill: var(--lilac); }
.site-footer .lm-front { fill: var(--white); }
.footer-grid { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; } }
.footer-brand p { font-size: 1rem; max-width: 36ch; margin-top: 12px; }
.footer-title { font: 700 1.05rem var(--f-head); color: var(--butter); margin: 0 0 .6em; letter-spacing: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .4em; font-size: 1rem; }
.footer-note { margin: 36px 0 8px; padding-top: 20px; border-top: 1px solid rgba(248, 248, 252, .3); font-size: .95rem; max-width: 80ch; }
.footer-copy { margin: 0; font-size: .92rem; opacity: .85; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media print {
  .site-header, .site-footer, .skip-link { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .article-side { display: none; }
}


/* =====================================================================
   Polish layer: wordmark, topic colors, hero depth, edges, page details
   ===================================================================== */

:root {
  --mint-soft: #DDF3EA;
  --sky-soft: #DCEBFF;
  --acc-how: #8A86CC;
  --acc-spaced: #FFC247;
  --acc-mnem: #FF6F59;
  --acc-subject: #4DBF9A;
  --acc-routines: #5B9CF0;
}

::selection { background: var(--butter); color: var(--ink); }
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }

/* Wordmark: the domain, with ".com" quieter than the name */
.brand-name { font-size: clamp(1.12rem, 5.2vw, 1.45rem); letter-spacing: -0.03em; }
.brand-tld { font-weight: 500; color: #6862B5; letter-spacing: -0.01em; }
.brand-light .brand-tld, .site-footer .brand-tld { color: var(--butter); }

/* Buttons lift a little on hover */
.btn { transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn-secondary:hover, .btn-ghost:hover { transform: translateY(-1px); }

/* ---------- Home hero ---------- */
.hero { position: relative; overflow: hidden; isolation: isolate; padding-block: clamp(40px, 7vw, 96px); }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(rgba(41, 35, 122, .16) 1.3px, transparent 1.8px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .5) 55%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .5) 55%, transparent 100%);
}
.hero::after {
  content: ""; position: absolute; z-index: -1; right: -10%; top: -35%; width: 62%; aspect-ratio: 1;
  background: radial-gradient(closest-side, var(--lilac) 0%, rgba(232, 231, 247, 0) 100%);
}
.hero h1 { font-size: clamp(2.5rem, 6.4vw, 4.5rem); max-width: 14ch; }
.hero-demo { position: relative; isolation: isolate; }
.hero-demo::before, .hero-demo::after {
  content: ""; position: absolute; z-index: -1; width: 54%; height: 280px;
  border: 2.5px solid var(--indigo); border-radius: 28px;
}
.hero-demo::before { left: -3%; top: 14px; background: var(--coral); transform: rotate(-7deg); }
.hero-demo::after { right: -2%; top: 34px; background: var(--butter); transform: rotate(6deg); }
.trust { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .98rem; color: var(--muted); }
.trust li { display: inline-flex; align-items: center; gap: 8px; }
.trust .icon { flex: none; width: 18px; height: 18px; padding: 3px; box-sizing: content-box; border-radius: 50%; background: var(--ok-bg); color: var(--ok); }

/* ---------- Topic colors ---------- */
.art .s-bg { fill: var(--lilac); }
.bg-spaced-repetition .s-bg { fill: var(--butter-soft); }
.bg-mnemonics .s-bg { fill: var(--coral-soft); }
.bg-memorize-by-subject .s-bg { fill: var(--mint-soft); }
.bg-study-routines .s-bg { fill: var(--sky-soft); }
[data-topic="how-memory-works"] { --accent: var(--acc-how); }
[data-topic="spaced-repetition"] { --accent: var(--acc-spaced); }
[data-topic="mnemonics"] { --accent: var(--acc-mnem); }
[data-topic="memorize-by-subject"] { --accent: var(--acc-subject); }
[data-topic="study-routines"] { --accent: var(--acc-routines); }
.article-card { border-top: 7px solid var(--accent, var(--lilac-2)); }
.article-card:hover { border-top-color: var(--accent, var(--indigo)); }
.topic-tile, .article-card { transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease; }
.topic-tile:hover, .article-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--indigo); }
.topic-tile .art { border: 2px solid var(--indigo); }
.topic-tile h3 { font-size: 1.3rem; }

/* ---------- Scalloped edges, like a perforated index card ---------- */
.section-alt { position: relative; }
.section-alt::before, .section-alt::after, .site-footer::before {
  content: ""; position: absolute; left: 0; right: 0; height: 14px; pointer-events: none;
  background-size: 40px 14px; background-repeat: repeat-x;
}
.section-alt::before, .site-footer::before {
  top: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='14' viewBox='0 0 40 14'%3E%3Cpath d='M0 0H40A20 14 0 0 1 0 0Z' fill='%23F8F8FC'/%3E%3C/svg%3E");
}
.section-alt::after {
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='14' viewBox='0 0 40 14'%3E%3Cpath d='M0 14H40A20 14 0 0 0 0 14Z' fill='%23F8F8FC'/%3E%3C/svg%3E");
}
.site-footer { position: relative; padding-top: 68px; }

/* ---------- Page details ---------- */
@media (min-width: 980px) {
  .page-head:not(.topic-head):not(.not-found) { position: relative; }
  .page-head:not(.topic-head):not(.not-found)::after {
    content: ""; position: absolute; right: var(--gutter); top: 10px; width: 230px; height: 150px; pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='230' height='150' viewBox='0 0 230 150'%3E%3Cg stroke='%2329237A' stroke-width='3' stroke-linejoin='round'%3E%3Crect x='52' y='26' width='96' height='116' rx='14' fill='%23D3D0EF' transform='rotate(-16 100 84)'/%3E%3Crect x='84' y='14' width='96' height='116' rx='14' fill='%23FFD479' transform='rotate(-2 132 72)'/%3E%3Crect x='112' y='22' width='96' height='116' rx='14' fill='%23FFFFFF' transform='rotate(12 160 80)'/%3E%3C/g%3E%3Cpath d='M142 82l14 14 24-28' fill='none' stroke='%23FF6F59' stroke-width='9' stroke-linecap='round' stroke-linejoin='round' transform='rotate(12 160 80)'/%3E%3C/svg%3E") no-repeat center / contain;
  }
}
.article-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: center; }
.article-art { display: none; }
@media (min-width: 980px) {
  .article-head { grid-template-columns: minmax(0, 1fr) 260px; gap: 40px; }
  .article-art { display: block; }
}
.article-art .art { border: 2.5px solid var(--indigo); border-radius: 22px; }

.ticks { list-style: none; padding-left: 0 !important; }
.ticks li { position: relative; padding-left: 36px; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .28em; width: 22px; height: 22px; border-radius: 7px;
  background: var(--butter) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231B1946' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 12.5l4.2 4.2L18.5 8'/%3E%3C/svg%3E") center / 80% no-repeat;
}

/* ---------- Guide lock (Recompensa) ---------- */
.stamp .st-ring { fill: none; stroke: var(--indigo); stroke-width: 3; stroke-dasharray: 1.5 5.2; stroke-linecap: round; }
.stamp .st-fill { fill: var(--butter); stroke: var(--indigo); stroke-width: 3; }
.stamp .st-check { fill: none; stroke: var(--indigo); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }

.gate {
  display: none; margin: 2.2em 0; padding: clamp(20px, 4vw, 32px); position: relative;
  background: var(--white); border: 2.5px solid var(--indigo); border-radius: var(--r-l); box-shadow: 8px 8px 0 var(--indigo);
}
.gate-locked .gate { display: block; }
.gate-locked .article-rest, .gate-locked .toc { display: none; }
.gate-head { display: flex; gap: 22px; align-items: flex-start; }
.gate-stamp { flex: none; transform: rotate(-8deg); }
.gate-title { font: 800 clamp(1.35rem, 3vw, 1.75rem)/1.15 var(--f-head); letter-spacing: -0.02em; color: var(--indigo); margin: 0 0 .4em; }
.gate-text { margin: 0 0 .6em; font-size: 1.08rem; }
.gate-fine { margin: 0; font-size: .95rem; color: var(--muted); }
.gate-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.gate-round-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.gate-count { margin: 0; font: 700 1.05rem var(--f-head); color: var(--indigo); }
.gate-progress { display: block; width: 100%; height: 12px; margin-bottom: 22px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 99px; background: var(--lilac-2); overflow: hidden; }
.gate-progress::-webkit-progress-bar { background: var(--lilac-2); }
.gate-progress::-webkit-progress-value { background: var(--coral); border-radius: 99px; }
.gate-progress::-moz-progress-bar { background: var(--coral); border-radius: 99px; }
.gate-stage { background: var(--lilac); border-radius: 24px; padding: 28px 14px 14px; }
.gate-note:empty { height: 0; margin: 0; padding: 0; border: 0; overflow: hidden; }
.gate-note:not(:empty) {
  display: flex; align-items: center; gap: 14px; margin: 1.6em 0; padding: 12px 16px;
  background: var(--butter-soft); border: 2px solid var(--ink); border-radius: var(--r-m);
}
.gate-note p { margin: 0; font-size: 1rem; }
.gate-note-icon { flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--butter); border: 2px solid var(--ink); display: grid; place-items: center; color: var(--ink); }
@media (max-width: 520px) {
  .gate-head { flex-direction: column; gap: 10px; }
  .gate-stamp svg { width: 56px; height: 56px; }
}

@media print {
  .gate, .gate-note { display: none !important; }
  .gate-locked .article-rest { display: block !important; }
}
