/* ===== The Ehrlich Essence Villa — shared styles ===== */

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

/* ---------- Theme tokens (Linen / Nocturne / Atlantic) ---------- */
:root,
[data-theme="linen"] {
  --bg:        #f3eee5;
  --bg-2:      #ebe3d4;
  --paper:     #fbf8f1;
  --ink:       #2b211a;
  --ink-soft:  #5a4a3d;
  --muted:     #8a7866;
  --rule:      #c8bba6;
  --accent:    #9a4a2a;   /* clay / terracotta */
  --accent-2:  #6b5638;   /* walnut */
  --hi:        #d9c9aa;
}
[data-theme="nocturne"] {
  --bg:        #15110d;
  --bg-2:      #1f1a14;
  --paper:     #1a1510;
  --ink:       #efe7d6;
  --ink-soft:  #c9bea7;
  --muted:     #8e8270;
  --rule:      #3a3127;
  --accent:    #c89557;   /* brass */
  --accent-2:  #d9c69a;
  --hi:        #2b2218;
}
[data-theme="atlantic"] {
  --bg:        #ecebe5;
  --bg-2:      #e0deD3;
  --paper:     #f5f4ee;
  --ink:       #1a2733;
  --ink-soft:  #3c5266;
  --muted:     #7a8898;
  --rule:      #c0c6cb;
  --accent:    #1f4a6b;   /* deep ocean */
  --accent-2:  #4e6e83;
  --hi:        #c5d3dc;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .4s ease, color .4s ease;
}

/* ---------- Type scale ---------- */
.display {
  font-family: 'Italiana', 'Cormorant Garamond', serif;
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 0.95;
}
h1, h2, h3, h4 { font-family: 'Italiana', serif; font-weight: 400; margin: 0; line-height: 1.02; }
h1 { font-size: clamp(48px, 7vw, 112px); }
h2 { font-size: clamp(36px, 4.5vw, 68px); }
h3 { font-size: clamp(24px, 2.4vw, 36px); }
h4 { font-size: 22px; letter-spacing: 0.01em; }
p  { margin: 0 0 1em; max-width: 62ch; }
.lede { font-size: clamp(20px, 1.6vw, 26px); line-height: 1.45; color: var(--ink-soft); font-style: italic; max-width: 38ch; }

.meta, .label, .crumb {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.serif-italic { font-style: italic; font-family: 'Cormorant Garamond', serif; color: var(--ink-soft); }

a { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .2s, color .2s; }
a:hover { border-bottom-color: var(--accent); color: var(--accent); }

hr.rule { border: none; border-top: 1px solid var(--rule); margin: 0; }

/* ---------- Layout primitives ---------- */
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 48px; }
@media (max-width: 720px) { .wrap { padding: 0 24px; } }

.grid-12 { display: grid; grid-template-columns: repeat(12, 1fr); gap: 32px; }

/* ---------- Top bar / nav ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 48px;
}
.wordmark {
  font-family: 'Italiana', serif;
  font-size: 22px;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.wordmark .amp { color: var(--accent); font-style: italic; }
.nav { display: flex; gap: 28px; }
.nav a { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft); border-bottom: none; padding-bottom: 4px; }
.nav a.active { color: var(--accent); border-bottom: 1px solid var(--accent); }
.nav a:hover { color: var(--accent); border-bottom: 1px solid var(--accent); }

@media (max-width: 860px) {
  .topbar-inner { padding: 14px 24px; flex-direction: column; gap: 12px; align-items: flex-start; }
  .nav { flex-wrap: wrap; gap: 14px 18px; }
}

/* ---------- Footer ---------- */
.foot {
  margin-top: 120px;
  border-top: 1px solid var(--rule);
  padding: 56px 0 32px;
  background: var(--bg-2);
}
.foot-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px;
}
.foot h5 { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; font-weight: 500; }
.foot .word-big { font-family: 'Italiana', serif; font-size: 44px; line-height: 1; }
.foot a { display: block; color: var(--ink-soft); margin-bottom: 6px; font-size: 17px; }
.foot-base { margin-top: 56px; display: flex; justify-content: space-between; color: var(--muted); font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; }
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-base { flex-direction: column; gap: 8px; } }

/* ---------- Photo containers (real images + fallback) ---------- */
.ph {
  position: relative;
  background:
    repeating-linear-gradient(135deg,
      color-mix(in oklab, var(--rule) 60%, transparent) 0 1px,
      transparent 1px 14px),
    linear-gradient(180deg, var(--bg-2), color-mix(in oklab, var(--bg-2) 70%, var(--ink) 10%));
  border: 1px solid var(--rule);
  overflow: hidden;
  display: flex; align-items: flex-end; justify-content: flex-start;
  background-size: cover;
  background-position: center;
}
.ph::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 30% 20%, color-mix(in oklab, var(--paper) 20%, transparent), transparent 60%);
  pointer-events: none;
}
.ph .ph-label {
  position: relative;
  padding: 10px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  background: color-mix(in oklab, var(--paper) 86%, transparent);
  border-top: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  margin: 0;
  backdrop-filter: blur(4px);
}
.ph.tall { aspect-ratio: 3 / 4; }
.ph.wide { aspect-ratio: 16 / 10; }
.ph.square { aspect-ratio: 1 / 1; }
.ph.cinema { aspect-ratio: 21 / 9; }

/* Real-image cell — keeps placeholder/.ph-label conventions but shows the photo */
.photo {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--bg-2);
  display: flex; align-items: flex-end; justify-content: flex-start;
}
.photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 1.6s cubic-bezier(.2,.6,.2,1);
}
.photo:hover img { transform: scale(1.025); }
.photo .ph-label {
  position: relative;
  padding: 10px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  background: color-mix(in oklab, var(--paper) 86%, transparent);
  border-top: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  margin: 0;
  backdrop-filter: blur(4px);
  z-index: 1;
}
.photo.tall { aspect-ratio: 3 / 4; }
.photo.wide { aspect-ratio: 16 / 10; }
.photo.square { aspect-ratio: 1 / 1; }
.photo.cinema { aspect-ratio: 21 / 9; }
.photo.portrait { aspect-ratio: 4 / 5; }

/* ---------- Buttons / chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  padding: 14px 20px;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: background .2s, color .2s;
  border-radius: 0;
}
.btn:hover { background: var(--ink); color: var(--bg); border-bottom-color: var(--ink); }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.btn .arrow { font-family: 'Cormorant Garamond', serif; font-size: 16px; letter-spacing: 0; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  padding: 6px 10px;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  border-radius: 999px;
}

/* ---------- Page header (interior pages) ---------- */
.page-head {
  padding: 80px 0 56px;
  border-bottom: 1px solid var(--rule);
}
.page-head .eyebrow { margin-bottom: 18px; }
.page-head .title { font-size: clamp(56px, 9vw, 140px); line-height: 0.94; max-width: 14ch; }
.page-head .sub { margin-top: 28px; max-width: 50ch; font-size: clamp(18px, 1.4vw, 22px); color: var(--ink-soft); font-style: italic; }

/* ---------- Section helpers ---------- */
.section { padding: 96px 0; }
.section.tight { padding: 64px 0; }
.eyebrow { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); display: inline-block; }
.kicker {
  display: flex; align-items: baseline; gap: 14px; margin-bottom: 24px;
}
.kicker .num {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.18em; color: var(--muted);
}

/* ---------- Cards ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 28px;
}
.card-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 16px; gap: 16px;
}

/* ---------- Numbered list with serif ---------- */
.numbered { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.numbered li {
  display: grid; grid-template-columns: 60px 1fr; gap: 24px;
  padding: 28px 0; border-bottom: 1px solid var(--rule);
}
.numbered li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.18em; color: var(--accent);
}
.numbered li h4 { margin-bottom: 8px; font-family: 'Italiana', serif; font-size: 26px; }
.numbered li p { color: var(--ink-soft); max-width: 60ch; }

/* ---------- Drop cap ---------- */
.dropcap::first-letter {
  font-family: 'Italiana', serif;
  font-size: 5.2em;
  float: left;
  line-height: 0.82;
  padding: 6px 12px 0 0;
  color: var(--accent);
}

/* ---------- Tabular spec rows ---------- */
.spec { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--rule); }
.spec dt, .spec dd { padding: 16px 0; border-bottom: 1px solid var(--rule); margin: 0; }
.spec dt { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.spec dd { text-align: right; font-size: 19px; }

/* ---------- Marquee word (decorative) ---------- */
.bigword {
  font-family: 'Italiana', serif;
  font-size: clamp(80px, 18vw, 260px);
  line-height: 0.9;
  letter-spacing: -0.01em;
}

/* ---------- Print-quality drop shadow for paper feel ---------- */
.paperlike {
  background: var(--paper);
  box-shadow:
    0 1px 0 var(--rule),
    0 24px 60px -32px color-mix(in oklab, var(--ink) 30%, transparent);
}

/* ---------- Utilities ---------- */
.center { text-align: center; }
.right  { text-align: right; }
.muted  { color: var(--muted); }
.soft   { color: var(--ink-soft); }
.accent { color: var(--accent); }
.upper  { text-transform: uppercase; letter-spacing: 0.18em; }
.tracker { letter-spacing: 0.18em; }
.divider-dot::before { content: "·"; padding: 0 10px; color: var(--muted); }

/* selection */
::selection { background: var(--accent); color: var(--paper); }
