/* ============================================
   THE LILONG — BASE & RESET
   ============================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--t-3);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  background-image:
    /* Paper grain — fine speckle */
    radial-gradient(circle at 1px 1px, rgba(74, 56, 30, 0.025) 0.5px, transparent 0.5px),
    radial-gradient(circle at 7px 11px, rgba(74, 56, 30, 0.015) 0.5px, transparent 0.5px),
    /* Subtle large-scale variation */
    radial-gradient(ellipse at 20% 30%, rgba(200, 153, 58, 0.04), transparent 60%),
    radial-gradient(ellipse at 80% 70%, rgba(176, 62, 44, 0.03), transparent 60%);
  background-size: 3px 3px, 11px 11px, 100% 100%, 100% 100%;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "ss01" 1;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: var(--cinnabar);
  color: var(--paper);
}

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

a {
  color: var(--cinnabar);
  text-decoration: none;
  text-decoration-color: var(--cinnabar-tint);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.06em;
  transition: color 0.2s, text-decoration-color 0.2s;
}

a:hover {
  color: var(--cinnabar-deep);
  text-decoration: underline;
  text-decoration-color: var(--cinnabar);
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}

input, textarea {
  font: inherit;
  color: inherit;
}

hr {
  border: 0;
  height: 1px;
  background: var(--ink-5);
  opacity: 0.4;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
}

h1 { font-size: var(--t-8); font-weight: 400; font-variation-settings: "opsz" 144, "SOFT" 30, "WONK" 0; }
h2 { font-size: var(--t-7); font-weight: 500; font-variation-settings: "opsz" 96, "SOFT" 0, "WONK" 0; }
h3 { font-size: var(--t-6); font-weight: 500; }
h4 { font-size: var(--t-5); font-weight: 500; }
h5 { font-size: var(--t-4); font-weight: 600; }
h6 { font-size: var(--t-3); font-weight: 600; }

p {
  text-wrap: pretty;
  hanging-punctuation: first allow-end;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--t-1);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cinnabar);
}

.eyebrow-ink {
  font-family: var(--font-mono);
  font-size: var(--t-1);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.lead {
  font-size: var(--t-4);
  line-height: 1.6;
  color: var(--ink-2);
}

.deck {
  font-family: var(--font-display);
  font-size: var(--t-4);
  font-style: italic;
  line-height: 1.55;
  color: var(--ink-3);
}

.dropcap::first-letter {
  font-family: var(--font-display);
  font-size: 5em;
  font-weight: 600;
  line-height: 0.85;
  float: left;
  padding: 0.05em 0.1em 0 0;
  margin: 0.05em 0.05em 0 0;
  color: var(--cinnabar);
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
}

blockquote {
  font-family: var(--font-display);
  font-size: var(--t-5);
  font-style: italic;
  line-height: 1.45;
  color: var(--ink-2);
  padding-left: var(--s-4);
  border-left: 2px solid var(--cinnabar);
  margin: var(--s-5) 0;
}

blockquote cite {
  display: block;
  margin-top: var(--s-2);
  font-style: normal;
  font-family: var(--font-mono);
  font-size: var(--t-2);
  color: var(--ink-4);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

em { font-style: italic; }
strong { font-weight: 600; }

.ch, .zh {
  font-family: var(--font-ch);
  font-weight: 500;
}

.zh-display {
  font-family: var(--font-ch-display);
  font-weight: 600;
  line-height: 1.05;
}

.hand {
  font-family: var(--font-hand);
  font-size: 1.15em;
}

.mono {
  font-family: var(--font-mono);
}

.serif {
  font-family: var(--font-body);
}

.display {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "SOFT" 50, "WONK" 0;
}

.text-cinnabar { color: var(--cinnabar); }
.text-ink { color: var(--ink); }
.text-ink-3 { color: var(--ink-3); }
.text-ink-4 { color: var(--ink-4); }

.text-center { text-align: center; }
.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }

.fs-1 { font-size: var(--t-1); }
.fs-2 { font-size: var(--t-2); }
.fs-3 { font-size: var(--t-3); }
.fs-4 { font-size: var(--t-4); }
.fs-5 { font-size: var(--t-5); }
.fs-6 { font-size: var(--t-6); }

.uppercase {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: var(--t-1);
  font-weight: 500;
}

.hallmarks {
  font-family: var(--font-mono);
  font-size: var(--t-1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.byline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--t-3);
  color: var(--ink-3);
}

/* ============================================
   DECORATIONS
   ============================================ */

.paper {
  background: var(--paper);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(74, 56, 30, 0.025) 0.5px, transparent 0.5px);
  background-size: 3px 3px;
}

.deckle {
  /* A torn paper edge */
  --mask:
    radial-gradient(1.4px at 1.4px 1.4px, #000 99%, transparent 100%) 0 0/3.4px 3.4px,
    linear-gradient(#000, #000);
  -webkit-mask: var(--mask);
  mask: var(--mask);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

.halftone {
  background-image:
    radial-gradient(circle at 1px 1px, var(--ink) 0.6px, transparent 0.7px);
  background-size: 3px 3px;
}

.duotone-ink-cinnabar {
  filter: grayscale(100%) contrast(1.05) sepia(0.4);
  mix-blend-mode: multiply;
}

.duotone-ink-ochre {
  filter: grayscale(100%) contrast(1.05) sepia(0.3);
  mix-blend-mode: multiply;
}

.duotone-deep {
  filter: contrast(1.1) brightness(0.95) saturate(0.5);
}

.paper-stamp {
  display: inline-block;
  padding: 0.1em 0.4em;
  border: 1px solid var(--cinnabar);
  color: var(--cinnabar);
  font-family: var(--font-mono);
  font-size: var(--t-1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: rotate(-2deg);
}

.paper-stamp.ink {
  border-color: var(--ink);
  color: var(--ink);
}

.paper-stamp.sage {
  border-color: var(--sage);
  color: var(--sage);
}

.paper-stamp.ochre {
  border-color: var(--ochre);
  color: var(--ochre);
}

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  margin: var(--s-6) 0;
  color: var(--ink-4);
}

.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ink-5);
  opacity: 0.5;
}

.divider-symbol {
  font-family: var(--font-ch);
  font-size: var(--t-5);
  color: var(--cinnabar);
}

.dotline {
  letter-spacing: 0.4em;
  color: var(--ink-5);
}

/* ============================================
   PRINT-PAGE / EDITORIAL GRID
   ============================================ */

.page {
  width: 100%;
  padding: var(--s-7) var(--w-margin);
  max-width: var(--w-page);
  margin: 0 auto;
}

.page-content {
  width: 100%;
  padding: var(--s-7) var(--w-margin);
  max-width: calc(var(--w-content) + var(--w-margin) * 2);
  margin: 0 auto;
}

.page-wide {
  width: 100%;
  padding: var(--s-7) var(--w-margin);
  max-width: var(--w-wide);
  margin: 0 auto;
}

.section {
  position: relative;
  padding: var(--s-9) 0;
}

.section + .section {
  border-top: 1px solid var(--ink-5);
  border-top-style: dashed;
  border-top-width: 1px;
  opacity: 1;
}

@media (max-width: 720px) {
  :root {
    --w-margin: 5vw;
    --s-9: 5rem;
    --s-10: 8rem;
  }
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.5rem; }
  body { font-size: 0.95rem; }
}

@media (max-width: 480px) {
  :root {
    --w-margin: 4vw;
  }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
}
