/* AetherCasa shared styles — Ambient Calm */

:root {
  /* Ambient calm palette */
  --slate-950: #08090F;
  --slate-900: #0E1220;
  --slate-850: #141829;
  --slate-800: #1A1F33;
  --slate-700: #242A40;
  --slate-600: #3A4159;

  --paper: #E7E4DC;
  --paper-dim: #C7C4BC;
  --paper-muted: #8B8A84;

  --amber: #E8B27A;
  --amber-bright: #F0C18D;
  --amber-deep: #B8814E;
  --ember: #8D4A2B;

  /* Default theme = dark (ambient dusk) */
  --bg: var(--slate-900);
  --bg-raised: var(--slate-850);
  --bg-elevated: var(--slate-800);
  --border: rgba(231, 228, 220, 0.08);
  --border-strong: rgba(231, 228, 220, 0.14);
  --text: var(--paper);
  --text-dim: var(--paper-dim);
  --text-muted: var(--paper-muted);
  --accent: var(--amber);
  --accent-deep: var(--amber-deep);

  /* Type */
  --serif: "Fraunces", "GT Sectra", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;

  /* Scale */
  --measure: 62ch;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* Warm paper light variant */
@media (prefers-color-scheme: light) {
  :root.auto-theme {
    --bg: #F3EEE4;
    --bg-raised: #EBE4D5;
    --bg-elevated: #E2DAC8;
    --border: rgba(20, 24, 41, 0.08);
    --border-strong: rgba(20, 24, 41, 0.14);
    --text: #1A1F33;
    --text-dim: #3A4159;
    --text-muted: #6B6860;
    --accent: var(--amber-deep);
    --accent-deep: var(--ember);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}

/* The aether field — signature ambient warmth.
   A single warm point bleeds across the dark room. */
.aether-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 50% at 78% 28%, rgba(232, 178, 122, 0.18) 0%, rgba(232, 178, 122, 0.06) 35%, transparent 70%),
    radial-gradient(ellipse 80% 70% at 78% 28%, rgba(184, 129, 78, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 40% 35% at 12% 85%, rgba(60, 80, 120, 0.10) 0%, transparent 60%);
}
.aether-field::after {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.04 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.5;
  mix-blend-mode: overlay;
}

/* Content above the field */
main, header, footer, .site-shell > * { position: relative; z-index: 1; }

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--text);
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: clamp(40px, 6vw, 72px); line-height: 1.02; letter-spacing: -0.025em; }
h2 { font-size: clamp(28px, 3.6vw, 44px); line-height: 1.08; }
h3 { font-size: clamp(20px, 2vw, 24px); line-height: 1.25; }
h4 { font-size: 17px; line-height: 1.3; }

p { margin: 0; max-width: var(--measure); text-wrap: pretty; color: var(--text-dim); }
.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  font-weight: 500;
}
.lede {
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.55;
  color: var(--text-dim);
  max-width: 58ch;
}

a { color: var(--text); text-decoration: none; }
a.link {
  color: var(--accent);
  border-bottom: 1px solid rgba(232, 178, 122, 0.3);
  padding-bottom: 1px;
  transition: border-color 180ms ease-out, color 180ms ease-out;
}
a.link:hover { border-color: var(--accent); color: var(--amber-bright); }

/* Header / nav */
.site-shell { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 640px) { .site-shell { padding: 0 20px; } }

.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--text);
  display: inline-flex; align-items: baseline; gap: 0;
}
/* The Æ ligature rendered with serif proportions */
.nav-logo .ae { font-weight: 500; font-style: italic; }
.nav-logo .rest { font-weight: 400; }

.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
  font-size: 14px;
  color: var(--text-dim);
  transition: color 180ms ease-out;
}
.nav-links a:hover, .nav-links a[aria-current] { color: var(--text); }
.nav-cta {
  font-size: 14px;
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text);
  transition: background 180ms ease-out, border-color 180ms ease-out;
}
.nav-cta:hover { background: var(--bg-raised); border-color: var(--accent); }

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

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 200ms ease-out, border-color 200ms ease-out, color 200ms ease-out, transform 200ms ease-out;
}
.btn-primary {
  background: var(--accent);
  color: var(--slate-900);
}
.btn-primary:hover { background: var(--amber-bright); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn .arrow { transition: transform 200ms ease-out; }
.btn:hover .arrow { transform: translateX(3px); }

/* Sections */
section { padding: 96px 0; }
@media (max-width: 640px) { section { padding: 64px 0; } }
section + section { border-top: 1px solid var(--border); }


/* Utility */
.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); }
.italic { font-style: italic; }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.accent { color: var(--accent); }
.center { text-align: center; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-dim);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.pill .dot.live {
  box-shadow: 0 0 0 3px rgba(232, 178, 122, 0.15);
  animation: breathe 3.2s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 3px rgba(232, 178, 122, 0.15); }
  50%      { box-shadow: 0 0 0 6px rgba(232, 178, 122, 0.02); }
}

/* Image placeholders — honest about what should go there */
.ph {
  position: relative;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(231, 228, 220, 0.015) 0px,
      rgba(231, 228, 220, 0.015) 2px,
      rgba(231, 228, 220, 0.04) 2px,
      rgba(231, 228, 220, 0.04) 4px
    ),
    var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: var(--text-muted);
}
.ph-label {
  position: absolute;
  left: 16px; bottom: 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.ph-label::before { content: "▚ "; color: var(--accent); opacity: 0.7; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* Skip link */
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--slate-900);
  padding: 10px 16px; border-radius: 0 0 8px 0;
  font-family: var(--mono); font-size: 12px;
  z-index: 100;
}
.skip:focus { left: 0; }

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

/* Tweaks panel */
.tweaks {
  position: fixed;
  right: 24px; bottom: 24px;
  width: 280px;
  background: rgba(14, 18, 32, 0.92);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 18px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text);
  z-index: 50;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  display: none;
}
.tweaks.open { display: block; }
.tweaks h4 {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  margin: 0 0 14px;
}
.tweaks label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12.5px; color: var(--text-dim);
  margin-bottom: 12px;
  gap: 10px;
}
.tweaks select, .tweaks input[type=range] {
  background: var(--bg-raised);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-family: var(--sans);
  max-width: 55%;
}
.tweaks .swatches { display: flex; gap: 6px; }
.tweaks .sw {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition: transform 150ms ease-out;
}
.tweaks .sw.on { outline: 2px solid var(--text); outline-offset: 2px; }
.tweaks .sw:hover { transform: scale(1.1); }
