/* ── Tokens ──────────────────────────────────────────── */
:root {
  --gold:           #D7B786;
  --gold-dark:      #C7A671;
  --cream:          #FAFAFA;
  --charcoal:       #1C1C1C;
  --warm-gray:      #736E66;
  --divider:        rgba(0, 0, 0, 0.08);
  --serif:          'Cormorant Garamond', Georgia, serif;
  --sans:           'Avenir Next', 'Avenir', -apple-system, BlinkMacSystemFont, sans-serif;
  --screen-pad:     24px;
  --max-width:      680px;
  --sidebar-width:  280px;
  --header-height:  72px;
  --ease-out:       cubic-bezier(0.22, 1, 0.36, 1);

  /* Theme-aware surface tokens (light mode defaults) */
  --bg:             #ffffff;
  --bg-secondary:   #FAFAFA;
  --bg-sidebar:     #ffffff;
  --text-primary:   #1C1C1C;
  --text-secondary: #736E66;
  --border:         rgba(0, 0, 0, 0.08);
}

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

/* ── Base ────────────────────────────────────────────── */
html { font-size: 16px; }
body {
  background: #fff;
  color: var(--charcoal);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Header ──────────────────────────────────────────── */
header {
  height: var(--header-height);
  border-bottom: 1px solid var(--divider);
  padding: 0 var(--screen-pad);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  background: var(--bg);
  transition: background 0.3s;
}

/* ── Header controls (theme toggle + hamburger) ──────── */
.header-controls {
  position: absolute;
  right: var(--screen-pad);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Theme toggle button ─────────────────────────────── */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--divider);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s;
  font-size: 15px;
  line-height: 1;
}
.theme-toggle:hover { border-color: var(--gold-dark); }

/* Show correct icon per mode */
.theme-icon { display: none; }
body:not(.grey-mode) .theme-icon--light { display: block; }
body.grey-mode .theme-icon--grey        { display: block; }

.wordmark {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--charcoal);
  text-decoration: none;
}

/* ── Grey mode overrides ─────────────────────────────── */
body.grey-mode {
  --bg:             #2A2A2A;
  --bg-secondary:   #222222;
  --bg-sidebar:     #1E1E1E;
  --text-primary:   #E8E4DF;
  --text-secondary: #9A9590;
  --divider:        rgba(255, 255, 255, 0.08);
  background: var(--bg);
  color: var(--text-primary);
}
body.grey-mode header,
body.grey-mode footer    { background: var(--bg); border-color: var(--divider); }
body.grey-mode .sidebar  { background: var(--bg-sidebar); }
body.grey-mode .wordmark { color: var(--text-primary); }
body.grey-mode h1,
body.grey-mode h2,
body.grey-mode p,
body.grey-mode ul li     { color: var(--text-primary); }
body.grey-mode .label    { color: var(--gold); }
body.grey-mode hr        { border-color: var(--divider); }
body.grey-mode .info-block {
  background: var(--bg-secondary);
}
body.grey-mode .info-block p,
body.grey-mode .last-updated,
body.grey-mode footer    { color: var(--text-secondary); }
body.grey-mode .hamburger span { background: var(--text-primary); }
body.grey-mode .appstore-badge { filter: brightness(0.9); }

/* ── Hamburger button ────────────────────────────────── */
.hamburger {
  position: absolute;
  right: var(--screen-pad);
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--divider);
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  transition: border-color 0.2s;
}
.hamburger:hover { border-color: var(--gold-dark); }
.hamburger span {
  display: block;
  width: 16px;
  height: 1px;
  background: var(--charcoal);
  transition: background 0.2s;
}
.hamburger:hover span { background: var(--gold-dark); }

/* ── Sidebar overlay ─────────────────────────────────── */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out);
  z-index: 100;
}
.sidebar-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--sidebar-width);
  height: 100%;
  background: #fff;
  padding: 28px 32px 40px;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s var(--ease-out);
  z-index: 101;
  overflow-y: auto;
}
.sidebar.active { transform: translateX(0); }

.sidebar-close {
  align-self: flex-end;
  background: transparent;
  border: none;
  font-size: 22px;
  color: var(--warm-gray);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  margin-bottom: 32px;
  transition: color 0.2s;
}
.sidebar-close:hover { color: var(--charcoal); }

/* Sidebar section label */
.sidebar::before {
  content: 'Navigation';
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 20px;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-nav li a {
  display: block;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--warm-gray);
  text-decoration: none;
  padding: 10px 0;
  border-bottom: 1px solid var(--divider);
  transition: color 0.2s;
  letter-spacing: 0.3px;
}
.sidebar-nav li a:hover,
.sidebar-nav li a.active { color: var(--charcoal); }

/* ── Hero (home page only) ───────────────────────────── */
main.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px var(--screen-pad) 80px;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(36px, 8vw, 56px);
  line-height: 1.1;
  color: var(--charcoal);
  margin-bottom: 20px;
}

.hero-sub {
  font-size: 14px;
  color: var(--warm-gray);
  line-height: 1.7;
  margin-bottom: 40px;
}

/* ── App Store button ────────────────────────────────── */
.appstore-btn {
  display: inline-block;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  line-height: 0;
  transition: opacity 0.18s, transform 0.15s;
}
.appstore-btn:hover {
  opacity: 0.78;
  transform: translateY(-2px);
  text-decoration: none;
}
.appstore-btn:active { transform: translateY(0); opacity: 1; }

.appstore-badge {
  height: 72px;   /* larger = sharper perceived quality for SVG */
  width: auto;
  display: block;
  image-rendering: crisp-edges;
}

/* ── Content pages (privacy policy etc.) ────────────── */
main:not(.hero) {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 56px var(--screen-pad) 80px;
  flex: 1;
}

/* ── Section label ───────────────────────────────────── */
.label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 16px;
}

/* ── Page title ──────────────────────────────────────── */
h1:not(.hero h1) {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 38px;
  line-height: 1.15;
  color: var(--charcoal);
  margin-bottom: 8px;
}
.last-updated {
  font-size: 13px;
  color: var(--warm-gray);
  margin-bottom: 48px;
}

/* ── Divider ─────────────────────────────────────────── */
hr {
  border: none;
  border-top: 1px solid var(--divider);
  margin: 40px 0;
}

/* ── Section headings ────────────────────────────────── */
h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 24px;
  color: var(--charcoal);
  margin-bottom: 12px;
}

/* ── Body text ───────────────────────────────────────── */
p {
  color: var(--charcoal);
  margin-bottom: 16px;
}
p:last-child { margin-bottom: 0; }

/* ── Lists ───────────────────────────────────────────── */
ul {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
ul li {
  padding-left: 16px;
  position: relative;
  color: var(--charcoal);
  margin-bottom: 6px;
}
ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 4px;
  height: 1px;
  background: var(--gold-dark);
}

/* ── Info block ──────────────────────────────────────── */
.info-block {
  background: var(--cream);
  border-radius: 4px;
  padding: 20px 24px;
  margin-bottom: 16px;
}
.info-block p { color: var(--warm-gray); font-size: 14px; }

/* ── Links ───────────────────────────────────────────── */
a { color: var(--gold-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Footer ──────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--divider);
  padding: 24px var(--screen-pad);
  text-align: center;
  font-size: 12px;
  color: var(--warm-gray);
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
