/* ── RESET & BASE ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  /* ── Base — Prussian Blue depths ── */
  --void:      #060d18;
  --deep:      #0c1e35;
  --surface:   #132840;

  /* ── Borders — terracotta-tinted ── */
  --border:    rgba(196,98,45,0.16);

  /* ── Text — warm parchment ── */
  --text:      #e8ddd0;
  --muted:     rgba(232,221,208,0.68);
  --warm:      #f2e8d8;

  /* ── Accents ── */
  --accent:    #d4694a;   /* Terracotta — primary */
  --accent2:   #9b87c4;   /* Muted Violet — secondary */
  --pine:      #3d9470;   /* Pine Green — tertiary */
  --gold:      #c4844a;   /* warm gold bridge */

  /* ── Fonts ── */
  --serif:     'Cormorant Garamond', Georgia, serif;
  --mono:      'Space Mono', monospace;
  --sans:      'Outfit', sans-serif;
}
html { scroll-behavior: smooth; }
body { font-family: var(--sans); background: var(--void); color: var(--text); line-height: 1.7; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }

/* ── CANVAS ─────────────────────────────────────────────── */
#cosmos { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* ── NAV ────────────────────────────────────────────────── */
nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; padding: 24px 48px; transition: background 0.4s, backdrop-filter 0.4s; }
nav.scrolled { background: rgba(6,13,24,0.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.nav-logo { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.12em; color: var(--accent); text-transform: uppercase; }
.nav-logo span { color: var(--muted); }
.nav-links { display: flex; align-items: center; gap: 36px; list-style: none; }
.nav-links a { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase; transition: color 0.2s; }
.nav-links a:hover { color: var(--accent); }
.nav-lang { display: flex; gap: 2px; }
.lang-btn { background: none; border: 1px solid transparent; color: var(--muted); font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.1em; padding: 4px 8px; cursor: pointer; transition: all 0.2s; }
.lang-btn.active, .lang-btn:hover { color: var(--accent); border-color: rgba(196,98,45,0.35); }
.hamburger { display: none; }

/* ── LAYOUT BASE ────────────────────────────────────────── */
section { position: relative; z-index: 10; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 48px; }

/* ── HERO ───────────────────────────────────────────────── */
#hero { min-height: 100vh; display: flex; align-items: center; padding: 120px 0 80px; }
.hero-inner { max-width: 1100px; margin: 0 auto; padding: 0 48px; }
.hero-eyebrow { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.2em; color: var(--pine); text-transform: uppercase; margin-bottom: 32px; opacity: 0; animation: fadeUp 0.8s 0.2s ease forwards; }
.hero-headline { font-family: var(--serif); font-weight: 300; font-size: clamp(3rem, 7vw, 7rem); line-height: 1.05; color: var(--warm); margin-bottom: 28px; opacity: 0; animation: fadeUp 0.8s 0.4s ease forwards; }
.hero-headline em { font-style: italic; color: var(--accent); }
.hero-sub { font-size: 1.05rem; font-weight: 300; color: var(--muted); max-width: 560px; line-height: 1.8; margin-bottom: 56px; opacity: 0; animation: fadeUp 0.8s 0.6s ease forwards; }
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; opacity: 0; animation: fadeUp 0.8s 0.8s ease forwards; }
.hero-scroll { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; opacity: 0; animation: fadeIn 1s 1.4s ease forwards; }
.hero-scroll span { font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.2em; color: var(--muted); text-transform: uppercase; }
.scroll-line { width: 1px; height: 48px; background: linear-gradient(to bottom, var(--accent), transparent); animation: scrollPulse 2s infinite; }

/* ── BUTTONS ────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; padding: 14px 28px; cursor: pointer; border: none; transition: all 0.25s; }
.btn-primary { background: var(--accent); color: var(--warm); }
.btn-primary:hover { background: #e07555; transform: translateY(-2px); box-shadow: 0 12px 32px rgba(196,98,45,0.3); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: rgba(196,98,45,0.5); color: var(--accent); transform: translateY(-2px); }

/* ── ABOUT ──────────────────────────────────────────────── */
#about { padding: 140px 0; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: start; }
.about-label { font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.2em; color: var(--accent); text-transform: uppercase; margin-bottom: 24px; }
.about-heading { font-family: var(--serif); font-size: clamp(2.4rem, 4vw, 3.8rem); font-weight: 300; line-height: 1.1; color: var(--warm); margin-bottom: 40px; }
.about-heading .c { color: var(--accent); font-style: italic; }
.about-body p { font-size: 0.96rem; font-weight: 300; color: var(--text); line-height: 1.9; margin-bottom: 24px; }
.about-photo { position: relative; }
.about-photo img { width: 100%; aspect-ratio: 4/5; object-fit: cover; object-position: center 10%; filter: grayscale(20%) contrast(1.05) sepia(8%); }
.about-photo::before { content: ''; position: absolute; inset: -16px; border: 1px solid var(--border); z-index: -1; }
.about-photo::after { content: ''; position: absolute; bottom: -24px; right: -24px; width: 50%; height: 50%; border: 1px solid rgba(196,98,45,0.25); z-index: -1; }
.about-right { display: flex; flex-direction: column; }
.stack-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); margin-top: 48px; }
.stack-cell { background: var(--deep); padding: 24px; transition: background 0.2s; }
.stack-cell:hover { background: var(--surface); }
.stack-cell-title { font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.14em; color: var(--accent); text-transform: uppercase; margin-bottom: 8px; }
.stack-cell-desc { font-size: 0.82rem; color: var(--muted); line-height: 1.7; }

/* ── PHILOSOPHY ─────────────────────────────────────────── */
#philosophy { padding: 140px 0; border-top: 1px solid var(--border); }
.philosophy-inner { display: grid; grid-template-columns: 1fr 1.4fr; gap: 100px; align-items: start; }
.philosophy-sticky { position: sticky; top: 120px; }
.section-eyebrow { font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.2em; color: var(--accent2); text-transform: uppercase; margin-bottom: 24px; }
.philosophy-heading { font-family: var(--serif); font-size: clamp(2.6rem,4.5vw,4.5rem); font-weight: 300; line-height: 1.05; color: var(--warm); margin-bottom: 32px; }
.philosophy-heading em { font-style: italic; color: var(--accent2); }
.philosophy-intro { font-size: 0.9rem; color: var(--muted); line-height: 1.9; }
.philosophy-content { display: flex; flex-direction: column; gap: 48px; }
.philosophy-block { padding: 40px; border: 1px solid var(--border); background: var(--deep); position: relative; overflow: hidden; }
.philosophy-block::before { content: ''; position: absolute; top: 0; left: 0; width: 2px; height: 100%; background: var(--accent2); }
.philosophy-block-num { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.15em; color: var(--accent2); opacity: 0.5; margin-bottom: 16px; }
.philosophy-block h3 { font-family: var(--serif); font-size: 1.6rem; font-weight: 400; color: var(--warm); margin-bottom: 16px; }
.philosophy-block p { font-size: 0.88rem; color: var(--muted); line-height: 1.85; }

/* ── WORKS ──────────────────────────────────────────────── */
#works { padding: 140px 0; border-top: 1px solid var(--border); }
.works-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 72px; }
.works-heading { font-family: var(--serif); font-size: clamp(2.4rem,4vw,3.8rem); font-weight: 300; color: var(--warm); line-height: 1.1; }
.works-meta { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.15em; color: var(--muted); text-transform: uppercase; margin-top: 12px; }
.project-list { display: flex; flex-direction: column; gap: 2px; }
.project-item { display: grid; grid-template-columns: 60px 1fr auto; gap: 32px; align-items: start; padding: 36px 40px; background: var(--deep); border: 1px solid var(--border); transition: all 0.3s; cursor: pointer; position: relative; overflow: hidden; }
.project-item::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(196,98,45,0.04), transparent); opacity: 0; transition: opacity 0.3s; }
.project-item:hover { border-color: rgba(196,98,45,0.35); }
.project-item:hover::before { opacity: 1; }
.project-num { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); letter-spacing: 0.1em; padding-top: 4px; }
.project-type { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.18em; color: var(--accent); text-transform: uppercase; margin-bottom: 8px; }
.project-name { font-family: var(--serif); font-size: 1.5rem; font-weight: 400; color: var(--warm); margin-bottom: 16px; }
.flow-diagram { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-bottom: 16px; }
.flow-node { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.08em; padding: 4px 10px; background: rgba(196,98,45,0.07); border: 1px solid rgba(196,98,45,0.25); color: var(--accent); white-space: nowrap; }
.flow-arrow { color: var(--muted); font-size: 0.72rem; font-family: var(--mono); }
.flow-impact { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.08em; padding: 4px 10px; background: rgba(155,135,196,0.07); border: 1px solid rgba(155,135,196,0.28); color: var(--accent2); white-space: nowrap; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.project-tag { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; padding: 3px 8px; border: 1px solid var(--border); color: var(--muted); }
.project-link { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); letter-spacing: 0.1em; align-self: center; transition: color 0.2s; }
.project-item:hover .project-link { color: var(--accent); }

/* ── COLLECTIVES ─────────────────────────────────────────── */
#collectives { padding: 140px 0; border-top: 1px solid var(--border); }
.collectives-header { margin-bottom: 64px; }
.collectives-heading { font-family: var(--serif); font-size: clamp(2.4rem,4vw,3.8rem); font-weight: 300; color: var(--warm); line-height: 1.1; margin-bottom: 16px; }
.collectives-sub { font-size: 0.9rem; color: var(--muted); max-width: 600px; line-height: 1.8; }
.collectives-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.collective-card { background: var(--deep); border: 1px solid var(--border); padding: 56px 48px; position: relative; overflow: hidden; transition: border-color 0.3s; }
.collective-card::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; background: linear-gradient(to right, var(--accent2), transparent); transform: scaleX(0); transform-origin: left; transition: transform 0.4s; }
.collective-card:hover { border-color: rgba(155,135,196,0.35); }
.collective-card:hover::after { transform: scaleX(1); }
.collective-role { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.18em; color: var(--accent2); text-transform: uppercase; margin-bottom: 20px; }
.collective-name { font-family: var(--serif); font-size: 2rem; font-weight: 400; color: var(--warm); line-height: 1.2; margin-bottom: 24px; }
.collective-desc { font-size: 0.88rem; color: var(--muted); line-height: 1.85; margin-bottom: 28px; }
.collective-impact { padding: 16px 20px; border: 1px solid var(--border); background: rgba(6,13,24,0.5); }
.collective-impact-label { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.16em; color: var(--muted); text-transform: uppercase; margin-bottom: 6px; }
.collective-impact-text { font-size: 0.82rem; color: var(--text); line-height: 1.7; }

/* ── WRITINGS ────────────────────────────────────────────── */
#writings { padding: 140px 0; border-top: 1px solid var(--border); }
.writings-header { margin-bottom: 64px; display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 24px; }
.writings-heading { font-family: var(--serif); font-size: clamp(2rem,4vw,3.4rem); font-weight: 300; color: var(--warm); line-height: 1.15; }
.writings-heading .c { color: var(--pine); font-style: italic; }
.writings-intro { font-size: 0.88rem; color: var(--muted); max-width: 540px; line-height: 1.85; margin-top: 20px; }
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(300px,1fr)); gap: 2px; }
.posts-loading { grid-column: 1/-1; font-family: var(--mono); font-size: 0.7rem; color: var(--muted); padding: 32px 0; letter-spacing: 0.1em; }
.blog-source { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); letter-spacing: 0.12em; margin-top: 32px; }
.post-card { display: block; background: var(--deep); border: 1px solid var(--border); padding: 32px; transition: border-color 0.25s; }
.post-card:hover { border-color: rgba(61,148,112,0.4); }
.post-card-meta { font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.16em; color: var(--pine); text-transform: uppercase; margin-bottom: 12px; }
.post-card-title { font-family: var(--serif); font-size: 1.3rem; font-weight: 400; color: var(--warm); margin-bottom: 12px; line-height: 1.3; }
.post-card-excerpt { font-size: 0.82rem; color: var(--muted); line-height: 1.7; }

/* ── CONTACT ─────────────────────────────────────────────── */
#contact { padding: 140px 0; border-top: 1px solid var(--border); }
.contact-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; }
.contact-heading { font-family: var(--serif); font-size: clamp(2.6rem,4.5vw,4.5rem); font-weight: 300; color: var(--warm); line-height: 1.05; margin-bottom: 24px; }
.contact-heading .c { color: var(--accent); font-style: italic; }
.contact-sub { font-size: 0.9rem; color: var(--muted); line-height: 1.85; margin-bottom: 40px; }
.contact-quick { margin-bottom: 32px; }
.contact-section-label { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.15em; color: var(--muted); text-transform: uppercase; margin-bottom: 12px; }
.contact-links { display: flex; flex-direction: column; gap: 2px; }
.contact-link-item { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border: 1px solid var(--border); background: var(--deep); transition: all 0.25s; margin-bottom: 2px; }
.contact-link-item:hover { border-color: rgba(196,98,45,0.35); background: var(--surface); }
.contact-link-icon { font-size: 1rem; width: 20px; text-align: center; }
.contact-link-name { font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.12em; color: var(--accent); text-transform: uppercase; flex: 1; }
.contact-link-handle { font-size: 0.82rem; color: var(--muted); }
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-label { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.15em; color: var(--muted); text-transform: uppercase; }
.form-input, .form-textarea { background: var(--deep); border: 1px solid var(--border); color: var(--text); font-family: var(--sans); font-size: 0.88rem; padding: 12px 16px; outline: none; transition: border-color 0.2s; resize: none; }
.form-input:focus, .form-textarea:focus { border-color: rgba(196,98,45,0.45); }
.form-textarea { height: 120px; }

/* ── FOOTER ─────────────────────────────────────────────── */
footer { position: relative; z-index: 10; border-top: 1px solid var(--border); padding: 40px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-left { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; color: var(--muted); }
.footer-left strong { color: var(--accent); }
.footer-right { font-family: var(--serif); font-size: 1rem; font-weight: 300; color: var(--muted); font-style: italic; }

/* ── DEMO MODAL ─────────────────────────────────────────── */
.demo-modal { display: none; position: fixed; inset: 0; z-index: 200; background: rgba(6,13,24,0.92); backdrop-filter: blur(8px); align-items: center; justify-content: center; }
.demo-box { background: var(--deep); border: 1px solid var(--border); padding: 48px; max-width: 440px; width: 90%; position: relative; }
.demo-close { position: absolute; top: 20px; right: 20px; background: none; border: none; color: var(--muted); font-size: 1.2rem; cursor: pointer; }
.demo-eyebrow { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.18em; color: var(--accent); text-transform: uppercase; margin-bottom: 20px; }
.demo-subtitle { font-size: 0.88rem; color: var(--muted); margin-bottom: 28px; }
.demo-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.demo-countdown { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); margin-top: 16px; }

/* ── ANIMATIONS ─────────────────────────────────────────── */
@keyframes fadeUp { from { opacity:0; transform:translateY(24px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes scrollPulse { 0%,100% { opacity:1; transform:scaleY(1); } 50% { opacity:0.3; transform:scaleY(0.6); } }
.reveal { opacity:0; transform:translateY(32px); transition:opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity:1; transform:translateY(0); }

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width:900px) {
  nav { padding: 20px 24px; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    background: rgba(6,13,24,0.97);
    backdrop-filter: blur(12px);
    align-items: center;
    justify-content: center;
    gap: 32px;
    z-index: 999;
  }
  .nav-links.open a { font-size: 1.1rem; letter-spacing: 0.2em; }
  .hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 6px;
    z-index: 1000;
    position: relative;
  }
  .hamburger span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: var(--text);
    transition: transform 0.3s, opacity 0.3s;
  }
  .hamburger.active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .hamburger.active span:nth-child(2) { opacity: 0; }
  .hamburger.active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
  .hero-inner, .container { padding: 0 24px; }
  .about-grid, .philosophy-inner, .collectives-inner, .contact-inner { grid-template-columns: 1fr; gap: 48px; }
  .about-photo { max-width: 340px; }
  .philosophy-sticky { position: static; }
  .works-header { flex-direction: column; align-items: flex-start; }
  .project-item { grid-template-columns: 40px 1fr; }
  .project-link { display: none; }
  .writings-header { flex-direction: column; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none !important; opacity: 1 !important; transform: none !important; }
  .hero-headline, .hero-eyebrow, .hero-sub, .hero-cta { animation: none !important; opacity: 1 !important; transform: none !important; }
  canvas#cosmos { display: none; }
}
