/* FirstOrg — polished design system
   Editorial tech. Warm off-white ground, deep ink type, single accent.
   Color scheme is intentionally generic — will be re-skinned to brand later. */

:root {
  /* Neutrals — warm, paper-leaning */
  --bg:         #f5f1ea;
  --bg-2:       #eeeae1;
  --bg-3:       #e6e1d5;
  --ink:        #1a1714;
  --ink-2:      #2f2a24;
  --ink-soft:   #56504a;
  --ink-faint:  #8a827a;
  --rule:       #d9d2c4;
  --rule-2:     #c7beac;

  /* Accent — single warm tone, used sparingly */
  --accent:     #c8502e;
  --accent-dk:  #a73d1f;
  --accent-lt:  #f3e3d8;

  /* Supporting — tasteful, muted */
  --amber:      #e8a653;
  --sage:       #8a9a7a;
  --slate:      #5a6370;

  /* Surfaces */
  --card:       #fdfbf5;
  --card-2:     #faf6ec;

  /* Shadows — soft, long */
  --shadow-sm:  0 1px 2px rgba(26,23,20,.04), 0 2px 6px rgba(26,23,20,.05);
  --shadow-md:  0 2px 4px rgba(26,23,20,.05), 0 8px 24px rgba(26,23,20,.07);
  --shadow-lg:  0 4px 8px rgba(26,23,20,.05), 0 20px 60px rgba(26,23,20,.10);

  /* Type */
  --font-display: 'Instrument Serif', 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Söhne', 'Inter Tight', ui-sans-serif, system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;

  /* Spacing scale */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --s-9: 96px; --s-10: 128px;

  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 400; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }

/* Type scale */
.display-xl { font-family: var(--font-display); font-size: clamp(56px, 7vw, 112px); line-height: .96; letter-spacing: -0.025em; font-weight: 400; }
.display-lg { font-family: var(--font-display); font-size: clamp(44px, 5vw, 76px);  line-height: 1.00; letter-spacing: -0.02em; }
.display-md { font-family: var(--font-display); font-size: clamp(32px, 3.6vw, 52px); line-height: 1.05; letter-spacing: -0.015em; }
.display-sm { font-family: var(--font-display); font-size: clamp(24px, 2.4vw, 34px); line-height: 1.15; letter-spacing: -0.01em; }

.body-lg { font-size: 19px; line-height: 1.5; color: var(--ink-2); font-weight: 350; }
.body    { font-size: 16px; line-height: 1.55; color: var(--ink-2); }
.body-sm { font-size: 14px; line-height: 1.55; color: var(--ink-soft); }

.mono    { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.02em; color: var(--ink-faint); text-transform: uppercase; }
.mono-md { font-family: var(--font-mono); font-size: 13px; color: var(--ink-soft); }
.eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }

.italic { font-style: italic; }
.serif  { font-family: var(--font-display); }

/* Layout */
.shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 var(--s-7);
}
@media (max-width: 860px) { .shell { padding: 0 var(--s-5); } }

.section {
  padding: var(--s-10) 0;
  position: relative;
}
.section.tight { padding: var(--s-9) 0; }
.section.compact { padding: var(--s-8) 0; }

.section + .section { border-top: 1px solid var(--rule); }

/* Nav */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--rule);
}
.nav-brand {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.01em;
  font-weight: 500;
  display: flex; align-items: baseline; gap: 4px;
}
.nav-brand .dot { color: var(--accent); }
.nav-logo { height: 28px; width: auto; max-height: 28px; display: block; }
.footer-logo { height: 48px; width: auto; max-height: 48px; display: block; }
.nav-links { display: flex; gap: var(--s-5); }
.nav-links a { font-size: 14px; color: var(--ink-soft); }
.nav-links a:hover { color: var(--ink); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 12px 20px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); }
.btn.ghost { background: transparent; border-color: var(--rule-2); color: var(--ink-soft); }
.btn.sm { padding: 8px 14px; font-size: 13px; }
.btn .arrow { display: inline-block; transition: transform .2s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--s-5);
}
.card.flat { box-shadow: none; }
.card.raised { box-shadow: var(--shadow-sm); }
.card.ink {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.card.ink .body-sm { color: #d9d2c4; }

/* Tags / chips */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-soft);
}
.tag.solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tag.accent { background: var(--accent-lt); color: var(--accent-dk); border-color: transparent; }

/* Number/stat */
.stat-num {
  font-family: var(--font-display);
  font-size: 88px;
  line-height: 1;
  letter-spacing: -0.03em;
}

/* Rules */
.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.rule-2 { border: 0; border-top: 1px solid var(--rule-2); margin: 0; }
.rule-ink { border: 0; border-top: 1px solid var(--ink); margin: 0; }

/* Section header — editorial */
.sec-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-7);
  align-items: start;
  margin-bottom: var(--s-8);
}
.sec-head .sec-num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--accent);
  padding-top: 8px;
}
.sec-head .sec-title h2 { margin-bottom: var(--s-3); }
.sec-head .sec-title .kicker {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
  color: var(--ink-faint); text-transform: uppercase;
  margin-bottom: var(--s-3);
}
.sec-head .sec-title .lead { max-width: 620px; }

@media (max-width: 860px) {
  .sec-head { grid-template-columns: 1fr; gap: var(--s-3); }
}

/* Utility */
.row { display: flex; flex-direction: row; }
.col { display: flex; flex-direction: column; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.gap-4 { gap: 16px; } .gap-5 { gap: 24px; } .gap-6 { gap: 32px; }
.gap-7 { gap: 48px; } .gap-8 { gap: 64px; }
.ai-c { align-items: center; } .ai-s { align-items: flex-start; } .ai-b { align-items: baseline; }
.jc-sb { justify-content: space-between; } .jc-c { justify-content: center; }
.flex-1 { flex: 1; }
.txt-c { text-align: center; }
.muted { color: var(--ink-faint); }
.soft  { color: var(--ink-soft); }
.accent { color: var(--accent); }

/* Grain overlay — adds warmth */
.grain::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    radial-gradient(rgba(26,23,20,.03) 1px, transparent 1px),
    radial-gradient(rgba(26,23,20,.02) 1px, transparent 1px);
  background-size: 3px 3px, 7px 7px;
  background-position: 0 0, 1px 1px;
  pointer-events: none;
  mix-blend-mode: multiply;
  z-index: 1;
}

/* Simple entrance */
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rise { animation: rise .6s ease-out both; }
.rise-2 { animation: rise .6s ease-out .1s both; }
.rise-3 { animation: rise .6s ease-out .2s both; }
.rise-4 { animation: rise .6s ease-out .3s both; }

/* Highlight mark */
.mark {
  background: linear-gradient(transparent 62%, var(--accent-lt) 62%);
  padding: 0 2px;
}
.underlined {
  background: linear-gradient(to right, var(--accent), var(--accent)) no-repeat left bottom / 100% 2px;
  padding-bottom: 3px;
}

/* Footer */
.footer {
  padding: var(--s-8) 0 var(--s-8);
  border-top: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
}
.footer .nav-brand { color: var(--bg); }
.footer a { color: #c7beac; }
.footer a:hover { color: var(--bg); }
.footer-minimal { border-top: 2px solid #3a342d; padding-top: var(--s-5); }

.footer-cols {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.footer-col-brand {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.footer-links-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--s-2);
}
.footer-link-row {
  display: contents;
}

/* Mobile breakpoint helpers */
@media (max-width: 860px) {
  .hide-mobile { display: none !important; }
  .stack-mobile { flex-direction: column !important; }
  .section { padding: var(--s-8) 0; }

  .footer-cols {
    flex-direction: column;
    gap: var(--s-4);
  }
  .footer-col-brand {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }
  .footer-links-col {
    align-items: flex-start;
    width: 100%;
  }
  .footer-link-row {
    display: flex;
    gap: var(--s-6);
  }
}

/* Container for polished page */
.polished-wrap {
  position: relative;
  overflow-x: clip;
}
