/* ===========================================================
   Parseroot Labs — site styles
   =========================================================== */

:root {
  /* Light mode */
  --bg:           #efece2;
  --bg-elev:      #f5f2e8;
  --fg:           #0e1612;
  --fg-soft:      #4a544f;
  --fg-faint:     #8d9189;

  /* Forest accent — saturated enough to read clearly against
     both the cream bg and the near-black body text. */
  --accent:       #1f6b3e;
  --accent-soft:  #5d8a6e;
  --accent-tint:  rgba(31, 107, 62, 0.08);
  --accent-glow:  rgba(31, 107, 62, 0.06);

  --line:         #d6d1c2;
  --line-soft:    #e4dfd0;

  --font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-body:    'Newsreader', Georgia, 'Times New Roman', serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', Menlo, ui-monospace, monospace;

  --max-w: 1180px;
}

[data-theme="dark"] {
  --bg:           #08110b;
  --bg-elev:      #0e1812;
  --fg:           #e6e3d5;
  --fg-soft:      #a3a89c;
  --fg-faint:     #5d6259;

  --accent:       #82c39a;
  --accent-soft:  #4f7560;
  --accent-tint:  rgba(130, 195, 154, 0.10);
  --accent-glow:  rgba(130, 195, 154, 0.10);

  --line:         #1c2620;
  --line-soft:    #131a16;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--fg);
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 700px at 50% -120px, var(--accent-glow), transparent 65%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  font-feature-settings: "kern", "liga", "onum";
  font-variant-numeric: oldstyle-nums;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 320ms ease, color 320ms ease;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 200ms ease;
}

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

/* ===========================================================
   Layout shell
   =========================================================== */

.shell {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

main { flex: 1 0 auto; }

/* ===========================================================
   Header
   =========================================================== */

.site-header {
  border-bottom: 1px solid var(--line);
  padding: 1.125rem 0;
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
          backdrop-filter: saturate(140%) blur(10px);
  z-index: 20;
}

.site-header .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--fg);
  letter-spacing: 0;
}

.wordmark__mark {
  width: 16px;
  height: 20px;
  flex: 0 0 auto;
  color: var(--fg);
}

.wordmark__mark .m-node { fill: currentColor; }
.wordmark__mark .m-line { stroke: var(--accent); fill: none; stroke-width: 0.6; }

.wordmark__text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* "Labs" rendered in accent — a small, persistent green moment. */
.wordmark__text .dim { color: var(--accent); }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.875rem, 2.2vw, 1.75rem);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.site-nav a {
  color: var(--fg-faint);
  position: relative;
  padding: 0.125rem 0;
}

.site-nav a:hover { color: var(--fg); }

.site-nav a.is-active {
  color: var(--fg);
}

.site-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--accent);
}

.theme-toggle {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg-soft);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: border-color 200ms ease, color 200ms ease, transform 240ms cubic-bezier(.2,.8,.2,1);
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(-12deg);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle svg { width: 14px; height: 14px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ===========================================================
   Hero
   =========================================================== */

.hero {
  padding: clamp(4rem, 11vw, 9rem) 0 clamp(3rem, 7vw, 5.5rem);
  text-align: center;
  position: relative;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: clamp(2rem, 4vw, 2.75rem);
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.eyebrow::before,
.eyebrow::after {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--accent);
  opacity: 0.7;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: var(--fg);
  max-width: 19ch;
  margin: 0 auto;
  font-variation-settings: "opsz" 72;
}

.hero__title em {
  font-style: italic;
  font-weight: 300;
  color: var(--accent);
  letter-spacing: -0.015em;
}

.hero__lede {
  font-family: var(--font-body);
  font-size: clamp(1.0625rem, 1.45vw, 1.1875rem);
  line-height: 1.6;
  max-width: 40rem;
  margin: clamp(1.75rem, 3vw, 2.25rem) auto 0;
  color: var(--fg-soft);
}

/* ===========================================================
   Block tree (hero seal)
   =========================================================== */

.tree-figure {
  margin: clamp(3rem, 7vw, 5.5rem) auto 0;
  max-width: 320px;
  width: 100%;
}

.block-tree { width: 100%; height: auto; display: block; }
.block-tree .horizon {
  stroke: var(--accent);
  stroke-width: 0.5;
  stroke-dasharray: 1.5 3;
  opacity: 0.45;
}
.block-tree .branch {
  stroke: var(--accent);
  stroke-width: 1;
  fill: none;
  opacity: 0.7;
}
.block-tree .node { fill: var(--fg); }
.block-tree .node--alive {
  animation: nodePulse 7s ease-in-out infinite;
  animation-delay: 1.4s;
}

@keyframes nodePulse {
  0%, 88%, 100% { fill: var(--fg); }
  44%           { fill: var(--accent); }
}

.tree-figure__caption {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-faint);
  text-align: center;
  margin-top: 1.5rem;
}

/* ===========================================================
   Editorial section
   =========================================================== */

.section {
  padding: clamp(4rem, 7vw, 6.5rem) 0;
  border-top: 1px solid var(--line);
  position: relative;
}

.section__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.85fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.section__lead {
  position: sticky;
  top: 5.5rem;
}

.section__label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
}

.section__label::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--accent);
}

/* When a status indicator is present, use it instead of the line. */
.section__label--status::before { display: none; }

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  display: inline-block;
  flex: 0 0 auto;
  position: relative;
  top: 0.5px;
}

.status-dot--active {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.status-dot--future {
  background: transparent;
  border: 1px solid var(--accent);
}

@media (prefers-reduced-motion: no-preference) {
  .status-dot--active {
    animation: dotBreath 3s ease-in-out infinite;
  }
  @keyframes dotBreath {
    0%, 100% { box-shadow: 0 0 0 2px var(--accent-tint); }
    50%      { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 4%, transparent); }
  }
}

.section__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.018em;
  color: var(--fg);
  max-width: 16ch;
  font-variation-settings: "opsz" 36;
}

.section__title em { font-style: italic; color: var(--accent); }

.section__body p {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--fg-soft);
  max-width: 38rem;
  font-variation-settings: "opsz" 14;
}

.section__body p + p { margin-top: 1.25rem; }

.section__body p .lift {
  color: var(--fg);
  font-style: italic;
}

.section__meta {
  margin-top: clamp(2.25rem, 4vw, 3rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-soft);
  letter-spacing: 0.04em;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
}

.section__meta span strong {
  color: var(--accent);
  font-weight: 500;
  margin-right: 0.5rem;
  text-transform: uppercase;
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
}

@media (max-width: 760px) {
  .section__grid { grid-template-columns: 1fr; gap: 2rem; }
  .section__lead { position: static; }
}

/* ===========================================================
   Contact
   =========================================================== */

.contact {
  padding: clamp(4.5rem, 9vw, 8rem) 0;
  border-top: 1px solid var(--line);
  text-align: center;
}

.contact__lede {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.contact__email {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.875rem, 4.4vw, 3.25rem);
  letter-spacing: -0.012em;
  color: var(--fg);
  display: inline-block;
  position: relative;
  padding-bottom: 0.1em;
  font-variation-settings: "opsz" 60;
}

.contact__email::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 600ms cubic-bezier(.2,.8,.2,1);
}

.contact__email:hover { color: var(--accent); }
.contact__email:hover::after { transform: scaleX(1); }

.contact__note {
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

/* ===========================================================
   Footer
   =========================================================== */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.75rem 0;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--fg-faint);
}

.site-footer .shell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.site-footer__left, .site-footer__right {
  display: inline-flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.site-footer a:hover { color: var(--fg); }

.dot {
  width: 3px;
  height: 3px;
  background: var(--accent);
  border-radius: 999px;
  display: inline-block;
  opacity: 0.7;
}

/* ===========================================================
   Privacy policy page
   =========================================================== */

.policy {
  padding: clamp(4rem, 8vw, 7rem) 0 clamp(3rem, 6vw, 5rem);
}

.policy__head {
  border-bottom: 1px solid var(--line);
  padding-bottom: clamp(2rem, 4vw, 3rem);
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  max-width: 50rem;
}

.policy__head .eyebrow {
  margin-bottom: 1.25rem;
}

.policy__head h1 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.25rem, 4.5vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin-bottom: 1rem;
  font-variation-settings: "opsz" 72;
}

.policy__head .updated {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-faint);
  letter-spacing: 0.08em;
}

.policy-content {
  max-width: 42rem;
  font-size: 1.0625rem;
  line-height: 1.72;
  color: var(--fg-soft);
}

.policy-content h2,
.policy-content h3,
.policy-content h4 {
  font-family: var(--font-display);
  color: var(--fg);
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 24;
}

.policy-content h2 {
  font-weight: 400;
  font-size: 1.625rem;
  line-height: 1.25;
  margin: 2.75rem 0 1rem;
}

.policy-content h3 {
  font-weight: 500;
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
}

.policy-content h4 {
  font-weight: 500;
  font-size: 1.0625rem;
  margin: 1.5rem 0 0.5rem;
}

.policy-content p { margin-bottom: 1.125rem; }
.policy-content ul,
.policy-content ol { margin: 1rem 0 1.25rem 1.5rem; }
.policy-content li { margin-bottom: 0.5rem; }
.policy-content li::marker { color: var(--accent); }
.policy-content a {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  padding-bottom: 1px;
  transition: color 200ms ease, border-color 200ms ease;
}
.policy-content a:hover {
  color: var(--fg);
  border-color: var(--fg);
}
.policy-content strong { color: var(--fg); font-weight: 500; }
.policy-content em { font-style: italic; }
.policy-content hr {
  border: 0;
  border-top: 1px solid var(--line-soft);
  margin: 2rem 0;
}
.policy-content blockquote {
  margin: 1.5rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--accent);
  color: var(--fg);
  font-style: italic;
}
.policy-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-elev);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.policy-placeholder {
  border: 1px dashed var(--line);
  border-radius: 4px;
  background: var(--bg-elev);
  padding: clamp(1.75rem, 4vw, 2.5rem);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--fg-soft);
  letter-spacing: 0.01em;
}

.policy-placeholder strong {
  color: var(--accent);
  font-weight: 500;
  display: block;
  margin-bottom: 0.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.6875rem;
}

.policy-placeholder a { color: var(--accent); }

/* ===========================================================
   Entrance reveal
   =========================================================== */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(10px);
    animation: reveal 900ms cubic-bezier(.2,.8,.2,1) forwards;
  }
  .reveal[data-delay="1"] { animation-delay: 80ms; }
  .reveal[data-delay="2"] { animation-delay: 200ms; }
  .reveal[data-delay="3"] { animation-delay: 340ms; }
  .reveal[data-delay="4"] { animation-delay: 500ms; }
  .reveal[data-delay="5"] { animation-delay: 700ms; }
  .reveal[data-delay="6"] { animation-delay: 920ms; }

  @keyframes reveal {
    to { opacity: 1; transform: translateY(0); }
  }

  .block-tree .branch {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: branchDraw 2.4s cubic-bezier(.2,.8,.2,1) 600ms forwards;
  }
  @keyframes branchDraw {
    to { stroke-dashoffset: 0; }
  }
}

/* ===========================================================
   Responsive
   =========================================================== */

@media (max-width: 540px) {
  .site-nav { gap: 0.875rem; }
  .wordmark__text .full { display: none; }
  .site-footer .shell { flex-direction: column; align-items: flex-start; }
}
