/* ─── SELF-HOSTED FONTS (no external requests) ─── */
@font-face { font-family:'Cinzel'; font-weight:400; font-style:normal; font-display:swap; src:url('fonts/cinzel-400.woff2') format('woff2'); }
@font-face { font-family:'Cinzel'; font-weight:500; font-style:normal; font-display:swap; src:url('fonts/cinzel-500.woff2') format('woff2'); }
@font-face { font-family:'Cinzel'; font-weight:600; font-style:normal; font-display:swap; src:url('fonts/cinzel-600.woff2') format('woff2'); }
@font-face { font-family:'Cormorant Garamond'; font-weight:300; font-style:normal; font-display:swap; src:url('fonts/cormorant-300.woff2') format('woff2'); }
@font-face { font-family:'Cormorant Garamond'; font-weight:400; font-style:normal; font-display:swap; src:url('fonts/cormorant-400.woff2') format('woff2'); }
@font-face { font-family:'Cormorant Garamond'; font-weight:300; font-style:italic; font-display:swap; src:url('fonts/cormorant-300i.woff2') format('woff2'); }
@font-face { font-family:'Cormorant Garamond'; font-weight:400; font-style:italic; font-display:swap; src:url('fonts/cormorant-400i.woff2') format('woff2'); }

/* ═══════════════════════════════════════════
   PHEID — SHARED STYLES
   Palette: sand / parchment / ink
═══════════════════════════════════════════ */

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

:root {
  --sand: #d8c4a3;
  --sand-dark: #c9b28e;
  --parchment: #e8d9c4;
  --ink: #1d1916;
  --ink-light: #3a3128;
  --muted: rgba(29,25,22,0.38);
  --very-muted: rgba(29,25,22,0.10);
  --line: rgba(29,25,22,0.18);
  --line-strong: rgba(29,25,22,0.35);
  --sand-on-ink: rgba(216,196,163,0.85);
  --line-on-ink: rgba(216,196,163,0.16);
}

html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; max-width: 100%; }

body {
  background: var(--sand);
  font-family: 'Cinzel', serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* paper texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22140%22 height=%22140%22%3E%3Cfilter id=%22n%22%3E%3CfeTurbulence type=%22fractalNoise%22 baseFrequency=%220.9%22 numOctaves=%222%22 stitchTiles=%22stitch%22/%3E%3CfeColorMatrix values=%220 0 0 0 0.1 0 0 0 0 0.08 0 0 0 0 0.06 0 0 0 0.6 0%22/%3E%3C/filter%3E%3Crect width=%22140%22 height=%22140%22 filter=%22url(%23n)%22/%3E%3C/svg%3E");
  opacity: 0.045;
  pointer-events: none;
  z-index: 0;
}

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

/* ─── NAV (injected by site.js) ─── */
.pnav {
  position: fixed;
  top: 0; left: 0; width: 100%;
  padding: 22px 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 200;
  transition: background 0.4s ease, padding 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}
.pnav.scrolled {
  background: rgba(216,196,163,0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
  padding: 14px 36px;
}
.pnav-brand {
  display: inline-flex; align-items: center; gap: 11px;
  font-size: 14px; font-weight: 600; letter-spacing: 0.35em;
  color: var(--ink); text-decoration: none;
}
.pnav-logo { height: 26px; width: auto; display: block; flex-shrink: 0; }
@media (max-width: 640px) { .pnav-logo { height: 22px; } }
.pnav-links {
  display: flex; gap: 28px; list-style: none; align-items: center;
}
.pnav-links a {
  font-size: 10px; letter-spacing: 0.28em;
  color: var(--ink); text-decoration: none;
  opacity: 0.75; transition: opacity 0.3s ease;
  padding: 4px 0; position: relative;
}
.pnav-links a:hover { opacity: 1; }
.pnav-links a.active { opacity: 0.95; }
.pnav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--ink-light); opacity: 0.5;
}

/* burger */
.pnav-burger {
  display: none;
  background: none; border: none; cursor: pointer;
  width: 40px; height: 32px;
  flex-direction: column; justify-content: center; gap: 7px;
  padding: 0 4px;
}
.pnav-burger span {
  display: block; height: 1px; width: 100%;
  background: var(--ink); transition: transform 0.35s ease, opacity 0.35s ease;
}
body.menu-open .pnav-burger span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
body.menu-open .pnav-burger span:nth-child(2) { opacity: 0; }
body.menu-open .pnav-burger span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* mobile menu overlay */
.pmenu {
  position: fixed; inset: 0; z-index: 190;
  background: var(--sand);
  display: flex; flex-direction: column;
  justify-content: center; align-items: center; gap: 28px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s ease;
}
body.menu-open .pmenu { opacity: 1; pointer-events: auto; }
body.menu-open { overflow: hidden; }
.pmenu a {
  font-family: 'Cinzel', serif;
  font-size: 17px; letter-spacing: 0.4em;
  color: var(--ink); text-decoration: none; opacity: 0.92;
}
.pmenu a.active { opacity: 1; border-bottom: 1px solid var(--line-strong); padding-bottom: 4px; }
.pmenu-tag { font-size: 10px; letter-spacing: 0.5em; opacity: 0.5; margin-top: 24px; }

@media (max-width: 860px) {
  .pnav { padding: 18px 22px; }
  .pnav.scrolled { padding: 12px 22px; }
  .pnav-links { display: none; }
  .pnav-burger { display: flex; }
}

/* ─── COMMON ─── */
.section-divider {
  width: 1px; height: 90px;
  background: var(--line);
  margin: 0 auto; position: relative; z-index: 2;
}
.eyebrow {
  font-size: 10px; letter-spacing: 0.5em; opacity: 0.6;
  text-align: center;
}
.serif-italic {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic; font-weight: 300;
}

.observe, .obs {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.observe.visible, .obs.visible { opacity: 1; transform: translateY(0); }
.obs-delay { transition-delay: 0.15s; }
.obs-delay-2 { transition-delay: 0.3s; }

/* buttons */
.pbtn {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--line-strong);
  font-family: 'Cinzel', serif;
  font-size: 10px; letter-spacing: 0.38em;
  color: var(--ink);
  padding: 16px 38px 16px 42px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.35s ease, color 0.35s ease;
}
.pbtn:hover { background: var(--ink); color: var(--sand); }
.pbtn-ink { border-color: var(--line-on-ink); color: var(--sand-on-ink); }
.pbtn-ink:hover { background: var(--sand); color: var(--ink); }

/* footer */
footer.pfooter {
  border-top: 1px solid var(--line);
  padding: 26px 28px;
  display: flex; justify-content: space-between; align-items: center;
  position: relative; z-index: 2;
}
.pfooter span { font-size: 10px; letter-spacing: 0.32em; opacity: 0.55; }
.pfooter a { color: var(--ink); text-decoration: none; transition: opacity 0.3s ease; }
.pfooter a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
body[data-page="circle"] .pfooter a { color: var(--sand); }
.pfooter .pf-center { position: absolute; left: 50%; transform: translateX(-50%); }
@media (max-width: 640px) {
  footer.pfooter { flex-direction: column; gap: 10px; text-align: center; }
  .pfooter .pf-center { position: static; transform: none; }
}

/* forms */
.pfield {
  width: 100%;
  background: transparent; border: none; border-bottom: 1px solid var(--line-strong);
  outline: none;
  font-family: 'Cinzel', serif;
  font-size: 11px; letter-spacing: 0.24em;
  color: var(--ink);
  padding: 13px 0;
}
.pfield::placeholder { color: var(--ink); opacity: 0.32; }
textarea.pfield {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px; letter-spacing: 0.02em; line-height: 1.6;
  resize: vertical;
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .track { animation: none !important; }
  .observe, .obs { opacity: 1 !important; transform: none !important; transition: none !important; }
  * { animation-duration: 0.01ms !important; }
}

/* keyboard focus */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 1px solid var(--ink-light);
  outline-offset: 3px;
}

/* ─── LANGUAGE TOGGLE ─── */
.pnav-lang-li { margin-left: 6px; }
.pnav-lang {
  background: transparent;
  border: 1px solid var(--line-strong);
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-size: 9px; letter-spacing: 0.2em;
  color: var(--ink);
  padding: 5px 10px 5px 12px;
  opacity: 0.85;
  transition: opacity 0.3s ease, background 0.3s ease, color 0.3s ease;
}
.pnav-lang:hover { opacity: 1; background: var(--ink); color: var(--sand); }
.pmenu-lang {
  background: transparent;
  border: 1px solid var(--line-strong);
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-size: 12px; letter-spacing: 0.25em;
  color: var(--ink);
  padding: 9px 18px 9px 22px;
  margin-top: 6px;
  opacity: 0.7;
}

/* ─── READABILITY (mobile type floor) ─── */
@media (max-width: 640px) {
  .eyebrow { font-size: 11px; letter-spacing: 0.4em; }
  .pfooter span { font-size: 10px; }
}

/* ─── MOTION (respects prefers-reduced-motion) ─── */
@media (prefers-reduced-motion: no-preference) {
  /* failsafe: page self-reveals via CSS even if JS never runs */

  .pbtn { transition: transform 0.18s ease, opacity 0.3s ease, background 0.3s ease, color 0.3s ease; will-change: transform; }
  .pbtn:active { transform: scale(0.97) !important; }

  [data-plx] { will-change: transform; }

  /* staggered reveals inside already-observed grids */
  .proof-grid .proof-cell,
  .pal-grid .pal-card {
    opacity: 0; transform: translateY(16px);
    transition: opacity 0.7s ease, transform 0.7s ease;
  }
  .proof-grid.visible .proof-cell,
  .pal-grid.visible .pal-card { opacity: 1; transform: none; }
  .proof-grid.visible .proof-cell:nth-child(2) { transition-delay: 0.12s; }
  .proof-grid.visible .proof-cell:nth-child(3) { transition-delay: 0.24s; }
  .pal-grid.visible .pal-card:nth-child(2) { transition-delay: 0.08s; }
  .pal-grid.visible .pal-card:nth-child(3) { transition-delay: 0.16s; }
  .pal-grid.visible .pal-card:nth-child(4) { transition-delay: 0.24s; }
  .pal-grid.visible .pal-card:nth-child(5) { transition-delay: 0.32s; }

  /* journal covers: slow settle + gentle hover */
  .jentry-cover { transform: scale(1.03); transition: transform 1.4s cubic-bezier(0.16,1,0.3,1); }
  .jentry:hover .jentry-cover { transform: scale(1.012); }
  .jread-cover { animation: coverSettle 1.3s cubic-bezier(0.16,1,0.3,1) both; }
  @keyframes coverSettle { from { opacity: 0; transform: scale(1.035); } to { opacity: 1; transform: scale(1); } }
}

/* ─── INLINE BRAND ICON (replaces the Greek letter in copy) ─── */
.phi-inline { height: 0.95em; width: auto; display: inline-block; vertical-align: -0.12em; }
