/* Hack for Humanity: Fredericksburg
   Palette sampled from The AI Collective's Hack for Humanity key art. */

:root {
  --fog: #F4F6F8;
  --paper: #FFFFFF;
  --ink: #15171A;
  --slate: #4A5260;
  --ember: #F87419;       /* brand orange: fills and marks only, never text on light */
  --ember-deep: #B24A06;  /* orange for text and links (5:1 on fog) */
  --sky: #B3CFE7;
  --peach: #F4D6C0;
  --rule: rgba(21, 23, 26, 0.28);

  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --text: "Source Serif 4", Georgia, "Times New Roman", serif;

  --gutter: clamp(1rem, 4vw, 3rem);
  --measure: 36rem;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fog);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.125rem;
  line-height: 1.65;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }

p { margin: 0; }
p + p { margin-top: 0.9em; }

a { color: var(--ember-deep); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--display); margin: 0; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--display);
  font-weight: 650;
  font-size: 1.125rem;
  line-height: 1;
  color: var(--ink);
  background: var(--ember);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  text-decoration: none;
  transition: background-color 120ms ease;
}
.btn:hover { background: #FF8A33; }
.btn-small { font-size: 0.95rem; padding: 0.7rem 1rem; border-radius: 10px; }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: #2B2F35; }
.btn-ink:focus-visible { outline-color: var(--paper); }

/* ---------- Hero ---------- */

.hero-wrap {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(70% 80% at 0% 10%, #A9C9E8 0%, rgba(169, 201, 232, 0) 70%),
    radial-gradient(55% 70% at 100% 45%, #F3CBAE 0%, rgba(243, 203, 174, 0) 70%),
    linear-gradient(180deg, #D9E5F0 0%, #E9EDF1 55%, var(--fog) 100%);
}

/* Film grain, as in the key art */
.hero-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.55;
  mix-blend-mode: multiply;
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem var(--gutter);
}

.chapter {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.25;
}
.chapter img { width: 2.25rem; }
.chapter .x { color: var(--ember-deep); padding: 0 0.15em; }

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(3rem, 9vw, 7rem) var(--gutter) clamp(4rem, 10vw, 8rem);
}

.hero h1 { font-weight: inherit; }

.wordmark {
  width: min(46rem, 100%);
  margin: 0 auto;
}

.place {
  display: block;
  margin-top: clamp(1.25rem, 3vw, 2rem);
  font-weight: 650;
  font-size: clamp(1.75rem, 4.4vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.hero-when {
  margin-top: 0.75rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  line-height: 1.4;
  color: var(--slate);
}
.hero-when time { display: block; color: var(--ink); font-weight: 650; }

.hero-cta { margin-top: 2.25rem; }
.hero-cta p {
  margin-top: 0.9rem;
  font-size: 1rem;
  color: var(--slate);
}

/* Page-load: the wordmark settles in once */
@media (prefers-reduced-motion: no-preference) {
  .wordmark { animation: settle 900ms cubic-bezier(.2, .7, .2, 1) both; }
  .place, .hero-when, .hero-cta { animation: settle 700ms cubic-bezier(.2, .7, .2, 1) 350ms both; }
}
@keyframes settle {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Content sections ---------- */

main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

main > section {
  padding: clamp(3rem, 7vw, 5.5rem) 0;
  border-top: 1px dashed var(--rule);
}
main > section:first-child { border-top: 0; }

main h2 {
  font-weight: 800;
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}

.prose { max-width: var(--measure); }

/* Statement + body side by side on wide screens */
.idea {
  display: grid;
  gap: 2rem 4rem;
}
.statement {
  font-family: var(--display);
  font-weight: 650;
  font-size: clamp(1.9rem, 4.2vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  max-width: 18ch;
}

/* Details: label column + content */
.facts { margin: 0; display: grid; gap: 2rem 3rem; }
.facts > div { display: grid; gap: 0.25rem; }
.facts dt {
  font-family: var(--display);
  font-weight: 650;
  font-size: 1rem;
  color: var(--ember-deep);
}
.facts dd { margin: 0; }
.facts dd p + p { margin-top: 0.35em; }

/* Timeline: the key art's dashed rule with orange dots */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 44rem;
}
.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1.5rem;
  padding-bottom: 1.75rem;
}
.timeline li::before {           /* dashed spine */
  content: "";
  position: absolute;
  left: 7.25rem;
  top: 0.9rem;
  bottom: -0.5rem;
  border-left: 2px dashed var(--rule);
}
.timeline li:last-child::before { display: none; }
.timeline li::after {            /* dot */
  content: "";
  position: absolute;
  left: calc(7.25rem - 5px);
  top: 0.5rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ember);
}
.timeline time {
  font-family: var(--display);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.timeline li > div { padding-left: 1rem; }
.timeline h3 { font-weight: 650; font-size: 1.2rem; line-height: 1.35; }
.timeline h3 + p { margin-top: 0.2rem; color: var(--slate); }

.note { margin-top: 1rem; font-size: 1rem; color: var(--slate); font-style: italic; }

/* FAQ */
.faq dl { margin: 0; display: grid; gap: 1.75rem; max-width: 44rem; }
.faq dt { font-family: var(--display); font-weight: 650; font-size: 1.2rem; line-height: 1.35; }
.faq dd { margin: 0.3rem 0 0; }

/* ---------- Closing band ---------- */

.closing { background: var(--ember); }
.closing-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5rem) var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 3rem;
}
.closing h2 {
  font-weight: 800;
  font-size: clamp(1.6rem, 3.6vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  max-width: 20ch;
}

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

.footer {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  max-width: 72rem;
  margin: 0 auto;
  padding: 2.5rem var(--gutter) 3rem;
  font-size: 0.95rem;
  color: var(--slate);
}
.footer img { width: 1.75rem; flex: none; margin-top: 0.2rem; }
.footer p { max-width: 44rem; }

/* ---------- Wider screens ---------- */

@media (min-width: 52rem) {
  .idea { grid-template-columns: 1.1fr 1fr; align-items: start; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts > div { grid-template-columns: 5rem 1fr; gap: 1.5rem; }
  .who, .faq { display: grid; grid-template-columns: 1fr 2fr; gap: 0 3rem; }
  .who h2, .faq h2 { margin-bottom: 0; }
}

/* ---------- Small screens ---------- */

@media (max-width: 34rem) {
  .chapter span { font-size: 0.85rem; }
  .masthead .btn-small { display: none; }  /* hero CTA sits just below */
  .timeline li { grid-template-columns: 4.75rem 1fr; gap: 0.75rem; }
  .timeline li::before { left: 5.4rem; }
  .timeline li::after { left: calc(5.4rem - 5px); }
  .timeline time { font-size: 0.95rem; }
}
