/**
 * Shared site shell: tokens, sidebar, custom cursor, scroll fade baseline.
 * Documented in design-system.html; cursor logic in site-cursor.js.
 */

:root {
  --bg: #F4EDE3;
  --fg: #18160f;
  --accent: #7a8450;
  --muted: #918c82;
  --border: #d9cfc3;
  --card: #ede4d8;
  --left-w: 380px;
  --cursor-invert-opacity: 0.68;
}

[data-theme="dark"] {
  --bg: #0f0e0c;
  --fg: #e6e2d8;
  --accent: #8fa05e;
  --muted: #635f57;
  --border: #242220;
  --card: #181714;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Spectral", serif;
  background: var(--bg);
  color: var(--fg);
  transition: background 0.3s, color 0.3s;
  min-height: 100vh;
  overflow-x: hidden;
}

* {
  cursor: none !important;
}

img,
video,
canvas,
picture {
  max-width: 100%;
}

/* Custom cursor: design system */
#cur {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, border-radius 0.2s, background 0.2s,
    opacity 0.15s ease;
}

#cur.pipe {
  width: 2px;
  height: 20px;
  border-radius: 1px;
  background: color-mix(in srgb, var(--accent) 55%, transparent);
}

/* Over imagery: difference blend + translucent (see --cursor-invert-opacity) */
#cur.cur-invert {
  background: #fff;
  mix-blend-mode: difference;
  opacity: var(--cursor-invert-opacity);
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.layout,
.page {
  display: flex;
  min-height: 100vh;
}

.left {
  width: var(--left-w);
  min-width: var(--left-w);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem 2.5rem;
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.left-main {
  flex: 1;
  overflow-y: auto;
}

.site-name {
  font-family: "Fraunces", serif;
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 0.35rem;
}

a.site-name {
  text-decoration: none;
  color: inherit;
  display: block;
}

a.site-name:hover {
  color: var(--accent);
}

.site-role {
  font-family: "Geist Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2.5rem;
}

.site-role::after {
  content: "|";
  color: var(--accent);
  animation: blink 0.8s step-end infinite;
}

.left-bio {
  font-size: 0.78rem;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 2.5rem;
  font-family: "Spectral", serif;
  max-width: 260px;
}

.left-bio em {
  font-style: italic;
  color: var(--fg);
  font-family: "Fraunces", serif;
  font-size: 0.92rem;
}

.left-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-bottom: 2.5rem;
}

.left-nav a {
  font-family: "Geist Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  padding: 0.4rem 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: color 0.2s;
}

.left-nav a::before {
  content: "·";
  color: var(--border);
  transition: color 0.2s;
}

.left-nav a:hover,
.left-nav a.active {
  color: var(--fg);
}

.left-nav a:hover::before,
.left-nav a.active::before {
  color: var(--accent);
}

.left-back {
  font-family: "Geist Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s;
  margin-bottom: 2.5rem;
}

.left-back:hover {
  color: var(--accent);
}

.left-links {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.left-links a {
  font-family: "Geist Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}

.left-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.theme-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  padding: 0.4rem 0.8rem;
  font-family: "Geist Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  transition: all 0.2s;
}

.theme-btn:hover {
  color: var(--fg);
  border-color: var(--fg);
}

.left-copy {
  font-family: "Geist Mono", monospace;
  font-size: 0.58rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-top: 1rem;
  line-height: 1.7;
}

.sydney-time {
  font-family: "Geist Mono", monospace;
  display: inline;
  font-size: 0.58rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

/* Insight cards: design system: 2px accent border-left, card surface, number · title · body */
.insights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin: 2.5rem 0;
}

.insight-card {
  background: var(--card);
  border-left: 2px solid var(--accent);
  padding: 1.35rem 1.65rem 1.35rem 1.35rem;
  transition: background 0.2s ease;
}

.insight-card:hover {
  background: color-mix(in srgb, var(--card) 88%, var(--accent) 12%);
}

.insights.insights--single {
  grid-template-columns: 1fr;
  max-width: 42rem;
  margin-top: 2.5rem;
}

.i-num {
  font-family: "Geist Mono", monospace;
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.45rem;
}

.i-head {
  font-family: "Fraunces", serif;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--fg);
  margin-bottom: 0.55rem;
}

.i-body {
  font-family: "Spectral", serif;
  font-size: 0.8rem;
  line-height: 1.75;
  color: var(--muted);
}

/* Scroll fade-in: design system */
.fade {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade.in {
  opacity: 1;
  transform: none;
}

@media (max-width: 1100px) {
  .layout,
  .page {
    flex-direction: column;
  }

  .left {
    position: relative;
    width: 100%;
    min-width: 0;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .insights {
    grid-template-columns: 1fr;
  }

  .insights.insights--single {
    max-width: none;
  }
}

@media (max-width: 768px) {
  .left {
    padding: 2rem 1.5rem;
  }
}

@media (pointer: coarse) {
  * {
    cursor: auto !important;
  }

  #cur {
    display: none;
  }
}
