/*
Theme Name:   ComplexPortfolio
Theme URI:    https://clarkajohnson.com
Description:  A landscape for sense-makers. Standalone theme rendering The Clearing (Zone One) per ComplexPortfolio Brand Book v1.1 — Fraunces + IBM Plex Mono, paper-and-ink palette, the iceberg principle. Built to scale into Canopy and Undergrowth zones with node-based content.
Author:       Clark Johnson
Version:      2.0.0
Text Domain:  complexportfolio
*/

/* ============================================================
   DESIGN TOKENS — Brand Book §VI Color, §V Typography
   ============================================================ */
:root {
  /* Palette — warm paper-and-ink, one accent. Never expands. */
  --paper:       #F3EFE9;
  --paper-deep:  #ECE7DE;
  --ink:         #14130F;
  --ink-soft:    #2A2823;
  --ink-mute:    #6A6458;
  --accent:      #5A3A1F;
  --accent-deep: #3E2814;

  /* Rules — §VII */
  --rule-light:  rgba(20, 19, 15, 0.14);
  --rule-strong: rgba(20, 19, 15, 0.32);

  /* Type scale — §V */
  --fs-display: clamp(2.25rem, 1.4rem + 4.2vw, 5.25rem); /* 36–84px */
  --fs-heading: clamp(1.5rem, 1.15rem + 1.7vw, 2.375rem); /* 24–38px */
  --fs-body:    1.0625rem; /* 17px */
  --fs-mono:    0.6875rem; /* 11px */

  /* Measure & rhythm — §VII */
  --measure: 56ch;
  --section-pad: clamp(72px, 10vw, 200px);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: "Fraunces", Georgia, serif;
  font-size: var(--fs-body);
  font-weight: 350;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Grain overlay — §VII, inline SVG turbulence at 32% multiply */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.32;
  mix-blend-mode: multiply;
  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.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3 { font-weight: 350; line-height: 1.12; color: var(--ink); margin: 0; }
p { margin: 0 0 1.25em; max-width: var(--measure); }
em { font-style: italic; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-deep); }

/* ============================================================
   LAYOUT
   ============================================================ */
.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 24px; }
.section { padding-block: var(--section-pad); }
.section + .section { border-top: 1px solid var(--rule-light); }

/* Mono label — §V, §VIII Section Header */
.mono { font-family: "IBM Plex Mono", "Courier New", monospace; font-size: var(--fs-mono);
  font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-mute); }
.section-header { display: flex; align-items: baseline; gap: 14px; margin-bottom: 2.5rem; }
.section-header .sep { flex: 0 0 28px; height: 1px; background: var(--rule-strong); transform: translateY(-3px); }

/* ============================================================
   MASTHEAD — §VII the single light exception (fade to transparent)
   ============================================================ */
.masthead { position: sticky; top: 0; z-index: 100; display: flex; justify-content: space-between;
  align-items: center; padding: 18px 24px; backdrop-filter: blur(2px);
  background: linear-gradient(to bottom, var(--paper) 55%, rgba(243,239,233,0)); }
.masthead .brand { font-size: var(--fs-mono); }
.masthead nav { display: flex; gap: 20px; }

/* ============================================================
   ARRIVAL (hero — a thesis, not an offer; no CTA button)
   ============================================================ */
.arrival { min-height: 88vh; display: flex; flex-direction: column; justify-content: center; }
.arrival .zone { margin-bottom: 2rem; }
.arrival h1 { font-size: var(--fs-display); max-width: 18ch; margin-bottom: 1.5rem; }
.arrival .lede { color: var(--ink-soft); font-size: 1.1875rem; }
.arrival .meta { margin-top: 3rem; }
.continue { margin-top: 4rem; display: inline-flex; align-items: center; gap: 10px;
  font-family: "IBM Plex Mono", monospace; font-size: var(--fs-mono); letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-mute); }
.continue::after { content: "↓"; display: inline-block; animation: drift 2.4s ease-in-out infinite; }
@keyframes drift { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(5px);} }

/* ============================================================
   COMPONENTS — §VIII
   ============================================================ */
/* Thread — inline expandable, dashed underline + toggle */
.thread { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: inherit;
  border-bottom: 1px dashed var(--accent); }
.thread-toggle { color: var(--accent); font-family: "IBM Plex Mono", monospace; font-size: 0.8em; }
.thread-body { display: none; margin: 1.25em 0; padding-left: 18px; border-left: 2px solid var(--accent);
  font-family: "IBM Plex Mono", monospace; font-size: 0.9rem; line-height: 1.7; color: var(--ink-mute); }
.thread-body.open { display: block; }

/* Pull-Quote — thick accent left rule, italic, mono attribution */
.pullquote { margin: 2.5rem 0; padding-left: 22px; border-left: 4px solid var(--accent); }
.pullquote p { font-style: italic; font-size: 1.25rem; color: var(--ink); max-width: 48ch; }
.pullquote .attr { font-family: "IBM Plex Mono", monospace; font-size: var(--fs-mono);
  letter-spacing: 0.06em; color: var(--ink-mute); margin: 0; }

/* Prompt Card — one per zone */
.prompt { border: 1px solid var(--rule-strong); background: var(--paper-deep); padding: 28px; margin: 3rem 0; }
.prompt .top { display: flex; justify-content: space-between; padding-bottom: 14px;
  border-bottom: 1px solid var(--rule-light); margin-bottom: 18px; }
.prompt .q { font-size: 1.375rem; color: var(--ink); max-width: 30ch; margin: 0 0 20px; }
.prompt .bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 14px;
  border-top: 1px solid var(--rule-light); }
.prompt .copy { border: 1px solid var(--rule-strong); background: none; cursor: pointer;
  font-family: "IBM Plex Mono", monospace; font-size: var(--fs-mono); letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink); padding: 8px 14px; }
.prompt .copy:hover { background: var(--ink); color: var(--paper); }

/* Field Notes Entry */
.entry { border: 1px solid var(--rule-light); padding: 24px; margin-bottom: 18px; }
.entry .meta-row { display: flex; gap: 14px; margin-bottom: 12px; }
.entry h3 { font-size: 1.375rem; margin-bottom: 4px; }
.entry .subtitle { font-style: italic; color: var(--ink-mute); }
.entry .byline { font-family: "IBM Plex Mono", monospace; font-size: var(--fs-mono);
  color: var(--ink-mute); margin: 6px 0 12px; letter-spacing: 0.04em; }

/* Zone signposts */
.signpost { margin-bottom: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--rule-light); }
.signpost:last-child { border-bottom: 0; }
.signpost h3 { font-size: var(--fs-heading); margin-bottom: 10px; }

/* Email capture — one field, framed as the landscape growing */
.capture { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.capture input { flex: 1; min-width: 200px; border: 1px solid var(--rule-strong); background: var(--paper);
  padding: 12px 14px; font: inherit; color: var(--ink); }
.capture button { border: 1px solid var(--ink); background: var(--ink); color: var(--paper); cursor: pointer;
  font-family: "IBM Plex Mono", monospace; font-size: var(--fs-mono); letter-spacing: 0.08em;
  text-transform: uppercase; padding: 12px 20px; }
.capture button:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.fineprint { font-family: "IBM Plex Mono", monospace; font-size: var(--fs-mono); color: var(--ink-mute);
  margin-top: 12px; letter-spacing: 0.03em; }

/* Footer */
.site-footer { padding: 40px 24px; border-top: 1px solid var(--rule-light); }
.site-footer .mono { display: block; text-align: center; }

/* Scroll reveal — §VII gentle fade-and-rise only */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .continue::after { animation: none; }
  html { scroll-behavior: auto; }
}
