/* The colours are JournalTheme's (lib/ui/core/theme.dart); the page is paper,
   so it has one light theme, like the app. */
@font-face {
  font-family: "Gaegu";
  src: url("/assets/fonts/gaegu-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Gaegu";
  src: url("/assets/fonts/gaegu-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #FBF7EE;
  --card: #FFFDF7;
  --ink: #3A312A;
  --ink-2: #7A6F66;
  --yellow: #FCE89B;
  --mint: #C8E6C9;
  --pink: #F8BBD0;
  --wood: #D7B48C;
  --wood-dark: #B08962;
  --stamp: #D9534F;
  --green: #4A6652;
  --sans: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand: "Gaegu", var(--sans);
  /* One hand-drawn outline for every card, note and button. */
  --wobble: 30px 22px 28px 20px / 22px 30px 20px 28px;
  --wobble-2: 20px 30px 22px 28px / 28px 20px 30px 22px;
  --pill: 30px 38px 32px 40px / 40px 30px 38px 32px;
  --pill-2: 38px 30px 40px 32px / 30px 40px 32px 38px;
  --shadow: 2px 3px 0 rgba(58, 49, 42, 0.16);
  --page: 1120px;
}
html[lang="zh-Hans"] {
  --sans: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
}
html[lang="en"] {
  --sans: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
/* Paper grain: fixed, never repainted while scrolling. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .23 0 0 0 0 .19 0 0 0 0 .16 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
header, main, footer { position: relative; z-index: 1; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ol, figure { margin: 0; }
ol { padding: 0; list-style: none; }

h1, h2 { font-weight: 800; letter-spacing: -0.01em; line-height: 1.25; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.15rem; font-weight: 700; line-height: 1.4; }
.lede { font-size: 1.12rem; color: var(--ink-2); max-width: 34em; text-wrap: pretty; }

/* The app's own title pattern: a handwritten Korean line over the heading. */
.ko {
  font-family: var(--hand);
  font-weight: 700;
  font-size: 1.7rem;
  line-height: 1.2;
  color: var(--green);
  margin-bottom: 0.15em;
}
mark {
  color: inherit;
  background: linear-gradient(transparent 52%, var(--yellow) 52%, var(--yellow) 94%, transparent 94%);
  padding: 0 0.12em;
  margin: 0 -0.06em;
  border-radius: 4px 9px 5px 8px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Header */
.top {
  max-width: var(--page);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.1rem; white-space: nowrap; }
.brand img { border-radius: 9px; }
.langs { display: flex; gap: 4px; font-size: 0.92rem; }
.langs a { padding: 6px 10px; text-decoration: none; color: var(--ink-2); border-radius: 999px; white-space: nowrap; }
.langs a:hover { color: var(--ink); }
.langs .narrow { display: none; }
.langs a[aria-current="true"] { color: var(--ink); background: var(--yellow); }

/* Buttons: the app's SketchButton */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 10px 28px;
  border: 1.8px solid var(--ink);
  border-radius: var(--pill);
  box-shadow: var(--shadow);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s;
}
.btn-yellow { background: var(--yellow); }
.btn-mint { background: var(--mint); border-radius: var(--pill-2); }
.btn:hover { transform: translateY(-2px); box-shadow: 3px 6px 0 rgba(58, 49, 42, 0.16); }
.btn:active { transform: scale(0.96); box-shadow: 1px 1px 0 rgba(58, 49, 42, 0.16); }
.btn:focus-visible, .langs a:focus-visible, .brand:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }

/* Screenshots */
.phone {
  border: 1.8px solid var(--ink);
  border-radius: 34px;
  box-shadow: 5px 8px 0 rgba(58, 49, 42, 0.12);
  background: var(--card);
}
.tape {
  position: absolute;
  z-index: 2;
  width: 118px;
  height: 30px;
  opacity: 0.85;
  background: repeating-linear-gradient(115deg, #b9dcc0 0 7px, #d9eedd 7px 14px);
}
.tape-a { top: -12px; left: 12%; transform: rotate(-7deg); }
.tape-b { top: -14px; right: 18px; transform: rotate(5deg); background: repeating-linear-gradient(115deg, #f3c9d6 0 7px, #fbe3ea 7px 14px); }
.tape-d { top: -13px; right: 14%; transform: rotate(6deg); }
.tape-c { top: -13px; left: 22px; transform: rotate(-4deg); background: repeating-linear-gradient(115deg, #f1dc8c 0 7px, #fbf0be 7px 14px); }

/* Hero */
.hero {
  max-width: var(--page);
  margin: 0 auto;
  padding: 28px 24px 64px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 56px;
  align-items: center;
}
.hero-copy .lede { margin-top: 18px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.hero-shot { position: relative; justify-self: center; width: min(100%, 292px); transform: rotate(2deg); }
.stamp {
  position: absolute;
  right: -46px;
  bottom: 44px;
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  border: 3px solid var(--stamp);
  border-radius: 50%;
  outline: 1.5px solid var(--stamp);
  outline-offset: -8px;
  color: var(--stamp);
  background: rgba(255, 253, 247, 0.9);
  font-family: var(--hand);
  font-weight: 700;
  font-size: 1.12rem;
  line-height: 1.05;
  text-align: center;
  transform: rotate(-12deg);
}
.stamp i { font-style: normal; }

/* Three steps */
.steps { max-width: var(--page); margin: 0 auto; padding: 72px 24px; }
.step-row {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px;
  align-items: start;
}
.step-row li { position: relative; }
.step-row img {
  border: 1.8px solid var(--ink);
  border-radius: 22px;
  box-shadow: var(--shadow);
  margin-top: 18px;
}
.step-row li:nth-child(1) img { transform: rotate(-1.2deg); }
.step-row li:nth-child(3) img { transform: rotate(1deg); }
.step-row li + li::before {
  content: "➔";
  position: absolute;
  left: -30px;
  top: 6px;
  font-size: 1.5rem;
  color: var(--ink-2);
}
.step-row p { color: var(--ink-2); min-height: 3.5em; }
.steps-after {
  margin-top: 40px;
  max-width: 36em;
  padding-left: 16px;
  border-left: 4px solid var(--yellow);
  font-weight: 600;
}

/* What the journal holds */
.inside { max-width: var(--page); margin: 0 auto; padding: 72px 24px; }
.notes {
  margin-top: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 300px) minmax(0, 1fr);
  grid-template-areas:
    "a shot b"
    "c shot d"
    "e e e";
  gap: 26px 34px;
  align-items: stretch;
}
.na { grid-area: a; } .nb { grid-area: b; } .nc { grid-area: c; } .nd { grid-area: d; } .ne { grid-area: e; }
.shelf-shot { grid-area: shot; align-self: center; transform: rotate(-1.5deg); }
.note {
  position: relative;
  padding: 26px 26px 24px;
  border: 1.8px solid var(--ink);
  border-radius: var(--wobble);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.note:nth-child(even) { border-radius: var(--wobble-2); }
.note-yellow { background: var(--yellow); transform: rotate(-1deg); }
.note-pink { background: var(--pink); transform: rotate(1.2deg); }
.note-mint { background: var(--mint); transform: rotate(0.8deg); }
.note-cream { background: var(--card); transform: rotate(-0.8deg); }
.note-wood {
  background: var(--wood);
  border-color: var(--wood-dark);
  border-radius: 10px;
  box-shadow: 0 7px 0 var(--wood-dark);
  padding: 18px 26px;
  text-align: center;
}
.fig { font-weight: 700; font-size: 1.08rem; line-height: 1.5; }
.fig b {
  display: block;
  font-family: var(--hand);
  font-size: 3.1rem;
  line-height: 1.05;
}
.fig-pair { display: flex; flex-wrap: wrap; gap: 4px 28px; }
.fig-line b { display: inline; font-size: 2.2rem; margin-right: 0.1em; vertical-align: -0.1em; }
.note p + p { font-size: 0.98rem; }

/* Sentence parser */
.parse {
  max-width: var(--page);
  margin: 0 auto;
  padding: 72px 24px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 64px;
  align-items: center;
}
.parse-shot { position: relative; justify-self: center; width: min(100%, 400px); transform: rotate(-1.5deg); }
.parse-shot img { border: 1.8px solid var(--ink); border-radius: 22px; box-shadow: 5px 8px 0 rgba(58, 49, 42, 0.12); }
.parse-copy .lede { margin-top: 16px; }

/* Review and sync */
.keep {
  max-width: var(--page);
  margin: 0 auto;
  padding: 56px 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 56px;
}
.keep-item { padding-top: 22px; border-top: 1.8px dashed var(--ink); }
.keep-item h2 { font-size: clamp(1.3rem, 2.2vw, 1.65rem); }
.keep-item p { margin-top: 10px; color: var(--ink-2); max-width: 30em; }

/* Download */
.download { max-width: var(--page); margin: 0 auto; padding: 72px 24px 88px; text-align: center; }
.dl-cards {
  margin: 40px auto 0;
  max-width: 760px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}
.dl-card {
  padding: 30px 26px 32px;
  background: var(--card);
  border: 1.8px solid var(--ink);
  border-radius: var(--wobble);
  box-shadow: var(--shadow);
  background-image:
    linear-gradient(rgba(58, 49, 42, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(58, 49, 42, 0.05) 1px, transparent 1px);
  background-size: 22px 22px;
}
.dl-card + .dl-card { border-radius: var(--wobble-2); }
.dl-card h3 { font-family: var(--hand); font-size: 2rem; line-height: 1.1; }
.dl-card p { margin: 8px 0 22px; color: var(--ink-2); font-size: 0.98rem; }
.version { margin-top: 26px; color: var(--ink-2); font-size: 0.9rem; }

.foot {
  max-width: var(--page);
  margin: 0 auto;
  padding: 26px 24px 40px;
  border-top: 1.8px dashed rgba(58, 49, 42, 0.35);
  color: var(--ink-2);
  font-size: 0.9rem;
}

/* Motion: the hero settles in once; cards rise as they enter the view. */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both; }
  .hero-copy > :nth-child(2) { animation-delay: 0.06s; }
  .hero-copy > :nth-child(3) { animation-delay: 0.12s; }
  .hero-copy > :nth-child(4) { animation-delay: 0.18s; }
  .hero-shot { animation: settle 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both; }
  .stamp { animation: stamp 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) 0.9s both; }
  @supports (animation-timeline: view()) {
    .reveal {
      animation: rise-in linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
  }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes settle { from { opacity: 0; transform: translateY(26px) rotate(5deg); } }
@keyframes stamp { from { opacity: 0; transform: rotate(-12deg) scale(1.6); } }
@keyframes rise-in { from { opacity: 0; translate: 0 22px; } }

/* Narrow screens: one column, in reading order. */
@media (max-width: 860px) {
  body { font-size: 16px; }
  .top { padding: 14px 18px; }
  .langs a { padding: 6px 10px; }
  .langs .wide { display: none; }
  .langs .narrow { display: inline; }
  .hero { grid-template-columns: 1fr; gap: 44px; padding: 20px 18px 56px; }
  .hero-shot { width: min(78%, 300px); }
  .stamp { right: -22px; width: 92px; height: 92px; font-size: 1rem; }
  .cta-row .btn { flex: 1 1 100%; }
  .steps, .inside, .parse, .download { padding: 52px 18px; }
  .step-row { grid-template-columns: 1fr; gap: 44px; max-width: 380px; margin-left: auto; margin-right: auto; }
  .step-row li + li::before { content: none; }
  .notes {
    grid-template-columns: 1fr;
    grid-template-areas: "a" "b" "shot" "c" "d" "e";
    gap: 24px;
  }
  .shelf-shot { justify-self: center; width: min(78%, 300px); }
  .parse { grid-template-columns: 1fr; gap: 36px; }
  .parse-copy { order: -1; }
  .keep { grid-template-columns: 1fr; gap: 36px; padding: 40px 18px; }
  .dl-cards { grid-template-columns: 1fr; max-width: 420px; }
  .foot { padding: 22px 18px 34px; }
}
