/* ============================================================
   Hajime Institute — shared design system
   Replaces the Tailwind CDN and the per-page duplicated CSS.
   Sections: fonts · tokens · base · utilities · components ·
             header/footer · motion
   ============================================================ */

/* ---------- Fonts (self-hosted, variable, latin) ---------- */
@font-face {
    font-family: 'Crimson Pro';
    font-style: normal;
    font-weight: 200 900;
    font-display: swap;
    src: url('fonts/crimson-pro-var.woff2') format('woff2');
}
@font-face {
    font-family: 'Crimson Pro';
    font-style: italic;
    font-weight: 200 900;
    font-display: swap;
    src: url('fonts/crimson-pro-italic-var.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('fonts/inter-var.woff2') format('woff2');
}

/* ---------- Tokens ---------- */
:root {
    --bg: #FFFFFF;
    --bg-alt: #F4F1E8;
    --ink: #1A1A1A;
    --ink-deep: #0E0E10;
    --ink-soft: #4A4A4A;
    --ink-mute: #6B6558;   /* small utility text — AA on cream */
    --ink-faint: #8A8678;  /* ornaments, large numerals only */
    --cream: #EFEAD8;
    --rule: #DAD5C8;
    --accent: #6B2C28;
    --serif: 'Crimson Pro', Georgia, serif;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-padding-top: 5.5rem; }
html, body { overflow-x: hidden; max-width: 100vw; }
body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'kern';
}
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: #1A1A1A; color: #F7F5F0; }
.dark-section ::selection { background: var(--cream); color: var(--ink-deep); }

/* ---------- Utility subset (Tailwind-compatible names) ---------- */
.relative { position: relative; }
.fixed { position: fixed; }
.top-0 { top: 0; } .left-0 { left: 0; } .right-0 { right: 0; }
.z-50 { z-index: 50; }
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.grid { display: grid; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.gap-3 { gap: 0.75rem; } .gap-6 { gap: 1.5rem; } .gap-8 { gap: 2rem; } .gap-10 { gap: 2.5rem; }
.gap-x-8 { column-gap: 2rem; } .gap-x-10 { column-gap: 2.5rem; }
.gap-y-2 { row-gap: 0.5rem; } .gap-y-4 { row-gap: 1rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mb-3 { margin-bottom: 0.75rem; } .mb-6 { margin-bottom: 1.5rem; } .mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; } .mb-12 { margin-bottom: 3rem; } .mb-16 { margin-bottom: 4rem; }
.mt-3 { margin-top: 0.75rem; } .mt-4 { margin-top: 1rem; } .mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; } .mt-10 { margin-top: 2.5rem; } .mt-12 { margin-top: 3rem; }
.mt-14 { margin-top: 3.5rem; } .mt-16 { margin-top: 4rem; }
.p-8 { padding: 2rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.pt-40 { padding-top: 10rem; }
.pb-20 { padding-bottom: 5rem; } .pb-24 { padding-bottom: 6rem; } .pb-32 { padding-bottom: 8rem; }
.w-10 { width: 2.5rem; } .h-10 { height: 2.5rem; } .h-16 { height: 4rem; }
.w-full { width: 100%; }
.max-w-2xl { max-width: 42rem; } .max-w-3xl { max-width: 48rem; } .max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; } .max-w-6xl { max-width: 72rem; } .max-w-7xl { max-width: 80rem; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.625; }
.leading-\[1\.05\] { line-height: 1.05; }
.border-t { border-top: 1px solid var(--rule); }
.border-t-2 { border-top: 2px solid var(--rule); }
.border-black { border-color: var(--ink); }
.rounded-full { border-radius: 9999px; }
.overflow-hidden { overflow: hidden; }
.object-contain { object-fit: contain; }
.transition-colors { transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease; }
.transition-opacity { transition: opacity 0.2s ease; }
.hover\:text-black:hover { color: var(--ink); }
.hover\:opacity-75:hover { opacity: 0.75; }

@media (min-width: 768px) {
    .md\:flex { display: flex; }
    .md\:flex-row { flex-direction: row; }
    .md\:items-center { align-items: center; }
    .md\:justify-between { justify-content: space-between; }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:p-10 { padding: 2.5rem; }
    .md\:p-12 { padding: 3rem; }
    .md\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
    .md\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
    .md\:text-5xl { font-size: 3rem; line-height: 1.1; }
}
@media (min-width: 1024px) {
    .lg\:px-10 { padding-left: 2.5rem; padding-right: 2.5rem; }
    .lg\:gap-10 { gap: 2.5rem; }
    .lg\:gap-16 { gap: 4rem; }
    .lg\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
    .lg\:col-span-3 { grid-column: span 3 / span 3; }
    .lg\:col-span-9 { grid-column: span 9 / span 9; }
    .lg\:text-6xl { font-size: 3.75rem; line-height: 1.05; }
}

/* ---------- Shared components ---------- */
.serif { font-family: var(--serif); }
.display { font-family: var(--serif); font-weight: 500; letter-spacing: -0.015em; }
.ink { color: var(--ink); }
.ink-soft { color: var(--ink-soft); }
.ink-mute { color: var(--ink-mute); }
.ink-faint { color: var(--ink-faint); }
.rule { border-color: var(--rule); }
.accent { color: var(--accent); }
.bg-alt { background: var(--bg-alt); }

.eyebrow {
    font-family: var(--sans);
    font-size: 0.72rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--ink-mute);
}

.quiet-link {
    font-family: var(--sans);
    color: var(--ink);
    border-bottom: 1px solid var(--ink);
    padding-bottom: 2px;
    transition: opacity 0.2s ease;
    font-weight: 400;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}
.quiet-link:hover { opacity: 0.55; }

.nav-link {
    font-family: var(--sans);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink);
    font-weight: 500;
    transition: opacity 0.2s ease;
}
.nav-link:hover { opacity: 0.55; }
.nav-link.is-current { font-weight: 700; color: var(--accent); }

.monumental {
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(2.4rem, 10vw, 9rem);
    line-height: 1.0;
    letter-spacing: -0.022em;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.monumental.compact { font-size: clamp(2.6rem, 8vw, 7rem); }
.colossal {
    font-family: var(--serif);
    font-weight: 600;
    font-size: clamp(4rem, 15vw, 13rem);
    line-height: 0.92;
    letter-spacing: -0.035em;
}

.ornament-rule {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin: 2.5rem 0 2rem;
}
.ornament-rule .rule-line {
    height: 1px;
    background: var(--ink);
    opacity: 0.35;
    flex: 0 0 4rem;
}
.ornament-rule .rule-line.long { flex: 1 1 auto; max-width: 18rem; }
.ornament-rule .inscription {
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: var(--ink-soft);
    letter-spacing: 0.015em;
    font-weight: 400;
}

.section-mark {
    position: absolute;
    font-family: var(--serif);
    font-weight: 700;
    font-size: clamp(8rem, 22vw, 24rem);
    letter-spacing: -0.05em;
    color: var(--ink);
    opacity: 0.045;
    pointer-events: none;
    user-select: none;
    line-height: 0.78;
    white-space: nowrap;
    top: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 0;
}
.dark-section .section-mark { color: var(--cream); opacity: 0.05; }

.hero-ambient {
    position: absolute;
    font-family: var(--serif);
    font-weight: 700;
    font-size: clamp(14rem, 38vw, 42rem);
    letter-spacing: -0.05em;
    color: var(--ink);
    opacity: 0.038;
    pointer-events: none;
    user-select: none;
    line-height: 0.85;
    white-space: nowrap;
    right: -8vw;
    bottom: -4vw;
    z-index: 0;
}

.major {
    position: relative;
    padding: clamp(5rem, 10vw, 9rem) 1.5rem;
}
.major .inner { position: relative; z-index: 1; }

.prose-classic p {
    font-family: var(--serif);
    font-size: 1.24rem;
    line-height: 1.65;
    color: var(--ink);
    font-weight: 400;
}
.prose-classic p + p { margin-top: 1.15rem; }
.prose-classic em { font-style: italic; }
.prose-classic .lede {
    font-size: clamp(1.4rem, 2vw, 1.7rem);
    line-height: 1.4;
    font-style: italic;
    color: var(--ink);
}

.drop-cap::first-letter {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 5.2rem;
    line-height: 0.85;
    float: left;
    padding-right: 0.7rem;
    padding-top: 0.4rem;
    color: var(--ink);
    font-style: normal;
}

.dark-section {
    background: var(--ink-deep) url('art/field-dark.jpg') center / cover no-repeat;
    color: var(--cream);
    position: relative;
    overflow: hidden;
    padding: clamp(7rem, 14vw, 12rem) 1.5rem;
}
.dark-section .display { color: var(--cream); }
.dark-section .prose-classic p { color: var(--cream); }
.dark-section .eyebrow { color: rgba(239, 234, 216, 0.62); }
.dark-section em { color: #FFFFFF; }

hr.thin { border: 0; border-top: 1px solid var(--rule); }

.venue-chip {
    display: inline-block;
    font-family: var(--sans);
    font-size: 0.66rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--ink);
    color: var(--ink);
    font-weight: 500;
    line-height: 1;
}
.venue-chip.muted { border-color: var(--ink-mute); color: var(--ink-mute); }
a.venue-chip { transition: background 0.2s ease, color 0.2s ease; }
a.venue-chip:hover { background: var(--ink); color: var(--cream); }

.output-meta {
    font-family: var(--sans);
    font-size: 0.78rem;
    color: var(--ink-mute);
    margin-top: 0.35rem;
    font-style: italic;
    line-height: 1.55;
}

/* Credibility strip (hero) */
.fact-strip {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    padding: 1.4rem 0;
}
@media (min-width: 768px) {
    .fact-strip { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
}
.fact-strip .fact { display: flex; flex-direction: column; gap: 0.35rem; }
.fact-strip .fact-lead {
    font-family: var(--serif);
    font-size: 1.18rem;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.3;
    letter-spacing: -0.008em;
}
.fact-strip .fact-note {
    font-family: var(--sans);
    font-size: 0.78rem;
    color: var(--ink-mute);
    line-height: 1.5;
    letter-spacing: 0.02em;
}

/* ---------- Site header / footer ---------- */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--rule);
}
.site-nav {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}
@media (min-width: 1024px) { .site-nav { padding: 0 2.5rem; } }
.brand { display: flex; align-items: center; gap: 0.75rem; color: var(--ink); }
.brand-logo { height: 2.5rem; width: 2.5rem; object-fit: contain; }
.brand-name { font-family: var(--serif); font-size: 1.125rem; font-weight: 500; letter-spacing: 0.005em; }
.nav-links { display: flex; align-items: center; gap: 1.1rem; }
@media (min-width: 768px) { .nav-links { gap: 2rem; } }
@media (max-width: 480px) {
    .brand-name { display: none; }
    .nav-links { gap: 0.9rem; }
    .nav-links .nav-link { font-size: 0.7rem; letter-spacing: 0.06em; }
}

.site-footer { padding: 3rem 1.5rem; border-top: 1px solid var(--rule); }
@media (min-width: 1024px) { .site-footer { padding-left: 2.5rem; padding-right: 2.5rem; } }
.footer-inner {
    max-width: 72rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
@media (min-width: 768px) {
    .footer-inner { flex-direction: row; align-items: center; justify-content: space-between; }
}
.footer-links { display: flex; flex-wrap: wrap; gap: 1.5rem; font-size: 0.875rem; color: var(--ink-soft); }
.footer-links a { transition: color 0.2s ease; }
.footer-links a:hover { color: var(--ink); }
.footer-legal { font-size: 0.75rem; color: var(--ink-mute); line-height: 1.6; }

/* ---------- Motion ----------
   Hidden state is gated on html.js (set by hajime.js), so content
   stays fully visible when JavaScript is unavailable. */
html.js .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
    transition-delay: var(--reveal-delay, 0s);
    will-change: opacity, transform;
}
html.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    html.js .reveal { opacity: 1; transform: none; transition: none; }
}
