/* ═══════════════════════════════════════════════════════════════
   DESIGN SYSTEM
   Editorial, light, typographic. Warm and approachable.
   ═══════════════════════════════════════════════════════════════ */

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

:root {
  /* Colours */
  --color-bg: #FDFCFB;
  --color-surface: #FFFFFF;
  --color-text: #1a1a1a;
  --color-text-secondary: #555555;
  --color-text-muted: #888888;
  --color-accent: #C45A3B;
  --color-accent-light: #F8EBE7;
  --color-border: #E8E6E3;
  --color-border-light: #F2F0ED;

  /* Typography */
  --font-serif: 'Georgia', 'Times New Roman', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', monospace;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  /* Layout */
  --max-width: 680px;
  --max-width-wide: 1100px;
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════════════════════ */

nav {
  position: sticky;
  top: 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border-light);
  z-index: 100;
}

.nav-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: var(--space-sm) var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
}

.nav-links a {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
  position: relative;
}

.nav-links a:hover {
  color: var(--color-text);
}

.nav-links a.active {
  color: var(--color-text);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--color-accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--color-text);
  padding: var(--space-xs);
}

@media (max-width: 700px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    border-bottom: 1px solid var(--color-border-light);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-links a {
    display: block;
    padding: var(--space-sm) var(--space-md);
  }

  .nav-links a.active::after {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════ */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md) var(--space-2xl);
}

main.wide {
  max-width: var(--max-width-wide);
}

/* ═══════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════ */

h1 {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--color-text);
  margin-bottom: var(--space-md);
}

h2 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

h3 {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

h4 {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  margin-bottom: var(--space-xs);
}

p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}

p:last-child {
  margin-bottom: 0;
}

.lead {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

strong {
  font-weight: 600;
  color: var(--color-text);
}

em {
  font-style: italic;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.75;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border-light);
  margin: var(--space-md) 0;
}

/* ═══════════════════════════════════════════════════════════════
   PAGE HEADER
   ═══════════════════════════════════════════════════════════════ */

.page-header {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.page-header p {
  max-width: none;
}

/* ═══════════════════════════════════════════════════════════════
   HOME PAGE
   Full-width hero + two-column layout below
   ═══════════════════════════════════════════════════════════════ */

.home-hero {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-border);
}

.home-hero h1 {
  font-size: 2.8rem;
  max-width: none;
  margin-bottom: var(--space-md);
  line-height: 1.15;
}

.home-hero .lead {
  font-size: 1.2rem;
  max-width: none;
}

@media (max-width: 600px) {
  .home-hero h1 {
    font-size: 2rem;
  }
}

.home-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--space-xl);
  align-items: start;
}

@media (max-width: 900px) {
  .home-layout {
    grid-template-columns: 1fr;
  }
}

/* Left column - sections */
.home-intro {
  padding-top: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.home-section h4 {
  margin-bottom: var(--space-sm);
}

.home-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.home-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.home-list li::before {
  content: '';
  flex-shrink: 0;
  width: 5px;
  height: 5px;
  background: var(--color-accent);
  border-radius: 50%;
  margin-top: 0.55rem;
}

/* Right column - timeline */
.home-timeline {
  padding: var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

.home-timeline h4 {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border-light);
}

.timeline {
  list-style: none;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--color-border);
}

.timeline-item {
  position: relative;
  padding-left: var(--space-md);
  padding-bottom: var(--space-md);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 7px;
  height: 7px;
  background: var(--color-bg);
  border: 2px solid var(--color-accent);
  border-radius: 50%;
}

.timeline-item.current::before {
  background: var(--color-accent);
}

.timeline-role {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.3;
  margin-bottom: 2px;
}

.timeline-meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.company-link {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--color-border);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.2s ease;
}

.company-link:hover {
  text-decoration-color: var(--color-text-muted);
  opacity: 1;
}

@media (max-width: 900px) {
  .home-intro {
    order: 1;
  }

  .home-timeline {
    order: 2;
  }
}

/* ═══════════════════════════════════════════════════════════════
   ENTRY LIST LAYOUT (Selected Work, Essays)
   Two-column: sidebar index + main content
   ═══════════════════════════════════════════════════════════════ */

.entry-page {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-xl);
  align-items: start;
}

@media (max-width: 900px) {
  .entry-page {
    grid-template-columns: 1fr;
  }
}

/* Sidebar Index */
.entry-index {
  position: sticky;
  top: 80px;
}

.entry-index-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.entry-index-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.entry-index-list a {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: all 0.15s ease;
}

.entry-index-list a:hover {
  background: var(--color-border-light);
  color: var(--color-text);
  opacity: 1;
}

.entry-index-list a.active {
  background: var(--color-accent-light);
  color: var(--color-accent);
}

.entry-index-list .entry-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--color-text-muted);
  min-width: 20px;
}

.entry-index-list a.active .entry-num {
  color: var(--color-accent);
}

@media (max-width: 900px) {
  .entry-index {
    position: relative;
    top: 0;
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    overflow-x: auto;
    padding-bottom: var(--space-sm);
    margin-bottom: var(--space-md);
    border-bottom: 1px solid var(--color-border-light);
  }

  .entry-index-title {
    display: none;
  }

  .entry-index-list {
    flex-direction: row;
    gap: var(--space-xs);
  }

  .entry-index-list a {
    white-space: nowrap;
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    font-size: 0.8rem;
  }

  .entry-index-list a.active {
    border-color: var(--color-accent);
  }
}

/* Entry Content Area */
.entry-content {
  max-width: 640px;
}

/* ═══════════════════════════════════════════════════════════════
   SINGLE ENTRY (Case Study / Essay)
   ═══════════════════════════════════════════════════════════════ */

.entry {
  padding-bottom: var(--space-xl);
  margin-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-border);
}

.entry:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.entry-header {
  margin-bottom: var(--space-lg);
}

.entry-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-accent);
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.entry-header h2 {
  margin-bottom: var(--space-xs);
}

.entry-meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.entry-section {
  margin-bottom: var(--space-lg);
}

.entry-section:last-child {
  margin-bottom: 0;
}

.entry-section h4 {
  margin-bottom: var(--space-sm);
}

.entry-section p {
  font-size: 0.95rem;
  line-height: 1.7;
}

.entry-section ul {
  list-style: none;
  margin: var(--space-sm) 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.entry-section ul li {
  font-size: 0.95rem;
  line-height: 1.7;
  padding-left: 1.5rem;
  position: relative;
}

.entry-section ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--color-text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   RECOMMENDATIONS
   ═══════════════════════════════════════════════════════════════ */

.recommendation {
  padding: var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  margin-bottom: var(--space-lg);
}

.recommendation:last-child {
  margin-bottom: 0;
}

.recommendation-number {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
}

.recommendation blockquote {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
  font-style: normal;
}

.recommendation-attribution {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border-light);
}

.recommendation-attribution .name {
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.9rem;
}

.recommendation-attribution .role {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   CONTACT BLOCK
   ═══════════════════════════════════════════════════════════════ */

.contact-block {
  padding: var(--space-md);
  background: var(--color-accent-light);
  border-radius: 8px;
  margin-top: var(--space-xl);
}

.contact-block p {
  color: var(--color-text);
  margin: 0;
}

.contact-block a {
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */

footer {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md);
  border-top: 1px solid var(--color-border-light);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-lg);
}

.footer-left .footer-name {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-text);
  margin-bottom: 2px;
}

.footer-left .footer-title {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0;
}

.footer-right {
  text-align: right;
}

.footer-right .footer-location {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.footer-right .footer-contact {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0;
}

.footer-contact a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-contact a:hover {
  color: var(--color-accent);
  opacity: 1;
}

.footer-separator {
  margin: 0 var(--space-xs);
  color: var(--color-border);
}

@media (max-width: 700px) {
  .footer-content {
    flex-direction: column;
    gap: var(--space-md);
  }

  .footer-right {
    text-align: left;
  }
}

/* ═══════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════ */

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

/* ═══════════════════════════════════════════════════════════════
   READING PROGRESS BAR
   Thin accent line at top showing scroll progress
   ═══════════════════════════════════════════════════════════════ */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--color-accent);
  z-index: 200;
  transition: width 0.1s ease-out;
}

/* ═══════════════════════════════════════════════════════════════
   SCROLL REVEAL ANIMATIONS
   Content elegantly fades up as it enters viewport
   ═══════════════════════════════════════════════════════════════ */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Stagger children for sequential reveal */
.reveal-stagger > .reveal:nth-child(1) { transition-delay: 0s; }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 0.3s; }
.reveal-stagger > .reveal:nth-child(5) { transition-delay: 0.4s; }
.reveal-stagger > .reveal:nth-child(6) { transition-delay: 0.5s; }

/* ═══════════════════════════════════════════════════════════════
   KEYBOARD NAVIGATION HINT
   ═══════════════════════════════════════════════════════════════ */

.keyboard-hint {
  position: fixed;
  bottom: var(--space-md);
  right: var(--space-md);
  font-size: 0.7rem;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 6px 10px;
  border-radius: 6px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.keyboard-hint.visible {
  opacity: 1;
  transform: translateY(0);
}

.keyboard-hint kbd {
  display: inline-block;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  margin: 0 2px;
}

@media (max-width: 700px) {
  .keyboard-hint {
    display: none;
  }
}
