/* The Features page: alternating rows of copy and a small drawn screen from the app. */

.page-hero { padding: 48px 0 80px; }
.page-hero h1 { font: 700 clamp(34px, 7vw, 54px)/1.1 var(--serif); margin: 6px 0 14px; }
.page-hero .lede { color: var(--muted); font-size: 18px; margin: 0 auto 24px; }
.toc { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.toc a {
  font-size: 14px; text-decoration: none; color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule); padding: 7px 12px; border-radius: 999px; transition: border-color 0.15s;
}
.toc a:hover { border-color: var(--accent); color: var(--accent); }

.feature-row { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; padding-block: 48px; scroll-margin-top: 80px; }
.feature-row.flip .feature-visual { order: 2; }
.feature-copy h2 { margin-bottom: 10px; }
.feature-copy > p { color: var(--muted); }
.ticks { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.ticks li { position: relative; padding-left: 28px; }
.ticks li::before {
  content: '✓'; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  color: var(--on-accent); background: var(--accent);
}
.feature-visual { display: flex; gap: 18px; justify-content: center; align-items: center; flex-wrap: wrap; }

.mock-card {
  width: min(340px, 100%); background: var(--surface); border: 1px solid var(--rule); border-radius: 22px;
  padding: 20px; box-shadow: var(--shadow); transition: transform 0.3s ease;
}
.feature-row:hover .mock-card, .feature-row:hover .mini-phone { transform: translateY(-4px) rotate(-0.5deg); }
.pill { display: inline-block; background: var(--accent); color: var(--on-accent); font: 700 11px/1 var(--sans); padding: 4px 7px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mock-card p { margin: 0; }

/* Widget and lock screen. */
.mini-phone {
  width: 200px; height: 330px; border-radius: 32px; padding: 10px; transition: transform 0.3s ease;
  background: linear-gradient(145deg, #2a2724, #0f0e0d); box-shadow: var(--shadow);
}
.mini-phone::before { content: ''; display: block; height: 100%; border-radius: 24px; background: url('/art/red-fuji.jpg') center / cover; }
.mini-phone { position: relative; }
.mini-widget {
  position: absolute; left: 22px; right: 22px; top: 34px; display: grid; justify-items: center; gap: 1px;
  background: #fbf9f4; color: #000; border-radius: 18px; padding: 10px 8px 12px; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
.mw-head { justify-self: start; font: 700 9px/1 var(--sans); letter-spacing: 0.1em; color: #4a4440; }
.mw-head b { background: #b02b26; color: #fff; padding: 2px 4px; border-radius: 3px; margin-right: 4px; }
.mw-kanji { font: 700 60px/1.1 var(--serif); }
.mw-read { font: 12px var(--serif); color: #4a4440; }
.mw-mean { font: 600 13px var(--sans); }
.mw-ex { font: 10px var(--sans); color: #4a4440; margin-top: 2px; }
.mini-lock {
  width: 170px; height: 300px; border-radius: 28px; padding: 18px 12px; display: flex; flex-direction: column; align-items: center; gap: 18px;
  background: linear-gradient(rgba(10, 10, 20, 0.35), rgba(10, 10, 20, 0.6)), url('/art/moon-pine.jpg') center / cover;
  border: 8px solid #1a1816; box-shadow: var(--shadow); color: #fff;
}
.ml-time { font: 300 46px/1 var(--sans); margin-top: 18px; }
.ml-note { width: 100%; background: rgba(255, 255, 255, 0.82); color: #111; border-radius: 12px; padding: 8px 10px; font-size: 13px; }
.ml-note b { font: 700 18px var(--serif); margin-right: 4px; }

/* Kanji page. */
.km-top { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.km-top p { margin: 4px 0 0; }
.km-glyph { font: 700 76px/1 var(--serif); }
.km-reads { font-family: var(--serif); font-size: 15px; border-block: 1px solid var(--rule); padding: 10px 0; }
.km-reads b { color: var(--accent); font-weight: 400; }
.km-words { display: grid; gap: 6px; margin-top: 12px; }
.km-words span { font: 17px var(--serif); background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; padding: 8px 10px; }
.km-words i { font: normal 13px var(--sans); color: var(--muted); margin-left: 6px; }

/* Writing practice. */
.write-mock { position: relative; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden;
  background-image: linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 50% 50%; background-position: center; }
.wm-ghost { font: 400 220px/1 var(--serif); color: var(--ink); opacity: 0.1; }
.write-mock svg { position: absolute; inset: 12%; width: 76%; height: 76%; }
.write-mock path { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 120; stroke-dashoffset: 120; animation: trace 3.2s ease-in-out infinite; }
.write-mock path + path { animation-delay: 0.9s; }
@keyframes trace { 0% { stroke-dashoffset: 120; } 45%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 120; } }
.wm-num { position: absolute; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font: 700 12px/22px var(--sans); text-align: center; }
.wm-num.n1 { top: 18%; left: 52%; } .wm-num.n2 { top: 36%; left: 24%; } .wm-num.n3 { top: 56%; left: 40%; }

/* Kana chart. */
.kana-mock { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.kana-mock span { display: grid; place-items: center; aspect-ratio: 1; font: 24px var(--serif); background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; }
.kana-mock span.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* Grammar. */
.gm-pattern { font: 34px/1.3 var(--serif); margin: 8px 0 0 !important; }
.gm-ex { font: 20px/1.6 var(--serif); margin: 14px 0 4px !important; padding: 12px; background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; }
.gm-ex mark { background: none; color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }

/* Reading passage. */
.pm-tabs { display: flex; border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.pm-tabs span { flex: 1; text-align: center; font-size: 13px; font-weight: 600; padding: 7px 0; }
.pm-tabs span.on { background: var(--accent); color: var(--on-accent); }
.passage-mock p { font: 17px/1.7 var(--serif); padding: 8px 10px; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); margin-top: 8px !important; }

/* Review. */
.review-mock { text-align: center; }
.rm-kanji { font: 700 90px/1.2 var(--serif); }
.rm-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.rm-options span { padding: 10px; border: 1px solid var(--rule); border-radius: 10px; font-weight: 600; background: var(--paper); }
.rm-options span.right { border-color: var(--green); background: color-mix(in srgb, var(--green) 14%, var(--surface)); }

/* Dictionary. */
.jm-search { border: 1px solid var(--rule); border-radius: 10px; padding: 10px 12px; color: var(--ink); background: var(--paper); margin-bottom: 10px; }
.jm-search::before { content: '⌕  '; color: var(--muted); }
.jm-search::after { content: ''; display: inline-block; width: 1px; height: 1.1em; background: var(--accent); margin-left: 2px; vertical-align: middle; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.jm-result { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; padding: 10px 2px; border-bottom: 1px solid var(--rule); }
.jm-result b { font: 700 20px var(--serif); }
.jm-result span { color: var(--muted); font-family: var(--serif); }
.jm-result i { font-style: normal; margin-left: auto; }

/* Practice test. */
.tm-head { display: flex; gap: 10px; align-items: center; font-size: 18px; margin-bottom: 12px !important; }
.tm-head b { color: var(--green); }
.bar { display: grid; grid-template-columns: 90px 1fr; gap: 10px; align-items: center; margin-top: 10px; font-size: 14px; }
.bar i, .pg-level i { display: block; height: 10px; border-radius: 999px; background: linear-gradient(90deg, var(--accent) var(--w), var(--rule) var(--w)); }
.w82 { --w: 82%; } .w75 { --w: 75%; } .w67 { --w: 67%; } .w83 { --w: 83%; } .w72 { --w: 72%; } .w28 { --w: 28%; }

/* Games. */
.games-mock { display: grid; justify-items: center; gap: 10px; }
.hinode { width: 120px; height: 120px; animation: bob 3s ease-in-out infinite; }
.hinode .rays path { stroke: #e8a33a; stroke-width: 6; stroke-linecap: round; fill: none; }
.hinode .face { fill: #f6c445; }
.hinode .eye { fill: #3a2a1a; }
.hinode .cheek { fill: #ef8a72; opacity: 0.8; }
.hinode .smile { fill: none; stroke: #3a2a1a; stroke-width: 3.5; stroke-linecap: round; }
@keyframes bob { 50% { translate: 0 -6px; rotate: 6deg; } }
.hearts { color: var(--accent); letter-spacing: 6px; font-size: 20px; }
.gm-list { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.gm-list span { font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--rule); background: var(--paper); }

/* News. */
.news-mock div { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--rule); }
.news-mock div:last-child { border-bottom: 0; }
.news-mock b { font: 600 15px var(--serif); }
.news-mock span { flex: none; font: 700 11px var(--sans); color: var(--accent); border: 1px solid var(--accent); border-radius: 6px; padding: 3px 6px; }

/* Progress. */
.pg-streak { font-size: 16px; margin-bottom: 12px !important; }
.pg-streak b { font: 700 32px var(--serif); color: var(--accent); margin-right: 4px; }
.pg-chart { display: flex; align-items: flex-end; gap: 5px; height: 90px; margin-bottom: 16px; }
.pg-chart i { flex: 1; height: var(--h); border-radius: 4px 4px 0 0; background: var(--accent); opacity: 0.85; }
.h20 { --h: 20%; } .h30 { --h: 30%; } .h35 { --h: 35%; } .h40 { --h: 40%; } .h45 { --h: 45%; } .h50 { --h: 50%; }
.h55 { --h: 55%; } .h60 { --h: 60%; } .h65 { --h: 65%; } .h70 { --h: 70%; } .h75 { --h: 75%; } .h80 { --h: 80%; }
.h85 { --h: 85%; } .h90 { --h: 90%; }
.pg-level { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; font-weight: 700; font-size: 13px; margin-top: 8px; }

/* Sync. */
.sync-mock { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; justify-items: center; }
.sync-mock .small { grid-column: 1 / -1; }
.sm-phone { width: 74px; height: 128px; border-radius: 16px; border: 5px solid #1a1816; background: var(--paper); display: grid; place-items: center; box-shadow: var(--shadow); }
.sm-phone span { font: 700 34px var(--serif); color: var(--accent); }
.sm-cloud { font-size: 28px; color: var(--accent); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { scale: 1.2; } }

@media (max-width: 820px) {
  .feature-row { grid-template-columns: 1fr; gap: 28px; padding-block: 32px; }
  .feature-row.flip .feature-visual { order: 0; }
}
@media (max-width: 420px) {
  .mini-lock { display: none; }
}
