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

:root {
  --bg:        #080808;
  --surface:   #111111;
  --border:    #1e1e1e;
  --text:      #ddd9ce;
  --muted:     #555;
  --accent:    #d4a843;
  --accent-dim:#8a6b28;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'IBM Plex Sans', sans-serif;
  --font-mono:    'IBM Plex Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  background-image:
    radial-gradient(circle at 50% 0%, rgba(212,168,67,0.09), transparent 34%),
    radial-gradient(circle at 85% 18%, rgba(255,255,255,0.04), transparent 22%);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
}

/* Grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
  z-index: 1000;
}

/* ─── NAV ─────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.4rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(8,8,8,0.95) 0%, transparent 100%);
  backdrop-filter: blur(2px);
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-decoration: none;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

.nav-toggle {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  padding: 0.45rem 0.7rem;
  cursor: pointer;
}

/* ─── HERO ────────────────────────────────────────── */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 2.5rem 6rem;
  position: relative;
  overflow: hidden;
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(212,168,67,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212,168,67,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 100%, black 0%, transparent 70%);
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.2s;
}

h1 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(4rem, 10vw, 9rem);
  line-height: 0.92;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 0.9s ease forwards 0.4s;
}

h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-tagline {
  max-width: 520px;
  font-size: 1rem;
  color: #908c82;
  line-height: 1.8;
  opacity: 0;
  animation: fadeUp 0.9s ease forwards 0.6s;
}

.hero-links {
  display: flex;
  gap: 1rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.9s ease forwards 0.8s;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  max-width: 760px;
  margin-top: 2rem;
  opacity: 0;
  animation: fadeUp 0.9s ease forwards 1s;
}

.hero-meta-item {
  padding: 1rem 1.1rem;
  border: 1px solid rgba(212,168,67,0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
}

.hero-meta-value {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.hero-meta-label {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--text);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  cursor: pointer;
  background: transparent;
}

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

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #080808;
}

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

.scroll-indicator {
  position: absolute;
  bottom: 5rem;
  right: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  animation: fadeIn 1s ease forwards 1.2s;
}

.scroll-indicator span {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  writing-mode: vertical-lr;
}

.scroll-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2s ease-in-out infinite 1.5s;
}

/* ─── SECTIONS ────────────────────────────────────── */
section {
  padding: 7rem 2.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

h2 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

h2 em {
  font-style: italic;
  color: var(--accent);
}

/* ─── ABOUT ───────────────────────────────────────── */
#about .about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-text p {
  color: #aaa;
  font-size: 1rem;
  line-height: 1.9;
  margin-bottom: 1.2rem;
}

.about-text p:last-child { margin-bottom: 0; }

.certs-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cert-intro {
  font-size: 0.86rem;
  line-height: 1.8;
  color: #8e8a80;
  margin-bottom: 0.2rem;
}

.cert-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
  color: inherit;
  text-decoration: none;
}

.cert-item:hover {
  border-color: var(--accent-dim);
  transform: translateX(4px);
  background: linear-gradient(180deg, rgba(212,168,67,0.05), rgba(255,255,255,0.01));
}

.cert-logo {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cert-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.cert-copy {
  min-width: 0;
}

.cert-meta {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.cert-name {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text);
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}

.cert-full {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ─── BOOK ────────────────────────────────────────── */
#book {
  border-top: 1px solid var(--border);
}

.book-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3.5rem;
  align-items: center;
  padding: 2.5rem;
  border: 1px solid var(--border);
  background: var(--surface);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s;
}

.book-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(212,168,67,0.08), transparent 35%);
  pointer-events: none;
}

.book-card:hover { border-color: var(--accent-dim); }

.book-cover {
  width: 200px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  border-left: 3px solid var(--accent);
  box-shadow: 8px 8px 30px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.4);
  overflow: hidden;
  background: #0a0a0a;
}

.book-cover img {
  width: 100%;
  height: auto;
  display: block;
}

.book-cover-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #1a1a1a, #222);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
  text-align: center;
  padding: 1rem;
}

.book-publisher {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

.book-title {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.book-authors {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 1.2rem;
  letter-spacing: 0.05em;
}

.book-desc {
  color: #9a978f;
  font-size: 0.9rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

/* ─── SPEAKING ─────────────────────────────────────── */
#speaking {
  border-top: 1px solid var(--border);
}

.speaking-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.speaking-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.conf-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  gap: 2rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: padding-left 0.2s;
  position: relative;
}

.conf-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--accent);
  transition: width 0.2s;
}

.conf-item:hover { padding-left: 1rem; }
.conf-item:hover::before { width: 2px; }

.conf-year {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.conf-name {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text);
}

.conf-location {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 0.2rem;
  letter-spacing: 0.05em;
}

.conf-arrow {
  font-size: 0.75rem;
  color: var(--muted);
  transition: color 0.2s, transform 0.2s;
}

.conf-item:hover .conf-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* ─── PROJECTS ─────────────────────────────────────── */
#projects {
  border-top: 1px solid var(--border);
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: 2rem;
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
}

.project-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 60px; height: 60px;
  background: radial-gradient(circle at top right, rgba(212,168,67,0.08), transparent 70%);
  transition: opacity 0.3s;
  opacity: 0;
}

.project-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
}

.project-card:hover::after { opacity: 1; }

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.project-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 300;
  margin-bottom: 0.8rem;
  line-height: 1.1;
}

.project-desc {
  font-size: 0.85rem;
  color: #777;
  line-height: 1.7;
  flex: 1;
}

.project-url {
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s;
}

.project-card:hover .project-url { color: var(--accent); }

/* ─── FOOTER ───────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 3rem 2.5rem;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--muted);
}

.social-links {
  display: flex;
  gap: 1.5rem;
}

.social-links a {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

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

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #333;
  letter-spacing: 0.05em;
}

/* ─── EXPERIENCE ───────────────────────────────────── */
#experience {
  border-top: 1px solid var(--border);
}

.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent), var(--border) 60%, transparent);
}

.timeline-group {
  margin-bottom: 3rem;
}

.timeline-company {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.timeline-company::before {
  content: '';
  position: absolute;
  left: -2rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--accent);
  top: 50%;
  transform: translateY(-50%);
}

.company-name {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.company-location {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
}

.timeline-roles {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-left: 0;
}

.timeline-role {
  padding: 1.4rem 1.6rem;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.2s;
}

.timeline-role:hover { border-color: var(--accent-dim); }

.role-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}

.role-title {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1.3;
}

.role-dates {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  white-space: nowrap;
  padding-top: 0.2rem;
}

.role-highlights {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.role-highlights li {
  font-size: 0.82rem;
  color: #777;
  line-height: 1.6;
  padding-left: 1rem;
  position: relative;
}

.role-highlights li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--accent-dim);
}

.timeline-earlier {
  margin-top: 1rem;
  padding: 1rem 1.6rem;
  border: 1px solid var(--border);
  border-style: dashed;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.earlier-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.earlier-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: baseline;
}

.earlier-role {
  font-size: 0.8rem;
  color: #666;
}

.earlier-company {
  color: #555;
}

.earlier-dates {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: #444;
  white-space: nowrap;
}

/* ─── ANIMATIONS ───────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50%       { opacity: 1;   transform: scaleY(1.1); }
}

/* Scroll-reveal */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* ─── RESPONSIVE ───────────────────────────────────── */
@media (max-width: 768px) {
  nav { padding: 1.2rem 1.5rem; }
  .nav-links { gap: 1.2rem; }
  #hero { padding: 0 1.5rem 4rem; }
  section { padding: 4rem 1.5rem; }
  footer { padding: 2.5rem 1.5rem; }

  #about .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .book-card {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .book-cover {
    width: 160px;
  }

  .hero-meta {
    grid-template-columns: 1fr;
    max-width: 360px;
  }

  .conf-item {
    grid-template-columns: 60px 1fr auto;
    gap: 1rem;
  }

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

  .speaking-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  nav {
    align-items: flex-start;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0.8rem;
    padding-top: 1rem;
  }

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

  .cert-item {
    align-items: flex-start;
  }

  .cert-logo {
    width: 52px;
    height: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }

  .hero-eyebrow,
  h1,
  .hero-tagline,
  .hero-links,
  .scroll-indicator,
  .reveal {
    opacity: 1;
    transform: none;
  }
}
