/* Semente Criativa — A clearing in the woods
   ------------------------------------------------------------------
   A small page kept quiet. Forest-floor cream paper, olive ink,
   late-afternoon light coming through the canopy.
   Type: Marcellus (Roman inscription) for display & labels,
         Cardo (Renaissance manuscript) for body & italics.
*/

:root {
  /* Paper — like late afternoon sun on hand-laid cotton */
  --paper:        #F1ECD8;
  --paper-deep:   #E8DEB8;
  --paper-edge:   #CDC0A0;

  /* Ink — dark forest, deep humus, not pure black */
  --ink:          #1E1F14;
  --ink-soft:     #3D3D2C;
  --ink-faint:    #7A7561;
  --ink-fade:     #A8A088;

  /* Botanical greens — leaf, moss, lichen */
  --leaf:         #4D5D34;
  --leaf-deep:    #2F3C20;
  --leaf-pale:    #93A375;
  --moss:         #5F6E3F;

  /* Earth — ochre, autumn pages, sienna */
  --ochre:        #B5894F;
  --ochre-deep:   #876738;

  /* Type stack */
  --display: 'Marcellus', 'Trajan Pro', Georgia, serif;
  --body:    'Cardo', 'EB Garamond', Garamond, 'Times New Roman', serif;

  /* Rhythm */
  --gutter:    clamp(1.4rem, 5vw, 5rem);
  --section-y: clamp(4.5rem, 12vh, 10rem);
  --measure:   30rem;
  --measure-w: 44rem;
}

/* ----- Reset -------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255, 232, 168, 0.30) 0%, transparent 60%),
    radial-gradient(ellipse 70% 60% at 85% 100%, rgba(77, 93, 52, 0.10) 0%, transparent 65%),
    radial-gradient(ellipse 60% 50% at 12% 78%, rgba(133, 152, 96, 0.07) 0%, transparent 60%);
  background-attachment: fixed;
  font-feature-settings: "kern" 1, "liga" 1, "onum" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection { background: rgba(181, 137, 79, 0.32); color: var(--ink); }

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

/* ----- Atmospheric layers ----------------------------------- */

/* `.canopy` is reserved for future use; gradients now live on <body>
   so they paint underneath the grain overlay without z-index gymnastics. */
.canopy { display: none; }

/* Paper grain — fixed, multiply blended. */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.55;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.86' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.18  0 0 0 0 0.14  0 0 0 0 0.08  0 0 0 0.085 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
}

/* ----- Masthead --------------------------------------------- */

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2rem;
  padding: 1.6rem var(--gutter) 1.3rem;
  border-bottom: 1px solid var(--paper-edge);
  color: var(--ink-soft);
  position: relative;
  z-index: 1;
}

.masthead__brand {
  margin: 0;
  font-family: var(--display);
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.masthead__meta {
  margin: 0;
  font-family: var(--display);
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0.75;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.masthead__meta .dot { color: var(--ochre); opacity: 0.9; }

@media (max-width: 640px) {
  .masthead { flex-direction: column; gap: 0.55rem; align-items: flex-start; }
  .masthead__meta { font-size: 0.62rem; gap: 0.55rem; }
}

/* ----- Hero ------------------------------------------------- */

.hero {
  padding: clamp(4rem, 11vh, 9rem) var(--gutter) clamp(3rem, 7vh, 5.5rem);
  display: flex;
  justify-content: center;
}

.hero__inner {
  width: 100%;
  max-width: 64rem;
}

.hero__mark {
  width: 28px;
  height: 38px;
  color: var(--leaf);
  margin: 0 0 clamp(1.8rem, 5vw, 2.8rem);
  opacity: 0.88;
  animation: rise 1s 0s both cubic-bezier(0.2, 0.7, 0.2, 1);
}

.hero__pretitle {
  font-family: var(--display);
  font-size: 0.82rem;
  letter-spacing: 0.44em;
  text-transform: uppercase;
  color: var(--leaf);
  margin: 0 0 clamp(1.8rem, 5vw, 3rem);
  animation: rise 1s 0.15s both cubic-bezier(0.2, 0.7, 0.2, 1);
}

.hero__title {
  font-family: var(--body);
  font-weight: 400;
  font-size: clamp(3.4rem, 11.5vw, 10rem);
  line-height: 0.95;
  letter-spacing: -0.018em;
  margin: 0 0 clamp(2rem, 5vw, 3.5rem);
  color: var(--ink);
}

.hero__line1 {
  display: block;
  font-style: italic;
  animation: rise 1.1s 0.32s both cubic-bezier(0.2, 0.7, 0.2, 1);
}

.hero__line2 {
  display: block;
  font-style: italic;
  padding-left: clamp(1.2rem, 6vw, 5rem);
  animation: rise 1.1s 0.6s both cubic-bezier(0.2, 0.7, 0.2, 1);
}

.hero__line2 em {
  font-style: italic;
  color: var(--leaf-deep);
}

.hero__lead {
  font-family: var(--body);
  font-style: italic;
  font-size: clamp(1.12rem, 1.6vw, 1.45rem);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 28em;
  margin: 0 0 clamp(2.5rem, 6vw, 4rem);
  padding-left: clamp(1.2rem, 6vw, 5rem);
  animation: rise 1.2s 0.9s both cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ----- Rules / dividers ------------------------------------- */

.rule--hero {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  margin: 0 0 clamp(2rem, 5vw, 3.5rem);
  padding-left: clamp(1.2rem, 6vw, 5rem);
  max-width: 36rem;
  animation: rise 1.3s 1.15s both cubic-bezier(0.2, 0.7, 0.2, 1);
}

.rule__line {
  flex: 1;
  height: 1px;
  background: var(--paper-edge);
}

.rule__leaf {
  width: 14px;
  height: 19px;
  color: var(--leaf);
  flex-shrink: 0;
  opacity: 0.85;
}

.rule--section {
  border: 0;
  height: 1px;
  background: linear-gradient(to right, transparent 0%, var(--paper-edge) 18%, var(--paper-edge) 82%, transparent 100%);
  margin: 0;
  position: relative;
}

.rule--section::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  background: var(--paper);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px var(--paper-edge);
}

/* ----- Marginalia (rotating quote) -------------------------- */

.marginalia {
  margin: 0;
  padding-left: clamp(1.2rem, 6vw, 5rem);
  max-width: 38rem;
  animation: rise 1.3s 1.4s both cubic-bezier(0.2, 0.7, 0.2, 1);
}

.marginalia__label {
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ochre-deep);
  margin: 0 0 1rem;
}

.marginalia__quote {
  font-family: var(--body);
  font-style: italic;
  font-size: clamp(1.3rem, 2.2vw, 1.9rem);
  line-height: 1.45;
  color: var(--ink);
  margin: 0;
  quotes: none;
  position: relative;
  padding-left: 1.6rem;
}

.marginalia__quote::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  bottom: 0.4em;
  width: 1px;
  background: var(--leaf-pale);
}

/* ----- Interlude (the clearing) ----------------------------- */

.interlude {
  text-align: center;
  padding: clamp(4rem, 10vw, 7rem) var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 2.5rem);
}

.interlude__sprig {
  width: clamp(80px, 18vw, 140px);
  height: auto;
  color: var(--leaf-pale);
  opacity: 0.9;
}

.interlude__sprig--flip { transform: scaleX(-1); }

.interlude__line {
  font-family: var(--body);
  font-style: italic;
  font-size: clamp(1.3rem, 2.4vw, 1.95rem);
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0;
  max-width: 36rem;
}

/* ----- Chapters --------------------------------------------- */

.chapter {
  padding: var(--section-y) var(--gutter);
  max-width: 64rem;
  margin: 0 auto;
}

.chapter__head {
  text-align: center;
  margin-bottom: clamp(3rem, 7vw, 5rem);
}

.chapter__numeral {
  font-family: var(--body);
  font-style: italic;
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  color: var(--ochre-deep);
  margin: 0 0 0.7rem;
  opacity: 0.85;
}

.chapter__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.85rem, 4.2vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: 0.005em;
  color: var(--ink);
  margin: 0;
  max-width: 22ch;
  margin-left: auto;
  margin-right: auto;
}

.chapter__body {
  max-width: var(--measure);
  margin: 0 auto;
  font-size: clamp(1.05rem, 1.35vw, 1.22rem);
  line-height: 1.72;
  color: var(--ink);
}

.chapter__body p { margin: 0 0 1.4em; }
.chapter__body p:last-child { margin-bottom: 0; }

/* Drop cap (chapter I) */
.dropcap::first-letter {
  font-family: var(--display);
  font-size: 4em;
  line-height: 0.85;
  float: left;
  margin: 0.06em 0.12em -0.05em 0;
  color: var(--leaf-deep);
}

/* Pull line */
.pull {
  font-family: var(--body);
  font-style: italic;
  font-size: 1.18em;
  line-height: 1.45;
  color: var(--ink-soft);
  text-align: center;
  padding: 1.6em 0 0;
  border-top: 1px solid var(--paper-edge);
  margin-top: 1.8em !important;
}

/* ----- Principles ------------------------------------------- */

.principles {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: var(--measure-w);
  counter-reset: principle;
}

.principles li {
  counter-increment: principle;
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1.6rem;
  align-items: baseline;
  padding: 1.55rem 0;
  border-bottom: 1px solid var(--paper-edge);
}

.principles li:last-child { border-bottom: none; }

.principles li::before {
  content: counter(principle, lower-roman) ".";
  font-family: var(--body);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ochre-deep);
  text-align: right;
  padding-top: 0.45em;
  opacity: 0.88;
}

.principles li span {
  font-family: var(--body);
  font-style: italic;
  font-size: clamp(1.12rem, 1.65vw, 1.4rem);
  line-height: 1.45;
  color: var(--ink);
}

/* ----- Contact ---------------------------------------------- */

.chapter--contact .chapter__body { text-align: center; }

.contact__email {
  margin-top: clamp(1.8rem, 4vw, 2.8rem) !important;
  font-family: var(--display);
}

.contact__email a {
  font-size: clamp(1.2rem, 2.4vw, 1.75rem);
  letter-spacing: 0.04em;
}

/* ----- Links ------------------------------------------------ */

a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ochre);
  padding-bottom: 0.08em;
  transition: color 0.4s ease, border-color 0.4s ease;
}

a:hover, a:focus-visible {
  color: var(--leaf-deep);
  border-bottom-color: var(--leaf-deep);
}

a:focus { outline: none; }
a:focus-visible { outline: 2px dotted var(--leaf); outline-offset: 4px; }

/* ----- Colophon --------------------------------------------- */

.colophon {
  text-align: center;
  padding: clamp(4rem, 9vw, 6rem) var(--gutter) clamp(3rem, 6vw, 4.5rem);
  border-top: 1px solid var(--paper-edge);
  margin-top: 2rem;
  position: relative;
}

.colophon__inner { max-width: 32rem; margin: 0 auto; }

.colophon__sprout {
  width: 44px;
  height: 58px;
  margin: 0 auto 1.6rem;
  color: var(--leaf);
  opacity: 0.92;
  animation: breathe 8s ease-in-out infinite;
  transform-origin: 50% 100%;
}

@keyframes breathe {
  0%, 100% { transform: scale(1);    opacity: 0.9; }
  50%      { transform: scale(1.04); opacity: 1; }
}

.colophon__line {
  font-family: var(--display);
  font-size: 0.82rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.35rem;
}

.colophon__line--soft {
  font-family: var(--body);
  font-style: italic;
  letter-spacing: 0.015em;
  text-transform: none;
  font-size: 0.95rem;
  color: var(--ink-faint);
  margin-bottom: 1.5rem;
}

.colophon__small {
  font-family: var(--display);
  font-size: 0.66rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-fade);
  margin: 0;
  display: inline-flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  justify-content: center;
}

.colophon__dot { color: var(--ochre); opacity: 0.9; }

.colophon__place {
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-fade);
  margin: 0;
}

/* ----- Mobile tweaks ---------------------------------------- */

@media (max-width: 720px) {
  body { font-size: 17px; }

  .hero { padding-top: 3.2rem; padding-bottom: 3.2rem; }
  .hero__line2,
  .hero__lead,
  .rule--hero,
  .marginalia { padding-left: 1rem; }

  .principles li {
    grid-template-columns: 2.6rem 1fr;
    gap: 1rem;
    padding: 1.25rem 0;
  }

  .principles li::before { padding-top: 0.3em; }

  .dropcap::first-letter { font-size: 3.4em; }

  .chapter__head { margin-bottom: 2.2rem; }

  .interlude { padding-top: 3.5rem; padding-bottom: 3.5rem; }
}

@media (max-width: 420px) {
  .hero__line1, .hero__line2,
  .hero__lead, .rule--hero, .marginalia { padding-left: 0; }
}

/* ----- Reduced motion --------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  html { scroll-behavior: auto; }
  .colophon__sprout { transform: none; }
}

/* ----- Print ------------------------------------------------ */

@media print {
  .grain, .canopy, .rule--hero, .rule--section, .interlude__sprig { display: none; }
  body { background: white; color: black; font-size: 12pt; }
  a { color: black; border-bottom: none; }
  .colophon__sprout { color: black; }
}
