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

:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-warm: #f0ebe4;
  --hero-bg: #2c2416;
  --hero-text: #faf8f5;
  --hero-dim: #c4b8a4;
  --border: #ddd7ce;
  --border-light: #ece8e2;
  --text: #2c2416;
  --text-dim: #8a7e6e;
  --text-mid: #5c5245;
  --accent: #b07340;
  --accent-hover: #965f30;
  --accent-light: #d4a574;
  --accent-glow: rgba(176, 115, 64, 0.12);
  --radius: 12px;
  --max-width: 1100px;
  --font-display: "DM Serif Display", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", "Consolas", monospace;
}

[data-theme="dark"] {
  --bg: #1a1611;
  --surface: #221d16;
  --surface-warm: #2a2318;
  --border: #3a3228;
  --border-light: #332b22;
  --text: #e8e0d4;
  --text-dim: #9a8e7e;
  --text-mid: #c4b8a4;
}

html { scroll-behavior: smooth; overflow-y: scroll; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-hover); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
}

/* ── HERO ── */
.hero {
  background: var(--hero-bg);
  color: var(--hero-text);
  position: relative;
  overflow: hidden;
}

.hero-image {
  width: 100%;
  display: block;
  opacity: 0.55;
}

.hero-compact .hero-image {
  height: 350px;
  object-fit: cover;
  object-position: center center;
}

.hero-natural .hero-image {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.hero-compact .hero-content {
  padding: 32px 0;
}

.hero-fade {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom,
    rgba(44, 36, 22, 0.95) 0%,
    rgba(44, 36, 22, 0.80) 25%,
    rgba(44, 36, 22, 0.40) 50%,
    rgba(44, 36, 22, 0.20) 65%,
    rgba(44, 36, 22, 0.40) 80%,
    rgba(44, 36, 22, 0.95) 100%
  );
  pointer-events: none;
  z-index: 1;
}

.hero-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 48px 0;
}

.hero .hero-brand {
  font-family: var(--font-body);
  font-size: 48px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.1;
  margin-bottom: 8px;
  color: var(--hero-text);
}

.hero .hero-brand .initial {
  font-size: 60px;
}

.hero .tagline {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--accent-light);
  letter-spacing: 0.25em;
  margin-bottom: 32px;
}

.hero .hero-headline {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 400;
  line-height: 1.15;
  max-width: 700px;
  color: var(--hero-text);
  margin-bottom: 24px;
}

.hero .sub {
  font-size: 17px;
  color: var(--hero-dim);
  max-width: 620px;
  line-height: 1.7;
  font-weight: 400;
}

/* ── TOP NAV ── */
.top-bar {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 10;
  padding: 20px 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.top-email {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--hero-dim);
  letter-spacing: 0.02em;
  transition: color 0.15s;
}

.top-email:hover {
  color: var(--hero-text);
}

.nav-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--hero-dim);
  transition: color 0.15s;
}

.nav-links a:hover {
  color: var(--hero-text);
}

.gear-btn {
  background: none;
  border: none;
  color: var(--hero-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s;
  line-height: 1;
}

.gear-btn:hover {
  color: var(--hero-text);
  background: rgba(255,255,255,0.1);
}

/* ── SECTION SHARED ── */
.section-label {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-headline {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.2;
}

.section-subtitle {
  font-family: var(--font-display);
  font-size: 18px;
  font-style: italic;
  color: var(--accent);
  margin-bottom: 40px;
}

/* ── NOTES / EDITORIAL ── */
.notes-section {
  padding: 96px 0;
  border-bottom: 1px solid var(--border);
}

.notes-body {
  max-width: 680px;
}

.notes-body p {
  font-size: 17px;
  line-height: 1.85;
  margin-bottom: 24px;
  color: var(--text-mid);
}

.notes-body .pullquote {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  font-style: italic;
  color: var(--text);
  border-left: 4px solid var(--accent);
  padding-left: 28px;
  margin: 48px 0;
  line-height: 1.4;
}

.notes-body .read-more {
  display: inline-block;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  margin-top: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--accent-light);
}

.notes-body .read-more:hover {
  border-bottom-color: var(--accent);
}

/* ── SECTION HERO (full-bleed background image) ── */
.section-hero {
  position: relative;
  background: var(--hero-bg);
  color: var(--hero-text);
}

.section-hero .section-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.3;
}

.section-hero .section-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(44, 36, 22, 0.4) 0%, rgba(44, 36, 22, 0.85) 100%);
}

.section-hero .container { position: relative; z-index: 1; }
.section-hero .section-label { color: var(--accent-light); }
.section-hero .section-headline { color: var(--hero-text); }
.section-hero .notes-body p { color: var(--hero-dim); }
.section-hero .pullquote { color: var(--hero-text); border-left-color: var(--accent-light); }
.section-hero .read-more { color: var(--accent-light); border-bottom-color: var(--accent-light); }
.section-hero .section-subtitle { color: var(--accent-light); }

/* ── WORK STEPS ── */
.work-section {
  padding: 96px 0;
  border-bottom: 1px solid var(--border);
}

.work-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 48px;
}

.work-step {
  padding: 36px 32px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.work-step:hover {
  border-color: var(--accent-light);
  box-shadow: 0 4px 24px var(--accent-glow);
}

.work-step .step-num {
  font-family: var(--font-display);
  font-size: 36px;
  color: var(--accent-light);
  margin-bottom: 16px;
  line-height: 1;
}

.work-step h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  margin-bottom: 12px;
}

.work-step p {
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.65;
}

.section-hero .work-step { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); }
.section-hero .work-step:hover { border-color: var(--accent-light); box-shadow: 0 4px 24px rgba(176,115,64,0.15); }
.section-hero .work-step .step-num { color: var(--accent-light); }
.section-hero .work-step h3 { color: var(--hero-text); }
.section-hero .work-step p { color: var(--hero-dim); }

.work-cta {
  text-align: center;
  padding: 24px 0;
}

.work-cta a {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--surface);
  background: var(--accent);
  padding: 16px 40px;
  border-radius: 8px;
  transition: all 0.2s;
  display: inline-block;
  letter-spacing: 0.04em;
}

.work-cta a:hover {
  background: var(--accent-hover);
  color: var(--surface);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.section-hero .work-cta a { background: var(--accent-light); color: var(--hero-bg); }
.section-hero .work-cta a:hover { background: var(--accent); }

/* ── PRODUCTS ── */
.products-section {
  padding: 96px 0;
  border-bottom: 1px solid var(--border);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.product-card:hover {
  border-color: var(--accent-light);
  box-shadow: 0 4px 24px var(--accent-glow);
  transform: translateY(-2px);
}

.product-card.product-primary {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--surface-warm) 0%, var(--surface) 100%);
  border-width: 2px;
}

.product-card .product-name { font-family: var(--font-display); font-size: 26px; font-weight: 400; color: var(--text); }
.product-card .product-domain { font-family: var(--mono); font-size: 13px; color: var(--accent); font-weight: 500; }
.product-card .product-desc { font-size: 15px; color: var(--text-mid); line-height: 1.65; }

/* ── RESEARCH ── */
.research-section {
  padding: 96px 0;
  border-bottom: 1px solid var(--border);
}

.research-cluster { margin-bottom: 48px; }
.research-cluster:last-child { margin-bottom: 0; }

.cluster-label { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.cluster-hint { font-size: 15px; color: var(--text-dim); margin-bottom: 20px; line-height: 1.5; }

.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.research-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.research-card:hover { border-color: var(--accent-light); box-shadow: 0 4px 24px var(--accent-glow); transform: translateY(-2px); }
.research-card .title { font-family: var(--font-display); font-size: 18px; font-weight: 400; color: var(--text); line-height: 1.3; }
.research-card .meta { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.research-card .summary { font-size: 14px; color: var(--text-dim); line-height: 1.55; }

/* ── BOOKS / METHOD ── */
.books-section {
  padding: 96px 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface-warm);
}

.books-body { max-width: 680px; }
.books-body p { font-size: 17px; line-height: 1.85; margin-bottom: 24px; color: var(--text-mid); }
.books-body .pullquote { font-family: var(--font-display); font-size: 28px; font-weight: 400; font-style: italic; color: var(--text); border-left: 4px solid var(--accent); padding-left: 28px; margin: 48px 0; line-height: 1.4; }
.books-body .read-more { display: inline-block; font-family: var(--mono); font-size: 13px; font-weight: 500; margin-top: 12px; padding: 8px 0; border-bottom: 1px solid var(--accent-light); }

/* ── HOME NAV CARDS ── */
.nav-cards {
  padding: 96px 0;
}

.nav-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
}

.nav-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.nav-card:hover {
  border-color: var(--accent-light);
  box-shadow: 0 4px 24px var(--accent-glow);
  transform: translateY(-2px);
}

.nav-card .nav-card-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  color: var(--text);
}

.nav-card .nav-card-desc {
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.65;
}

.nav-card .nav-card-arrow {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  margin-top: auto;
}

/* ── CONTACT FORM ── */
.contact-form {
  max-width: 520px;
}

.contact-form .form-row {
  margin-bottom: 20px;
}

.contact-form label {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  transition: border-color 0.15s;
  line-height: 1.6;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.contact-form textarea {
  min-height: 120px;
  resize: vertical;
}

.contact-form .form-submit {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--surface);
  background: var(--accent);
  border: none;
  padding: 14px 36px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.04em;
}

.contact-form .form-submit:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.contact-form .form-note {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 12px;
}

.form-status {
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 24px;
  font-size: 15px;
}

.form-status.success {
  background: rgba(76, 175, 80, 0.1);
  color: #2e7d32;
  border: 1px solid rgba(76, 175, 80, 0.2);
}

.form-status.error {
  background: rgba(211, 47, 47, 0.1);
  color: #c62828;
  border: 1px solid rgba(211, 47, 47, 0.2);
}

/* Dark theme form */
[data-theme="dark"] .contact-form input,
[data-theme="dark"] .contact-form textarea {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

/* Hero form variant (light text) */
.hero-form label {
  color: var(--hero-dim);
}

.hero-form input,
.hero-form textarea {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--hero-text);
}

.hero-form input:focus,
.hero-form textarea:focus {
  border-color: var(--accent-light);
}

.hero-form input::placeholder,
.hero-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.hero-form .form-submit {
  background: var(--accent-light);
  color: var(--hero-bg);
}

.hero-form .form-submit:hover {
  background: var(--accent);
}

.hero-form .form-note {
  color: var(--hero-dim);
}

/* ── FOOTER ── */
footer {
  padding: 64px 0 48px;
  background: var(--hero-bg);
  color: var(--hero-dim);
}

footer .container {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-nav a {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--hero-dim);
  transition: color 0.15s;
}

.footer-nav a:hover {
  color: var(--hero-text);
}

.footer-legal {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-legal a {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--hero-dim);
  opacity: 0.6;
  transition: opacity 0.15s;
}

.footer-legal a:hover {
  opacity: 1;
  color: var(--hero-dim);
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

footer .entity { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--hero-text); letter-spacing: 0.06em; }
footer .footer-line { font-family: var(--font-display); font-size: 18px; color: var(--hero-dim); font-style: italic; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .hero-content { padding: 32px 0; }
  .hero .hero-brand { font-size: 32px; }
  .hero .hero-brand .initial { font-size: 40px; }
  .hero .hero-headline { font-size: 28px; }
  .section-headline { font-size: 30px; }
  .notes-section, .research-section, .products-section, .work-section, .books-section, .nav-cards { padding: 64px 0; }
  .products-grid { grid-template-columns: 1fr; }
  .research-grid { grid-template-columns: 1fr; }
  .work-steps { grid-template-columns: 1fr; }
  .nav-cards-grid { grid-template-columns: 1fr; }
  .notes-body .pullquote, .books-body .pullquote { font-size: 22px; }
  .top-bar { padding: 12px 16px; }
  .nav-links { display: none; }
}
