/* ---------------------------------------------------------------
   Nous Forge — single page
   Monochrome, matching the brand mark. Dark by default,
   full light variant via prefers-color-scheme.
   --------------------------------------------------------------- */

:root {
  --bg:         #0a0a0a;
  --glow:       rgba(255, 255, 255, 0.022);
  --fg:         #eaeaea;
  --fg-strong:  #fbfbfb;
  --muted:      #838384;
  --faint:      #545455;
  --hair:       rgba(255, 255, 255, 0.11);
  --grain-opacity: 0.045;
  --grain-blend:   overlay;
  --watermark-opacity: 0.05;

  --pad: clamp(1.4rem, 4vw, 2.75rem);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg:        #e6e7e8;
    --glow:      rgba(255, 255, 255, 0.5);
    --fg:        #2e2e2f;
    --fg-strong: #161617;
    --muted:     #646466;
    --faint:     #9d9d9f;
    --hair:      rgba(16, 16, 18, 0.16);
    --grain-opacity: 0.04;
    --grain-blend:   multiply;
    --watermark-opacity: 0.05;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  min-height: 100svh;
  color: var(--fg);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 78% 55% at 80% 8%, var(--glow), transparent 72%),
    radial-gradient(ellipse 66% 50% at 10% 96%, var(--glow), transparent 72%);
  background-attachment: fixed;
  font-family: "Jost", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* slow drifting light */
body::before {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, var(--glow), transparent 60%);
}

/* film grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* oversized brand mark, bleeding off the right edge (desktop only) */
.watermark {
  display: none;
  position: fixed;
  z-index: 0;
  top: 50%;
  right: -12vw;
  width: 44vw;
  height: auto;
  transform: translateY(-50%);
  color: var(--fg-strong);
  opacity: var(--watermark-opacity);
  pointer-events: none;
}
.watermark circle { fill: none; stroke: currentColor; stroke-width: 6; }
.watermark .v { fill: currentColor; }

/* ---------------------------------------------------------------
   Layout — mobile first: one column, corners in flow
   --------------------------------------------------------------- */

.page {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: var(--pad);
  gap: clamp(2.5rem, 9vh, 5rem);
}

main {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}

/* ---------------------------------------------------------------
   Lockup — brand mark + wordmark
   --------------------------------------------------------------- */

.lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--fg-strong);
}

.mark {
  width: 42px;
  height: auto;
  flex: none;
}
.mark circle { fill: none; stroke: currentColor; stroke-width: 12; }
.mark .v { fill: currentColor; }

.wordmark {
  font-family: "Jost", sans-serif;
  font-weight: 300;
  font-size: 0.66rem;
  line-height: 1.32;
  text-transform: uppercase;
  letter-spacing: 0.22em;
}

/* ---------------------------------------------------------------
   Entry — the thesis, then a plain statement, then an etym note
   --------------------------------------------------------------- */

.entry { max-width: 42rem; min-width: 0; }

.lead {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: clamp(2.5rem, 6.4vw, 3.9rem);
  line-height: 1;
  letter-spacing: -0.032em;
  color: var(--fg-strong);
}

.lead-line { display: block; }
.lead-line + .lead-line { margin-top: 0.6em; }

.lead .w { display: block; color: var(--fg-strong); }

.lead .g {
  display: block;
  margin-top: 0.22em;
  font-size: 0.4em;
  font-style: italic;
  font-weight: 350;
  letter-spacing: -0.005em;
  color: var(--muted);
}

.lead .g::before { content: "\2014\00a0"; color: var(--faint); }

.lead-note {
  margin: clamp(1.8rem, 4vw, 2.6rem) 0 0;
  max-width: 32rem;
  font-family: "Fraunces", Georgia, serif;
  font-optical-sizing: auto;
  font-weight: 350;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.58;
  color: var(--fg);
}

.etym {
  display: block;
  margin-top: clamp(3.5rem, 12vh, 7rem);
  padding-left: 1.3rem;
  border-left: 1px solid var(--hair);
  max-width: 24rem;
  font-family: "Jost", sans-serif;
}

.etym-k {
  font-weight: 400;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--fg);
}

.etym-ipa {
  margin-left: 0.7em;
  font-weight: 300;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--faint);
}

.etym-v {
  display: block;
  margin-top: 0.7rem;
  font-weight: 300;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------------------------------------------------------------
   Footer — status + contact
   --------------------------------------------------------------- */

footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}

.status,
.contact {
  margin: 0;
  font-family: "Jost", sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.status { display: flex; align-items: center; gap: 0.6rem; }

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.contact a {
  color: var(--fg-strong);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--hair);
  transition: border-color 0.25s ease, color 0.25s ease;
}

.contact a:hover { border-color: currentColor; }

/* ---------------------------------------------------------------
   Colophon — legal line, quiet, below the fold
   --------------------------------------------------------------- */

.colophon {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 1.6rem var(--pad) 2.2rem;
  border-top: 1px solid var(--hair);
  font-family: "Jost", sans-serif;
  font-size: 0.72rem;
  line-height: 1.7;
  letter-spacing: 0.03em;
  color: var(--faint);
}

.colophon .legal { display: block; }

/* ---------------------------------------------------------------
   Desktop — pin the corners, offset the entry off centre
   --------------------------------------------------------------- */

@media (min-width: 760px) {
  .watermark { display: block; }

  .page { display: block; padding: 0; }

  .lockup,
  footer > * {
    position: absolute;
    z-index: 3;
  }

  .lockup { top: var(--pad); left: var(--pad); }

  main {
    min-height: 100svh;
    padding: 14vh var(--pad);
  }

  .entry { margin-left: clamp(0px, 11vw, 170px); }

  .status  { bottom: var(--pad); left: var(--pad); }
  .contact { bottom: var(--pad); right: var(--pad); text-align: right; }
}

@media (min-width: 1100px) {
  .entry { margin-left: clamp(0px, 16vw, 300px); }
}

/* ---------------------------------------------------------------
   Motion — intro reveal + ambient drift, opt-in only
   --------------------------------------------------------------- */

.reveal { opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: var(--d, 0s);
  }

  @keyframes rise {
    from { opacity: 0; transform: translateY(11px); filter: blur(6px); }
    to   { opacity: 1; transform: none;             filter: blur(0);   }
  }

  body::before { animation: drift 78s ease-in-out infinite alternate; }

  @keyframes drift {
    from { transform: translate(-7%, -4%) scale(1);    }
    to   { transform: translate(7%, 6%)   scale(1.18); }
  }

  .dot { animation: breathe 3.4s ease-in-out infinite; }

  @keyframes breathe {
    0%, 100% { opacity: 1;   }
    50%      { opacity: 0.3; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; }
}

/* ---------------------------------------------------------------
   Focus
   --------------------------------------------------------------- */

a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 1px;
}
