/* ========================================
   FONTS (self-hosted; SIL Open Font License, see fonts/OFL-plusjakartasans.txt)
   Plus Jakarta Sans for display and text. Variable, so one file per style
   covers every weight the site uses. Latin subset only.
   ======================================== */

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('/fonts/plus-jakarta-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url('/fonts/plus-jakarta-sans-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ========================================
   DESIGN TOKENS
   ======================================== */

:root {
  /* Type scale */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Fonts */
  --font-display: 'Plus Jakarta Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Plus Jakarta Sans', 'Helvetica Neue', Arial, sans-serif;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;
}

/* ========================================
   LIGHT MODE (default)
   ======================================== */

:root, [data-theme="light"] {
  --color-bg:             #f6f7f8;
  --color-surface:        #ffffff;
  --color-surface-2:      #eef1f4;
  --color-surface-offset: #e9edf1;
  --color-divider:        #e1e5ea;
  --color-border:         #d3d9e0;

  --color-text:           #121820;
  --color-text-muted:     #5d6876;
  --color-text-faint:     #626e7b;
  --color-text-inverse:   #f6f7f8;

  --color-primary:        #0f766e;
  --color-primary-hover:  #0b5f58;
  --color-primary-active: #084a45;
  --color-primary-highlight: #e3f2f0;

  --color-accent:         #0f766e;
  --color-accent-hover:   #0b5f58;

  /* The one call to action: a teal button */
  --color-cta:            #0f766e;
  --color-cta-text:       #ffffff;

  --shadow-sm: 0 1px 2px oklch(0.2 0.02 250 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.2 0.02 250 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.2 0.02 250 / 0.12);
}

/* ========================================
   DARK MODE
   ======================================== */

[data-theme="dark"] {
  --color-bg:             #0d131b;
  --color-surface:        #131b25;
  --color-surface-2:      #18212d;
  --color-surface-offset: #111923;
  --color-divider:        #1d2733;
  --color-border:         #283444;

  --color-text:           #e8edf3;
  --color-text-muted:     #94a1b2;
  --color-text-faint:     #838f9f;
  --color-text-inverse:   #0d131b;

  --color-primary:        #3cc4b4;
  --color-primary-hover:  #5fd3c5;
  --color-primary-active: #86e0d5;
  --color-primary-highlight: #15302f;

  --color-accent:         #3cc4b4;
  --color-accent-hover:   #5fd3c5;

  --color-cta:            #3cc4b4;
  --color-cta-text:       #0d131b;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.2);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.3);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:             #0d131b;
    --color-surface:        #131b25;
    --color-surface-2:      #18212d;
    --color-surface-offset: #111923;
    --color-divider:        #1d2733;
    --color-border:         #283444;
    --color-text:           #e8edf3;
    --color-text-muted:     #94a1b2;
    --color-text-faint:     #838f9f;
    --color-text-inverse:   #0d131b;
    --color-primary:        #3cc4b4;
    --color-primary-hover:  #5fd3c5;
    --color-primary-active: #86e0d5;
    --color-primary-highlight: #15302f;
    --color-accent:         #3cc4b4;
    --color-accent-hover:   #5fd3c5;
    --color-cta:            #3cc4b4;
    --color-cta-text:       #0d131b;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.2);
    --shadow-md: 0 4px 12px oklch(0 0 0 / 0.3);
    --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.4);
  }
}

/* ========================================
   GLOBAL LAYOUT
   ======================================== */

.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.container {
  max-width: var(--content-default);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

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

.container--narrow {
  max-width: var(--content-narrow);
}

main {
  flex: 1;
}

/* ========================================
   HEADER / NAV
   ======================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: oklch(from var(--color-bg) l c h / 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid oklch(from var(--color-text) l c h / 0.08);
  transition: box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.site-header--scrolled {
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-4);
}

.site-logo {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.site-logo:hover {
  color: var(--color-primary);
}

.nav-desktop {
  display: none;
  gap: var(--space-6);
  align-items: center;
}

.nav-desktop a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  padding-bottom: 2px;
}

.nav-desktop a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--color-primary);
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--color-text);
}

.nav-desktop a:hover::after,
.nav-desktop a.active::after {
  width: 100%;
}

@media (min-width: 768px) {
  .nav-desktop { display: flex; gap: var(--space-4); }
  .nav-mobile-toggle { display: none !important; }
}

@media (min-width: 960px) {
  .nav-desktop { gap: var(--space-6); }
}

/* Mobile nav */
.nav-mobile-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--color-text);
}

.nav-mobile {
  display: none;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  border-top: 1px solid var(--color-divider);
  background: var(--color-bg);
}

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

.nav-mobile a {
  display: block;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
  border-radius: var(--radius-md);
}

.nav-mobile a:hover,
.nav-mobile a:active,
.nav-mobile a.active {
  color: var(--color-text);
  background: var(--color-surface-2);
}

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
}

.theme-toggle:hover {
  color: var(--color-text);
  background: var(--color-surface-2);
}

/* ========================================
   HERO / HOME
   ======================================== */

.hero {
  padding-block: clamp(var(--space-12), 6vw, var(--space-20));
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .hero-content {
    flex-direction: row;
    align-items: center;
    gap: var(--space-12);
  }
  .hero-text {
    flex: 1;
  }
  .hero-visual {
    flex-shrink: 0;
  }
}

.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.hero-subtitle {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
  max-width: 50ch;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-outline {
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn--success {
  background: #2e7d32;
  color: #fff;
  border-color: #2e7d32;
}

button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.hero-monogram {
  width: 140px;
  height: 140px;
}

@media (min-width: 480px) {
  .hero-monogram {
    width: 160px;
    height: 160px;
  }
}

@media (min-width: 768px) {
  .hero-monogram {
    width: 200px;
    height: 200px;
  }
}

/* ========================================
   COLLAPSIBLE SECTIONS
   ======================================== */

.collapsible-section {
  border: none;
}

/* Reduce section padding when collapsed */
.section:has(.collapsible-section:not([open])) {
  padding-block: clamp(var(--space-6), 3vw, var(--space-10));
}

.collapsible-toggle {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  user-select: none;
}

.collapsible-toggle::-webkit-details-marker {
  display: none;
}

/* h2 inside summary inherits styling -- semantic heading without visual change */
.collapsible-toggle h2 {
  all: unset;
  font: inherit;
  color: inherit;
}

.collapsible-toggle::after {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: rotate(-45deg);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

details[open] > .collapsible-toggle::after {
  transform: rotate(45deg);
}

.collapsible-toggle:hover {
  color: var(--color-primary);
}

.collapsible-toggle:hover::after {
  border-color: var(--color-primary);
}

/* Collapsible content animation */
.collapsible-content {
  overflow: hidden;
  animation: collapsible-open 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes collapsible-open {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Timeline job-level collapsible summary */
.timeline-job-summary {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  width: 100%;
  font-family: var(--font-display);
}

.timeline-job-summary .timeline-company,
.timeline-job-summary .timeline-group-company {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-accent);
}

.timeline-job-summary .timeline-date,
.timeline-job-summary .timeline-group-date {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-family: var(--font-body);
}

/* Override the section-level padding reduction for timeline jobs */
details.collapsible-section.timeline-item,
details.collapsible-section.timeline-group {
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--color-divider);
}

details.collapsible-section.timeline-item:last-child,
details.collapsible-section.timeline-group:last-child {
  border-bottom: none;
}

/* ========================================
   SECTIONS
   ======================================== */

.section {
  padding-block: clamp(var(--space-12), 6vw, var(--space-24));
}

.section--alt {
  background: var(--color-surface-2);
}

.section-header {
  margin-bottom: var(--space-8);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-2);
}

.section-subtitle {
  font-size: var(--text-base);
  color: var(--color-text-muted);
}

/* ========================================
   PAGE HEADER (for inner pages)
   ======================================== */

.page-header {
  padding-block: clamp(var(--space-12), 8vw, var(--space-20));
  border-bottom: 1px solid var(--color-divider);
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-2);
}

.page-header p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
}

/* ========================================
   CARDS
   ======================================== */

.card-grid {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 640px) {
  .card-grid--2 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .card-grid--3 { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: box-shadow var(--transition-interactive), transform var(--transition-interactive);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-tag {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-3);
}

.card h3,
.card h2.card-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--color-text);
}

.card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

.card-meta {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: var(--space-4);
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.tech-tag {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-primary);
  background: var(--color-primary-highlight);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}

/* ========================================
   RESUME / TIMELINE
   ======================================== */

.timeline {
  position: relative;
  padding-left: var(--space-6);
}

@media (min-width: 640px) {
  .timeline {
    padding-left: var(--space-8);
  }
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-divider);
}

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

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

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-6) - 4px);
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  border: 2px solid var(--color-bg);
}

@media (min-width: 640px) {
  .timeline-item::before {
    left: calc(-1 * var(--space-8) - 4px);
  }
}

.timeline-date {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-1);
}

.timeline-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.timeline-company {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
}

.timeline-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
}

.timeline-desc ul {
  padding-left: var(--space-5);
  margin-top: var(--space-2);
}

.timeline-desc li {
  margin-bottom: var(--space-1);
}

/* Company group: multiple roles under one company */
.timeline-group {
  position: relative;
  padding-bottom: var(--space-8);
}

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

.timeline-group::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-6) - 4px);
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  border: 2px solid var(--color-bg);
}

@media (min-width: 640px) {
  .timeline-group::before {
    left: calc(-1 * var(--space-8) - 4px);
  }
}

.timeline-group-header {
  margin-bottom: var(--space-4);
}

.timeline-group-company {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-accent);
  margin-bottom: var(--space-1);
}

.timeline-group-meta {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-accent);
}

.timeline-group-date {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.timeline-group-roles {
  padding-left: 0;
  margin-left: 0;
}

.timeline-role {
  position: relative;
  padding-bottom: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-divider);
}

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

.timeline-role-date {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-1);
}

.timeline-role-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.timeline-role-badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-highlight);
  border: 1px solid var(--color-divider);
  padding: 0.15em 0.6em;
  border-radius: var(--radius-full);
  margin-left: var(--space-2);
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ========================================
   EDUCATION & CERTS
   ======================================== */

.edu-grid {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 640px) {
  .edu-grid { grid-template-columns: repeat(2, 1fr); }
}

.edu-item {
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-lg);
}

.edu-item h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.edu-item p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ========================================
   SKILLS
   ======================================== */

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.skill-pill {
  font-size: var(--text-xs);
  font-weight: 500;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  border: 1px solid oklch(from var(--color-text) l c h / 0.06);
}

/* ========================================
   BOOK CARD
   ======================================== */

.book-card {
  display: grid;
  gap: var(--space-6);
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

@media (min-width: 640px) {
  .book-card {
    grid-template-columns: 160px 1fr;
  }
}

.book-cover {
  width: 160px;
  height: 220px;
  background: var(--color-surface-offset);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  margin-inline: auto;
}

@media (min-width: 640px) {
  .book-cover {
    margin-inline: 0;
  }
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.book-cover-placeholder {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: center;
  padding: var(--space-4);
  line-height: 1.4;
}

.book-info h3,
.book-info h2 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.book-info .book-author {
  font-size: var(--text-sm);
  color: var(--color-accent);
  font-weight: 500;
  margin-bottom: var(--space-3);
}

.book-info p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
}

.book-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

/* ========================================
   VOLUNTEER
   ======================================== */

.volunteer-item {
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}

.volunteer-item h3,
.volunteer-item h2 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.volunteer-org {
  font-size: var(--text-sm);
  color: var(--color-accent);
  font-weight: 500;
  margin-bottom: var(--space-1);
}

.volunteer-dates {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-bottom: var(--space-3);
}

.volunteer-item p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ========================================
   FOOTER
   ======================================== */

.site-footer {
  border-top: 1px solid var(--color-divider);
  padding-block: var(--space-8);
  margin-top: var(--space-16);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: center;
  text-align: center;
}

@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-copy {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.footer-disclaimer {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-style: italic;
  width: 100%;
  text-align: center;
  order: 10;
  margin-top: var(--space-2);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3) var(--space-4);
}

@media (min-width: 640px) {
  .footer-links {
    justify-content: flex-end;
  }
}

.footer-links a {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-decoration: none;
}

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

/* ========================================
   SCROLL REVEAL
   ======================================== */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ========================================
   HOME HIGHLIGHTS
   ======================================== */

.highlights-grid {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 640px) {
  .highlights-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .highlights-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .highlights-grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
  .highlights-grid--5 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Wide highlight card variant */
.highlight-card--wide {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

@media (min-width: 640px) {
  .highlights-grid--5 .highlight-card--wide:nth-child(4),
  .highlights-grid--5 .highlight-card--wide:nth-child(5) {
    grid-column: span 1;
  }
  .highlight-card--wide {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-5);
  }
  .highlight-card--wide .highlight-card-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: oklch(from var(--color-accent) l c h / 0.1);
    color: var(--color-accent);
  }
}

.highlight-card,
.work-card {
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--transition-interactive), transform var(--transition-interactive);
}

.highlight-card:hover,
.work-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.highlight-card h3,
.work-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.highlight-card p,
.work-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

.highlight-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-3);
}

/* ========================================
   PRINT
   ======================================== */

/* ========================================
   STAGE BADGES
   ======================================== */

.card-stage {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-highlight);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  margin-top: var(--space-4);
}

.book-status {
  font-weight: 600;
  color: var(--color-accent);
}

/* ========================================
   CONTACT FORM
   ======================================== */

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-group label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.form-group input,
.form-group textarea {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  transition: border-color var(--transition-interactive), box-shadow var(--transition-interactive);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-highlight);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--color-text-faint);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

/* Clarifying note under a field. Quieter and smaller than the label, because a
   hint that competes with the label makes the field harder to read, not easier. */
.form-hint {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--color-text-muted);
}

/* Honeypot. Kept out of sight and out of the accessibility tree, but not with
   display:none, which some bots detect and skip. Off-screen leaves it in the
   document where a scripted form filler will still find and complete it. */
.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* The workshop date before one is set. Removing this class is not required for
   the page to be correct, it just stops the line reading as provisional. */
.workshop-tbd {
  padding: var(--space-4) var(--space-5);
  border-left: 3px solid var(--color-border);
  background: var(--color-surface, transparent);
  border-radius: var(--radius-md);
}

.contact-submit {
  align-self: flex-start;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  background: transparent;
  transition: all var(--transition-interactive);
}

.contact-submit:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ========================================
   EXPERTISE / CONSULTING
   ======================================== */

.expertise-block {
  display: grid;
  gap: var(--space-8);
}

@media (min-width: 768px) {
  .expertise-block {
    grid-template-columns: 1fr 1.4fr;
    gap: var(--space-10);
  }
}

.expertise-header {
  align-self: start;
}

@media (min-width: 768px) {
  .expertise-header {
    position: sticky;
    top: calc(var(--space-16) + var(--space-4));
  }
}

.expertise-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-3);
}

.expertise-summary {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
}

.expertise-details h3 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-3);
  margin-top: var(--space-6);
}

.expertise-details h3:first-child {
  margin-top: 0;
}

.expertise-details ul {
  padding-left: var(--space-5);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
}

.expertise-details li {
  margin-bottom: var(--space-2);
}

.form-group select {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  transition: border-color var(--transition-interactive), box-shadow var(--transition-interactive);
  appearance: none;
  -webkit-appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns=%22http://www.w3.org/2000/svg%22 width=%2212%22 height=%2212%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%236b6b6b%22 stroke-width=%222%22><polyline points=%226 9 12 15 18 9%22/></svg>');
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  width: 100%;
}

.form-group select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-highlight);
}

/* ========================================
   MULTISELECT DROPDOWN
   ======================================== */

.multiselect {
  position: relative;
}

.multiselect-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  transition: border-color var(--transition-interactive), box-shadow var(--transition-interactive);
  text-align: left;
}

.multiselect-toggle:hover {
  border-color: var(--color-primary);
}

.multiselect-toggle[aria-expanded="true"] {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-highlight);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.multiselect-toggle svg {
  flex-shrink: 0;
  color: var(--color-text-muted);
  transition: transform var(--transition-interactive);
}

.multiselect-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.multiselect-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multiselect-label--placeholder {
  color: var(--color-text-faint);
}

.multiselect-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--color-surface);
  border: 1px solid var(--color-primary);
  border-top: none;
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  max-height: 240px;
  overflow-y: auto;
}

.multiselect-dropdown.open {
  display: block;
}

.multiselect-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--color-text);
  transition: background var(--transition-interactive);
  user-select: none;
}

.multiselect-option:hover {
  background: var(--color-surface-2);
}

.multiselect-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--color-primary);
  cursor: pointer;
}

/* ========================================
   BLOG
   ======================================== */

/* Regeneration safety net: if blog.html is ever rebuilt without the section
   wrapper, bare cards under <main> still get container width and padding. */
main > .blog-card {
  max-width: var(--content-narrow);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

/* Blog listing cards */
.blog-card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: var(--space-6);
  border-bottom: 1px solid var(--color-divider);
  transition: background var(--transition-interactive);
}

.blog-card:hover {
  background: var(--color-surface-2);
}

.blog-card:last-child {
  border-bottom: none;
}

.blog-card-date {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-2);
}

.blog-card-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.blog-card-excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-3);
}

.blog-card-tag {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* The tag sits on the date line ("OCTOBER 11, 2026 · MARKETS"), in the
   markup too, so it never reads as a label for the next card. */
.blog-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.blog-card-meta .blog-card-date {
  margin-bottom: 0;
}

.blog-card-meta .blog-card-tag::before {
  content: "\00b7";
  margin-right: var(--space-2);
  color: var(--color-text-muted);
}

/* Blog post detail */
.blog-post {
  padding-block: clamp(var(--space-8), 4vw, var(--space-16));
}

.blog-post-header {
  margin-bottom: var(--space-8);
}

.blog-post-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.blog-post-header-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.blog-back-link {
  display: inline-block;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-interactive);
}

.blog-back-link:hover {
  color: var(--color-primary);
}

.blog-post-date {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.blog-share-btn--top {
  flex-shrink: 0;
  margin-top: 2px;
}

.blog-post-header h1 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-3);
}

.blog-post-updated {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: var(--space-2);
  margin-bottom: 0;
}

.blog-post-body {
  font-size: var(--text-base);
  color: var(--color-text);
  line-height: 1.8;
}

.blog-post-body a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-color: oklch(from var(--color-accent) l c h / 0.35);
  text-underline-offset: 0.15em;
  transition: text-decoration-color var(--transition-interactive);
}

.blog-post-body a:hover {
  text-decoration-color: var(--color-accent);
}

.blog-post-body h2 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
}

.blog-post-body code {
  font-family: var(--font-mono, monospace);
  font-size: 0.9em;
  background: var(--color-surface-alt, var(--color-surface));
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.blog-post-note {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  border-left: 2px solid var(--color-border);
  padding-left: var(--space-4);
  max-width: 65ch;
}

.blog-post-body p {
  margin-bottom: var(--space-5);
  max-width: 65ch;
}

.blog-post-table {
  overflow-x: auto;
  margin: var(--space-6) 0;
}

.blog-post-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.blog-post-body th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 2px solid var(--color-border);
  font-weight: 600;
  color: var(--color-text);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.blog-post-body td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  vertical-align: top;
}

/* On phones the table fits the column: tighter cells, words wrap. A table
   too wide even then still scrolls inside .blog-post-table. */
@media (max-width: 480px) {
  .blog-post-body th,
  .blog-post-body td {
    padding: var(--space-2) 0.375rem;
    overflow-wrap: break-word;
    hyphens: auto;
  }

  .blog-post-body th:first-child,
  .blog-post-body td:first-child {
    padding-left: 0;
  }

  .blog-post-body table {
    font-size: 0.8125rem;
  }

  .blog-post-body th {
    letter-spacing: 0.02em;
  }
}

.blog-post-body ul,
.blog-post-body ol {
  padding-left: var(--space-6);
  margin-bottom: var(--space-5);
}

.blog-post-body li {
  margin-bottom: var(--space-2);
}

.blog-post-body em {
  font-style: italic;
}

/* Policy pages with sub-sections (the games privacy policy and support
   page). The base reset zeroes heading margins, so give h3 and h4 room. */
.policy-body h3,
.policy-body h4 {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

.policy-body h3 {
  font-family: var(--font-display);
}

.policy-body h4 {
  font-family: var(--font-body);
}

.policy-body h2 + h3 {
  margin-top: var(--space-4);
}

.card-link {
  display: inline-block;
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* ========================================
   COMMENTS
   ======================================== */

.comments-section {
  margin-top: var(--space-12);
  padding-top: var(--space-10);
  border-top: 1px solid var(--color-border);
}

.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.comments-count {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
}

.comments-list {
  margin-bottom: var(--space-8);
}

.comments-empty {
  color: var(--color-text-muted);
  font-style: italic;
  padding: var(--space-6) 0;
}

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

.comment--reply {
  margin-left: var(--space-6);
  margin-top: var(--space-3);
  background: oklch(from var(--color-surface) calc(l - 0.02) c h);
}

@media (max-width: 480px) {
  .comment--reply {
    margin-left: var(--space-3);
  }
}

.comment-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.comment-author {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.comment-time {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.comment-body {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.6;
  margin-bottom: var(--space-3);
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.comment-like,
.comment-reply-btn,
.comment-delete {
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  transition: color var(--transition-interactive), background var(--transition-interactive);
}

.comment-like:hover,
.comment-reply-btn:hover {
  color: var(--color-primary);
  background: oklch(from var(--color-primary) l c h / 0.08);
}

.comment-like--liked {
  color: #e74c3c;
}

.comment-like--liked svg {
  fill: #e74c3c;
  stroke: #e74c3c;
}

.comment-delete {
  color: #c0392b;
}

.comment-delete:hover {
  background: oklch(from #c0392b l c h / 0.1);
  color: #c0392b;
}

.comment-replies {
  margin-top: var(--space-3);
}

.reply-form-wrapper {
  margin-top: var(--space-3);
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Honeypot field: hidden from people, filled only by bots. */
.comment-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.comment-input,
.comment-textarea {
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color var(--transition-interactive);
  box-sizing: border-box;
}

.comment-input:focus,
.comment-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.comment-textarea {
  resize: vertical;
  min-height: 80px;
}

.comment-form-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}

.comment-submit {
  padding: var(--space-2) var(--space-5);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-interactive);
}

.comment-submit:hover {
  background: var(--color-primary-hover);
}

.comment-cancel {
  padding: var(--space-2) var(--space-4);
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  cursor: pointer;
}

.admin-banner {
  background: var(--color-accent);
  color: #fff;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--space-4);
  text-align: center;
}

/* ========================================
   SUBSCRIBE
   ======================================== */

.subscribe-section {
  margin-top: var(--space-12);
  padding: var(--space-8);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.subscribe-section h2 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.subscribe-section p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
}

.subscribe-form {
  display: flex;
  gap: var(--space-3);
  max-width: 480px;
  margin: 0 auto;
}

@media (max-width: 480px) {
  .subscribe-form {
    flex-direction: column;
  }
}

.subscribe-form input {
  flex: 1;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text);
  background: var(--color-bg);
}

.subscribe-form input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.subscribe-form button {
  padding: var(--space-3) var(--space-6);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-interactive);
  white-space: nowrap;
}

.subscribe-form button:hover {
  background: var(--color-primary-hover);
}

.subscribe-msg {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-accent);
  font-weight: 500;
}

/* ========================================
   ADMIN PAGE
   ======================================== */

.admin-section {
  padding: var(--space-8) 0;
}

.admin-section h2 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.admin-stat {
  display: inline-block;
  padding: var(--space-3) var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-right: var(--space-3);
  margin-bottom: var(--space-3);
}

.admin-stat-value {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  display: block;
}

.admin-stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  margin-top: var(--space-4);
}

.admin-table th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 2px solid var(--color-border);
  font-weight: 600;
  color: var(--color-text);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}

.admin-table tr:hover td {
  background: oklch(from var(--color-surface) calc(l - 0.02) c h);
}

.admin-delete-btn {
  background: none;
  border: 1px solid #c0392b;
  color: #c0392b;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: all var(--transition-interactive);
}

.admin-delete-btn:hover {
  background: #c0392b;
  color: #fff;
}

.admin-login {
  max-width: 400px;
  margin: var(--space-16) auto;
  text-align: center;
}

.admin-login input {
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text);
  background: var(--color-surface);
  margin-bottom: var(--space-4);
  box-sizing: border-box;
}

.admin-login button {
  padding: var(--space-3) var(--space-6);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
}

/* ========================================
   BLOG SHARE BUTTON
   ======================================== */

.blog-share {
  position: relative;
  display: flex;
  align-items: center;
  margin: var(--space-8) 0 var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}

.blog-share-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.blog-share-btn:hover {
  border-color: var(--color-accent);
  background: var(--color-bg);
}

.blog-share-menu {
  display: none;
  position: absolute;
  top: calc(100% - var(--space-4));
  left: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  padding: var(--space-1);
  min-width: 180px;
  z-index: 100;
  flex-direction: column;
}

.blog-share-menu.open {
  display: flex;
}

.blog-share-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-family: var(--font-body);
  color: var(--color-text);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.12s ease;
}

.blog-share-option:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

/* ========================================
   ANALYTICS
   ======================================== */

.analytics-period-btn {
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.15s ease;
}

.analytics-period-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-text);
}

.analytics-period-btn.active {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
}

@media (max-width: 640px) {
  #analytics-dashboard > div:nth-child(2),
  #analytics-dashboard > div:nth-child(3) {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   HOMEPAGE WIDE LAYOUT
   ======================================== */

.home-about {
  max-width: 780px;
}

.home-about p {
  margin-top: var(--space-4);
  color: var(--color-text-muted);
  line-height: 1.8;
}

/* ========================================
   SERVICES (Expertise page)
   ======================================== */

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
}

.service-card {
  padding: var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  transition: border-color var(--transition-interactive), transform var(--transition-interactive);
}

.service-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

/* Buy buttons on the consulting page's Spec Review cards. Scoped to service
   cards so the site's other outline links keep the look they already have. */
.service-card a.btn-primary,
.service-card a.btn-outline {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  margin-top: var(--space-3);
}

.service-card h3 {
  margin-top: var(--space-3);
  margin-bottom: var(--space-2);
}

.service-card p {
  color: var(--color-text-muted);
  line-height: 1.7;
}

.service-card .service-deliverables {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
}

/* ========================================
   PRINT
   ======================================== */

@media print {
  .site-header, .site-footer, .theme-toggle, .nav-mobile-toggle { display: none; }
  body { font-size: 11pt; color: #000; background: #fff; }
  .section { padding-block: 1rem; }
  .card, .book-card, .volunteer-item, .edu-item { break-inside: avoid; border: 1px solid #ccc; }
  /* Scroll-reveal elements must not print invisible. */
  .reveal { opacity: 1 !important; transform: none !important; }
  /* Collapsed sections print expanded; keep the summary text (job titles,
     companies, dates on the resume) but drop the disclosure marker. */
  details { display: block; }
  details > summary { display: block; list-style: none; cursor: default; }
  details > summary::marker { content: ''; }
  details > summary::-webkit-details-marker { display: none; }
  .collapsible-content { display: block !important; overflow: visible !important; }
  .blog-share, .comments-section, .subscribe-section { display: none; }
}

/* ========================================
   HOME PAGE (Profile Rail, 2026-10-12)
   A sticky identity column on the left (photo, name, one line, the page's
   sections); the right column reads top to bottom: about, latest writing,
   what I am building, and, last, how to work with me. Classes are prefixed
   home- so they never collide with other pages.
   ======================================== */

.home-layout {
  display: grid;
  grid-template-columns: 16.5rem minmax(0, 1fr);
  gap: var(--space-16);
}

.home-rail {
  position: sticky;
  top: 5rem;
  align-self: start;
  padding-block: var(--space-12) var(--space-8);
  display: flex;
  flex-direction: column;
}

.home-photo {
  width: 128px;
  height: 128px;
  border-radius: 18px;
  object-fit: cover;
  margin-bottom: var(--space-5);
}

.home-name {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--color-text);
}

.home-role {
  margin-top: var(--space-3);
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--color-text);
}

.home-line {
  margin-top: var(--space-2);
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
  max-width: 30ch;
}

.home-sections {
  display: grid;
  gap: var(--space-1);
  margin-top: var(--space-8);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.home-sections a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-block: 0.375rem;
  color: var(--color-text-muted);
  text-decoration: none;
}

.home-sections a::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  transition: width 0.2s ease;
}

.home-sections a:hover,
.home-sections a.is-current {
  color: var(--color-text);
}

.home-sections a:hover::before,
.home-sections a.is-current::before {
  width: 56px;
}

.home-social {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin-top: var(--space-8);
  font-size: 0.875rem;
}

.home-social a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.home-social a:hover {
  color: var(--color-text);
}

.home-main {
  min-width: 0;
  padding-block: var(--space-12) var(--space-16);
}

.home-section {
  scroll-margin-top: 5rem;
}

.home-section + .home-section {
  margin-top: var(--space-20);
}

.home-h {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-5);
}

.home-about p {
  color: var(--color-text-muted);
  max-width: 62ch;
}

.home-about p + p {
  margin-top: var(--space-4);
}

.home-about .home-big {
  font-size: clamp(1.1875rem, 1.05rem + 0.5vw, 1.375rem);
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

.home-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-6);
  margin-top: var(--space-6);
  font-size: 0.9375rem;
  font-weight: 600;
}

.home-links a {
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px solid var(--color-primary);
  padding-bottom: 2px;
}

.home-lead {
  color: var(--color-text-muted);
  max-width: 62ch;
  margin-bottom: var(--space-2);
}

.home-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.home-rows a {
  display: grid;
  grid-template-columns: 10.5rem minmax(0, 1fr);
  gap: var(--space-4);
  padding: var(--space-4);
  margin-inline: calc(-1 * var(--space-4));
  border-radius: var(--radius-lg);
  color: var(--color-text);
  text-decoration: none;
  transition: background-color var(--transition-interactive);
}

.home-rows a:hover {
  background: oklch(from var(--color-primary) l c h / 0.07);
}

.home-meta {
  font-size: 0.78125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding-top: 3px;
}

.home-meta.home-price {
  font-size: 0.9375rem;
  letter-spacing: 0;
  text-transform: none;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  padding-top: 0;
}

.home-rows h3 {
  font-family: var(--font-body);
  font-size: 1.03125rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text);
}

.home-rows a:hover h3 {
  color: var(--color-primary);
}

.home-rows p {
  margin-top: 2px;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--color-text-muted);
}

.home-more {
  display: inline-block;
  margin-top: var(--space-3);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
}

.home-more::after {
  content: " \2192";
}

.home-more:hover {
  color: var(--color-primary);
}

.home-sections a:focus-visible,
.home-social a:focus-visible,
.home-links a:focus-visible,
.home-rows a:focus-visible,
.home-more:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

@media (max-width: 880px) {
  .home-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .home-rail {
    position: static;
    padding-block: var(--space-10) 0;
  }

  .home-photo {
    width: 96px;
    height: 96px;
  }

  .home-sections {
    display: none;
  }

  .home-social {
    margin-top: var(--space-5);
  }

  .home-main {
    padding-top: var(--space-10);
  }

  .home-section + .home-section {
    margin-top: var(--space-16);
  }

  .home-rows a {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
}

/* ========================================
   PROSE DEFAULTS (2026-10-14)
   Links in running text take the accent, and paragraphs in a section
   column get room between them. The link rule has the specificity of a
   bare `a`, so any component's own link style (home rows, link lists,
   cards, nav) wins over it.
   ======================================== */

:where(main p, main li) a:where(:not([class])) {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: oklch(from var(--color-primary) l c h / 0.35);
  text-underline-offset: 0.15em;
  transition: text-decoration-color var(--transition-interactive);
}

:where(main p, main li) a:where(:not([class])):hover {
  text-decoration-color: var(--color-primary);
}

.section .container > p + p {
  margin-top: var(--space-4);
}

/* A ruled list of places to go next (404, subscription status) */
.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--color-divider);
}

.link-list li {
  border-bottom: 1px solid var(--color-divider);
}

.link-list a {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: var(--space-4);
  padding-block: var(--space-3);
  color: var(--color-text);
  text-decoration: none;
}

.link-list a b {
  font-weight: 600;
}

.link-list a span {
  color: var(--color-text-muted);
}

.link-list a:hover b {
  color: var(--color-primary);
}

.link-list a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

@media (max-width: 480px) {
  .link-list a {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
}

/* ===========================================================
   CONSULTING SITE (consulting.michaelcarroll.studio, 2026-10-18)
   consulting.html is served at the subdomain's root with its own
   menu; its sections are in-page anchors under a sticky header.
   =========================================================== */
#spec-review, #about, #writing, #start {
  scroll-margin-top: 5rem;
}

.consult-about {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.consult-about p {
  margin: 0;
}

.consult-photo {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  border-radius: 16px;
  object-fit: cover;
}

@media (max-width: 480px) {
  .consult-about {
    flex-direction: column;
    align-items: flex-start;
  }
}
