/* ==========================================================================
   Rootwise Holdings — shared design system
   Apothecary-modern: engraved rules, botanical restraint, generous measure.
   Palette is unchanged from the original site; only its application is new.
   ========================================================================== */

:root {
  /* Core palette (unchanged) */
  --bg: #f7f3ec;
  --surface: #faf8f4;
  --ink: #1c1a17;
  --forest: #2d4a35;
  --moss: #4a7c59;
  --sage: #8aab8f;
  --gold: #b8862a;
  --gold-light: #e8c97a;
  --gold-pale: #f5edd8;
  --cream: #f7f3ec;
  --stone: #8c8478;
  --border: rgba(44, 74, 53, 0.1);

  /* Derived tones — same hues, extra steps for depth */
  --forest-deep: #223829;
  --ink-soft: rgba(28, 26, 23, 0.72);
  --rule: rgba(44, 74, 53, 0.14);
  --rule-soft: rgba(44, 74, 53, 0.08);
  --gold-rule: rgba(184, 134, 42, 0.32);
  --on-forest: rgba(247, 243, 236, 0.82);
  --on-forest-dim: rgba(247, 243, 236, 0.5);
  --on-forest-faint: rgba(247, 243, 236, 0.28);

  /* Type */
  --display: 'Marcellus', Georgia, serif;
  --sans: 'Epilogue', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;

  --radius: 2px;
  --gutter: clamp(1.25rem, 5vw, 3rem);
}

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

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Laid paper grain — barely perceptible, but it kills the flat-template look. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23g)'/%3E%3C/svg%3E");
}

::selection { background: var(--gold-pale); color: var(--forest); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 1px;
}

img, video { max-width: 100%; height: auto; display: block; }

/* Trademark marks ride high and small, never as full-size glyphs. */
sup {
  font-size: 0.5em;
  line-height: 0;
  vertical-align: super;
  letter-spacing: 0.02em;
}


/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.wrap {
  width: min(1120px, 100%);
  margin-inline: auto;
  padding-inline: var(--gutter);
  text-align: center;
}

/* Same outer box as .wrap; the measure is capped on the children and each one
   is centred, so long-form text stays readable without hugging either edge. */
.wrap-tight {
  width: min(1120px, 100%);
  margin-inline: auto;
  padding-inline: var(--gutter);
  text-align: center;
}

.wrap-tight > * { max-width: 52rem; margin-inline: auto; }

/* Section stack. The label sits above its content on the page's single left
   edge — nav, hero, every heading, body copy, and footer all start here. */
.rail { display: block; }

.band { padding-block: clamp(2.5rem, 5vw, 3.75rem); }
.band-forest { background: var(--forest); color: var(--on-forest); }
.band-surface { background: var(--surface); border-block: 1px solid var(--rule-soft); }


/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */

.display-1,
.display-2,
.display-3 {
  font-family: var(--display);
  font-weight: 400;
  color: var(--forest);
  letter-spacing: -0.008em;
  text-wrap: balance;
}

/* Tight solid underpress in dark gold — crisp letterpress depth, no blur. */
.display-1 {
  font-size: clamp(1.85rem, 4.2vw, 2.85rem);
  line-height: 1.14;
  text-shadow: 0 2px 0 rgba(156, 113, 31, 0.35);
}

/* Short gold rule under a page's main headline. */
.headrule {
  width: 72px;
  height: 3px;
  margin: 1.1rem auto 0;
  background: linear-gradient(90deg, #9c711f, var(--gold));
}

.display-2 {
  font-size: clamp(1.4rem, 2.6vw, 1.95rem);
  line-height: 1.2;
}

.display-3 {
  font-size: clamp(1.1rem, 1.7vw, 1.3rem);
  line-height: 1.3;
}

/* The one accent that stays: an italic phrase, used once per page at most. */
.accent {
  font-style: italic;
  font-weight: 300;
  color: var(--gold);
}

.band-forest .display-1,
.band-forest .display-2,
.band-forest .display-3 { color: var(--cream); }

.band-forest .accent { color: var(--gold-light); }

/* Short intro paragraphs sit centred under their centred headline; long-form
   body copy further down the page stays left-aligned. */
.lede {
  font-size: clamp(0.95rem, 1.15vw, 1.05rem);
  line-height: 1.65;
  color: var(--ink-soft);
  font-weight: 400;
  max-width: 64ch;
  margin-inline: auto;
  text-align: center;
  text-wrap: pretty;
}

.band-forest .lede { color: var(--on-forest); }

/* Small label type. Sans, not mono — mono is reserved for actual code. */
.eyebrow {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--moss);
}

.eyebrow-gold { color: var(--gold); }
.band-forest .eyebrow { color: var(--sage); }

/* Section index number — the recurring structural device across the site. */
.index-num {
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  display: block;
  margin-bottom: 0.55rem;
}

/* Section label: a hairline, then "01 · SECTION" on one line above the heading. */
.rail-label {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.85rem;
  border-top: 1px solid var(--gold-rule);
  padding-top: 0.8rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

.rail-label .index-num { margin-bottom: 0; }

.band-forest .rail-label { border-top-color: rgba(232, 201, 122, 0.28); }

/* Engraved ornament: hairline, small gold lozenge, hairline. Echoes the mark. */
.ornament {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--gold);
}

.ornament::before,
.ornament::after {
  content: '';
  height: 1px;
  flex: 1;
  background: var(--gold-rule);
}

.ornament > i {
  width: 5px;
  height: 5px;
  background: currentColor;
  transform: rotate(45deg);
  flex: none;
  font-style: normal;
}

.ornament-start::before { display: none; }

hr.hairline {
  border: none;
  height: 1px;
  background: var(--rule-soft);
}


/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 243, 236, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule-soft);
}

.site-nav-inner {
  width: min(1120px, 100%);
  margin-inline: auto;
  padding: 1.1rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--display);
  font-size: 1.12rem;
  font-weight: 500;
  color: var(--forest);
  letter-spacing: 0.005em;
  line-height: 1.15;
  white-space: nowrap;
}

.brand a { color: inherit; text-decoration: none; }

.brand-sub {
  display: block;
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 0.3rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--stone);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-links a:hover,
.nav-links a:focus-visible { color: var(--forest); border-bottom-color: var(--gold); }

.nav-tag {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stone);
  white-space: nowrap;
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 10px 0 10px 10px;
  background: none;
  border: none;
  margin-left: auto;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--forest);
  transition: transform 0.25s, opacity 0.2s;
}

.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 760px) {
  .brand-sub { display: none; }
  .hamburger { display: flex; }
  .nav-links {
    display: none;
    order: 3;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0;
    margin-top: 0.35rem;
    border-top: 1px solid var(--rule-soft);
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    display: flex;
    align-items: center;
    min-height: 46px;
    font-size: 0.86rem;
    border-bottom: 1px solid var(--rule-soft);
  }
  .nav-links li:last-child a { border-bottom: none; }
}


/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

/* Raised button: the subtle golden gradient from the Media site, a tight
   contact shadow and a soft warm lift. Hover raises it a further pixel. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0 1.4rem;
  border: 1px solid transparent;
  border-radius: 4px;
  background: linear-gradient(155deg, var(--gold), #9c711f);
  color: #fff;
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 2px 4px rgba(28, 26, 23, 0.12), 0 10px 20px -10px rgba(184, 134, 42, 0.55);
  transition: transform 0.2s, box-shadow 0.2s, color 0.2s, opacity 0.2s;
}

.btn:hover {
  color: #fff;
  opacity: 0.96;
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 4px 8px rgba(28, 26, 23, 0.14), 0 16px 28px -10px rgba(184, 134, 42, 0.6);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(28, 26, 23, 0.16);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 1px 2px rgba(28, 26, 23, 0.08);
}

.btn-ghost {
  background: none;
  color: var(--forest);
  border-color: var(--rule);
  box-shadow: none;
}

.btn-ghost:hover {
  color: var(--gold);
  border-color: var(--gold);
  opacity: 1;
  box-shadow: 0 4px 12px rgba(28, 26, 23, 0.07);
}

.btn-ghost:active { box-shadow: none; }

.link-quiet {
  color: var(--moss);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(74, 124, 89, 0.35);
  transition: color 0.2s, text-decoration-color 0.2s;
}

.link-quiet:hover { color: var(--gold); text-decoration-color: var(--gold); }


/* --------------------------------------------------------------------------
   Waitlist / forms
   -------------------------------------------------------------------------- */

.signup {
  max-width: 34rem;
  margin-inline: auto;
}

.signup-intro {
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.signup-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.field {
  width: 100%;
  height: 50px;
  padding: 0 0.95rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--ink);
  outline: none;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field::placeholder { color: var(--stone); opacity: 0.85; }
.field:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184, 134, 42, 0.13); }
.field.error { border-color: #a83232; }

.band-surface .field { background: var(--surface); }

.consent {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--stone);
  padding: 0.4rem 0 0.15rem;
  text-align: left;
  cursor: pointer;
}

.consent input[type="checkbox"] {
  margin-top: 0.22rem;
  flex: none;
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
  cursor: pointer;
}

.consent strong { color: var(--forest); font-weight: 600; }

.consent a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.consent a:hover { color: var(--forest); }

.signup-success {
  display: none;
  padding: 1.6rem 1.4rem;
  border-top: 2px solid var(--gold);
  background: var(--gold-pale);
  border-radius: 0 0 var(--radius) var(--radius);
}

.signup-success strong {
  display: block;
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--forest);
  margin-bottom: 0.35rem;
}

.signup-success p { font-size: 0.9rem; color: var(--ink-soft); }

.signup-note {
  margin-top: 1.1rem;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--stone);
}


/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  background: var(--forest);
  color: var(--on-forest-dim);
  padding-block: clamp(3rem, 6vw, 4.5rem) 2.25rem;
  font-size: 0.85rem;
  position: relative;
}

.site-footer::before {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(90deg, var(--gold) 0%, rgba(184, 134, 42, 0.15) 38%, rgba(184, 134, 42, 0) 100%);
  position: absolute;
  inset: 0 0 auto 0;
}

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

@media (max-width: 820px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}

.footer-mark {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--gold-light);
  line-height: 1.2;
}

.footer-mark a { color: inherit; text-decoration: none; }

.footer-tagline {
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 0.95rem;
  color: var(--on-forest-dim);
  margin-top: 0.4rem;
}

.footer-heading {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--on-forest-faint);
  padding-bottom: 0.7rem;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid rgba(247, 243, 236, 0.12);
}

.footer-list { list-style: none; line-height: 1.9; }
.footer-list li { font-size: 0.83rem; color: var(--on-forest-dim); }

.footer-list a,
.site-footer a.footer-link {
  color: var(--sage);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-list a:hover,
.site-footer a.footer-link:hover { color: var(--gold-light); }

.footer-people {
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(247, 243, 236, 0.1);
  font-size: 0.83rem;
  line-height: 1.85;
  color: var(--on-forest-dim);
}

.footer-people span { color: var(--on-forest-faint); }

.footer-base {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: 1.4rem;
  border-top: 1px solid rgba(247, 243, 236, 0.1);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--on-forest-faint);
}

.footer-base nav { display: flex; gap: 1.5rem; justify-content: center; }


/* --------------------------------------------------------------------------
   Legal pages
   -------------------------------------------------------------------------- */

.legal-head {
  padding-block: clamp(3.5rem, 7vw, 5.5rem) clamp(2rem, 4vw, 3rem);
}

.legal-meta {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--stone);
  margin-top: 1.1rem;
}

.legal-body { padding-block: clamp(2.5rem, 5vw, 4rem) clamp(4rem, 8vw, 6rem); }

.legal-body section + section {
  margin-top: 3.25rem;
  padding-top: 3.25rem;
  border-top: 1px solid var(--rule-soft);
}

.legal-body h2 {
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  font-weight: 400;
  color: var(--forest);
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin-bottom: 1.1rem;
}

.legal-body h3 {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--moss);
  margin-top: 2rem;
  margin-bottom: 0.7rem;
}

.legal-body p {
  font-size: 0.98rem;
  line-height: 1.8;
  color: var(--ink-soft);
  margin-bottom: 1rem;
  text-align: left;
}

.legal-body p:last-child { margin-bottom: 0; }

.legal-body ul {
  list-style: none;
  margin: 0.75rem 0 1.4rem;
  text-align: left;
}

.legal-body ul li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.7rem;
  font-size: 0.98rem;
  line-height: 1.75;
  color: var(--ink-soft);
}

.legal-body ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 5px;
  height: 5px;
  background: var(--gold);
  transform: rotate(45deg);
}

/* Structural bits stay centred even though running paragraphs are left-aligned. */
.legal-body p.index-num,
.legal-body p.legal-close,
.contact-block,
.contact-block p { text-align: center; }

.legal-body strong { font-weight: 600; color: var(--forest); }

.legal-body a {
  color: var(--moss);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(74, 124, 89, 0.35);
  transition: color 0.2s, text-decoration-color 0.2s;
}

.legal-body a:hover { color: var(--gold); text-decoration-color: var(--gold); }

.callout {
  background: var(--gold-pale);
  border-top: 2px solid var(--gold);
  padding: 1.15rem 1.4rem;
  margin: 1.35rem 0;
  border-radius: 0 0 var(--radius) var(--radius);
  text-align: left;
}

.callout p { color: var(--ink); margin-bottom: 0; font-size: 0.95rem; }

.contact-block {
  border-top: 1px solid var(--rule);
  padding-top: 1.2rem;
  margin-top: 1.4rem;
}

.contact-block p { margin-bottom: 0.15rem; font-size: 0.92rem; }

.contact-block .contact-name {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--forest);
  margin-bottom: 0.6rem;
}

.allcaps { text-align: left; }

.allcaps p,
.allcaps li {
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  line-height: 1.85;
  color: var(--stone);
}

.legal-close {
  margin-top: 3.5rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule-soft);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stone);
}


/* --------------------------------------------------------------------------
   Preview banner (demo pages)
   -------------------------------------------------------------------------- */

.preview-banner {
  background: var(--forest-deep);
  color: var(--on-forest-dim);
  text-align: center;
  padding: 0.7rem 1rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.preview-banner a {
  color: var(--gold-light);
  text-decoration: none;
  border-bottom: 1px solid rgba(232, 201, 122, 0.4);
  padding-bottom: 1px;
}

.preview-banner a:hover { color: #fff; border-bottom-color: #fff; }


/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
