/* Hanzi Daily — static site shared styles (ink & paper) */

:root {
  --paper: #faf7f1;
  --paper-2: #f4eee3;
  --paper-3: #ece3d3;
  --ink: #1b1811;
  --ink-2: #4a4438;
  --ink-3: #7d7565;
  --line: #e2d9c8;
  --accent: #b8410f;
  --accent-ink: #fff6ee;
  --shadow: 0 1px 2px rgba(27, 24, 17, 0.04), 0 12px 32px -12px rgba(27, 24, 17, 0.22);
  --radius: 16px;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --han: 'WenKai', 'Songti SC', 'Noto Serif CJK SC', serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141310;
    --paper-2: #1b1a15;
    --paper-3: #24221b;
    --ink: #f2ede2;
    --ink-2: #cfc7b6;
    --ink-3: #948c7b;
    --line: #322e27;
    --accent: #e2703c;
    --accent-ink: #1a120c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 40px -16px rgba(0, 0, 0, 0.7);
  }
}

@font-face {
  font-family: 'WenKai';
  src: url('wenkai.woff2') format('woff2');
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16.5px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.han {
  font-family: var(--han);
  font-weight: 400;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

img {
  max-width: 100%;
  height: auto;
}

.wrap {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

/* ------------------------------------------------------------------ top nav */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: saturate(1.2) blur(12px);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  border-bottom: 1px solid var(--line);
}

.top__in {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(160deg, #fdfbf6, #eadfcd);
  color: #1c1913;
  font-size: 22px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(28, 25, 19, 0.09);
}

@media (prefers-color-scheme: dark) {
  .brand__mark {
    background: linear-gradient(160deg, #f6f0e3, #dccfba);
  }
}

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

.nav a {
  color: var(--ink-2);
  text-decoration: none;
}

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

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
  padding: clamp(56px, 9vw, 104px) 0 clamp(40px, 6vw, 72px);
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

h1 {
  margin: 0 0 20px;
  font-family: var(--serif);
  font-size: clamp(34px, 4.4vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.lede {
  margin: 0 0 28px;
  font-size: clamp(17px, 1.5vw, 19px);
  color: var(--ink-2);
  max-width: 46ch;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
  font: 600 15px/1 var(--sans);
  text-decoration: none;
  transition: transform 0.12s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
  box-shadow: var(--shadow);
}

.fine {
  margin: 16px 0 0;
  font-size: 13.5px;
  color: var(--ink-3);
}

.hero__art {
  position: relative;
}

.hero__art img {
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--paper);
}

.hero__glyph {
  position: absolute;
  right: -6px;
  top: -58px;
  font-size: 150px;
  line-height: 1;
  color: color-mix(in srgb, var(--ink) 7%, transparent);
  pointer-events: none;
  user-select: none;
}

/* ------------------------------------------------------------------ sections */

section {
  padding: clamp(44px, 6vw, 76px) 0;
  border-top: 1px solid var(--line);
}

.section__head {
  max-width: 62ch;
  margin-bottom: 34px;
}

h2 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  font-weight: 600;
}

.section__head p {
  margin: 0;
  color: var(--ink-2);
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.card {
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--paper-2);
}

.card h3 {
  margin: 0 0 6px;
  font-size: 15.5px;
  letter-spacing: -0.005em;
}

.card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
}

.shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.shot {
  margin: 0;
}

.shot img {
  display: block;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.shot figcaption {
  margin-top: 9px;
  font-size: 13px;
  color: var(--ink-3);
}

/* ------------------------------------------------------------------ pricing */

.pricing {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.pricing__terms {
  margin: 18px auto 0;
  max-width: 62ch;
  text-align: center;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-3);
}

.pricing__terms a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.plan {
  display: flex;
  flex-direction: column;
  padding: 26px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--paper-2);
}

.plan--pro {
  background: var(--paper);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: var(--shadow);
}

.plan__name {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.plan__price {
  margin: 8px 0 2px;
  font-family: var(--serif);
  font-size: 40px;
  line-height: 1;
  letter-spacing: -0.02em;
}

.plan__note {
  font-size: 13.5px;
  color: var(--ink-3);
}

.plan ul {
  margin: 18px 0 24px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
  font-size: 14.5px;
  color: var(--ink-2);
}

.plan li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: start;
}

.plan li::before {
  content: '✓';
  color: var(--accent);
  font-weight: 700;
  line-height: 1.5;
}

.plan .btn {
  margin-top: auto;
  justify-content: center;
}

/* ---------------------------------------------------------------------- faq */

.faq {
  max-width: 760px;
}

.faq details {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15.5px;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  float: right;
  color: var(--ink-3);
  font-weight: 400;
}

.faq details[open] summary::after {
  content: '–';
}

.faq p {
  margin: 10px 0 0;
  color: var(--ink-2);
  font-size: 15px;
}

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

.foot {
  border-top: 1px solid var(--line);
  padding: 36px 0 56px;
  font-size: 13.5px;
  color: var(--ink-3);
}

.foot__in {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: baseline;
  justify-content: space-between;
}

.foot a {
  color: var(--ink-2);
  text-decoration: none;
}

.foot a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* ------------------------------------------------------------- doc pages */

.doc {
  max-width: 760px;
  padding: 56px 0 80px;
  font-size: 16px;
}

.doc h1 {
  font-size: clamp(30px, 3.6vw, 42px);
  margin-bottom: 12px;
}

.doc h2 {
  font-size: 22px;
  margin: 40px 0 10px;
}

.doc h3 {
  font-size: 16.5px;
  margin: 26px 0 6px;
}

.doc p,
.doc li {
  color: var(--ink-2);
}

.doc code {
  font: 500 13.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  padding: 1px 5px;
  border-radius: 5px;
}

.doc hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 32px 0;
}

.doc blockquote {
  margin: 16px 0;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--line);
  color: var(--ink-3);
}

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

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero__glyph {
    display: none;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .shots {
    grid-template-columns: 1fr;
  }
  .pricing {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .wrap,
  .top__in {
    width: calc(100% - 32px);
  }
  .nav {
    gap: 14px;
    font-size: 13.5px;
  }
  .brand span:last-child {
    display: none;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .cta .btn {
    width: 100%;
    justify-content: center;
  }
}
