/* ============================================================
   Ramblin Studio — ramblin.ai
   Tokens and rules per "Ramblin Studio Brand Guide v1", Aug 2026.
   No shadows anywhere: depth is hairline borders + surface changes.
   ============================================================ */

:root {
  /* Color */
  --paper:        #F6F2EA;
  --linen:        #EFE9DC;
  --surface:      #FFFFFF;
  --ink:          #21201C;
  --pine:         #2F5D4A;
  --pine-hover:   #25493B;
  --pine-link:    #1F3D31;
  --amber:        #E8B341;
  --clay:         #A34A32;
  --border:       #DED7C8;
  --border-strong:#C9C0AC;

  --text:         #21201C;
  --text-2:       #413E36;
  --muted:        #6E6857;
  --faint:        #8A8371;

  /* Type */
  --display: 'Familjen Grotesk', system-ui, sans-serif;
  --body:    'Libre Franklin', system-ui, sans-serif;
  --mono:    'Space Mono', ui-monospace, monospace;

  /* Spacing — 8px grid */
  --s1: 8px;  --s2: 16px; --s3: 24px; --s4: 32px;
  --s5: 56px; --s6: 72px; --s7: 112px;

  /* Radius */
  --r-control: 10px;
  --r-pill: 999px;

  /* Motion */
  --t-state: 180ms ease-out;
  --t-enter: 320ms ease-out;
}

/* Dark mode: Ink becomes the background, Paper text at 92%.
   Pine lightens to hold contrast; borders drop to a paper wash. */
@media (prefers-color-scheme: dark) {
  :root {
    --paper:        #21201C;
    --linen:        #282621;
    --surface:      #282621;
    --ink:          #F6F2EA;
    --pine:         #4A8368;
    --pine-hover:   #58977A;
    --pine-link:    #6FAE8F;
    --border:       rgba(246,242,234,.14);
    --border-strong:rgba(246,242,234,.28);

    --text:         rgba(246,242,234,.92);
    --text-2:       #B8B1A0;
    --muted:        #9A9382;
    --faint:        #8A8371;
  }
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--amber); color: #21201C; }

a {
  color: var(--pine);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--pine) 35%, transparent);
  transition: color var(--t-state), border-color var(--t-state);
}
a:hover { color: var(--pine-link); border-bottom-color: var(--pine-link); }

:where(a, button, input, summary):focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  border-radius: 2px;
}

p { margin: 0; max-width: 34em; text-wrap: pretty; }
h1, h2, h3 { margin: 0; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--paper);
  padding: 12px 16px; z-index: 20; border: 0;
}
.skip:focus { left: 8px; top: 8px; }

/* Standalone message pages (404, no-JS form result). */
.pagelet { min-height: 76vh; align-content: center; }
.pagelet .display { font-size: clamp(44px, 5vw, 64px); }

/* ---------- Type roles ---------- */

.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
}
.mono--pine { color: var(--pine); }
.mono--amber { color: var(--amber); }
.mono--clay { color: var(--clay); }

.display {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(44px, 6.4vw, 96px);
  line-height: .96;
  letter-spacing: -.03em;
  max-width: 15em;
  text-wrap: balance;
}

.h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -.02em;
}

.h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -.01em;
}

.lede { font-size: 20px; line-height: 1.55; color: var(--text-2); }
/* Pull quote role from the guide: Familjen Grotesk italic, 24–30px, 1.3, pine.
   Pine only works on a paper ground — see the .ink-section override below. */
.pullquote {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: 30px;
  line-height: 1.3;
  letter-spacing: -.01em;
  color: var(--pine);
  max-width: 18em;
  text-wrap: balance;
}
@media (max-width: 900px) { .pullquote { font-size: 24px; } }
.intro { font-size: 19px; line-height: 1.6; }      /* section opening paragraph */
.panel__body { font-size: 18px; line-height: 1.55; } /* copy inside a linen panel */
.small { font-size: 14px; color: var(--text-2); }
.caption { font-size: 13px; color: var(--muted); max-width: 40em; }

/* ---------- Masthead ---------- */

.masthead {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3);
  padding: 20px var(--s5);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(8px);
}

/* Horizontal lockup: mark + RAMBLIN | STUDIO.
   This is the page's one musical cue — hence no string rule in the footer. */
.lockup { display: flex; align-items: center; gap: 14px; border: 0; }
.lockup:hover { border: 0; }
.lockup__mark { width: 36px; height: 36px; flex: none; display: block; }
/* Colorway 1 (primary): ink container, amber strings — on Paper. */
.lockup__mark .mark__bg { fill: #21201C; stroke: none; }
.lockup__mark .mark__strings { fill: #E8B341; }
@media (prefers-color-scheme: dark) {
  /* Colorway 3 (reversed): on Ink the filled container disappears, so the guide
     calls for a hairline container and paper strings instead. */
  .lockup__mark .mark__bg { fill: none; stroke: rgba(246,242,234,.18); stroke-width: 1; }
  .lockup__mark .mark__strings { fill: #F6F2EA; }
}
.lockup__type { display: flex; align-items: baseline; gap: 10px; }
.lockup__name {
  font-family: var(--display); font-weight: 500; font-size: 18px;
  letter-spacing: .02em; color: var(--text); line-height: 1;
}
.lockup__bar { width: 1px; height: 13px; background: var(--border-strong); }
.lockup__sub {
  font-family: var(--mono); font-size: 10px; letter-spacing: .3em;
  color: var(--text-2); line-height: 1;
}

.masthead__nav { display: flex; align-items: center; gap: 26px; }
.masthead__nav a {
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); border-bottom: 0;
}
.masthead__nav a:hover { color: var(--text); }
@media (max-width: 640px) {
  .nav-hide-sm { display: none; }
  /* Reduce to mark + short form ("Ramblin") so the lockup and nav stop
     competing for the same 311px. Both are sanctioned by the guide. */
  .lockup__bar, .lockup__sub { display: none; }
  .masthead__nav { gap: 20px; }
}
@media (max-width: 400px) {
  .masthead { padding: 16px 20px; gap: 16px; }
  .masthead__nav { gap: 16px; }
}

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

.hero {
  padding: var(--s7) var(--s5) 92px;
  max-width: 1180px;
  display: grid;
  gap: var(--s4);
}

.section {
  border-top: 1px solid var(--border);
  padding: var(--s6) var(--s5);
  max-width: 1440px;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(0, 3.2fr);
  gap: var(--s5);
}
.section__head { align-content: start; }
.section__num { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; color: var(--faint); }
.section__head .h2 { margin-top: var(--s1); }
.section__head .caption { margin-top: 14px; }
.section__body { display: grid; gap: var(--s4); max-width: 920px; align-content: start; }

@media (max-width: 900px) {
  .masthead { padding: 16px var(--s4); }
  .hero { padding: 64px var(--s4) var(--s5); }
  .section { grid-template-columns: 1fr; gap: var(--s3); padding: var(--s5) var(--s4); }
}

/* ---------- Pills ---------- */

.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn--secondary { border-bottom-width: 1px; }
a.btn--secondary { border-bottom: 1px solid var(--border-strong); }
a.btn--secondary:hover { border-color: var(--ink); }

.pills { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 6px; }
.pill {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-2);
  padding: 8px 14px; border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
}

/* ---------- Panels, cards, tables ---------- */

.rail { display: grid; gap: 8px; padding-left: 20px; border-left: 2px solid var(--pine); }
.rail--amber { border-left-color: var(--amber); }
.rail__kicker {
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
}

.panel {
  background: var(--linen);
  border: 1px solid var(--border);
  padding: 28px var(--s4);
  display: grid;
  gap: 12px;
}

.grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--tight { gap: 20px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

/* 1px gap over a border-coloured background = hairline dividers */
.hairline-table {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
.hairline-table > div { background: var(--paper); padding: 22px; }
.hairline-table__value { font-family: var(--display); font-size: 24px; margin-top: var(--s1); line-height: 1.2; }
.hairline-table__note { font-size: 13px; color: var(--muted); margin-top: 6px; }

.card {
  border: 1px solid var(--border);
  border-radius: var(--r-control);
  background: var(--surface);
  padding: 22px;
  display: grid;
  gap: 12px;
  align-content: start;
}

/* ---------- Controls ---------- */

.btn {
  font-family: var(--body); font-size: 15px; font-weight: 500;
  border-radius: var(--r-control);
  padding: 12px 20px;
  min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--t-state), border-color var(--t-state), color var(--t-state);
}
.btn--primary {
  color: #F6F2EA; background: var(--pine); border: 1px solid var(--pine);
}
.btn--primary:hover:not(:disabled) { background: var(--pine-hover); border-color: var(--pine-hover); }
.btn--primary:disabled { opacity: .6; cursor: default; }
.btn--secondary {
  color: var(--text); background: transparent; border: 1px solid var(--border-strong);
}
.btn--secondary:hover { border-color: var(--ink); }
.btn--link {
  color: var(--pine); background: transparent; border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--pine) 40%, transparent);
  border-radius: 0; padding: 12px 2px;
}
.btn--link:hover { color: var(--pine-link); border-bottom-color: var(--pine-link); }

.field { display: grid; gap: var(--s1); }
.field label { font-size: 13px; color: var(--text-2); }
.field input {
  font-family: var(--body); font-size: 15px;
  padding: 12px 14px; min-height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-control);
  background: var(--paper);
  color: var(--text);
  transition: border-color var(--t-state);
}
.field input::placeholder { color: var(--faint); }
.field input:focus-visible {
  outline: 2px solid var(--amber); outline-offset: 2px; border-color: var(--faint);
}

/* ---------- Menu section (on Ink) ---------- */

/* Fixed values throughout: this band is Ink in both themes, so it must not
   inherit tokens that invert. In dark mode only the ground lifts, so the band
   still separates from a page background that is already Ink. */
.ink-section {
  background: #21201C;
  color: rgba(246,242,234,.92);
  border-top: 1px solid var(--border);
}
@media (prefers-color-scheme: dark) {
  .ink-section { background: #282621; }
}
.ink-section .section__num,
.ink-section .caption { color: #8A8371; }
.ink-section .h2 { color: rgba(246,242,234,.92); }
.ink-section .lede, .ink-section .small { color: #B8B1A0; }
.ink-section .pullquote { color: rgba(246,242,234,.92); }
.ink-section .field label { color: #B8B1A0; }
.ink-section .field input {
  background: transparent; color: #F6F2EA;
  border-color: rgba(246,242,234,.28);
}
.ink-section .field input::placeholder { color: #8A8371; }
.ink-section .btn--primary { color: #F6F2EA; background: #2F5D4A; border-color: #2F5D4A; }
.ink-section .btn--primary:hover:not(:disabled) { background: #386F58; border-color: #386F58; }
.ink-section a { color: var(--amber); border-bottom-color: rgba(232,179,65,.4); }
.ink-section a:hover { color: #F0C66C; border-bottom-color: #F0C66C; }

.spec-row {
  display: flex; flex-wrap: wrap; gap: var(--s4);
  padding-top: var(--s1);
}
.spec { display: grid; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: var(--r-pill); flex: none; }
.dot--amber { background: var(--amber); }
.spec__label { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #8A8371; }
.spec__value { font-family: var(--display); font-size: 18px; color: rgba(246,242,234,.92);
               display: flex; align-items: center; gap: 9px; }

.signup { display: grid; gap: 14px; max-width: 30em; }
.signup__row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.signup__row .field { flex: 1 1 220px; }
.signup__msg { font-size: 14px; min-height: 1.6em; }
.signup__msg[data-state="ok"] { color: var(--amber); }
.signup__msg[data-state="error"] { color: #E08A70; }

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

.footer {
  border-top: 1px solid var(--border);
  padding: var(--s5);
  display: flex; flex-wrap: wrap; gap: var(--s3);
  justify-content: space-between; align-items: flex-end;
  max-width: 1440px;
}
.footer__mark { display: grid; gap: 6px; }
.footer__name {
  font-family: var(--display); font-weight: 500; font-size: 26px;
  letter-spacing: .02em; line-height: 1;
}
.footer__rule { height: 1px; background: var(--ink); width: 100%; }
.footer__sub { font-family: var(--mono); font-size: 11px; letter-spacing: .4em; text-indent: .4em; color: var(--text-2); }
.footer__meta { display: grid; gap: 6px; justify-items: flex-end; text-align: right; }
@media (max-width: 900px) {
  .footer { padding: var(--s4); }
  .footer__meta { justify-items: flex-start; text-align: left; }
}
