/* =========================================================
   Facultas — editorial landing page
   Typography: Newsreader (display serif) + Inter (UI / body)
   ========================================================= */

:root {
  /* Palette — warm paper, ink, single oxblood accent */
  --paper:    #faf8f3;
  --paper-2:  #f3efe5;
  --ink:      #1b1a16;
  --ink-soft: #43413a;
  --muted:    #6e6a60;
  --rule:     #e2dccd;
  --accent:   #a6432f;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --maxw: 1080px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --section-y: clamp(4rem, 9vw, 8rem);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--paper); }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section-y); }
.section-rule { border-top: 1px solid var(--rule); }
[id] { scroll-margin-top: 6rem; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: .6rem 1rem;
  z-index: 100;
  border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 4.25rem;
}
.wordmark {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}
.wordmark .dot { color: var(--accent); }
.site-nav {
  display: flex;
  gap: 1.75rem;
  margin-left: auto;
  font-size: .95rem;
}
.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  position: relative;
  padding-block: .25rem;
  transition: color .2s ease;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.site-nav a:hover::after { transform: scaleX(1); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: .95rem;
  font-weight: 500;
  letter-spacing: .01em;
  text-decoration: none;
  padding: .8rem 1.5rem;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-sm { padding: .55rem 1.05rem; font-size: .875rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1.05rem; }

/* ---------- Eyebrow / labels ---------- */
.eyebrow {
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.5rem;
}
.eyebrow .num { color: var(--accent); margin-right: .9rem; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(4.5rem, 11vw, 9rem) clamp(3.5rem, 8vw, 6.5rem); }
.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.25rem, 8vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 1.75rem;
  max-width: 20ch;
  text-wrap: balance;
}
.hero-lede {
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 56ch;
  margin: 0 0 2.5rem;
}
.hero-actions { display: flex; flex-direction: column; align-items: stretch; gap: .85rem; margin-bottom: 3rem; }
.etymology {
  font-size: .85rem;
  letter-spacing: .04em;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  padding-top: 1.5rem;
  margin: 0;
}
.etymology span { font-family: var(--serif); font-style: italic; font-size: 1rem; color: var(--ink-soft); }

/* ---------- Section titles & prose ---------- */
.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 1.5rem;
  max-width: 22ch;
}
.prose { max-width: 60ch; color: var(--ink-soft); }
.prose p { margin: 0 0 1.25rem; }
.prose strong { color: var(--ink); font-weight: 600; }

/* ---------- 01 — Statement / pull quote ---------- */
.statement {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 3.6vw, 2.6rem);
  line-height: 1.22;
  letter-spacing: -0.01em;
  margin: 0 0 2.5rem;
  max-width: 24ch;
  text-wrap: balance;
}
.statement em { font-style: italic; color: var(--accent); }

/* ---------- 02 — Pillars ---------- */
.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: clamp(2rem, 4vw, 3.5rem);
}
.pillar { border-top: 2px solid var(--ink); padding-top: 1.5rem; }
.pillar h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.4rem;
  line-height: 1.2;
  margin: 0 0 .9rem;
}
.pillar p { margin: 0; color: var(--ink-soft); font-size: 1rem; }

/* ---------- Stats band ---------- */
.stats { background: var(--ink); color: var(--paper); padding-block: clamp(3.5rem, 7vw, 6rem); }
.stats-grid {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  gap: clamp(2rem, 4vw, 3rem);
}
.stats-grid li { display: flex; flex-direction: column; gap: .5rem; }
.stat-num {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.75rem, 6vw, 4.25rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-label { font-size: .9rem; color: color-mix(in srgb, var(--paper) 68%, transparent); line-height: 1.4; }
.stats-caption {
  margin: 0;
  font-size: .9rem;
  color: color-mix(in srgb, var(--paper) 60%, transparent);
  border-top: 1px solid color-mix(in srgb, var(--paper) 18%, transparent);
  padding-top: 1.75rem;
  max-width: 60ch;
}

/* ---------- 03 — Steps ---------- */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: clamp(2rem, 3.5vw, 3rem);
  counter-reset: step;
}
.step { position: relative; }
.step-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--accent);
  display: block;
  margin-bottom: .9rem;
}
.step h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.45rem;
  margin: 0 0 .7rem;
}
.step p { margin: 0; color: var(--ink-soft); font-size: 1rem; }

/* ---------- 04 — Integrate ---------- */
.integrate-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: center;
}
@media (min-width: 860px) {
  .integrate-grid { grid-template-columns: 1.05fr 1fr; }
}
.code-card {
  margin: 0;
  background: var(--ink);
  color: #ece7da;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(27, 26, 22, 0.45);
  font-size: .9rem;
}
.code-card figcaption {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .85rem 1.25rem;
  font-family: var(--sans);
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--paper) 55%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--paper) 14%, transparent);
}
.code-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: color-mix(in srgb, var(--paper) 30%, transparent);
  display: inline-block;
}
.code-dot:first-of-type { background: var(--accent); }
.code-card pre {
  margin: 0;
  padding: 1.5rem 1.5rem 1.75rem;
  overflow-x: auto;
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace;
  line-height: 1.7;
  white-space: pre;
}
.c-key   { color: #d8a48f; }
.c-val   { color: #f4efe4; font-weight: 600; }
.c-arrow { color: var(--accent); }

/* ---------- Closing CTA ---------- */
.cta { text-align: center; padding-block: clamp(5rem, 11vw, 9rem); }
.cta-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.1rem, 5.5vw, 3.75rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
  text-wrap: balance;
}
.cta-lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 46ch; margin: 0 auto 2.5rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); padding-block: 3rem; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: end;
  justify-content: space-between;
}
.footer-brand .wordmark { font-size: 1.25rem; }
.footer-etym { margin: .5rem 0 0; color: var(--muted); font-size: .92rem; }
.footer-small { margin: 0; color: var(--muted); font-size: .85rem; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .site-nav { display: none; }
}
@media (min-width: 721px) {
  .hero-actions { flex-direction: row; align-items: center; gap: 1rem; }
}

/* Tighten the code sample on very small screens */
@media (max-width: 560px) {
  .code-card pre { font-size: .8rem; padding: 1.25rem; }
}

/* ---------- Motion / a11y ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
