/* =============================================
   HYPOTHESIS LABS — Global Stylesheet
   ============================================= */

/* ─── TOKENS ─── */
:root {
  --bg:        #F7F5F0;
  --surface:   #EFECE5;
  --ink:       #1A1916;
  --ink-muted: #6B6760;
  --accent:    #B85C2A;
  --rule:      rgba(26,25,22,0.1);
  --serif:     'Playfair Display', Georgia, serif;
  --sans:      'DM Sans', system-ui, sans-serif;
  --max:       1120px;
}

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.65;
  font-size: clamp(15px, 1.05vw, 17px);
  -webkit-font-smoothing: antialiased;
}

/* ─── GRID BACKGROUND ─── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 64px 64px;
  z-index: 0;
}

/* ─── LAYOUT ─── */
.container {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 3rem);
}

/* ─── NAV ─── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(247,245,240,0.82);
  border-bottom: 1px solid var(--rule);
}

nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}
.nav-links a {
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }

.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-back:hover { color: var(--accent); }
.nav-back svg { transition: transform 0.2s; }
.nav-back:hover svg { transform: translateX(-3px); }

/* ─── FOOTER ─── */
footer {
  padding: 2.5rem 0;
  border-top: 1px solid var(--rule);
}
footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-logo {
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--ink-muted);
}
.footer-logo span { color: var(--accent); }
.footer-note { font-size: 0.78rem; color: var(--ink-muted); }

/* ─── SHARED COMPONENTS ─── */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.75rem;
}
.section-label::before {
  content: '';
  display: block;
  width: 20px; height: 1px;
  background: var(--ink-muted);
}

.section-title {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-radius: 3px;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}
.btn-primary  { background: var(--ink); color: var(--bg); }
.btn-primary:hover  { background: var(--accent); }
.btn-secondary { background: transparent; color: var(--ink); border: 1px solid var(--rule); }
.btn-secondary:hover { border-color: var(--ink); background: var(--surface); }

.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag {
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--rule);
  color: var(--ink-muted);
  border-radius: 2px;
}

/* ─── ANIMATIONS ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ─── PROSE (used on experiment pages) ─── */
.prose h2 {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.5vw, 1.9rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 3rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 80px;
}
.prose h2:first-child { margin-top: 0; border-top: none; padding-top: 0; }
.prose h3 {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  font-weight: 500;
  font-style: italic;
  margin: 2rem 0 0.75rem;
}
.prose p { color: var(--ink-muted); margin-bottom: 1.25rem; line-height: 1.75; }
.prose strong { color: var(--ink); font-weight: 500; }
.prose ul, .prose ol { color: var(--ink-muted); padding-left: 1.5rem; margin-bottom: 1.25rem; }
.prose li { margin-bottom: 0.4rem; line-height: 1.7; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { opacity: 0.7; }
.prose hr { border: none; border-top: 1px solid var(--rule); margin: 2.5rem 0; }
.prose blockquote {
  border-left: 3px solid var(--accent);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: var(--surface);
  font-family: var(--serif);
  font-size: 1.05rem;
  font-style: italic;
  color: var(--ink);
  line-height: 1.6;
}
.prose blockquote cite {
  display: block;
  margin-top: 0.75rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-style: normal;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.prose code {
  font-family: 'Courier New', monospace;
  font-size: 0.85em;
  background: var(--surface);
  padding: 0.15em 0.4em;
  border-radius: 2px;
  color: var(--accent);
}
.prose pre {
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: 3px;
}
.prose pre code { background: none; padding: 0; color: var(--ink); font-size: 0.88rem; }

/* ─── CALLOUT ─── */
.callout {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--rule);
  background: var(--surface);
  margin: 2rem 0;
  border-left: 3px solid var(--accent);
}
.callout-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.callout p { font-size: 0.92rem; margin-bottom: 0; }

/* ─── MEDIA BLOCKS ─── */
.media-full { margin: 2.5rem 0; }
.media-full img, .media-full video, .media-full iframe {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--rule);
}
.media-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 2.5rem 0;
}
@media (max-width: 560px) { .media-grid { grid-template-columns: 1fr; } }
.media-grid img, .media-grid video {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--rule);
  object-fit: cover;
}
.media-video {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
  margin: 2.5rem 0;
}
.media-video iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}
.media-inline { margin: 2.5rem auto; max-width: 560px; }
.media-inline img { width: 100%; height: auto; display: block; border: 1px solid var(--rule); }
.media-caption {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-style: italic;
}
