/* ── Brand tokens ───────────────────────────────────────── */
:root {
  --orange:   #E07860;
  --teal:     #1A3A3A;
  --cream:    #F5E6D3;
  --paper:    #F7F3EE;
  --font-brand: 'TAY Big Bird', Georgia, serif;
  --font-ui:    system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-body:  'Georgia', 'Times New Roman', serif;
  --ease:     cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Theme: dark (default) ──────────────────────────────── */
[data-theme="dark"] {
  --bg:         #0C0C0C;
  --bg-alt:     #111111;
  --bg-raised:  #161616;
  --border:     rgba(255,255,255,0.07);
  --border-med: rgba(255,255,255,0.12);
  --text-pri:   #F0EAE0;
  --text-sec:   rgba(240,234,224,0.5);
  --text-ter:   rgba(240,234,224,0.28);
  --accent:     var(--orange);
  --toggle-bg:  #222;
}

/* ── Theme: light ───────────────────────────────────────── */
[data-theme="light"] {
  --bg:         var(--paper);
  --bg-alt:     #EDEAE4;
  --bg-raised:  #fff;
  --border:     rgba(0,0,0,0.07);
  --border-med: rgba(0,0,0,0.13);
  --text-pri:   #0C0C0C;
  --text-sec:   rgba(12,12,12,0.5);
  --text-ter:   rgba(12,12,12,0.3);
  --accent:     var(--orange);
  --toggle-bg:  #ddd8d2;
}

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

body {
  background: var(--bg);
  color: var(--text-pri);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

/* ── Brand font ─────────────────────────────────────────── */
@font-face {
  font-family: 'TAY Big Bird';
  src: url('/static/fonts/TAYBigBirdRegular.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ── Film grain overlay ─────────────────────────────────── */
.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

[data-theme="light"] .grain-overlay { opacity: 0.025; }

/* ── Layout ─────────────────────────────────────────────── */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 2.5rem;
}

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.header-brand {
  font-family: var(--font-brand);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-pri);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.header-link {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-sec);
  text-decoration: none;
  transition: color 0.2s;
}
.header-link:hover { color: var(--accent); }

/* ── Theme toggle ───────────────────────────────────────── */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.toggle-track {
  position: relative;
  display: block;
  width: 34px;
  height: 18px;
  background: var(--toggle-bg);
  border-radius: 9px;
  transition: background 0.25s;
  border: 1px solid var(--border-med);
}

.toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 0.25s var(--ease);
}

[data-theme="light"] .toggle-thumb {
  transform: translateX(16px);
}

.toggle-label {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-ter);
  min-width: 2.5rem;
  transition: color 0.2s;
}

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 9rem 2.5rem 3rem;
  max-width: 1080px;
  margin: 0 auto;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 3rem;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-ter);
}

.meta-sep { color: var(--accent); }

.hero-title {
  display: flex;
  flex-direction: column;
  font-family: var(--font-brand);
  font-size: clamp(5rem, 14vw, 12rem);
  line-height: 0.88;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin-bottom: 3rem;
}

.title-line { color: var(--text-pri); }
.title-line--accent { color: var(--accent); }

.hero-tagline {
  font-family: var(--font-ui);
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-sec);
  line-height: 1.8;
  max-width: 320px;
}

.hero-footer {
  padding-top: 4rem;
}

.hero-rule-wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.hero-rule {
  flex: 1;
  height: 1px;
  background: var(--border-med);
}

.hero-rule-label {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

/* ── Sections shared ────────────────────────────────────── */
.section {
  padding: 7rem 0;
  border-top: 1px solid var(--border);
}

.section-label {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-ter);
  margin-bottom: 3.5rem;
}

/* ── Philosophy ─────────────────────────────────────────── */
.section--philosophy { background: var(--bg); }

.philosophy-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
  align-items: start;
}

.philosophy-quote {
  font-family: var(--font-brand);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--accent);
  position: sticky;
  top: 6rem;
}

.philosophy-body p {
  color: var(--text-sec);
  font-size: 1.05rem;
  line-height: 1.85;
  margin-bottom: 1.25rem;
  max-width: 600px;
}

.philosophy-body p:last-child { margin-bottom: 0; }

/* ── Pillars ────────────────────────────────────────────── */
.section--pillars { background: var(--bg-alt); }

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
}

.pillar {
  background: var(--bg-alt);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transition: background 0.2s;
}

.pillar:hover { background: var(--bg-raised); }

.pillar-index {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.pillar-title {
  font-family: var(--font-brand);
  font-size: 1.7rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-pri);
}

.pillar-body {
  font-size: 0.92rem;
  color: var(--text-sec);
  line-height: 1.75;
}

/* ── Features ───────────────────────────────────────────── */
.section--features { background: var(--bg); }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border: 1px solid var(--border);
}

.feature {
  padding: 2rem 2.5rem;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  transition: background 0.2s;
}

.feature:hover { background: var(--bg-raised); }

.feature:nth-child(even) { border-right: none; }
.feature:nth-last-child(-n+2) { border-bottom: none; }

.feature-title {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-pri);
  margin-bottom: 0.6rem;
}

.feature-body {
  font-size: 0.92rem;
  color: var(--text-sec);
  line-height: 1.7;
}

/* ── Contact ────────────────────────────────────────────── */
.section--contact { background: var(--bg-alt); }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
}

.contact-heading {
  font-family: var(--font-brand);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-pri);
  line-height: 1.15;
  margin-bottom: 1.5rem;
}

.contact-body {
  font-size: 0.95rem;
  color: var(--text-sec);
  line-height: 1.8;
  margin-bottom: 1rem;
}

/* ── Form ───────────────────────────────────────────────── */
.contact-form { display: flex; flex-direction: column; gap: 1.25rem; }

.field { display: flex; flex-direction: column; gap: 0.4rem; }

.field-label {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-ter);
}

.field-optional {
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.6;
  font-size: 0.65rem;
}

.field-input {
  background: var(--bg);
  border: 1px solid var(--border-med);
  color: var(--text-pri);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  border-radius: 0;
  -webkit-appearance: none;
  width: 100%;
}

.field-input:focus { border-color: var(--accent); }
.field-textarea { resize: vertical; min-height: 100px; }

.submit-btn {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: var(--accent);
  color: #0C0C0C;
  border: none;
  padding: 0.9rem 2rem;
  cursor: pointer;
  align-self: flex-start;
  transition: opacity 0.2s;
}

.submit-btn:hover { opacity: 0.85; }
.submit-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.form-success {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  min-height: 1.2em;
}

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  background: var(--bg);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}

.footer-brand {
  font-family: var(--font-brand);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-pri);
}

.footer-loc,
.footer-copy {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-ter);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero { padding: 7rem 1.5rem 2.5rem; border: none; }
  .container { padding: 0 1.5rem; }
  .philosophy-grid { grid-template-columns: 1fr; gap: 2rem; }
  .philosophy-quote { position: static; font-size: 1.6rem; }
  .pillar-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature { border-right: none !important; }
  .feature:nth-last-child(-n+2) { border-bottom: 1px solid var(--border); }
  .feature:last-child { border-bottom: none; }
  .contact-grid { grid-template-columns: 1fr; gap: 3rem; }
  .site-header { padding: 1rem 1.5rem; }
  .header-link { display: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
