/* Aewita — Design Tokens
   Per Master Design Document v2.0 */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Instrument+Serif:ital@0;1&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Brand */
  --color-brand-primary: #0F0F0F;
  --color-brand-accent: #D9484E;
  --color-brand-accent-dark: #B83A40;
  --color-brand-accent-light: #E8686D;

  /* Backgrounds */
  --color-bg: #FAFAF8;
  --color-surface: #FFFFFF;
  --color-border: #E5E5E3;
  --color-border-strong: #D4D4D0;
  --color-dark-bg: #0F0F0F;
  --color-dark-surface: #1A1A1A;
  --color-dark-border: #2A2A2A;

  /* Text */
  --color-text-primary: #0F0F0F;
  --color-text-secondary: #2F2F2F;
  --color-text-tertiary: #555555;
  --color-text-inverse: #FFFFFF;
  --color-text-inverse-muted: rgba(255,255,255,0.72);

  /* Functional */
  --color-success: #1A7A3A;
  --color-warning: #C47F17;
  --color-error: #C13515;
  --color-info: #2563EB;

  /* Typography */
  --font-display: 'Cormorant Garamond', 'FreightDisp Pro', 'Canela', Georgia, serif;
  --font-serif-accent: 'Instrument Serif', 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Söhne', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Berkeley Mono', ui-monospace, monospace;

  /* Spacing */
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
  --space-4: 1rem; --space-6: 1.5rem; --space-8: 2rem;
  --space-12: 3rem; --space-16: 4rem; --space-20: 5rem;
  --space-24: 6rem; --space-32: 8rem;

  /* Radii */
  --radius-sm: 4px; --radius-md: 8px; --radius-lg: 12px;
  --radius-xl: 16px; --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.08);
  --shadow-xl: 0 24px 48px rgba(0,0,0,0.10);

  /* Layout */
  --max-width: 1280px;
  --nav-height: 72px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

button, input, textarea, select { font: inherit; }

/* Typography primitives */
.display {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.05;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.mono {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum' 1;
}

.etym {
  font-family: var(--font-serif-accent);
  font-style: italic;
  font-weight: 400;
}

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 64px;
}
@media (max-width: 720px) {
  .container { padding: 0 20px; }
}

/* Nav */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  z-index: 100;
  background: transparent;
  transition: background 220ms ease, border-color 220ms ease, backdrop-filter 220ms ease;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled,
.nav.is-light {
  background: rgba(250, 250, 248, 0.88);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom-color: var(--color-border);
}
.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text-inverse);
  transition: color 220ms ease;
}
.nav.is-scrolled .nav-brand,
.nav.is-light .nav-brand { color: var(--color-text-primary); }
.nav-brand img.quill {
  height: 28px; width: 28px;
  border-radius: 6px;
}
.nav-brand .wordmark {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-links a {
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.005em;
  color: rgba(255,255,255,0.88);
  transition: color 180ms ease;
  position: relative;
  padding: 6px 2px;
}
.nav-links a:hover { color: #fff; }
.nav.is-scrolled .nav-links a,
.nav.is-light .nav-links a { color: var(--color-text-secondary); }
.nav.is-scrolled .nav-links a:hover,
.nav.is-light .nav-links a:hover { color: var(--color-text-primary); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 820px) {
  .nav-links { display: none; }
}
@media (max-width: 820px) {
  .nav-right .nav-signin { display: none; }
}

/* Burger (hidden above 820px) */
.nav-burger {
  display: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 10px;
  width: 42px; height: 42px;
  padding: 0;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: border-color 180ms ease, background 180ms ease;
}
.nav-burger span {
  width: 18px; height: 1.5px; background: #fff;
  transition: transform 220ms ease, opacity 180ms ease;
}
.nav.is-scrolled .nav-burger, .nav.is-light .nav-burger { border-color: rgba(15,15,15,0.2); }
.nav.is-scrolled .nav-burger span, .nav.is-light .nav-burger span { background: #0F0F0F; }
.nav.nav-open .nav-burger span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav.nav-open .nav-burger span:nth-child(2) { opacity: 0; }
.nav.nav-open .nav-burger span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* Drawer */
.nav-drawer {
  position: fixed;
  top: 64px; left: 0; right: 0;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  padding: 24px 24px 32px;
  display: none;
  flex-direction: column;
  gap: 0;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}
.nav-drawer a {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  color: var(--color-text-primary);
  padding: 14px 0;
  border-bottom: 1px solid rgba(15,15,15,0.07);
  letter-spacing: -0.005em;
}
.nav-drawer a:last-child { border-bottom: none; }
.nav-drawer .btn { font-family: var(--font-body); font-size: 16px; }
.nav-drawer-divider { height: 8px; }
.nav.nav-open .nav-drawer { display: flex; }

@media (max-width: 820px) {
  .nav-burger { display: inline-flex; }
}
@media (max-width: 560px) {
  .nav-right .nav-cta { display: none; }
  .nav-inner { gap: 16px; }
  .nav-brand .wordmark { font-size: 19px; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 13px 22px;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, color 150ms ease;
  min-width: 0;
  white-space: nowrap;
  line-height: 1;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }

.btn-primary {
  background: var(--color-brand-accent);
  color: #fff;
}
.btn-primary:hover { background: var(--color-brand-accent-light); }

.btn-secondary {
  background: transparent;
  color: var(--color-text-primary);
  border-color: var(--color-border-strong);
}
.btn-secondary:hover { background: var(--color-surface); border-color: #0F0F0F; }

.btn-secondary-inverse {
  background: rgba(235,235,235,0.82);
  color: #0F0F0F;
  border-color: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn-secondary-inverse:hover { background: rgba(255,255,255,0.95); border-color: #fff; color: #0F0F0F; }

.btn-ghost {
  background: transparent;
  color: var(--color-text-primary);
  padding: 10px 12px;
  border: none;
}
.btn-ghost:hover { color: var(--color-brand-accent); }

.btn-ghost-inverse {
  background: transparent;
  color: rgba(255,255,255,0.88);
  padding: 10px 12px;
  border: none;
}
.btn-ghost-inverse:hover { color: #fff; }

.nav.is-scrolled .btn-ghost-inverse,
.nav.is-light .btn-ghost-inverse {
  color: var(--color-text-primary);
}
.nav.is-scrolled .btn-ghost-inverse:hover,
.nav.is-light .btn-ghost-inverse:hover {
  color: var(--color-brand-accent);
}

.btn-lg { padding: 16px 28px; font-size: 16px; }

.btn .arrow {
  display: inline-block;
  transition: transform 180ms ease;
}
.btn:hover .arrow { transform: translateX(3px); }

/* Sections */
section { position: relative; }

.section-pad {
  padding: 128px 0;
}
@media (max-width: 720px) {
  .section-pad { padding: 80px 0; }
}

.section-head {
  max-width: 760px;
  margin-bottom: 64px;
}
.section-head .kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-brand-accent);
  margin-bottom: 20px;
}
.section-head .kicker::before {
  content: '';
  display: inline-block;
  width: 24px; height: 1px;
  background: var(--color-brand-accent);
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(34px, 4.2vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
}
.section-head p.lede {
  font-size: 20px;
  line-height: 1.55;
  color: var(--color-text-secondary);
  margin: 0;
  max-width: 640px;
}

/* Footer */
.site-footer {
  background: var(--color-dark-bg);
  color: var(--color-text-inverse);
  padding: 96px 0 40px;
}
.site-footer .footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 48px;
  padding-bottom: 64px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
@media (max-width: 960px) {
  .site-footer .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
}
.site-footer h4 {
  font-family: var(--font-body);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.5);
  margin: 0 0 18px;
  font-weight: 500;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.site-footer li a {
  color: rgba(255,255,255,0.78);
  font-size: 14.5px;
  transition: color 150ms ease;
}
.site-footer li a:hover { color: #fff; }

.footer-brand .wordmark {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.22em;
  font-weight: 600;
  margin-bottom: 18px;
  display: block;
}
.footer-brand p {
  color: rgba(255,255,255,0.6);
  font-size: 14.5px;
  line-height: 1.6;
  margin: 0 0 24px;
  max-width: 320px;
}
.footer-brand .newsletter {
  display: flex;
  gap: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 4px 4px 4px 14px;
  max-width: 340px;
}
.footer-brand .newsletter input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 14px;
  outline: none;
  min-width: 0;
}
.footer-brand .newsletter input::placeholder { color: rgba(255,255,255,0.4); }
.footer-brand .newsletter button {
  background: var(--color-brand-accent);
  border: none;
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.footer-meta {
.footer-meta {
  padding-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  text-align: center;
}
.footer-meta .etym {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 14px;
  color: rgba(255,255,255,0.82);
}
.footer-meta .etym .etym-word {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 500;
  font-size: 17px;
  color: #fff;
}
.footer-meta .etym .etym-pos {
  font-family: var(--font-body);
  font-size: 12px;
  font-style: italic;
  color: rgba(255,255,255,0.55);
}
.footer-meta .etym .etym-sep {
  color: rgba(255,255,255,0.4);
  margin: 0 2px;
}
.footer-meta .etym .etym-origin {
  font-family: var(--font-body);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.6);
}
.footer-meta .etym .etym-def {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 16px;
  color: #fff;
}
.footer-meta .legal-links { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; font-size: 11.5px; color: rgba(255,255,255,0.4); letter-spacing: 0.01em; }
.footer-meta .legal-links a { color: rgba(255,255,255,0.45); }
.footer-meta .legal-links a:hover { color: #fff; }

/* Reveal util */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 700ms ease, transform 700ms cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation: none !important; transition: none !important; }
}

/* Focus */
:focus-visible { outline: 2px solid var(--color-brand-accent); outline-offset: 2px; border-radius: 2px; }
