:root {
  color-scheme: dark;
  --black: #020202;
  --ink: #070706;
  --panel: rgba(10, 9, 7, 0.74);
  --gold: #c79a45;
  --gold-bright: #efd28c;
  --gold-deep: #6f5120;
  --ivory: #f0ece3;
  --muted: #a9a193;
  --line: rgba(199, 154, 69, 0.22);
  --soft-line: rgba(255, 255, 255, 0.08);
  --max: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html:focus-within {
  scroll-padding-top: 118px;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ivory);
  background: var(--black);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(circle at 76% 18%, rgba(171, 121, 38, 0.13), transparent 29rem),
    radial-gradient(circle at 18% 76%, rgba(118, 82, 22, 0.08), transparent 31rem),
    linear-gradient(180deg, rgba(2,2,2,0.12), rgba(2,2,2,0.72));
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255,255,255,0.014) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
}

.water-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -4;
  display: block;
}

.water-vignette {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    radial-gradient(circle at center, transparent 22%, rgba(0,0,0,0.4) 72%, rgba(0,0,0,0.85) 100%),
    linear-gradient(to bottom, rgba(0,0,0,0.18), rgba(0,0,0,0.48));
}

body:is([data-surface="home"], [data-surface="art"], [data-surface="private"], [data-surface="tap"], [data-surface="missing"]) > .water-canvas {
  z-index: 0;
  pointer-events: none;
}

body[data-surface="art"] > .water-canvas {
  z-index: 3;
  opacity: 0.78;
  mix-blend-mode: screen;
}

body:is([data-surface="home"], [data-surface="art"], [data-surface="private"], [data-surface="tap"], [data-surface="missing"]) > .water-vignette {
  z-index: 1;
}

body:is([data-surface="home"], [data-surface="art"], [data-surface="private"], [data-surface="tap"], [data-surface="missing"]) > :is(header, main, footer) {
  position: relative;
  z-index: 2;
}

::selection {
  color: #080603;
  background: var(--gold-bright);
}

a { color: inherit; }

main:focus {
  outline: none;
}

.skip-link {
  position: fixed;
  left: 18px;
  top: 14px;
  z-index: 2147483647;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  color: #080603;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  border: 1px solid rgba(111,234,255,0.42);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
  transform: translateY(-72px);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shell {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  min-height: 92px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  width: fit-content;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1;
  transform: rotate(45deg);
}

.brand-mark::first-letter { transform: rotate(-45deg); }

.brand-name {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.primary-nav a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -7px;
  height: 1px;
  background: var(--gold);
  transition: right 180ms ease;
}

.primary-nav a:hover,
.primary-nav a:focus-visible { color: var(--ivory); }

.primary-nav a:hover::after,
.primary-nav a:focus-visible::after { right: 0; }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 0 4px rgba(239,210,140,0.08), 0 0 18px rgba(239,210,140,0.7);
  animation: pulse 2.8s ease-in-out infinite;
}

.hero {
  min-height: calc(100vh - 92px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  align-items: center;
  gap: 70px;
  padding-block: 80px 110px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--gold-bright);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero h1,
.section-heading h2,
.about-grid h2,
.article-header h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: 0;
}

.hero h1 {
  font-size: clamp(5.7rem, 15vw, 11rem);
  line-height: 0.82;
  background: linear-gradient(180deg, #fff8e7 0%, var(--gold-bright) 40%, var(--gold) 68%, #76541e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 22px 50px rgba(0,0,0,0.44);
}

.hero-lede {
  max-width: 590px;
  margin: 34px 0 0;
  color: #d6d0c5;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 34px;
}

.button {
  min-height: 46px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button:hover { transform: translateY(-2px); }

.button-primary {
  color: #0a0703;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  border-color: transparent;
  box-shadow: 0 12px 34px rgba(144, 99, 27, 0.16);
}

.button-secondary {
  color: var(--ivory);
  background: rgba(5,5,5,0.44);
  backdrop-filter: blur(10px);
}

.button-secondary:hover { border-color: var(--gold); }

.hero-object {
  display: grid;
  place-items: center;
  min-height: 420px;
}

.writing-section,
.art-section,
.about-section,
.article-shell,
.art-shell {
  scroll-margin-top: 120px;
  padding-block: 110px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 42px;
}

.section-heading h2,
.about-grid h2 {
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 1;
}

.journal-list { border-top: 1px solid var(--line); }

.journal-entry {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  gap: 28px;
  align-items: start;
  padding: 28px 0;
  border-bottom: 1px solid var(--soft-line);
  transition: padding-left 180ms ease, border-color 180ms ease;
}

.journal-entry:hover {
  padding-left: 12px;
  border-color: var(--gold-deep);
}

.entry-meta {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.entry-copy h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 400;
}

.entry-copy h3 a { text-decoration: none; }
.entry-copy h3 a:hover { color: var(--gold-bright); }

.entry-copy p {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.entry-link {
  color: var(--gold-bright);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 80px;
  align-items: start;
}

.about-copy {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
}

.about-copy p { margin-top: 0; }
.about-copy a { color: var(--gold-bright); text-underline-offset: 5px; }

.site-footer {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--gold-bright); }

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.article-shell { max-width: 900px; }
.article-header { margin-bottom: 54px; }
.article-header h1 { font-size: clamp(3.4rem, 8vw, 6.8rem); line-height: 0.95; }
.article-meta { margin-top: 20px; color: var(--muted); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
.article-body { color: #d4cec2; font-family: Georgia, "Times New Roman", serif; font-size: 1.18rem; line-height: 1.9; }
.article-body p { margin: 0 0 1.6em; }
.article-body h2 { margin: 2.4em 0 0.8em; color: var(--gold-bright); font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 1rem; letter-spacing: 0.12em; text-transform: uppercase; }
.article-back { display: inline-block; margin-top: 36px; color: var(--gold-bright); text-underline-offset: 5px; }

.private-panel {
  min-height: calc(100vh - 182px);
  display: grid;
  place-items: center;
  padding-block: 80px;
}

.private-card {
  width: min(620px, 100%);
  padding: 44px;
  border: 1px solid var(--line);
  background: rgba(7,7,6,0.72);
  backdrop-filter: blur(16px);
  box-shadow: 0 30px 90px rgba(0,0,0,0.5);
}

.private-card h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(3rem, 7vw, 5rem); font-weight: 400; }
.private-card p { color: var(--muted); line-height: 1.7; }
.private-card input {
  width: 100%;
  height: 48px;
  margin-top: 12px;
  padding: 0 14px;
  color: var(--ivory);
  background: #050505;
  border: 1px solid var(--line);
  font: inherit;
}
.private-card button {
  width: 100%;
  height: 48px;
  margin-top: 12px;
  color: #080603;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  border: 0;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

@keyframes pulse {
  0%, 100% { opacity: 0.65; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.08); }
}

@media (max-width: 860px) {
  .site-header {
    grid-template-columns: 1fr auto;
    gap: 18px;
    padding-block: 18px;
  }

  .primary-nav {
    grid-column: 1 / -1;
    order: 3;
    justify-content: space-between;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .status-dot { justify-self: end; }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 32px;
    padding-block: 72px 96px;
  }

  .hero-object { min-height: 260px; }
  .writing-section, .art-section, .about-section, .article-shell, .art-shell { scroll-margin-top: 148px; }

  .journal-entry {
    grid-template-columns: 1fr auto;
  }

  .entry-meta { grid-column: 1 / -1; }
  .about-grid { grid-template-columns: 1fr; gap: 34px; }
}

@media (max-width: 560px) {
  .shell { width: min(var(--max), calc(100% - 24px)); }
  .site-header { min-height: 82px; }
  .brand-name { font-size: 0.72rem; }
  .primary-nav a { font-size: 0.74rem; }
  .hero h1 { font-size: clamp(4.6rem, 27vw, 7rem); }
  .hero-actions { flex-direction: column; }
  .button { width: 100%; }
  .writing-section, .art-section, .about-section, .article-shell, .art-shell { padding-block: 78px; }
  .journal-entry { grid-template-columns: 1fr; gap: 14px; }
  .entry-link { justify-self: start; }
  .private-card { padding: 28px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
