/* ==========================================================================
   Technology Commons Alliance — Shared Stylesheet
   Palette: red, white, black (editorial / institutional)
   ========================================================================== */

:root {
  --paper: #FAFAF7;
  --paper-alt: #FFFFFF;
  --ink: #0D0D0D;
  --ink-soft: #2A2A2A;
  --muted: #5C5C5C;
  --muted-light: #8A8A8A;
  --rule: #E4E1D7;
  --rule-strong: #111111;

  --red: #B8231F;
  --red-dark: #8B1A17;
  --red-bright: #D02A25;
  --red-soft: rgba(184, 35, 31, 0.08);

  --font-serif: "Cormorant Garamond", "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --font-sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

  --container-max: 1200px;
  --container-narrow: 820px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
  min-height: 100vh;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; transition: color 0.2s ease, opacity 0.2s ease; }

/* Subtle paper texture via layered gradients */
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(184, 35, 31, 0.04), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(13, 13, 13, 0.04), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Typography */
h1, h2, h3, h4, h5 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--ink);
}
h1 { font-size: clamp(2.6rem, 6vw, 5.2rem); font-weight: 400; }
h2 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 400; margin-bottom: 1rem; }
h3 { font-size: clamp(1.35rem, 2.2vw, 1.85rem); margin-bottom: 0.75rem; }
h4 { font-size: 1.15rem; font-weight: 500; letter-spacing: 0.01em; }

p { margin-bottom: 1.15rem; color: var(--ink-soft); }
p.lede {
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 2.1vw, 1.7rem);
  line-height: 1.45;
  color: var(--ink);
  font-weight: 400;
  font-style: italic;
  margin-bottom: 2rem;
  max-width: 38em;
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 28px; height: 1px;
  background: var(--red);
}

/* Layout */
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 2.5rem); position: relative; z-index: 1; }
.container.narrow { max-width: var(--container-narrow); }

section { padding: clamp(4rem, 9vw, 7.5rem) 0; position: relative; }
section + section { border-top: 1px solid var(--rule); }

/* Alternating section background */
section.alt { background: var(--paper-alt); }

/* Full bleed red rule at top of page */
.top-rule {
  height: 4px;
  background: var(--red);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
}

/* Header / Nav */
.site-header {
  position: fixed;
  top: 4px; left: 0; right: 0;
  z-index: 50;
  transition: background 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  border-bottom: 1px solid transparent;
  background: rgba(250, 250, 247, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.site-header.scrolled {
  background: rgba(250, 250, 247, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--rule);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem clamp(1.25rem, 4vw, 2.5rem);
  max-width: var(--container-max); margin: 0 auto;
}
.brand {
  display: flex; align-items: center; gap: 0.7rem;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  letter-spacing: 0.005em;
  font-weight: 500;
  color: var(--ink);
}
.brand-mark {
  width: 30px; height: 30px;
  display: inline-block;
  flex-shrink: 0;
}
.brand-text .full { display: inline; }
.brand-text .short { display: none; }

.nav-links {
  display: flex; align-items: center; gap: 2.2rem;
  list-style: none;
}
.nav-links a {
  font-size: 0.86rem;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  position: relative;
  padding: 0.35rem 0;
  font-weight: 500;
}
.nav-links a:hover, .nav-links a.active { color: var(--red); }
.nav-links a.active::after {
  content: "";
  position: absolute; bottom: -4px; left: 0; right: 0;
  height: 2px; background: var(--red);
}

.nav-toggle {
  display: none;
  background: transparent; border: none; cursor: pointer;
  color: var(--ink);
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
}

@media (max-width: 820px) {
  .brand-text .full { display: none; }
  .brand-text .short { display: inline; }
  .nav-links {
    position: fixed;
    top: 68px; left: 0; right: 0;
    flex-direction: column;
    gap: 1.25rem;
    padding: 2rem;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    transform: translateY(-110%);
    transition: transform 0.3s ease;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-toggle { display: inline-flex; }
}

/* Hero */
.hero {
  min-height: 88vh;
  padding-top: 8.5rem;
  padding-bottom: 3rem;
  display: flex; flex-direction: column; justify-content: center;
  position: relative;
}
.hero::before {
  content: "";
  position: absolute;
  top: 120px; right: 0;
  width: 42%; height: 75%;
  background:
    linear-gradient(135deg, transparent 0%, transparent 48%, var(--red) 48.3%, var(--red) 52%, transparent 52.3%);
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
}
.hero .container { position: relative; z-index: 2; }
.hero h1 {
  margin: 0.5rem 0 1.5rem;
  max-width: 15ch;
}
.hero h1 .accent {
  color: var(--red);
}
.hero .tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  color: var(--red);
  margin-bottom: 2rem;
  letter-spacing: 0.005em;
}
.hero .hero-sub {
  font-size: 1.1rem;
  max-width: 38em;
  color: var(--ink-soft);
  margin-bottom: 2.5rem;
}
.hero-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; }

/* Page headers (non-home) */
.page-header {
  padding-top: 9rem;
  padding-bottom: 3rem;
  position: relative;
}
.page-header h1 { margin-top: 0.5rem; max-width: 20ch; }

/* Buttons & links */
.btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.9rem 1.6rem;
  font-family: var(--font-sans); font-size: 0.85rem; font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.primary { background: var(--red); color: var(--paper); border-color: var(--red); }
.btn.primary:hover { background: var(--red-dark); border-color: var(--red-dark); color: var(--paper); }
.btn .arrow { transition: transform 0.2s ease; }
.btn:hover .arrow { transform: translateX(3px); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: var(--red);
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  font-weight: 500;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 3px;
  transition: border-color 0.2s ease, gap 0.2s ease;
}
.link-arrow:hover { border-color: var(--red); gap: 0.6rem; }

/* Pillar / card grid */
.grid { display: grid; gap: clamp(1.25rem, 2.5vw, 1.75rem); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
  background: var(--paper-alt);
  border: 1px solid var(--rule);
  padding: clamp(1.75rem, 3vw, 2.25rem);
  position: relative;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--ink);
  box-shadow: 8px 8px 0 var(--red);
}
.card .pillar-num {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 400;
  color: var(--red);
  line-height: 1;
  margin-bottom: 1rem;
  display: block;
}
.card h3 { margin-bottom: 1rem; color: var(--ink); }
.card p { color: var(--ink-soft); font-size: 0.97rem; line-height: 1.65; margin-bottom: 0; }
.card ul {
  list-style: none;
  margin-top: 1.25rem;
  display: grid;
  gap: 0.55rem;
}
.card ul li {
  color: var(--ink-soft);
  font-size: 0.92rem;
  padding-left: 1.1rem;
  position: relative;
  line-height: 1.55;
}
.card ul li::before {
  content: "—";
  position: absolute; left: 0;
  color: var(--red);
}

/* Two-column narrative */
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } }

/* Pullquote */
.pullquote {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  line-height: 1.35;
  color: var(--ink);
  font-style: italic;
  padding: 0 0 0 2rem;
  border-left: 3px solid var(--red);
  margin: 3rem 0;
  max-width: 34em;
}
.pullquote cite {
  display: block;
  margin-top: 1.25rem;
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

/* Section intro */
.section-intro {
  max-width: 46em;
  margin-bottom: 3.5rem;
}
.section-intro h2 { margin-bottom: 1.25rem; }

/* Principles list */
.principles {
  list-style: none;
  display: grid;
  gap: 0;
  counter-reset: principle;
  max-width: 48em;
}
.principles li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.75rem;
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
}
.principles li:last-child { border-bottom: 1px solid var(--rule); }
.principles li::before {
  counter-increment: principle;
  content: "0" counter(principle);
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--red);
  letter-spacing: 0.05em;
  padding-top: 0.1rem;
}
.principles h4 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--ink);
  letter-spacing: -0.005em;
  text-transform: none;
}
.principles p { margin: 0; color: var(--ink-soft); font-size: 0.97rem; }

/* Contact block */
.contact-card {
  background: var(--paper-alt);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--red);
  padding: clamp(2.5rem, 5vw, 3.75rem);
  text-align: left;
  max-width: 720px;
}
.contact-card .label {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
  display: block;
  font-weight: 600;
}
.contact-card a.email {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  color: var(--red);
  display: inline-block;
  margin-bottom: 2rem;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease;
}
.contact-card a.email:hover { border-bottom-color: var(--red); }

/* Stats / figures */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}
.stat .num {
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 4.5vw, 3.8rem);
  line-height: 1;
  color: var(--red);
  font-weight: 400;
  margin-bottom: 0.5rem;
  display: block;
}
.stat .label {
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

/* Footer */
.site-footer {
  padding: 3.5rem 0 2.5rem;
  border-top: 4px solid var(--red);
  background: var(--ink);
  color: var(--paper);
  position: relative;
  z-index: 2;
}
.site-footer h5, .site-footer p, .site-footer a, .site-footer span { color: inherit; }
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
}
@media (max-width: 820px) { .footer-inner { grid-template-columns: 1fr; gap: 2rem; } }
.footer-inner h5 {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(250, 250, 247, 0.6);
  margin-bottom: 1rem;
  font-weight: 600;
}
.footer-inner p, .footer-inner a {
  font-size: 0.9rem;
  color: rgba(250, 250, 247, 0.85);
  line-height: 1.6;
}
.footer-inner a:hover { color: var(--red-bright); }
.footer-brand .brand { color: var(--paper); font-size: 1.3rem; }
.footer-brand p { margin-top: 1rem; max-width: 32em; color: rgba(250, 250, 247, 0.7); font-size: 0.92rem; }
.footer-bottom {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(250, 250, 247, 0.12);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: rgba(250, 250, 247, 0.55);
}
.footer-disclosure {
  font-size: 0.78rem;
  color: rgba(250, 250, 247, 0.55);
  max-width: 56em;
  line-height: 1.6;
  margin-top: 1.5rem;
  font-style: italic;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Utility */
.mt-lg { margin-top: 3rem; }
.mt-md { margin-top: 1.5rem; }
.text-muted { color: var(--muted); }
.text-accent { color: var(--red); }
.rule { height: 1px; background: var(--rule); margin: 2.5rem 0; border: 0; }
.rule-red { height: 2px; background: var(--red); width: 60px; margin: 0 0 2rem; border: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
  .reveal { opacity: 1; transform: none; }
}
