/* Seewe Chinese — marketing site
   Palette, type, and texture mirror src/constants/theme.ts from the app:
   ruled notebook paper, hand-inked card outlines, a pink pen + yellow
   highlighter marker, torn washi tape. */

@font-face {
  font-family: 'SeeweKai';
  src: url('../fonts/SeeweKai-subset.woff2') format('woff2');
  font-display: swap;
  unicode-range: U+4E00-9FFF;
}

:root {
  --bg: #FBF7EE;
  --surface: #FFFEFA;
  --bg-selected: #F1EADB;
  --text: #1F2A44;
  --text-secondary: #56617A;
  --tint: #C2456F;
  --on-tint: #ffffff;
  --ink: #1F2A44;
  --highlight: rgba(242, 169, 59, 0.42);
  --tape: rgba(226, 112, 152, 0.55);
  --rule: rgba(70, 120, 180, 0.16);
  --border: rgba(31, 42, 68, 0.14);
  --rule-spacing: 34px;
  --max-width: 1040px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151B26;
    --surface: #1E2633;
    --bg-selected: rgba(239, 232, 216, 0.10);
    --text: #EFE8D8;
    --text-secondary: #A3ABBA;
    --tint: #F08CB0;
    --on-tint: #1A0E13;
    --ink: #D9D2C2;
    --highlight: rgba(224, 160, 64, 0.34);
    --tape: rgba(240, 140, 176, 0.5);
    --rule: rgba(150, 180, 230, 0.10);
    --border: rgba(239, 232, 216, 0.16);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background-color: var(--bg);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--rule-spacing) - 1px),
    var(--rule) calc(var(--rule-spacing) - 1px),
    var(--rule) var(--rule-spacing)
  );
  color: var(--text);
  font-family: 'Patrick Hand', 'Comic Sans MS', cursive, sans-serif;
  font-size: 19px;
  line-height: 1.5;
  overflow-x: hidden;
}

.hanzi, [lang="zh"] {
  font-family: 'SeeweKai', 'Patrick Hand', sans-serif;
  font-weight: 400;
}

a { color: var(--tint); }

img, svg { max-width: 100%; display: block; }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- header ---------- */

.site-header {
  position: relative;
  z-index: 10;
  padding: 20px 0;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand img { width: 38px; height: 38px; }

/* The logo's strokes are drawn near-black in the source file; invert them
   in dark mode so they stay legible against the navy paper. */
@media (prefers-color-scheme: dark) {
  .brand img, .site-footer .brand img { filter: invert(1) brightness(1.5); }
}

.brand span {
  font-size: 26px;
  color: var(--text);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 19px;
}

.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
}

.site-nav a:hover { color: var(--tint); }

/* ---------- buttons ---------- */

/* Matches the app's own Button component (src/components/button.tsx): a
   SketchFrame — a hand-wobbled rectangle, never a pill — filled solid.
   Primary fills with the highlighter color, secondary/ghost with the paper. */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  font-family: inherit;
  font-size: 19px;
  text-decoration: none;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  --sketch-fill: var(--surface);
}

.btn-primary {
  color: var(--ink);
  --sketch-fill: var(--highlight);
}

.btn-ghost {
  color: var(--text-secondary);
  --sketch-fill: var(--surface);
}

.btn[disabled], .btn.is-soon {
  cursor: default;
  opacity: 0.9;
}

.btn .soon-tag {
  font-size: 13px;
  color: var(--text-secondary);
  border: 1.5px dashed var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 2px;
}

/* ---------- sketch frame (hand-wobbled card outline, see js/sketch.js) ---------- */

.sketch {
  position: relative;
}

.sketch > .sketch-svg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.sketch > .sketch-content {
  position: relative;
  z-index: 1;
}

/* Everything else inside a .sketch card besides the injected frame itself —
   without this, the frame's opaque paper fill (position:absolute) paints
   over static-flow siblings, since absolutely-positioned elements paint
   after in-flow ones regardless of DOM order. */
.sketch > :not(.sketch-svg):not(.tape-svg):not(.phone-btn) {
  position: relative;
  z-index: 1;
}

/* ---------- tape ---------- */

.tape-svg {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  width: 66px;
  height: 22px;
  z-index: 2;
  pointer-events: none;
}

/* ---------- highlight marker ---------- */

.hl { position: relative; white-space: nowrap; }
.hl .mark {
  position: absolute;
  left: -4px; right: -6px; top: 46%; bottom: 2%;
  background: var(--highlight);
  border-radius: 3px 10px 4px 12px;
  transform: rotate(-1.5deg);
  z-index: -1;
}
.hl span { position: relative; }

/* ---------- doodles ---------- */

.doodle {
  position: absolute;
  color: var(--ink);
  opacity: 0.9;
  pointer-events: none;
  z-index: 0;
}

.doodle svg [fill="white"] { fill: var(--bg); }
.doodle svg { width: 100%; height: 100%; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: 50px 0 70px;
  overflow: hidden;
}

.hero .wrap {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}

.hero h1 {
  font-size: 54px;
  line-height: 1.12;
  margin: 0 0 20px;
  color: var(--text);
}

.hero .hanzi-accent {
  display: block;
  font-size: 30px;
  color: var(--tint);
  margin-bottom: 10px;
}

.hero p.lede {
  font-size: 21px;
  color: var(--text-secondary);
  max-width: 48ch;
  margin: 0 0 30px;
}

.hero .cta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* phone mockup — a real device has true mechanical rounded corners, not a
   hand-sketched wobble, so the frame is a plain ink-colored rounded border
   (the sketch wobble is for flat paper elements elsewhere on the page)
   around a real screenshot. */

.phone-shell {
  position: relative;
  justify-self: center;
  width: 272px;
  height: 560px;
  border-radius: 46px;
  border: 3px solid var(--ink);
  padding: 7px;
  background: var(--surface);
  box-shadow: 10px 12px 0 -4px var(--highlight);
}

.phone-btn {
  position: absolute;
  background: var(--ink);
  opacity: 0.85;
  border-radius: 2px;
}
.phone-btn-action { left: -3px; top: 118px; width: 3px; height: 28px; }
.phone-btn-up     { left: -3px; top: 164px; width: 3px; height: 38px; }
.phone-btn-down   { left: -3px; top: 210px; width: 3px; height: 38px; }
.phone-btn-power  { right: -3px; top: 176px; width: 3px; height: 62px; }

.phone {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 40px;
  background: #151E33;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.08);
}

/* A real device screenshot (see assets/images/app-home-preview.png), filling
   the screen the same way the old hand-built lock-screen mockup did. */
.phone-screenshot {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* ---------- section titles ---------- */

section { position: relative; padding: 50px 0; }

.section-title {
  font-size: 36px;
  margin: 0 0 8px;
  text-align: center;
}

.section-sub {
  text-align: center;
  color: var(--text-secondary);
  font-size: 19px;
  max-width: 56ch;
  margin: 0 auto 40px;
}

/* A quiet line under a grid, for a note rather than a heading. */
.section-note {
  text-align: center;
  color: var(--text-secondary);
  font-size: 16px;
  max-width: 56ch;
  margin: 32px auto 0;
}

/* ---------- feature cards ---------- */

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 24px;
  position: relative;
}

.feature {
  background: var(--surface);
  padding: 26px 22px 24px;
  border-radius: 14px;
}

.feature .f-icon {
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  color: var(--tint);
}

.feature h3 {
  font-size: 23px;
  margin: 0 0 8px;
}

.feature p {
  color: var(--text-secondary);
  font-size: 17px;
  margin: 0;
  line-height: 1.5;
}

/* ---------- how it works ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  counter-reset: step;
  position: relative;
}

.step {
  background: var(--surface);
  border-radius: 14px;
  padding: 22px 18px;
  text-align: center;
}

.step .step-num {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  font-size: 18px;
  background: var(--highlight);
}

.step h4 { margin: 0 0 6px; font-size: 19px; }
.step p { margin: 0; color: var(--text-secondary); font-size: 15px; }

/* ---------- trending ---------- */

.trending-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  position: relative;
}

.trend-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 24px 20px;
  text-align: center;
}

.trend-card .t-hanzi {
  font-family: 'SeeweKai', sans-serif;
  font-size: 30px;
}

.trend-card .t-pinyin {
  color: var(--tint);
  font-size: 17px;
  margin-top: 4px;
}

.trend-card .t-english {
  color: var(--text-secondary);
  font-size: 16px;
  margin-top: 6px;
}

/* ---------- footer ---------- */

.site-footer {
  position: relative;
  padding: 40px 0 50px;
  border-top: 1.5px solid var(--border);
  margin-top: 30px;
}

.site-footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.site-footer .brand img { width: 26px; height: 26px; }
.site-footer .brand span { font-size: 19px; }

.footer-links {
  display: flex;
  gap: 18px;
  font-size: 17px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-links a:hover { color: var(--tint); }

.footer-note {
  width: 100%;
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 6px;
}

/* ---------- responsive ---------- */

@media (max-width: 880px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero h1 { font-size: 40px; }
  .phone-shell { justify-self: center; width: 240px; height: 494px; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .trending-cards { grid-template-columns: 1fr; }
  .site-nav { display: none; }
}

@media (max-width: 520px) {
  body { font-size: 18px; }
  .features { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .hero h1 { font-size: 34px; }
  .section-title { font-size: 28px; }
}
