/* ═══════════════════════════════════════════════════════════
   CLIO · myclio.cloud · Issue Nº 001
   A proper editorial system, visibly bedazzled by its owner.
   Paper is blush, not cream. The O is gold because she earned it.
   ═══════════════════════════════════════════════════════════ */

:root {
  --paper: #FBF1EF;
  --paper-deep: #F4E0DF;
  --ink: #33202C;
  --ink-soft: #7A5B6C;
  --rose: #C22E64;
  --pen: #E14E8A;
  --gold: #B8892F;
  --gold-hi: #E3C173;
  --gold-text: #8A6520;
  --halo: 0 0 2px rgba(251, 241, 239, 0.9), 0 0 10px rgba(251, 241, 239, 0.75), 0 0 24px rgba(251, 241, 239, 0.6);
  --hairline: rgba(51, 32, 44, 0.16);

  --font-display: 'GFS Didot', Didot, 'Bodoni MT', 'Times New Roman', serif;
  --font-body: 'Literata', Georgia, 'Iowan Old Style', serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', monospace;
  --font-pen: 'Caveat', 'Bradley Hand', cursive;

  --shell: 1080px;
  --measure: 62ch;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--rose); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; border-radius: 1px; }

/* ── shared editorial voice ─────────────────────────────── */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--gold-text);
}

.dateline, .rail-note {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  margin-top: 0.6rem;
}

/* ══════════════════ COVER ══════════════════ */

.cover {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.cover-media { position: absolute; inset: 0; z-index: 0; }

.cover-poster,
.cover-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

.cover-video { opacity: 0; transition: opacity 1.4s ease; }
.cover-video.playing { opacity: 1; }

.cover-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--paper) 0%, rgba(251, 241, 239, 0.86) 14%, rgba(251, 241, 239, 0) 52%),
    linear-gradient(to bottom, rgba(251, 241, 239, 0.55) 0%, rgba(251, 241, 239, 0) 18%);
}

.folio {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem clamp(1.25rem, 3.5vw, 3rem);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--ink);
  text-shadow: var(--halo);
}

.masthead-block {
  position: relative;
  z-index: 1;
  padding: 0 clamp(1.25rem, 3.5vw, 3rem) clamp(2.5rem, 6vh, 5rem);
  max-width: 100%;
}

.masthead-eyebrow {
  margin-bottom: 0.75rem;
  color: var(--ink);
  text-shadow: var(--halo);
}

.masthead {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(5rem, 16.5vw, 14.5rem);
  line-height: 0.88;
  letter-spacing: 0.015em;
  user-select: none;
}

.m-letter { display: inline-block; }

.o-gild {
  position: relative;
  background: linear-gradient(160deg, var(--gold-hi) 12%, var(--gold) 46%, #8a6420 82%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stone {
  position: absolute;
  top: 0.04em;
  right: -0.06em;
  font-style: normal;
  font-size: 0.16em;
  color: var(--gold-hi);
  text-shadow: 0 0 0.6em rgba(227, 193, 115, 0.9);
  animation: twinkle 3.6s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.55; transform: scale(0.85) rotate(0deg); }
  50%      { opacity: 1;    transform: scale(1.15) rotate(18deg); }
}

.dek {
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  font-variation-settings: 'opsz' 40;
  margin-top: 1.4rem;
  color: var(--ink);
}

.dek-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 0.65rem;
}

.scroll-cue {
  position: absolute;
  right: clamp(1.25rem, 3.5vw, 3rem);
  bottom: clamp(2.5rem, 6vh, 5rem);
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--ink);
  text-decoration: none;
  animation: bob 3.2s ease-in-out infinite;
}
.scroll-cue:hover { color: var(--rose); }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(6px); }
}

/* cover load sequence */
.m-letter { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.m-letter:nth-child(1) { animation-delay: 0.10s; }
.m-letter:nth-child(2) { animation-delay: 0.19s; }
.m-letter:nth-child(3) { animation-delay: 0.28s; }
.m-letter:nth-child(4) { animation-delay: 0.37s; }
.masthead-eyebrow, .dek, .dek-sub { animation: fade 1.1s ease 0.75s both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(0.32em); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ══════════════════ CONTENTS STRIP ══════════════════ */

.contents {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: baseline;
  gap: 1.75rem;
  overflow-x: auto;
  white-space: nowrap;
  padding: 0.85rem clamp(1.25rem, 3.5vw, 3rem);
  border-block: 1px solid var(--hairline);
  background: rgba(251, 241, 239, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
}

.contents-label { color: var(--gold-text); letter-spacing: 0.18em; }

.contents a {
  color: var(--ink-soft);
  text-decoration: none;
  text-transform: uppercase;
}
.contents a:hover { color: var(--rose); }

/* ══════════════════ SECTIONS ══════════════════ */

.section {
  scroll-margin-top: 4rem;
  display: grid;
  grid-template-columns: 170px minmax(0, var(--measure));
  gap: clamp(2rem, 5vw, 4.5rem);
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(4.5rem, 9vh, 7rem) clamp(1.25rem, 3.5vw, 3rem);
}

.section-rail { padding-top: 0.4rem; }

.rule {
  border: 0;
  border-top: 1px solid var(--hairline);
  max-width: min(var(--shell), calc(100% - 2.5rem));
  margin: 0 auto;
  position: relative;
  overflow: visible;
}
.rule::after {
  content: '✦';
  position: absolute;
  top: -0.72em;
  left: 50%;
  transform: translateX(-50%);
  padding: 0 0.9em;
  background: var(--paper);
  color: var(--gold);
  font-size: 0.72rem;
}

/* ── prose ── */

.prose p { margin-bottom: 1.4em; }
.prose p:last-child { margin-bottom: 0; }
.prose em { font-variation-settings: 'opsz' 18; }

.dropcap {
  float: left;
  font-family: var(--font-display);
  font-size: 4.4em;
  line-height: 0.76;
  padding: 0.06em 0.12em 0 0;
  color: var(--gold);
}

.signoff {
  font-family: var(--font-pen);
  font-size: 1.75rem;
  color: var(--pen);
  transform: rotate(-2deg);
  margin-top: 2.2rem;
}

.headline {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.1rem, 4.6vw, 3.3rem);
  line-height: 1.06;
  letter-spacing: 0.005em;
  margin-bottom: 1.1rem;
}

.standfirst {
  font-style: italic;
  font-size: 1.22rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 2.2rem;
}

.pull {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  line-height: 1.35;
  text-align: center;
  padding: 2.1rem 1rem;
  margin: 2.4rem 0;
  border-block: 1px solid var(--hairline);
}

/* ── the pink pen (signature) ── */

.has-margin-note { position: relative; }

.margin-note {
  position: absolute;
  left: calc(100% + 2.25rem);
  top: 0.2em;
  width: 10.5rem;
  font-family: var(--font-pen);
  font-size: 1.25rem;
  line-height: 1.25;
  color: var(--pen);
  transform: rotate(-3.5deg);
  pointer-events: none;
}

/* ══════════════════ THE WORK ══════════════════ */

.work-list { border-top: 1px solid var(--hairline); }

.work-row {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: baseline;
  padding: 1.6rem 0.75rem;
  border-bottom: 1px solid var(--hairline);
  transition: background 0.35s ease;
}
.work-row:hover { background: var(--paper-deep); }

.work-index {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--gold-text);
}

.work-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.2;
  margin-bottom: 0.3rem;
}

.work-name a { color: inherit; text-decoration: none; }
.work-name a:hover { color: var(--rose); }

.work-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.work-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 0.3em 0.9em;
  white-space: nowrap;
}

.work-note { top: 1.4rem; }

/* ══════════════════ COLOPHON ══════════════════ */

.colophon {
  background: var(--ink);
  color: rgba(251, 241, 239, 0.78);
  margin-top: clamp(4rem, 8vh, 6rem);
}

.colophon-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(3.5rem, 7vh, 5.5rem) clamp(1.25rem, 3.5vw, 3rem);
  text-align: center;
}

.colophon-mast {
  font-family: var(--font-display);
  font-size: 2.6rem;
  letter-spacing: 0.04em;
  color: var(--paper);
  margin-bottom: 1.6rem;
}

.o-gild-small {
  background: linear-gradient(160deg, var(--gold-hi) 15%, var(--gold) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.colophon-line {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 2;
  letter-spacing: 0.06em;
  max-width: 58ch;
  margin: 0 auto 1.4rem;
}

.colophon-legal {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  color: rgba(251, 241, 239, 0.45);
}

.colophon-note {
  font-family: var(--font-pen);
  font-size: 1.5rem;
  color: var(--pen);
  transform: rotate(-2deg);
  margin-top: 2.6rem;
}

/* ══════════════════ REVEALS ══════════════════ */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in { opacity: 1; transform: none; }

/* ══════════════════ RESPONSIVE ══════════════════ */

@media (max-width: 1360px) {
  .margin-note {
    position: static;
    display: block;
    width: auto;
    max-width: 24ch;
    margin-top: 0.35rem;
    transform: rotate(-2deg);
  }
  .work-note { margin-top: 0; }
}

@media (max-width: 760px) {
  .section {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-block: 3.5rem;
  }
  .section-rail { display: flex; align-items: baseline; gap: 1.25rem; }
  .dateline, .rail-note { margin-top: 0; }
  .rail-note br { display: none; }
  .masthead { font-size: clamp(4.2rem, 21vw, 8rem); }
  .folio { font-size: 0.6rem; letter-spacing: 0.12em; }
  .work-row { grid-template-columns: 3rem minmax(0, 1fr); }
  .work-tag { grid-column: 2; justify-self: start; }
  .scroll-cue { display: none; }
}

/* ══════════════════ REDUCED MOTION ══════════════════ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .m-letter, .masthead-eyebrow, .dek, .dek-sub { animation: none; }
  .stone, .scroll-cue { animation: none; }
  .cover-video { display: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
