/* ============================================================
   PARASPARA GROUP / paraspara.in
   Visual system v1.0
   Ivory ground · Paraspara Green · hairlines · one idea per screen
   ============================================================ */

/* ---------- 1. Tokens ---------- */

:root {
  /* Colour */
  --ivory:        #FAF7F1;
  --ivory-lift:   #FFFDF8;
  --sandstone:    #E7DFD1;
  --green:        #1B3B32;
  --green-deep:   #12261F;
  --bronze:       #8A5E36;
  --bronze-light: #B08A5E;
  --stone:        #5E655E;
  --ink:          #1A1D1A;

  --hairline:      rgba(27, 59, 50, 0.14);
  --hairline-soft: rgba(27, 59, 50, 0.08);
  --hairline-dark: rgba(250, 247, 241, 0.16);

  /* Type */
  --font-display: 'Spectral', Georgia, 'Times New Roman', Times, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --step--1: clamp(0.82rem, 0.79rem + 0.14vw, 0.9rem);
  --step-0:  clamp(1.02rem, 0.98rem + 0.2vw, 1.15rem);
  --step-1:  clamp(1.18rem, 1.1rem + 0.4vw, 1.4rem);
  --step-2:  clamp(1.55rem, 1.3rem + 1.2vw, 2.4rem);
  --step-3:  clamp(1.85rem, 1.4rem + 2.1vw, 3.1rem);
  --step-4:  clamp(2.1rem, 1.4rem + 3.2vw, 4rem);

  /* Space */
  --gutter: clamp(1.35rem, 5vw, 3rem);
  --measure: 34rem;
  --section-y: clamp(5.5rem, 13vh, 10rem);

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- 2. Reset & base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.78;
  letter-spacing: 0.004em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Paper grain: a single fixed, rasterised layer */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, p, figure, blockquote, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
em { font-style: italic; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--bronze);
  outline-offset: 4px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.85rem 1.3rem;
  background: var(--green);
  color: var(--ivory);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  text-decoration: none;
}
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- 3. Layout ---------- */

.wrap {
  width: min(100% - (var(--gutter) * 2), 74rem);
  margin-inline: auto;
}

.section {
  padding-block: var(--section-y);
  position: relative;
}

.section--rule::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  height: 1px;
  background: var(--hairline-soft);
}

.section__grid { display: grid; gap: 2.2rem; }

.section__body > * + * { margin-top: clamp(1.6rem, 3vw, 2.4rem); }

@media (min-width: 62rem) {
  .section__grid {
    grid-template-columns: minmax(8rem, 1fr) minmax(0, 2.55fr);
    gap: clamp(2.5rem, 6vw, 6rem);
  }
  .section__grid .label {
    position: sticky;
    top: 7.5rem;
    align-self: start;
  }
}

/* ---------- 4. Typography primitives ---------- */

.label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--stone);
  line-height: 1.6;
}

.h2 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--step-3);
  line-height: 1.16;
  letter-spacing: -0.014em;
  color: var(--green);
  max-width: 20ch;
  text-wrap: balance;
}

.prose { max-width: var(--measure); color: var(--ink); }
.prose p + p { margin-top: 1.25em; }
.prose em { color: var(--green); font-style: italic; }

.footnote {
  font-family: var(--font-sans);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone);
}

/* ---------- 5. Mark ---------- */

.mark { display: block; color: var(--green); }
.mark--sm   { width: 1.4rem; height: 1.4rem; }
.mark--hero { width: clamp(2.6rem, 6vw, 3.7rem); height: clamp(2.6rem, 6vw, 3.7rem); margin-inline: auto; }
.mark--sig  { width: 2.2rem; height: 2.2rem; margin-inline: auto; }

/* The two arcs draw simultaneously, each closing on the other. Once. */
.mark--hero .mark__arc {
  stroke-dasharray: 62;
  stroke-dashoffset: 62;
  animation: draw 1.8s var(--ease) 0.2s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- 6. Header ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding-block: 1.15rem;
  transition: background-color 0.5s var(--ease), box-shadow 0.5s var(--ease), padding 0.5s var(--ease);
}

.site-header.is-stuck {
  background: rgba(250, 247, 241, 0.86);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  box-shadow: 0 1px 0 var(--hairline-soft);
  padding-block: 0.85rem;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--green);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  pointer-events: none;
}
.site-header.is-stuck .site-header__brand {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.site-header__word {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  padding-left: 0.2em;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  gap: clamp(1rem, 3.5vw, 2.25rem);
  margin-left: auto;
}

.site-nav a {
  font-family: var(--font-sans);
  font-size: clamp(0.68rem, 2.1vw, 0.74rem);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone);
  text-decoration: none;
  padding-block: 0.25rem;
  position: relative;
  transition: color 0.35s var(--ease);
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}
.site-nav a:hover { color: var(--green); }
.site-nav a:hover::after { transform: scaleX(1); }

/* On small screens the header word still reserves space while it is
   invisible, which pushes the last nav item off the edge. Keep the mark. */
@media (max-width: 34rem) {
  .site-header__word { display: none; }
  .site-nav { gap: 1rem; }
  .site-nav a { letter-spacing: 0.1em; }
}

/* ---------- 7. Hero ---------- */

.hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding-block: 8rem 4rem;
  background:
    radial-gradient(115% 70% at 50% 0%, var(--ivory-lift) 0%, var(--ivory) 46%, #F1EBDF 100%);
}

.hero__inner { text-align: center; }

.lockup { margin-top: clamp(2rem, 5vh, 3.25rem); }

/* Nine tracked capitals must fit the smallest screen we support.
   At 0.2em tracking each cap costs roughly 1em, so the word is ~9em wide:
   8.4vw keeps it inside the gutters from 320px upward. */
.lockup__word {
  display: block;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.55rem, 8.4vw, 7rem);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  padding-left: 0.2em;
  color: var(--green);
  animation: rise 1.5s var(--ease) 0.15s both;
}

.lockup__descriptor {
  display: block;
  margin-top: clamp(0.9rem, 2vw, 1.4rem);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(0.62rem, 1.5vw, 0.76rem);
  text-transform: uppercase;
  letter-spacing: 0.52em;
  padding-left: 0.52em;
  color: var(--bronze);
  animation: rise 1.5s var(--ease) 0.4s both;
}

.hero__line {
  margin-top: clamp(2.6rem, 7vh, 4.5rem);
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  font-size: var(--step-2);
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--green);
  animation: rise 1.6s var(--ease) 0.75s both;
}

.hero__cue {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  margin-top: clamp(3.5rem, 9vh, 6rem);
  font-family: var(--font-sans);
  font-size: 0.68rem;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--stone);
  text-decoration: none;
  animation: rise 1.6s var(--ease) 1.15s both;
}
.hero__cue-rule {
  width: 1px;
  height: 3.2rem;
  background: linear-gradient(to bottom, var(--hairline), transparent);
  transition: height 0.5s var(--ease);
}
.hero__cue:hover .hero__cue-rule { height: 4.2rem; }

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

/* ---------- 8. Word structure figure ---------- */

.wordstructure {
  padding-block: clamp(1.6rem, 4vw, 2.4rem);
  border-top: 1px solid var(--hairline-soft);
  border-bottom: 1px solid var(--hairline-soft);
  max-width: var(--measure);
}

.ws__row {
  display: flex;
  align-items: baseline;
  gap: clamp(0.5rem, 2.4vw, 1.1rem);
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.35rem, 5.6vw, 2.15rem);
  letter-spacing: 0.16em;
  line-height: 1;
}

.ws__half {
  color: var(--green);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--hairline);
}

.ws__pivot {
  color: var(--bronze);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--bronze);
}

.wordstructure figcaption {
  margin-top: 1.15rem;
  font-family: var(--font-sans);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--stone);
  line-height: 1.7;
}

/* ---------- 9. Principles ---------- */

.principles {
  display: grid;
  gap: 0;
  max-width: 44rem;
  border-top: 1px solid var(--hairline-soft);
}

.principle {
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  gap: 0.2rem 1rem;
  padding-block: clamp(1.35rem, 3vw, 1.8rem);
  border-bottom: 1px solid var(--hairline-soft);
}

.principle__num {
  grid-row: span 2;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--bronze-light);
  padding-top: 0.5rem;
}

.principle__name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--step-1);
  line-height: 1.4;
  color: var(--green);
  letter-spacing: -0.005em;
}

.principle__text {
  font-size: var(--step-0);
  line-height: 1.7;
  color: var(--ink);
  max-width: 42ch;
}

@media (min-width: 40rem) {
  .principle {
    grid-template-columns: 3rem 11rem 1fr;
    align-items: baseline;
    gap: 1.5rem;
  }
  .principle__num { grid-row: auto; padding-top: 0; }
}

/* ---------- 10. Domains ---------- */

.domains {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--hairline-soft);
}

.domain {
  padding-block: clamp(1.3rem, 3vw, 1.7rem);
  border-bottom: 1px solid var(--hairline-soft);
}

.domain__name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--step-1);
  color: var(--green);
  line-height: 1.35;
}

.domain__text {
  margin-top: 0.35rem;
  font-size: var(--step-0);
  color: var(--stone);
  line-height: 1.65;
  max-width: 38ch;
}

/* Two columns, never four: inside the editorial column, quarters leave
   the measure too narrow and the copy goes ragged. */
@media (min-width: 44rem) {
  .domains {
    grid-template-columns: repeat(2, 1fr);
    column-gap: clamp(1.75rem, 4vw, 3.25rem);
  }
}

/* ---------- 11. Dark section ---------- */

.section--dark {
  background: var(--green-deep);
  color: var(--sandstone);
}
.section--dark .label { color: rgba(231, 223, 209, 0.62); }
.section--dark .prose { color: rgba(231, 223, 209, 0.9); }
.section--dark .prose em { color: var(--ivory); }

.statement p {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--step-4);
  line-height: 1.13;
  letter-spacing: -0.018em;
  color: var(--ivory);
  text-wrap: balance;
  /* ch must be declared where the display size lives, not on the blockquote */
  max-width: 17ch;
}

/* ---------- 12. Closing ---------- */

.closing {
  text-align: center;
  background: linear-gradient(to bottom, var(--ivory) 0%, #F2ECE0 100%);
}

.closing__inner {
  display: grid;
  justify-items: center;
  gap: clamp(1.8rem, 4vw, 2.6rem);
}

.closing__head { max-width: 18ch; }

.prose--center { text-align: center; max-width: 40ch; }

.contact {
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
  padding-top: clamp(1.8rem, 4vw, 2.5rem);
  border-top: 1px solid var(--hairline);
  width: min(100%, 34rem);
}

.contact__note {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  line-height: 1.75;
  color: var(--stone);
  max-width: 46ch;
  margin-inline: auto;
}

.contact__domain {
  margin-top: 0.9rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green);
}

.signature {
  margin-top: clamp(2.5rem, 7vw, 4.5rem);
  display: grid;
  justify-items: center;
  gap: 1.15rem;
}

.signature__word {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.15rem, 4.4vw, 1.7rem);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  padding-left: 0.3em;
  color: var(--green);
  line-height: 1;
}

.signature__line {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: var(--step-0);
  color: var(--bronze);
  letter-spacing: 0.01em;
}

/* ---------- 13. Footer ---------- */

.site-footer {
  background: var(--green);
  color: rgba(250, 247, 241, 0.72);
  padding-block: clamp(2.5rem, 6vw, 3.5rem);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  letter-spacing: 0.05em;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem 2rem;
}

.site-footer__legal { letter-spacing: 0.1em; }

.site-footer__domain {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(250, 247, 241, 0.5);
}

.site-footer__credit {
  color: rgba(250, 247, 241, 0.42);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}

.site-footer__credit a {
  color: rgba(250, 247, 241, 0.72);
  text-decoration: none;
  letter-spacing: 0.14em;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(250, 247, 241, 0.22);
  transition: color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.site-footer__credit a:hover {
  color: var(--ivory);
  border-bottom-color: rgba(250, 247, 241, 0.6);
}

@media (max-width: 40rem) {
  .site-footer__inner { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}

/* ---------- 13b. Not found ---------- */

.notfound {
  min-height: 100svh;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  gap: 1.5rem;
  padding: 3rem var(--gutter);
  background: radial-gradient(115% 70% at 50% 0%, var(--ivory-lift) 0%, var(--ivory) 46%, #F1EBDF 100%);
}

.notfound__code {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--bronze);
}

.notfound__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--step-3);
  line-height: 1.2;
  letter-spacing: -0.012em;
  color: var(--green);
  max-width: 18ch;
}

.notfound__link {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stone);
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 3px;
  transition: color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.notfound__link:hover { color: var(--green); border-bottom-color: var(--bronze); }

/* ---------- 14. Reveal ---------- */

/* Gated on .js so that content is never hidden when scripting is off */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.95s var(--ease), transform 0.95s var(--ease);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- 15. Reduced motion & print ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .mark--hero .mark__arc { stroke-dashoffset: 0; }
  .site-header__brand { opacity: 1; transform: none; pointer-events: auto; }
}

@media print {
  body { background: #fff; color: #000; }
  body::after, .site-header, .hero__cue { display: none; }
  .section--dark { background: #fff; color: #000; }
  .statement p, .section--dark .prose { color: #000; }
  .js .reveal { opacity: 1; transform: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.7em; }
}
