/* ═══════════════════════════════════════════════════════════════════════
   adrianwoodward.com — styles.css
   Dark-mode only. Noir / moody. Cyan accent.
   ═══════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────── Design tokens */
:root {
  --bg: #0a0a0c;             /* near-black, slight blue */
  --bg-elevated: #14141a;    /* card / section alt */
  --fg: #e8e8ea;             /* primary text */
  --fg-muted: #8a8a92;       /* secondary text */
  --accent: #00d4ff;         /* cyan — book cover echo */
  --accent-dim: #0099b8;     /* hover / pressed */
  --border: #2a2a32;
  --max-width: 1120px;
  --space: 1rem;
  --radius: 4px;
  --transition: 200ms ease;
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
  color: var(--fg);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle background grain — inline data URI, low opacity, does not ship a file */
body {
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
  /* Paint the grain at ~3% so it reads as texture, not noise */
  position: relative;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: inherit;
  background-size: inherit;
  background-repeat: inherit;
  opacity: 0.03;
  pointer-events: none;
  z-index: 0;
}

/* Clear the body's own image after establishing the pseudo — avoids double grain */
body {
  background-image: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

ul[role="list"] {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ─────────────────────────────────────────── Typography */
h1, h2, h3, h4 {
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  line-height: 1.2;
}

code, .mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

/* ─────────────────────────────────────────── Focus styles */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─────────────────────────────────────────── Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  border-radius: var(--radius);
  z-index: 9999;
  transition: top var(--transition);
}
.skip-link:focus {
  top: 1rem;
}

/* ─────────────────────────────────────────── Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 12, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.wordmark {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
  white-space: nowrap;
}
.wordmark:hover {
  color: var(--accent);
}

.site-nav ul {
  display: flex;
  gap: 2rem;
}

.site-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-muted);
  transition: color var(--transition);
  position: relative;
  padding-bottom: 2px;
}
.site-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width var(--transition);
}
.site-nav a:hover,
.site-nav a.active {
  color: var(--accent);
}
.site-nav a.active::after,
.site-nav a:hover::after {
  width: 100%;
}

/* Hamburger button — hidden on desktop */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--fg);
}
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 22px;
}
.hamburger span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* ─────────────────────────────────────────── Mobile nav drawer */
.nav-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(320px, 90vw);
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  z-index: 200;
  padding: 5rem 2rem 2rem;
  transform: translateX(100%);
  transition: transform 300ms ease;
  visibility: hidden;
}
.nav-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
}
.nav-drawer nav ul {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.nav-drawer nav a {
  display: block;
  padding: 1rem 0;
  font-family: 'EB Garamond', serif;
  font-size: 1.5rem;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--border);
  transition: color var(--transition);
}
.nav-drawer nav a:hover {
  color: var(--accent);
}

.nav-drawer-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--fg-muted);
  padding: 0.5rem;
  transition: color var(--transition);
}
.nav-drawer-close:hover {
  color: var(--accent);
}

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}
.nav-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ─────────────────────────────────────────── Section base */
.section {
  position: relative;
  z-index: 1;
  padding: 6rem 1.5rem;
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-inner--centered {
  max-width: 640px;
  text-align: center;
}

/* Alternating background for rhythm */
.section-writing {
  background: var(--bg-elevated);
}

/* ─────────────────────────────────────────── Section headings */
.section-heading {
  font-family: 'EB Garamond', Georgia, serif;
  font-style: italic;
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--fg-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
/* Thin cyan rule beneath — rendered as an after element */
.section-heading::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--accent);
  flex-shrink: 0;
}

/* ─────────────────────────────────────────── Section dividers */
.section-divider {
  position: relative;
  z-index: 1;
  height: 1px;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.divider-mark {
  display: block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  transform: rotate(45deg);
  margin-top: -3px; /* center the diamond on the line */
  flex-shrink: 0;
}

/* ─────────────────────────────────────────── Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  border: 2px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-dim);
  border-color: var(--accent-dim);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 212, 255, 0.2);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-secondary:hover {
  background: var(--accent);
  color: var(--bg);
  transform: translateY(-1px);
}

/* Inline variant for the veritynull.com CTA within a sentence */
.btn-inline {
  display: inline-flex;
  padding: 0.4rem 0.9rem;
  font-size: 0.875rem;
  vertical-align: middle;
}

/* ─────────────────────────────────────────── Hero */
.section-hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
}

.hero-inner {
  max-width: 800px;
}

.hero-name {
  font-family: 'EB Garamond', Georgia, serif;
  font-weight: 600;
  font-size: clamp(3rem, 8vw, 6rem);
  letter-spacing: -0.02em;
  color: var(--fg);
  line-height: 1.05;
  margin-bottom: 0.75rem;
}

.hero-role {
  font-family: 'EB Garamond', Georgia, serif;
  font-style: italic;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  color: var(--fg-muted);
  margin-bottom: 1.5rem;
}

.hero-copy {
  font-size: 1rem;
  color: var(--fg-muted);
  margin-bottom: 2.5rem;
  font-family: 'Inter', system-ui, sans-serif;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ─────────────────────────────────────────── Writing section */
.book-layout {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 4rem;
  align-items: start;
}

.book-cover-wrap {
  position: relative;
  align-self: start; /* prevent grid row-stretch from distorting the image */
}

.book-cover {
  display: block;
  width: 100%;
  height: auto;          /* never let a parent force a height */
  aspect-ratio: 2 / 3;  /* matches the 900×1350 source file; pins ratio before image loads */
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  transition: box-shadow var(--transition), filter var(--transition);
}
.book-cover:hover {
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(0, 212, 255, 0.2);
}

.book-title {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 400;
  margin-bottom: 0.5rem;
  color: var(--fg);
}

.book-tagline {
  font-family: 'EB Garamond', Georgia, serif;
  font-style: italic;
  font-size: 1.25rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.book-description {
  color: var(--fg-muted);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 2rem;
  max-width: 60ch;
}

.book-buy-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.book-sister-site {
  color: var(--fg-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}
.book-sister-site em {
  color: var(--fg);
}

/* ─────────────────────────────────────────── Music section */
.music-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
}

.music-title {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  color: var(--fg);
}

.music-subline {
  font-size: 0.875rem;
  color: var(--fg-muted);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.05em;
}

.spotify-embed-wrap {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
}
.spotify-embed-wrap iframe {
  display: block;
}

.streaming-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.streaming-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fg-muted);
  transition: all var(--transition);
}
.streaming-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(0, 212, 255, 0.05);
}
.streaming-icon {
  flex-shrink: 0;
  color: inherit;
  transition: color var(--transition);
}

/* ─────────────────────────────────────────── About section */
.about-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 4rem;
  align-items: start;
}

.portrait {
  display: block;
  width: 100%;
  height: auto;            /* never let the grid row force a height */
  aspect-ratio: 480 / 721; /* matches the 480×721 source file */
  object-fit: cover;
  max-width: 240px;
  border-radius: var(--radius);
  filter: grayscale(0.4) contrast(1.05);
  transition: filter 400ms ease;
}
.portrait:hover {
  filter: grayscale(0) contrast(1);
}

/* Subtle cyan duotone feel reinforced by a CSS overlay */
.about-portrait-wrap {
  position: relative;
  align-self: start; /* prevent grid row-stretch from distorting the image */
}
.about-portrait-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 212, 255, 0.04);
  border-radius: var(--radius);
  pointer-events: none;
  mix-blend-mode: screen;
  transition: opacity 400ms ease;
}
.about-portrait-wrap:hover::after {
  opacity: 0;
}

.bio {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--fg-muted);
  max-width: 60ch;
  margin-bottom: 2rem;
}
.bio em {
  color: var(--fg);
  font-style: italic;
}

.social-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}

.social-link {
  color: var(--fg-muted);
  transition: color var(--transition), transform var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  /* 44×44px minimum touch target — visual size stays small */
  min-width: 44px;
  min-height: 44px;
}
.social-link:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

/* ─────────────────────────────────────────── Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  position: relative;
  z-index: 1;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  justify-content: center;
}

.copyright {
  font-size: 0.8rem;
  color: var(--fg-muted);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

/* ─────────────────────────────────────────── Fade-up animation on scroll */
.section,
.book-layout,
.about-layout,
.music-body {
  /* Elements start slightly below and invisible */
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms ease, transform 600ms ease;
}

/* Active section uses 50% threshold so it triggers mid-scroll, not at edges */
.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Hero is immediately visible — no entrance animation needed */
.section-hero {
  opacity: 1;
  transform: none;
}

/* ─────────────────────────────────────────── Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  html {
    scroll-behavior: auto;
  }

  .section,
  .book-layout,
  .about-layout,
  .music-body {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ─────────────────────────────────────────── Responsive — mobile (<720px) */
@media (max-width: 720px) {
  .section {
    padding: 4rem 1rem;
  }

  /* Show hamburger, hide desktop nav */
  .nav-toggle {
    display: flex;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    align-items: center;
  }
  .nav-drawer-close {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .site-nav {
    display: none;
  }

  .book-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .book-cover-wrap {
    max-width: 280px;
    margin: 0 auto;
  }

  .about-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .about-portrait-wrap {
    max-width: 200px;
    margin: 0 auto; /* center portrait when layout stacks to single column */
  }

  /* Center social icons under the portrait on mobile */
  .social-links {
    justify-content: center;
  }

  /* Taller streaming pills — easier to tap */
  .streaming-link {
    padding: 0.65rem 1rem;
  }

  .hero-ctas {
    flex-direction: column;
    align-items: center;
  }
}
