/* Home page (#427). The catalogue card opens out into a landing page:
   the same paper, card stock and ink from style.css, a try-it book page as
   the one rich moment, and the red ribbon as the only signature.
   Loaded on the home page only, after style.css. */

.wrap-wide { max-width: 70rem; }

/* The try-it page shows and hides its parts with the hidden attribute;
   keep it winning over the display rules below. */
.home [hidden] { display: none !important; }

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  background: var(--card);
  color: var(--ink);
  padding: 8px 12px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  z-index: 10;
}
.skip:focus { top: 8px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.home :focus-visible { outline: 2px solid var(--cloth); outline-offset: 2px; }

.sans,
.label,
.facts,
.try-steps,
.running-head,
.btn,
.textlink,
.credit,
.theme-pick label,
.tp-credit,
.ribbon {
  font-family: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

.label {
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
  margin: 0;
}

.home h2 { font-size: 1.625rem; margin: 0 0 12px; }
.home h2.label { font-size: 0.8125rem; margin: 0; }
.home h3 { margin: 0 0 4px; }

/* Hero: words on the left, the try-it page on the right */
.hero {
  display: grid;
  gap: 32px;
  padding-top: 24px;
  padding-bottom: 48px;
}
@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 56px;
    align-items: center;
    padding-top: 40px;
    padding-bottom: 72px;
  }
}
.hero h1 {
  font-size: clamp(2.25rem, 1.4rem + 3.6vw, 3.5rem);
  line-height: 1.1;
  font-weight: 600;
  margin: 8px 0 20px;
  max-width: 14ch;
}
/* An ink underline, as if drawn by a reader's pen */
.inked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8.5c30-4 62-5.5 98-4.5 34 1 66 2.6 98 .8' fill='none' stroke='%234a5263' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 0.28em;
  padding-bottom: 0.08em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
@media (prefers-color-scheme: dark) {
  .inked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8.5c30-4 62-5.5 98-4.5 34 1 66 2.6 98 .8' fill='none' stroke='%23b4b7bf' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  }
}
.hero .lede { max-width: 34rem; }
.status { margin: 0 0 20px; }
.facts {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}
.facts li { margin: 0; }

/* The try-it page */
.try {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.07);
  padding: 20px 20px 24px;
  position: relative;
}
@media (min-width: 640px) { .try { padding: 24px 36px 32px; } }
.try-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  border-bottom: 2px solid var(--rule-red);
  padding-bottom: 12px;
  margin-bottom: 20px;
}
.try-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 16px;
  counter-reset: step;
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.try-steps li { margin: 0; counter-increment: step; }
.try-steps li::before { content: "0" counter(step) " "; font-variant-numeric: tabular-nums; }
.try-steps li[aria-current="step"] { color: var(--ink); font-weight: 600; }

.running-head {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink-soft);
  margin: 0 0 16px;
}
.passage {
  font-size: 1.1875rem;
  line-height: 1.75;
  hyphens: auto;
  margin-bottom: 12px;
}
.w {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0 1px;
  margin: 0 -1px;
  cursor: pointer;
  border-radius: 3px;
  text-decoration: underline dotted var(--cloth);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.22em;
}
.w:hover { background: color-mix(in srgb, var(--cloth) 10%, transparent); }
.w[aria-pressed="true"] {
  background: color-mix(in srgb, var(--cloth) 16%, transparent);
  text-decoration-style: solid;
}
.try-hint { font-size: 0.9375rem; color: var(--ink-soft); margin: 0; }

.lookup {
  border: 1px solid var(--rule);
  border-left: 4px solid var(--cloth);
  border-radius: 6px;
  padding: 16px 20px;
  background: var(--paper);
  margin-top: 4px;
  animation: settle 220ms ease-out;
}
.lookup:focus { outline: none; }
.lookup-word { font-size: 1.5rem; font-weight: 600; margin: 0; line-height: 1.3; }
.ipa { font-size: 1rem; font-weight: 400; color: var(--ink-soft); }
.pos { font-style: italic; color: var(--ink-soft); margin: 0 0 8px; }
.meaning { font-size: 1.125rem; margin-bottom: 12px; }
.sense-note { margin-top: -4px; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.btn {
  font-size: 1rem;
  font-weight: 600;
  min-height: 44px;
  padding: 10px 22px;
  border-radius: 22px;
  cursor: pointer;
  transition: background-color 120ms ease-out, transform 120ms ease-out;
}
.btn:active { transform: scale(0.98); }
.btn-ink { background: var(--ink-btn); color: var(--on-ink-btn); border: 1px solid var(--ink-btn); }
.btn-card { background: var(--card); color: var(--ink); border: 1px solid var(--ink); }
.actions[data-grade] .btn { flex: 1 1 9rem; }
.textlink {
  font-size: 0.9375rem;
  color: var(--cloth);
  background: none;
  border: 0;
  padding: 12px 0;
  min-height: 44px;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

/* The recall card, as the app shows it */
.try-card { position: relative; animation: settle 220ms ease-out; }
.try-card:focus { outline: none; }
/* Keep the running head clear of the ribbon: centred between two free
   margins when there is room, set to the left of it on a phone. */
.try-card .running-head { padding: 0 96px; }
@media (max-width: 559px) {
  .try-card .running-head { padding: 0 96px 0 0; text-align: left; min-height: 48px; }
}
.card-word {
  font-size: 2.5rem;
  line-height: 1.15;
  text-align: center;
  margin: 8px 0 16px;
}
.card-sentence { font-size: 1.1875rem; line-height: 1.7; }
.asterism { text-align: center; color: var(--ink-soft); margin: 4px 0 8px; letter-spacing: 0.3em; }
.second { font-size: 1rem; color: var(--ink-soft); }
.credit { display: block; font-size: 0.875rem; margin-top: 4px; }
.try-reset { margin: 8px 0 0; text-align: center; }

/* The ribbon: hangs from the top edge of the try-it page with the due date */
.ribbon {
  position: absolute;
  top: -20px;
  right: 0;
  width: 88px;
  padding: 12px 8px 22px;
  background: var(--ribbon);
  color: var(--on-ribbon);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 10px), 0 100%);
  animation: drop 320ms cubic-bezier(0.2, 0.8, 0.3, 1);
}


@keyframes settle { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes drop { from { transform: translateY(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .lookup, .try-card, .ribbon { animation: fade 160ms linear; }
  .btn { transition: none; }
  .btn:active { transform: none; }
}

/* Bands: a full-width strip of card stock between paper sections */
.band {
  background: var(--card);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 48px 0;
}
@media (min-width: 900px) { .band { padding: 72px 0; } }

/* Three ways in */
.ways { display: grid; gap: 32px; }
@media (min-width: 900px) {
  .ways { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 64px; align-items: center; }
}
.ways-text > p:first-of-type { max-width: 36rem; }
.ways-list { list-style: none; padding: 0; margin: 24px 0; }
.ways-list li {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 0 12px;
  padding: 16px 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}
.ways-list li:last-child { border-bottom: 1px solid var(--rule); }
.ways-list p { margin: 0; }
.num {
  font-size: 1.5rem;
  line-height: 1.2;
  color: var(--rule-red);
  font-variant-numeric: tabular-nums lining-nums;
}
.ways-photo { margin: 0; max-width: 26rem; justify-self: center; }
.ways-photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--rule);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* What's in the app */
.features { padding-top: 56px; padding-bottom: 56px; }
@media (min-width: 900px) { .features { padding-top: 80px; padding-bottom: 80px; } }
.bento { display: grid; gap: 16px; margin-top: 24px; }
@media (min-width: 720px) {
  .bento { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tile-methods { grid-column: span 4; grid-row: span 2; }
  .tile-fsrs, .tile-sense { grid-column: span 2; }
  .tile-dict, .tile-yours { grid-column: span 3; }
}
.tile {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 24px;
}
.tile p { margin: 0; }
.tile h3 { font-size: 1.1875rem; margin-bottom: 8px; }
.tile-methods > p { max-width: 36rem; }
.methods {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: grid;
  gap: 0 32px;
}
@media (min-width: 560px) { .methods { grid-template-columns: 1fr 1fr; } }
.methods li {
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  border-top: 1px solid var(--rule);
  margin: 0;
  position: relative;
}
.methods li:first-child { font-weight: 600; grid-column: 1 / -1; }
.methods .small { font-weight: 400; }

.index-list {
  list-style: none;
  padding: 0;
  margin: 32px 0 0;
  display: grid;
  gap: 0 32px;
}
@media (min-width: 720px) { .index-list { grid-template-columns: 1fr 1fr; } }
.index-list li { margin: 0; padding: 12px 0; border-top: 1px solid var(--rule); }

/* Theme preview */
.themes { display: grid; gap: 32px; }
@media (min-width: 900px) {
  .themes { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center; }
}
.theme-pick {
  border: 0;
  padding: 0;
  margin: 24px 0 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-width: 26rem;
}
.theme-pick legend { margin-bottom: 8px; padding: 0; }
.theme-pick label {
  font-size: 0.9375rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px 8px 12px;
  border: 1px solid var(--rule);
  border-radius: 22px;
  background: var(--paper);
  cursor: pointer;
}
.theme-pick input { accent-color: var(--cloth); margin: 0; width: 18px; height: 18px; }
.theme-pick label:has(input:checked) { border-color: var(--ink); }
.theme-pick label:has(input:focus-visible) { outline: 2px solid var(--cloth); outline-offset: 2px; }
.theme-credit { margin: 0; }

.theme-preview {
  --tp-bg: var(--paper);
  --tp-ink: var(--ink);
  --tp-soft: var(--ink-soft);
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid var(--rule);
  background: var(--tp-bg);
  color: var(--tp-ink);
  width: 100%;
  max-width: 22rem;
  aspect-ratio: 9 / 15;
  justify-self: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
  transition: background-color 200ms ease-out, color 200ms ease-out;
}
.tp-night { --tp-bg: #1d1a17; --tp-ink: #ece4d8; --tp-soft: #aba194; }
.tp-sepia { --tp-bg: #eddfc6; --tp-ink: #3b2b1c; --tp-soft: #66513b; }
.tp-painting { --tp-bg: #1d1a17; --tp-ink: #faf7f0; --tp-soft: #faf7f0; }
.tp-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 200ms ease-out;
}
.tp-painting .tp-art { opacity: 1; }
.tp-painting::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(14, 12, 10, 0.66);
}
.tp-page {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 28px;
}
.tp-page .running-head { color: var(--tp-soft); margin-bottom: auto; }
.tp-word { font-size: 2.5rem; line-height: 1.1; margin: 0 0 4px; text-align: center; }
.tp-sub { text-align: center; color: var(--tp-soft); margin: 0 0 24px; font-size: 0.9375rem; }
.tp-sentence { font-size: 1.0625rem; line-height: 1.65; margin: 0 0 16px; }
.tp-meaning { margin: 0 0 16px; font-size: 1rem; }
.tp-credit { font-size: 0.875rem; color: var(--tp-soft); margin: 0 0 auto; }
@media (prefers-reduced-motion: reduce) {
  .theme-preview, .tp-art { transition: none; }
}

.more { padding-top: 56px; padding-bottom: 32px; }
.more .index { grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr)); }
@media (min-width: 1100px) { .more .index { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.home .site-footer { border-top: 1px solid var(--rule); padding-top: 24px; }
.more .index li { display: flex; margin: 0; }
.more .index a { flex: 1; }

/* Without JS the demo and the theme buttons cannot work: hide their controls and
   show the passage as plain text (a noscript line shows one meaning instead). */
.no-js .try-steps, .no-js [data-hint], .no-js .theme-pick { display: none; }
.w:disabled { cursor: text; text-decoration: none; }
.w:disabled:hover { background: none; }
[data-reveal-focus]:focus, [data-after]:focus { outline: none; }
[data-reveal-focus]:focus-visible, [data-after]:focus-visible { outline: 2px solid var(--cloth); outline-offset: 4px; border-radius: 2px; }
