/* Rabbit Hole Digital — WordPress theme styles
   Tokens + studio kit layout + form/button primitives. */

:root {
  --ivory: #E8EDDF;
  --dust: #CFDBD5;
  --gold: #F5CB5C;
  --shadow: #242423;
  --graphite: #333533;

  --bg: var(--ivory);
  --surface: var(--dust);
  --surface-sunk: #DBE4DA;
  --text: var(--shadow);
  --text-muted: #565751;
  --text-faint: #7C7D75;
  --accent: var(--gold);
  --on-accent: var(--shadow);
  --accent-hover: #E6B93F;
  --accent-active: #D4A92F;
  --accent-soft: #FBEFCB;
  --hairline: #D6E0DA;
  --hairline-strong: #B8C6C0;
  --focus-ring: var(--gold);
  --card-bg: linear-gradient(180deg, #F2F5EC 0%, var(--ivory) 100%);

  --font-display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Instrument Sans', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --weight-light: 300;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-black: 900;

  --display-size: clamp(3.25rem, 6vw + 1rem, 5rem);
  --display-lh: 0.95;
  --display-ls: -0.02em;
  --h1-size: clamp(2.25rem, 3vw + 1rem, 3rem);
  --h1-lh: 1.04;
  --h1-ls: -0.02em;
  --h2-size: 2.125rem;
  --h2-lh: 1.1;
  --h2-ls: -0.015em;
  --h3-size: 1.5rem;
  --h3-lh: 1.2;
  --h3-ls: -0.01em;
  --body-size: 1rem;
  --body-lh: 1.65;
  --body-lg-size: 1.1875rem;
  --body-lg-lh: 1.6;
  --small-size: 0.8125rem;
  --mono-size: 0.75rem;
  --mono-ls: 0.14em;
  --mono-weight: var(--weight-semibold);
  --quote-size: clamp(1.5rem, 2vw + 1rem, 1.875rem);
  --quote-lh: 1.32;
  --quote-ls: -0.01em;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;

  --container-max: 1120px;
  --container-pad-desktop: 2.5rem;
  --container-pad-mobile: 1.25rem;

  --radius-button: 6px;
  --radius-pill: 999px;
  --radius-card: 4px;
  --radius-none: 0;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur: 180ms;
  --rh-ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --rh-ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

.rh-dark {
  --bg: var(--shadow);
  --surface: var(--graphite);
  --surface-sunk: #1A1E1D;
  --text: var(--ivory);
  --text-muted: #B4BEB6;
  --text-faint: #868F88;
  --accent: var(--gold);
  --on-accent: var(--shadow);
  --accent-hover: #F8D778;
  --accent-active: #E6B93F;
  --accent-soft: #3A3826;
  --hairline: #3A403D;
  --hairline-strong: #4C544F;
  --focus-ring: var(--gold);
}

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

html, body { margin: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--ivory);
  color: var(--shadow);
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: var(--body-lh);
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; display: block; }
a {
  color: inherit;
  transition: color var(--dur) var(--ease);
}
a:hover { color: var(--accent); }

.rh-wrap {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-pad-mobile);
  padding-right: var(--container-pad-mobile);
}
@media (min-width: 720px) {
  .rh-wrap {
    padding-left: var(--container-pad-desktop);
    padding-right: var(--container-pad-desktop);
  }
}

.rh-mono-link {
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.25rem 0;
  transition: color var(--dur) var(--ease);
}
.rh-mono-link:hover,
.rh-mono-link.is-current { color: var(--accent); }
.rh-mono-link:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

.rh-btn {
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  font-weight: var(--mono-weight);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.75rem 1.25rem;
  min-height: 44px;
  border-radius: var(--radius-button);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.rh-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}
.rh-btn--sm {
  font-size: var(--small-size);
  padding: 0.75rem 1rem;
  min-height: 44px;
}
.rh-btn--solid {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.rh-btn--solid:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--on-accent);
}
.rh-btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--hairline-strong);
}
.rh-btn--ghost:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}
.rh-btn:disabled,
.rh-btn[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
}

.rh-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  font-weight: var(--mono-weight);
  letter-spacing: var(--mono-ls);
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
}
.rh-eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  flex-shrink: 0;
}

.rh-section-marker {
  display: flex;
  gap: var(--space-3);
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  font-weight: var(--mono-weight);
  letter-spacing: var(--mono-ls);
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
}
.rh-section-marker span:first-child { color: var(--accent); }

.rh-h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--h1-size);
  line-height: var(--h1-lh);
  letter-spacing: var(--h1-ls);
  margin: 0;
  color: var(--text);
  text-wrap: balance;
}
.rh-h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--h2-size);
  line-height: var(--h2-lh);
  letter-spacing: var(--h2-ls);
  margin: 0;
  color: var(--text);
}
.rh-h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--h3-size);
  line-height: var(--h3-lh);
  letter-spacing: var(--h3-ls);
  margin: 0;
  color: var(--text);
}
.rh-lede {
  font-family: var(--font-body);
  font-size: var(--body-lg-size);
  line-height: var(--body-lg-lh);
  color: var(--text);
  margin: 0;
  text-wrap: pretty;
}
.rh-body-muted {
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: var(--body-lh);
  color: var(--text-muted);
  margin: 0;
  text-wrap: pretty;
}

.rh-brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  min-height: 44px;
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  font-size: var(--body-size);
  line-height: 1.15;
  max-width: 18rem;
  transition: color var(--dur) var(--ease);
}
.rh-brand-mark:hover { color: var(--text); }
.rh-brand-mark:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}
.rh-rabbit-mark {
  display: block;
  flex-shrink: 0;
  width: 1.55em;
  height: 1.2em;
  color: inherit;
}
.rh-brand-accent { color: var(--accent); }

.rh-site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
}
.rh-nav-links {
  display: flex;
  gap: var(--space-4);
  align-items: center;
}
@media (min-width: 720px) {
  .rh-nav-links { gap: var(--space-6); }
}
.rh-nav-actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex-shrink: 0;
}
@media (min-width: 720px) {
  .rh-nav-actions { gap: var(--space-5); }
}

.rh-forge-hero {
  position: relative;
  overflow: hidden;
  background: var(--surface-sunk);
  color: var(--text);
}
.rh-hero-mesh {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, transparent 18%, var(--ivory) 100%);
  mask-image: linear-gradient(90deg, transparent 0%, transparent 18%, var(--ivory) 100%);
}
.rh-hero-mesh canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
.rh-hero-foreground { position: relative; z-index: 1; }
.rh-hero-inner {
  padding-top: var(--space-10);
  padding-bottom: var(--space-10);
}
.rh-hero-offers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  align-items: center;
}
.rh-hero-offers li {
  display: inline-flex;
  align-items: center;
  gap: var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  font-weight: var(--mono-weight);
  letter-spacing: var(--mono-ls);
  text-transform: uppercase;
  color: var(--text-muted);
}
.rh-hero-offers .dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  flex-shrink: 0;
}
.rh-display {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--display-size);
  line-height: var(--display-lh);
  letter-spacing: var(--display-ls);
  text-transform: uppercase;
  margin: var(--space-4) 0 0;
  max-width: 14ch;
  text-wrap: balance;
}
.rh-hero-rule {
  display: block;
  width: min(11rem, 48%);
  height: 3px;
  margin-top: var(--space-5);
  background: var(--accent);
  transform-origin: left center;
}
.rh-hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.rh-section {
  padding-top: var(--space-10);
  padding-bottom: var(--space-10);
}
.rh-section--dust { background: var(--surface); }
.rh-section--ivory { background: var(--ivory); }
.rh-section--shadow {
  background: var(--surface-sunk);
  color: var(--text);
}

.rh-services-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  align-items: start;
}
@media (min-width: 860px) {
  .rh-services-split {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.35fr);
    gap: var(--space-8);
  }
  .rh-services-intro {
    position: sticky;
    top: var(--space-6);
  }
}
.rh-service-row {
  padding: var(--space-7) 0;
  border-top: 1px solid var(--hairline);
}
.rh-service-row:first-child { border-top-color: var(--hairline-strong); }
.rh-service-row:last-child { border-bottom: 1px solid var(--hairline-strong); }
.rh-service-row p {
  font-size: var(--body-lg-size);
  line-height: var(--body-lg-lh);
  color: var(--text);
  margin: var(--space-4) 0 0;
  max-width: 40ch;
}

.rh-approach-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--hairline);
  position: relative;
}
.rh-approach-row {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: var(--space-3) var(--space-4);
  align-items: baseline;
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--hairline);
}
.rh-approach-row > :nth-child(3) { grid-column: 2; }
@media (min-width: 720px) {
  .rh-approach-row {
    grid-template-columns: 4.5rem minmax(8rem, 12rem) 1fr;
    gap: var(--space-5);
  }
  .rh-approach-row > :nth-child(3) { grid-column: auto; }
}
.rh-forge-step-n {
  font-family: var(--font-mono);
  font-size: var(--body-size);
  font-weight: 600;
  color: var(--text-faint);
  transition: color 280ms var(--rh-ease-out-quart);
}
.rh-forge-step.is-struck .rh-forge-step-n { color: var(--accent); }

.rh-forge-ledger { --rh-ledger-x: 1.25rem; --rh-ledger-fill: 0; }
@media (min-width: 720px) {
  .rh-forge-ledger { --rh-ledger-x: 2rem; }
}
.rh-forge-ledger::before,
.rh-forge-ledger::after {
  content: "";
  position: absolute;
  left: var(--rh-ledger-x);
  top: 0.5rem;
  bottom: 0.5rem;
  width: 3px;
  pointer-events: none;
}
.rh-forge-ledger::before { background: var(--hairline-strong); }
.rh-forge-ledger::after {
  background: var(--accent);
  transform: scaleY(var(--rh-ledger-fill, 0));
  transform-origin: top center;
}

.rh-work-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-5);
  align-items: end;
  margin-bottom: var(--space-7);
}
.rh-work-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--hairline);
  text-decoration: none;
  color: inherit;
  transition: border-color 180ms var(--ease);
}
.rh-work-row:hover { border-bottom-color: var(--accent); }
.rh-work-row:hover .rh-work-row-title { color: var(--accent); }
.rh-work-row-meta {
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.rh-work-row-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--h3-size);
  letter-spacing: var(--h3-ls);
  color: var(--text);
  transition: color 180ms var(--ease);
}
@media (min-width: 720px) {
  .rh-work-row {
    grid-template-columns: 5.5rem minmax(10rem, 14rem) 1fr auto;
    gap: var(--space-5);
    align-items: baseline;
  }
}

.rh-quote {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--quote-size);
  line-height: var(--quote-lh);
  letter-spacing: var(--quote-ls);
  color: var(--text);
  margin: 0;
  text-wrap: pretty;
}
.rh-quote cite {
  display: block;
  margin-top: var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  font-style: normal;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.rh-contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-8);
  align-items: start;
}
.rh-field { display: flex; flex-direction: column; gap: var(--space-2); }
.rh-field label {
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.rh-field input,
.rh-field select,
.rh-field textarea {
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: 1.4;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-button);
  padding: 0.75rem 0.875rem;
  width: 100%;
}
.rh-field input:focus,
.rh-field select:focus,
.rh-field textarea:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.rh-contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.rh-contact-form.is-sent {
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--accent) 35%, transparent);
}

.rh-footer {
  background: var(--surface-sunk);
  color: var(--text);
  padding-top: var(--space-7);
  padding-bottom: var(--space-7);
}
.rh-footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-5);
  align-items: center;
}
.rh-footer-links {
  display: flex;
  gap: var(--space-5);
  flex-wrap: wrap;
}
.rh-footer-note {
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.rh-page-inner {
  padding-top: var(--space-9);
  padding-bottom: var(--space-9);
}
.rh-wrap.rh-article,
.rh-wrap.rh-page-inner {
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.rh-article-body {
  font-family: var(--font-body);
  font-size: var(--body-lg-size);
  line-height: var(--body-lg-lh);
  color: var(--text);
  margin-top: var(--space-6);
}
.rh-article-body > *:first-child { margin-top: 0; }
.rh-article-body p,
.rh-article-body ul,
.rh-article-body ol,
.rh-article-body blockquote {
  margin: 0 0 var(--space-5);
  max-width: 68ch;
}
.rh-case-block p {
  max-width: 68ch;
}
.rh-field-error {
  color: var(--accent-active);
}
.rh-article-body h2,
.rh-article-body h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--h3-ls);
  color: var(--text);
  margin: var(--space-7) 0 var(--space-3);
}
.rh-article-body h2 { font-size: var(--h2-size); line-height: var(--h2-lh); }
.rh-article-body h3 { font-size: var(--h3-size); line-height: var(--h3-lh); }
.rh-article-body a { color: var(--accent-active); text-decoration: none; }
.rh-article-body a:hover { color: var(--accent); }
.rh-article-body ul,
.rh-article-body ol { padding-left: 1.25em; }
.rh-article-body li + li { margin-top: var(--space-2); }
.rh-case-block .rh-lede { max-width: none; }
.rh-article-meta {
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin: 0 0 var(--space-5);
}
.rh-case-block {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--hairline);
}
.rh-case-block h2 {
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  font-weight: var(--mono-weight);
  letter-spacing: var(--mono-ls);
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--space-3);
}
.rh-case-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  margin: var(--space-6) 0;
}
@media (min-width: 720px) {
  .rh-case-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-6);
  }
}
.rh-case-meta dt {
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 var(--space-2);
}
.rh-case-meta dd {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--h3-size);
  color: var(--text);
}

.rh-work-close {
  background: var(--surface-sunk);
  color: var(--text);
  padding: var(--space-10) 0;
  text-align: left;
}

.rh-forge-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 40;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}

@keyframes rh-enter {
  from { opacity: 0.001; transform: translateY(0.55rem); filter: blur(3px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes rh-strike {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

@media (prefers-reduced-motion: no-preference) {
  .rh-forge-hero.is-ready .rh-enter-title {
    animation: rh-enter 720ms var(--rh-ease-out-expo) both;
  }
  .rh-forge-hero.is-ready .rh-enter-strike {
    animation: rh-strike 820ms var(--rh-ease-out-expo) 120ms both;
  }
  .rh-forge-hero.is-ready .rh-enter-lede {
    animation: rh-enter 640ms var(--rh-ease-out-expo) 160ms both;
  }
  .rh-forge-hero.is-ready .rh-enter-cta {
    animation: rh-enter 600ms var(--rh-ease-out-expo) 260ms both;
  }
  .rh-forge-hero.is-ready .rh-hero-offers {
    animation: rh-enter 560ms var(--rh-ease-out-expo) 40ms both;
  }
  .rh-forge-hero.is-ready .rh-hero-rule {
    animation: rh-strike 900ms var(--rh-ease-out-expo) 200ms both;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rh-forge-progress { display: none; }
  .rh-forge-ledger::after { transform: scaleY(1); }
  .rh-forge-step .rh-forge-step-n { color: var(--accent); }
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* Work archive: continuous dark surface */
.rh-dark.rh-section--shadow,
.rh-section--shadow.rh-dark {
  background: var(--surface-sunk);
  color: var(--text);
}
.rh-dark .rh-work-row-title { color: var(--text); }
.rh-dark .rh-body-muted { color: var(--text-muted); }
.rh-dark .pagination,
.rh-dark .nav-links {
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: var(--space-7);
  color: var(--text-muted);
}
.rh-dark .pagination a,
.rh-dark .nav-links a { color: var(--text-muted); text-decoration: none; }
.rh-dark .pagination a:hover,
.rh-dark .nav-links a:hover { color: var(--accent); }
