/* =========================================================================
   JING 静 — A QUIET BALL SPECIMEN · VOL. 01 · SS26
   Editorial broadsheet variant. Massimo Vignelli meets Aesop product card.
   Black ink on cream paper. One accent: OXBLOOD #7A2E2E.
   ========================================================================= */

/* -------- Tokens -------- */
:root {
  /* Paper & ink */
  --paper:        #F4ECDA;   /* cream paper */
  --paper-2:      #F8F2E5;   /* lighter paper */
  --ink:          #1A1814;   /* ink */
  --walnut:       #5C4533;   /* walnut */
  --rule:         rgba(26, 24, 20, 0.55);
  --rule-soft:    rgba(26, 24, 20, 0.18);

  /* The single accent — committed. */
  --accent:       #7A2E2E;   /* oxblood */

  /* Type */
  --serif:        "Fraunces", "Noto Serif SC", Georgia, serif;
  --cn:           "Noto Serif SC", "Fraunces", serif;
  --sans:         "Inter", system-ui, -apple-system, Segoe UI, sans-serif;
  --mono:         "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Rhythm */
  --gutter:       24px;
  --gutter-l:     32px;
  --measure:      62ch;
}

/* -------- Reset-ish -------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

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

button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; color: inherit; }

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

/* -------- Body -------- */
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 400;
  font-variation-settings: "opsz" 14, "SOFT" 50;
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: 0.005em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;

  /* Subtle vertical paper variation */
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.4), transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(92,69,51,0.06), transparent 70%);
}

.mono { font-family: var(--mono); letter-spacing: 0.04em; }
.mono { font-size: 11px; text-transform: uppercase; }

sup.fn {
  color: var(--accent);
  font-family: var(--serif);
  font-size: 0.7em;
  vertical-align: super;
  line-height: 0;
  margin-left: 0.05em;
  font-feature-settings: "sups";
}

em { font-style: italic; }

/* -------- Paper grain overlay -------- */
.grain {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.32;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='4'/><feColorMatrix values='0 0 0 0 0.10  0 0 0 0 0.09  0 0 0 0 0.08  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
}

/* =========================================================================
   TITLE PLATE
   ========================================================================= */
.plate {
  position: relative;
  padding: 32px var(--gutter) 36px;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.plate__rule {
  height: 1px;
  background: var(--ink);
  width: 100%;
}
.plate__rule--bot { margin-top: auto; }

.plate__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-top: 14px;
  color: var(--ink);
}

.plate__title {
  margin: 8vh 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings: "opsz" 144, "SOFT" 30, "WONK" 0;
  line-height: 0.86;
  letter-spacing: -0.045em;
}
.plate__title-en {
  display: block;
  font-size: clamp(110px, 38vw, 220px);
  color: var(--ink);
}
.plate__title-cn {
  display: block;
  font-family: var(--cn);
  font-size: clamp(140px, 46vw, 260px);
  line-height: 0.9;
  font-weight: 500;
  color: var(--ink);
  margin-top: -0.05em;
  margin-left: -0.04em;
}

.plate__sub {
  margin: 4vh 0 0;
  color: var(--ink);
  line-height: 1.7;
  font-size: 10px;
}

/* Stamp */
.stamp {
  position: absolute;
  top: 40%;
  right: var(--gutter);
  transform: rotate(-4deg);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  opacity: 0.92;
}
.stamp__row {
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--accent);
}


/* =========================================================================
   SECTIONS / SPECIMEN
   ========================================================================= */
.specimen {
  position: relative;
  padding: 56px var(--gutter) 56px;
  border-top: 1px solid var(--rule);
}

.section-head {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: start;
  gap: 8px;
  margin-bottom: 28px;
}

.numeral {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
  padding-top: 8px;
  line-height: 1;
}

.section-h {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings: "opsz" 72, "SOFT" 40;
  font-style: italic;
  font-size: clamp(34px, 9vw, 56px);
  line-height: 0.98;
  letter-spacing: -0.02em;
}
.section-h__cn {
  display: block;
  font-style: normal;
  font-family: var(--cn);
  font-weight: 500;
  font-size: 0.42em;
  letter-spacing: 0.06em;
  margin-top: 6px;
  color: var(--walnut);
  padding-top: 6px;
  border-top: 0.5px solid var(--rule-soft);
  width: fit-content;
}

/* Body copy */
.body {
  max-width: var(--measure);
  margin: 0 0 1em;
  font-size: 18px;
  line-height: 1.6;
  font-variation-settings: "opsz" 18, "SOFT" 60;
}
.body--lead { font-size: 19px; }

/* Drop cap */
.dropcap {
  float: left;
  font-family: var(--serif);
  font-variation-settings: "opsz" 144, "SOFT" 30;
  font-size: 4.6em;
  line-height: 0.82;
  padding: 0.08em 0.08em 0 0;
  margin-right: 0.04em;
  color: var(--ink);
  font-weight: 400;
}

/* Marginalia */
.margin {
  position: absolute;
  top: 80px;
  right: 12px;
  color: var(--walnut);
  font-size: 9px;
  letter-spacing: 0.14em;
  line-height: 1.55;
  text-align: right;
  opacity: 0.85;
  max-width: 80px;
}

/* Footnotes */
.footnote {
  color: var(--walnut);
  font-size: 10px;
  letter-spacing: 0.08em;
  margin-top: 22px;
  padding-top: 10px;
  border-top: 0.5px solid var(--rule-soft);
  max-width: var(--measure);
}
.footnote sup { color: var(--accent); font-family: var(--serif); }

/* =========================================================================
   N°02 — ROOMS
   ========================================================================= */
.rooms {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.room {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 8px;
  padding-top: 18px;
  border-top: 0.5px solid var(--rule-soft);
}
.room:first-child { border-top: 0; padding-top: 0; }

.room__num {
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.14em;
  padding-top: 6px;
}

.room__body { min-width: 0; }

.room__cn {
  color: var(--walnut);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  margin: 0 0 8px;
}

.room__h {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings: "opsz" 60, "SOFT" 50;
  font-size: clamp(26px, 7.6vw, 40px);
  line-height: 1.02;
  letter-spacing: -0.015em;
}
.room__h em {
  font-style: italic;
  color: var(--ink);
  font-variation-settings: "opsz" 60, "SOFT" 70;
}

/* Dotted leader between headline and subline */
.leader {
  display: block;
  height: 0;
  border-bottom: 1px dotted var(--rule);
  margin: 4px 0 10px;
  opacity: 0.6;
}

.room__sub {
  margin: 0;
  color: var(--walnut);
  font-size: 15px;
  line-height: 1.5;
  max-width: 38ch;
  font-style: normal;
}

/* =========================================================================
   N°03 — THE OBJECT (the only image)
   ========================================================================= */
.specimen--object {
  background:
    linear-gradient(180deg, var(--paper-2), var(--paper));
  padding-bottom: 72px;
}

.exhibit {
  margin: 16px 0 0;
  position: relative;
  display: grid;
  justify-items: center;
  gap: 28px;
  padding: 24px 0 0;
}

.exhibit__notes-l, .exhibit__notes-r {
  position: absolute;
  top: 8px;
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--accent);
  line-height: 1.4;
}
.exhibit__notes-l { left: 4px; text-align: left; }
.exhibit__notes-r { right: 4px; text-align: right; }

/* The ball — single contemplative CSS-rendered exhibit (Paper finish) */
.ball {
  position: relative;
  width: min(72vw, 320px);
  aspect-ratio: 1 / 1;
  margin: 8px auto 0;
}

.ball__sphere {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background:
    /* core paper tone with very subtle gradient */
    radial-gradient(circle at 36% 32%,
      #FBF6E8 0%,
      #F4ECD7 38%,
      #E6DCC2 72%,
      #C9BFA4 100%);
  box-shadow:
    inset -22px -28px 50px rgba(92, 69, 51, 0.22),
    inset 14px 18px 36px rgba(255, 255, 255, 0.55),
    0 1px 0 rgba(255,255,255,0.5);
  overflow: hidden;
  isolation: isolate;
}

.ball__hilite {
  position: absolute;
  top: 8%; left: 14%;
  width: 42%;
  height: 30%;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.55), rgba(255,255,255,0) 70%);
  border-radius: 50%;
  filter: blur(2px);
}

/* Subtle seams — embossed, not printed */
.ball__seam {
  position: absolute;
  background: rgba(92,69,51,0.18);
  box-shadow: 0 1px 0 rgba(255,255,255,0.5);
}
.ball__seam--v {
  top: 6%; bottom: 6%;
  left: 50%;
  width: 0.6px;
  transform: translateX(-50%);
  border-radius: 1px;
}
.ball__seam--h {
  left: 6%; right: 6%;
  top: 50%;
  height: 0.6px;
  transform: translateY(-50%);
  border-radius: 1px;
}

.ball__mark {
  position: absolute;
  left: 50%;
  top: 64%;
  transform: translate(-50%, -50%);
  color: var(--walnut);
  opacity: 0.55;
  font-size: 9px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}
.ball__mark [lang="zh-Hans"] { font-family: var(--cn); letter-spacing: 0; margin-left: 4px; }

/* Soft cast shadow under the ball */
.ball__shadow {
  position: absolute;
  left: 8%; right: 8%;
  bottom: -6%;
  height: 18px;
  background: radial-gradient(ellipse at center, rgba(26,24,20,0.28), rgba(26,24,20,0) 70%);
  filter: blur(4px);
  z-index: -1;
}

.exhibit__cap {
  text-align: center;
  max-width: 36ch;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
}
.exhibit__cap em { font-style: italic; }
.exhibit__cap-meta {
  display: block;
  margin-top: 10px;
  color: var(--accent);
  font-size: 9.5px;
  letter-spacing: 0.18em;
}

/* =========================================================================
   N°04 — SPECIFICATIONS (type-table with dotted leaders)
   ========================================================================= */
.spec-table {
  margin: 12px 0 0;
  padding: 0;
}

.spec-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 0.5px solid var(--rule-soft);
  position: relative;
}
.spec-row:first-child { border-top: 0.5px solid var(--rule-soft); }

.spec-row dt {
  display: flex;
  align-items: baseline;
  gap: 6px;
  position: relative;
  overflow: hidden;
  padding-right: 8px;
}
.spec-row dt::after {
  content: "";
  flex: 1;
  height: 1px;
  margin-left: 8px;
  margin-bottom: 4px;
  background-image: radial-gradient(circle, var(--rule) 0.6px, transparent 0.6px);
  background-size: 5px 1px;
  background-repeat: repeat-x;
  background-position: 0 50%;
  opacity: 0.8;
}
.spec-row dt span:first-child {
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0.16em;
}
.spec-cn {
  font-family: var(--cn) !important;
  font-size: 10px !important;
  color: var(--walnut);
  letter-spacing: 0.06em !important;
  text-transform: none !important;
}

.spec-row dd {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-variation-settings: "opsz" 24, "SOFT" 60;
  font-size: 16px;
  letter-spacing: 0.005em;
  color: var(--ink);
  text-align: right;
  max-width: 60%;
}

/* =========================================================================
   N°05 — COLORWAYS (Vignelli grid)
   ========================================================================= */
.swatches {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 0.5px solid var(--rule);
  border-left: 0.5px solid var(--rule);
}

.swatch {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  align-items: start;
  gap: 8px;
  padding: 14px 12px 14px;
  border-right: 0.5px solid var(--rule);
  border-bottom: 0.5px solid var(--rule);
  min-height: 200px;
}

.swatch__name {
  font-family: var(--serif);
  font-style: italic;
  font-variation-settings: "opsz" 36, "SOFT" 60;
  font-size: 22px;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--ink);
}

.swatch__tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--c);
  margin-top: 4px;
}
.swatch__edge {
  position: absolute; inset: 0;
  box-shadow: inset 0 0 0 0.5px rgba(26,24,20,0.4);
  pointer-events: none;
}

.swatch__cn {
  font-family: var(--cn);
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--walnut);
}

.swatch__hex {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--accent);
}

/* Make the 5th swatch span both cols on mobile */
.swatch:nth-child(5) {
  grid-column: 1 / -1;
  grid-template-rows: auto;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  min-height: 120px;
  padding: 18px 12px;
  column-gap: 18px;
}
.swatch:nth-child(5) .swatch__tile {
  grid-row: 1 / span 4;
  grid-column: 2;
  aspect-ratio: 2 / 1;
  margin: 0;
}
.swatch:nth-child(5) .swatch__name,
.swatch:nth-child(5) .swatch__cn,
.swatch:nth-child(5) .swatch__hex {
  grid-column: 1;
}

/* =========================================================================
   N°06 — THE QUIET LAB
   ========================================================================= */
.pull {
  margin: 28px 0;
  padding: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-variation-settings: "opsz" 96, "SOFT" 30;
  font-size: clamp(28px, 8vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--accent);
  max-width: 22ch;
  border: 0;
  quotes: "“" "”";
}

.diagram {
  margin: 36px auto 8px;
  text-align: center;
  max-width: 260px;
  color: var(--walnut);
}
.diagram__svg {
  width: 100%;
  height: auto;
  color: var(--walnut);
}
.diagram__cap {
  margin-top: 14px;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--accent);
}

/* =========================================================================
   N°08 — RESERVE
   ========================================================================= */
.specimen--reserve {
  padding-bottom: 32px;
}

.reserve__h {
  margin: 12px 0 28px;
  font-family: var(--serif);
  font-variation-settings: "opsz" 96, "SOFT" 30;
  font-size: clamp(36px, 11vw, 60px);
  line-height: 1;
  letter-spacing: -0.02em;
}
.reserve__h em { font-style: italic; color: var(--ink); }

.form {
  margin: 0 0 40px;
}
.form__label {
  display: block;
  color: var(--walnut);
  font-size: 10px;
  letter-spacing: 0.16em;
  margin-bottom: 8px;
}
.form__row {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-top: 0.5px solid var(--ink);
  border-bottom: 0.5px solid var(--ink);
}

.form__input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 14px 4px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--ink);
  outline: none;
}
.form__input::placeholder { color: var(--walnut); opacity: 0.65; }
.form__input:focus { background: rgba(122,46,46,0.04); }

.form__btn {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0 0 0 16px;
  border-left: 0.5px solid var(--ink);
}
.form__btn:hover { color: var(--ink); }
.form__btn:focus-visible { outline: 1px dashed var(--accent); outline-offset: 4px; }

.form__hint {
  margin: 10px 0 0;
  color: var(--walnut);
  font-size: 9.5px;
  letter-spacing: 0.14em;
}
.form__hint--ok    { color: var(--accent); }
.form__hint--error { color: var(--accent); }

/* Imprint */
.imprint {
  margin-top: 24px;
  padding-top: 18px;
}
.imprint__rule {
  height: 1px;
  background: var(--ink);
  margin-bottom: 16px;
}
.imprint__line {
  margin: 4px 0;
  color: var(--ink);
  font-size: 9.5px;
  letter-spacing: 0.16em;
}
.imprint__colo {
  margin-top: 16px;
  color: var(--accent);
  letter-spacing: 0.22em;
}

/* =========================================================================
   ENTER ANIMATION (paragraphs only)
   ========================================================================= */
.body, .room, .pull, .spec-row, .swatch, .reserve__h, .diagram, .exhibit, .footnote {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 700ms ease, transform 700ms ease;
}
.is-in.body, .is-in.room, .is-in.pull, .is-in.spec-row, .is-in.swatch,
.is-in.reserve__h, .is-in.diagram, .is-in.exhibit, .is-in.footnote {
  opacity: 1;
  transform: none;
}

/* =========================================================================
   REDUCED MOTION
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
  .body, .room, .pull, .spec-row, .swatch, .reserve__h, .diagram, .exhibit, .footnote {
    opacity: 1;
    transform: none;
  }
}

/* =========================================================================
   ≥ 720px — tablet / wider
   ========================================================================= */
@media (min-width: 720px) {
  body { font-size: 18px; }

  .plate { padding: 48px 56px 56px; }
  .specimen { padding: 80px 56px; }

  .section-head { grid-template-columns: 88px 1fr; gap: 16px; }
  .numeral { font-size: 12px; padding-top: 14px; }

  .margin { right: 24px; max-width: 110px; font-size: 10px; }

  .rooms { gap: 36px; }
  .room { grid-template-columns: 64px 1fr; gap: 12px; }

  .swatches { grid-template-columns: repeat(4, 1fr); }
  .swatch { min-height: 240px; }
  .swatch:nth-child(5) {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 2fr 1fr;
    grid-template-rows: auto;
    align-items: center;
    min-height: 140px;
  }
  .swatch:nth-child(5) .swatch__tile {
    grid-row: 1;
    grid-column: 2;
    aspect-ratio: 4 / 1;
  }
  .swatch:nth-child(5) .swatch__name { grid-column: 1; }
  .swatch:nth-child(5) .swatch__cn   { grid-column: 3; }
  .swatch:nth-child(5) .swatch__hex  { grid-column: 3; justify-self: end; }

  .ball { width: min(50vw, 380px); }
}
