:root {
  --bg: #f7f5f0;
  --bg-2: #efece4;
  --ink: #14171c;
  --ink-2: #2b3038;
  --muted: #6a6f78;
  --line: #d9d4c7;
  --accent: #1a3a2e;
  --dark-bg: #14171c;
  --dark-ink: #f4f1ea;
  --dark-muted: #8a8f99;
  --dark-line: #2a2f38;
  --max: 1200px;
  --pad: clamp(20px, 4vw, 40px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.italic { font-family: 'Newsreader', serif; font-style: italic; font-weight: 400; }

/* ---------- subtle grain ---------- */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}
.logo-mark {
  width: 26px;
  height: 26px;
  color: var(--ink);
}
.logo-word {
  font-family: 'Newsreader', serif;
  font-weight: 400;
  font-size: 22px;
  letter-spacing: 0.01em;
}
.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
  color: var(--ink-2);
}
.nav a:hover { color: var(--ink); }
.nav-cta {
  border: 1px solid var(--ink);
  padding: 8px 16px;
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}
.nav-cta:hover { background: var(--ink); color: var(--bg); }

@media (max-width: 640px) {
  .nav a:not(.nav-cta) { display: none; }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: clamp(80px, 14vw, 160px) 0 clamp(80px, 12vw, 140px);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 80% 0%, rgba(26,58,46,0.08), transparent 70%),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(26,58,46,0.05), transparent 70%);
  pointer-events: none;
}
.hero > .container { position: relative; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 70%, white);
  margin-bottom: 32px;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.hero-title {
  font-family: 'Newsreader', serif;
  font-weight: 300;
  font-size: clamp(40px, 6.5vw, 84px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
  color: var(--ink);
  max-width: 16ch;
}
.hero-sub {
  font-size: clamp(17px, 1.4vw, 19px);
  color: var(--ink-2);
  max-width: 58ch;
  line-height: 1.6;
  margin: 0 0 40px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--accent);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover {
  border-color: var(--ink);
}

/* ---------- generic section ---------- */
.section {
  padding: clamp(80px, 11vw, 140px) 0;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.grid-2 {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: clamp(32px, 6vw, 80px);
}
@media (max-width: 800px) {
  .grid-2 { grid-template-columns: 1fr; gap: 24px; }
}

.section-label {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  position: sticky;
  top: 100px;
  align-self: start;
  height: max-content;
}
.section-label .num {
  color: var(--ink);
  font-weight: 500;
}
@media (max-width: 800px) {
  .section-label { position: static; }
}

.section-title {
  font-family: 'Newsreader', serif;
  font-weight: 300;
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 28px;
  max-width: 22ch;
}
.section-body p {
  margin: 0 0 18px;
  color: var(--ink-2);
  max-width: 62ch;
}
.section-body strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- stat list ---------- */
.stat-list {
  list-style: none;
  padding: 0;
  margin: 44px 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}
.stat-list li {
  padding: 28px 32px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stat-list li:first-child { padding-left: 0; }
.stat-list li:last-child { border-right: none; padding-right: 0; }
@media (max-width: 720px) {
  .stat-list { grid-template-columns: 1fr; }
  .stat-list li {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 20px 0;
  }
  .stat-list li:last-child { border-bottom: none; }
}
.stat-num {
  font-family: 'Newsreader', serif;
  font-size: 36px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.stat-label {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- dark section ---------- */
.section-dark {
  background: var(--dark-bg);
  color: var(--dark-ink);
  border-bottom: none;
}
.section-dark .section-label { color: var(--dark-muted); }
.section-dark .section-label .num { color: var(--dark-ink); }
.section-dark .section-title { color: var(--dark-ink); }
.section-dark .section-body p { color: color-mix(in srgb, var(--dark-ink) 80%, transparent); }
.section-dark .section-body strong { color: var(--dark-ink); }

/* ---------- pillars ---------- */
.pillars {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--dark-line);
  border: 1px solid var(--dark-line);
}
@media (max-width: 720px) {
  .pillars { grid-template-columns: 1fr; }
}
.pillar {
  background: var(--dark-bg);
  padding: 28px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pillar-mark {
  font-size: 22px;
  color: var(--dark-ink);
  opacity: 0.7;
  margin-bottom: 6px;
}
.pillar h3 {
  font-family: 'Newsreader', serif;
  font-weight: 400;
  font-size: 20px;
  letter-spacing: -0.005em;
  margin: 0;
  color: var(--dark-ink);
}
.pillar p {
  font-size: 14.5px;
  color: var(--dark-muted);
  margin: 0;
  line-height: 1.55;
}

/* ---------- closing ---------- */
.section-closing {
  padding: clamp(100px, 14vw, 160px) 0;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.closing-inner {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}
.closing-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  letter-spacing: 0.02em;
}
.closing-eyebrow .italic { font-size: 15px; color: var(--ink-2); }
.closing-title {
  font-family: 'Newsreader', serif;
  font-weight: 300;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0;
}
.closing-soon {
  display: block;
  font-style: italic;
  color: var(--muted);
  margin-top: 8px;
  font-size: 0.7em;
}

/* ---------- contact dialog ---------- */
.contact-dialog {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 620px;
  width: calc(100% - 32px);
  max-height: calc(100vh - 32px);
  margin: auto;
  color: var(--ink);
  overflow: visible;
}
.contact-dialog::backdrop {
  background: rgba(20, 23, 28, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.contact-dialog[open] {
  animation: dialog-pop 220ms cubic-bezier(0.2, 0.7, 0.3, 1);
}
@keyframes dialog-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.dialog-content {
  background: var(--bg);
  border-radius: 14px;
  padding: clamp(28px, 4vw, 44px);
  box-shadow: 0 30px 80px -20px rgba(20, 23, 28, 0.35), 0 0 0 1px var(--line);
  position: relative;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.dialog-close:hover {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  color: var(--ink);
  border-color: var(--line);
}
.dialog-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}
.dialog-eyebrow .num { color: var(--ink); font-weight: 500; margin-right: 8px; }
.dialog-title {
  font-family: 'Newsreader', serif;
  font-weight: 300;
  font-size: clamp(28px, 3.4vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
}
.dialog-sub {
  color: var(--ink-2);
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.55;
}
.dialog-sub a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.dialog-sub a:hover { color: var(--accent); }

/* view switching */
.dialog-form-view,
.dialog-success-view {
  display: none;
}
.dialog-body[data-view="form"] .dialog-form-view {
  display: block;
}
.dialog-body[data-view="success"] .dialog-success-view {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 4px 0;
  animation: dialog-success-in 320ms cubic-bezier(0.2, 0.7, 0.3, 1);
}
@keyframes dialog-success-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.success-mark {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 999px;
  padding: 14px;
  display: inline-flex;
  margin-bottom: 4px;
}
.success-mark svg { width: 32px; height: 32px; display: block; }
.dialog-success-view .dialog-title { margin-bottom: 4px; }
.success-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.btn-link {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  padding: 8px 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--muted) 40%, transparent);
  transition: color 0.15s, text-decoration-color 0.15s;
}
.btn-link:hover { color: var(--ink); text-decoration-color: var(--ink); }

.contact-form {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 640px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.contact-form input,
.contact-form textarea {
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background: color-mix(in srgb, var(--bg) 60%, white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  width: 100%;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.contact-form textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--ink);
  background: white;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 8%, transparent);
}
.contact-form input:invalid:not(:placeholder-shown),
.contact-form textarea:invalid:not(:placeholder-shown) {
  border-color: #b94a3b;
}
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form-footer {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.contact-form .btn-primary[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}
.form-status {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}
.form-status[data-state="ok"] { color: var(--accent); }
.form-status[data-state="error"] { color: #b94a3b; }

/* ---------- footer ---------- */
.site-footer {
  padding: 36px 0;
  font-size: 13px;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Newsreader', serif;
  font-size: 16px;
  color: var(--ink);
}
.footer-brand .logo-mark { width: 18px; height: 18px; }
.footer-meta {
  display: flex;
  align-items: center;
  gap: 24px;
}
.footer-meta a:hover { color: var(--ink); }
