/* === COMMON STYLES — Clear Fog Capital === */

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

:root {
  --bg-top: #EEF2F3;
  --bg-bottom: #F7F4EE;
  --text-primary: #171717;
  --text-secondary: #5F6368;
  --accent: #B89A63;
  --line: rgba(23,23,23,0.09);
  --divider: rgba(184,154,99,0.40);
  --mark-stroke: #171717;
  --nav-border: rgba(95,99,104,0.28);
  --nav-border-hover: rgba(95,99,104,0.48);
  --nav-bg-hover: rgba(23,23,23,0.022);
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'IBM Plex Sans', sans-serif;
}

[data-theme="dark"] {
  --bg-top: #181B20;
  --bg-bottom: #1F1D18;
  --text-primary: #E2DED6;
  --text-secondary: #8A8680;
  --accent: #C4A96E;
  --line: rgba(255,255,255,0.09);
  --mark-stroke: #E2DED6;
  --nav-border: rgba(180,176,168,0.22);
  --nav-border-hover: rgba(180,176,168,0.40);
  --nav-bg-hover: rgba(255,255,255,0.03);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-top: #181B20;
    --bg-bottom: #1F1D18;
    --text-primary: #E2DED6;
    --text-secondary: #8A8680;
    --accent: #C4A96E;
    --line: rgba(255,255,255,0.09);
    --mark-stroke: #E2DED6;
    --nav-border: rgba(180,176,168,0.22);
    --nav-border-hover: rgba(180,176,168,0.40);
    --nav-bg-hover: rgba(255,255,255,0.03);
  }
}

html { font-size: 16px; scroll-behavior: smooth; background-color: var(--bg-bottom); }

body {
  background-color: var(--bg-bottom);
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  min-height: 100vh;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  opacity: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.10;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

body.page-enter { opacity: 0; }
body.page-ready { transition: opacity 0.4s ease; opacity: 1; }
body.page-exit { transition: opacity 0.25s ease; opacity: 0; }

/* IDENTITY */
.identity-name-link { text-decoration: none; color: inherit; transition: opacity 0.25s ease; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.identity-name-link:hover { opacity: 0.7; }
.nav-item.nav-item--active { opacity: 0.9; color: var(--accent); }

.identity {
  position: relative; z-index: 1;
  margin-left: clamp(48px, 17vw, 220px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-right: clamp(32px, 5vw, 80px);
}

.identity-left { display: flex; flex-direction: row; align-items: center; gap: 14px; }

.identity-name {
  font-family: var(--font-sans); font-size: 12px;
  letter-spacing: 0.20em; text-transform: uppercase; color: var(--text-secondary); line-height: 1;
}

.identity-sub {
  font-family: var(--font-sans); font-size: 10px;
  letter-spacing: 0.32em; text-transform: uppercase; color: var(--text-secondary); opacity: 0.65; line-height: 1;
}

/* CAPSULE NAV */
.nav-capsule {
  display: flex; align-items: center;
  border: 1px solid var(--nav-border); border-radius: 100px;
  padding: 7px 18px; background: transparent;
  transition: border-color 0.35s ease, background 0.35s ease;
}

.nav-capsule:hover { border-color: var(--nav-border-hover); background: var(--nav-bg-hover); }

.nav-item {
  font-family: var(--font-sans); font-size: 12px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-secondary); opacity: 0.68;
  text-decoration: none; white-space: nowrap;
  transition: opacity 0.25s ease; cursor: pointer;
}

.nav-item:hover { opacity: 1; }

.theme-toggle {
  font-family: var(--font-sans); font-size: 12px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-secondary); opacity: 0.68;
  background: none; border: none; padding: 0; cursor: pointer;
  transition: opacity 0.25s ease; white-space: nowrap;
}
.theme-toggle:hover { opacity: 1; }

.nav-dot {
  font-family: var(--font-sans); font-size: 11px;
  color: var(--text-secondary); opacity: 0.32;
  margin: 0 10px; line-height: 1; user-select: none;
}

/* LOGO MARK */
.identity-mark { width: 34px; height: 34px; opacity: 0.45; flex-shrink: 0; color: var(--mark-stroke); }
.identity-mark svg { width: 100%; height: 100%; }

/* PAGE HEADER */
.page-header {
  position: relative;
  padding-top: clamp(48px, 7vw, 110px);
  padding-bottom: clamp(32px, 4vw, 56px);
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('assets/ocean-background.jpg') 50% 72%/cover no-repeat;
  opacity: 0.20;
  pointer-events: none;
  z-index: 0;
}

/* SECTIONS */
.section-divider {
  width: clamp(48px, 17vw, 220px); margin-left: clamp(48px, 17vw, 220px);
  height: 1px; background: var(--divider);
}

.section { padding: 160px 0; }
.section-inner { margin-left: clamp(48px, 17vw, 220px); max-width: 560px; }

.section-label {
  font-family: var(--font-sans); font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--text-secondary); opacity: 0.70; margin-bottom: 48px;
}

/* FOOTER */
.footer { border-top: 1px solid var(--line); padding: 40px 0 56px; }

.footer-inner {
  margin-left: clamp(48px, 17vw, 220px);
  display: flex; justify-content: space-between; align-items: flex-end;
  padding-right: clamp(32px, 5vw, 80px);
}

.footer-left { display: flex; flex-direction: column; gap: 8px; }

.footer-name { font-family: var(--font-sans); font-size: 11px; letter-spacing: 0.20em; text-transform: uppercase; color: var(--text-secondary); opacity: 0.60; }

.footer-disclaimer { font-family: var(--font-sans); font-size: 11px; line-height: 1.55; color: var(--text-secondary); opacity: 0.40; max-width: 380px; }

.footer-right { font-family: var(--font-serif); font-size: 13px; font-style: italic; color: var(--text-secondary); opacity: 0.35; letter-spacing: 0.02em; }

/* SCROLL REVEAL */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.9s ease, transform 0.9s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* KEYFRAMES */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ESSAY BASE */
.essay-header {
  margin-left: clamp(48px, 17vw, 220px);
  max-width: 560px;
  padding-top: 80px;
  padding-bottom: 48px;
}

.essay-title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.essay-body {
  margin-left: clamp(48px, 17vw, 220px);
  max-width: 560px;
  padding-bottom: 120px;
}

.essay-body h2 {
  font-family: var(--font-serif);
  font-size: clamp(18px, 1.8vw, 22px);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-top: 64px;
  margin-bottom: 24px;
}

.essay-body p {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.72;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.essay-body hr {
  border: none;
  height: 1px;
  background: var(--divider);
  width: 40px;
  margin: 48px 0;
}

.essay-body em {
  font-style: italic;
}

.essay-back {
  margin-left: clamp(48px, 17vw, 220px);
  padding-bottom: 120px;
}

.essay-back-link {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--text-secondary);
  opacity: 0.55;
  text-decoration: none;
  transition: opacity 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.essay-back-link:hover { opacity: 1; }

.essay-back-arrow {
  font-size: 16px;
  line-height: 1;
  font-weight: 300;
  opacity: 0.6;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .nav-capsule { padding: 6px 14px; }
  .nav-dot { margin: 0 8px; }
}

@media (max-width: 640px) {
  .identity, .section-inner, .section-divider,
  .footer-inner { margin-left: 28px; margin-right: 28px; }

  .footer-inner { flex-direction: column; gap: 24px; align-items: flex-start; padding-right: 28px; }
  .footer-right { display: block; margin-top: 8px; }

  .essay-header, .essay-body, .essay-back { margin-left: 28px; margin-right: 28px; }
}

@media (max-width: 540px) {
  .identity { flex-wrap: wrap; gap: 16px; }

  .nav-capsule {
    order: -1; width: 100%; justify-content: flex-start;
    padding: 6px 14px;
  }

  .nav-item { font-size: 11px; letter-spacing: 0.14em; }
  .nav-dot { margin: 0 8px; }
}
