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

:root {
  /* ─── Warm editorial palette ─── */
  --paper: #FAF6F0;        /* page background */
  --paper-raised: #FFFDF9; /* inputs, active tabs */
  --surface: #F3EDE3;      /* subtle recessed surface */
  --hairline: #E6DED2;     /* rules & borders */
  --ink: #1C1917;          /* headings */
  --ink-soft: #44403C;     /* strong body */
  --body: #46423E;         /* body text (darkened ~20% from #57534E for reading contrast) */
  --muted: #58524A;        /* secondary text (darkened ~20% from #6E665C) */
  --faint: #726A60;        /* tertiary text (darkened ~20% from #8F8578) */
  --ochre: #B98A2E;        /* stars, small warm marks */

  /* ─── Electric-violet accent scale ─── */
  --violet-50: #f5f3ff;
  --violet-100: #ede9fe;
  --violet-200: #ddd6fe;
  --violet-300: #c4b5fd;
  --violet-400: #a78bfa;
  --violet-500: #8b5cf6;
  --violet-600: #7c3aed;
  --violet-700: #6d28d9;
  --violet-800: #5b21b6;
  --violet-900: #4c1d95;
  --violet-950: #2e1065;
  --accent: var(--violet-600);      /* passes AA on paper (5.3:1); matches the live site's button color */
  --accent-deep: var(--violet-700);
  --accent-tint: var(--violet-100);

  /* ─── Legacy aliases (used by per-page inline styles) ─── */
  --black: var(--ink);
  --white: var(--paper);
  --gray-50: var(--surface);
  --gray-100: #EDE6DA;
  --gray-200: var(--hairline);
  --gray-400: var(--faint);
  --gray-500: var(--muted);
  --gray-600: var(--body);
  --gray-700: var(--ink-soft);
  --gray-800: var(--ink-soft);
  --purple: var(--accent);
  --purple-light: var(--violet-400);
  --purple-bg: var(--accent-tint);
  --purple-dark: var(--accent-deep);

  --font-body: 'Instrument Sans', -apple-system, 'Helvetica Neue', sans-serif;
  --font-heading: 'Fraunces', Georgia, 'Times New Roman', serif;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--body);
  background: var(--paper);
  line-height: 1.7;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 550;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
}

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

::selection { background: var(--accent-tint); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ─── NAV ─── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(250, 246, 240, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
nav.scrolled { border-bottom-color: var(--hairline); }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.nav-logo {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.nav-links { display: flex; gap: 32px; align-items: center; }
.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--body);
  padding-bottom: 3px;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: color 0.25s, background-size 0.25s;
}
.nav-links a:hover { color: var(--ink); background-size: 100% 1px; }
.nav-links a.active { color: var(--ink); background-size: 100% 1px; }

/* ─── NAV: secondary "•••" menu (Book Notes, Watchlist, Pins, …) ───
   Deliberately not a top-level nav item: the trigger is an ellipsis glyph, so it
   never carries the active-page underline the real nav links use. Open state is
   signalled by a faint circular ground instead. */
.nav-more { position: relative; display: flex; align-items: center; }
.nav-more-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  transition: color 0.22s, background 0.22s;
}
.nav-more-trigger svg { display: block; width: 18px; height: 18px; }
.nav-more-trigger:hover { color: var(--accent); }
/* open: accent-coloured dots on a faint circular ground, matching the social icons */
.nav-more.open .nav-more-trigger { color: var(--accent); background: var(--surface); }

.nav-more-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  width: 224px;
  padding: 14px;
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: 0 12px 30px -16px rgba(60, 42, 30, 0.22);
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}
/* invisible bridge so the pointer can cross the gap to the menu without it closing */
.nav-more-menu::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  height: 14px;
}
.nav-more.open > .nav-more-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
/* No :hover / :focus-within open rule here on purpose — visibility is driven
   entirely by the .open class from JS, so clicking the trigger can always close
   the panel instead of a CSS state holding it open. */

/* rows are neutral on open; the accent underline (same treatment as the real nav
   links) marks hover or the current page */
.nav-more-menu a {
  display: flex;
  align-items: center;
  min-height: 50px;
  padding: 0 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--body);
  background: none;
  transition: color 0.22s;
}
.nav-more-menu a span {
  padding-bottom: 3px;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size 0.25s;
}
.nav-more-menu a:hover { color: var(--ink); }
.nav-more-menu a:hover span,
.nav-more-menu a[aria-current="page"] span { background-size: 100% 1px; }
.nav-more-menu a[aria-current="page"] { color: var(--ink); }

.nav-socials { display: flex; gap: 16px; align-items: center; }
.nav-socials a {
  color: var(--faint);
  transition: color 0.25s;
  display: flex;
  background: none;
  padding-bottom: 0;
}
.nav-socials a:hover { color: var(--accent); }
.nav-socials svg { width: 19px; height: 19px; }

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink);
}

/* ─── HERO ─── */
.hero {
  padding: 168px 0 96px;
  display: flex;
  align-items: center;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 72px;
  align-items: center;
}
.hero-text h1 {
  font-size: clamp(2.75rem, 5.5vw, 4.25rem);
  font-weight: 540;
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
}
.hero-text h1 span {
  font-style: italic;
  font-weight: 480;
  color: var(--accent);
}
.hero-text p {
  font-size: 1.25rem;
  color: var(--body);
  max-width: 520px;
  margin-bottom: 40px;
  line-height: 1.65;
}
.hero-text p strong { color: var(--ink); font-weight: 600; }
.hero-ctas {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 15px 28px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  transition: background 0.3s;
}
.hero-cta:hover { background: var(--accent-deep); }
.hero-cta.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--hairline);
}
.hero-cta.secondary:hover {
  border-color: var(--ink);
  background: transparent;
}
.hero-photo {
  display: flex;
  justify-content: flex-end;
}
.hero-photo .photo-wrapper {
  width: 340px;
  aspect-ratio: 5/6;
  height: auto;
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
  position: relative;
  box-shadow: 0 24px 48px -24px rgba(60, 42, 30, 0.35);
}
.hero-photo .photo-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ─── SECTION SHARED ─── */
section { padding: 104px 0; }
.section-label,
.section-label-centered {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-label::before,
.section-label-centered::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--accent);
  flex-shrink: 0;
}
.section-label-centered {
  justify-content: center;
  margin-bottom: 28px;
}
.section-label-centered::after {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--accent);
  flex-shrink: 0;
}
.section-title {
  font-size: clamp(1.85rem, 3.5vw, 2.5rem);
  font-weight: 540;
  line-height: 1.15;
  margin-bottom: 40px;
}
.section-desc {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 560px;
  margin-bottom: 48px;
}

/* ─── SKILLS (editorial list, no boxes) ─── */
.skills { border-top: 1px solid var(--hairline); padding-bottom: 56px; }
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 72px;
  align-items: start;
}
.skill-card {
  border-top: 1px solid var(--hairline);
  padding: 32px 0 40px;
  position: relative;
  cursor: pointer;
}
.skill-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 2px; }
/* accent line sweeps across the top rule on hover */
.skill-card::after {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.skill-card:hover::after,
.skill-card.expanded::after { transform: scaleX(1); }
.skill-icon {
  display: block;
  margin-bottom: 18px;
  color: var(--faint);
  transition: color 0.35s, transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.skill-icon svg { display: block; width: 26px; height: 26px; }
.skill-card:hover .skill-icon,
.skill-card.expanded .skill-icon { color: var(--accent); }
.skill-card h3 {
  font-size: 1.35rem;
  font-weight: 560;
  margin-bottom: 12px;
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.skill-card:hover h3,
.skill-card.expanded h3 { transform: translateX(10px); }
.skill-card p {
  font-size: 1rem;
  color: var(--body);
  line-height: 1.7;
  max-width: 42ch;
}

/* ─── SKILL CTA (click-to-reveal affordance) ─── */
.skill-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--accent);
}
.skill-chevron { transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.skill-card.expanded .skill-chevron { transform: rotate(180deg); }

/* ─── SKILL EXAMPLES (nested proof-of-work, revealed on expand) ─── */
.skill-examples {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.skill-card.expanded .skill-examples { grid-template-rows: 1fr; }
.skill-examples-inner { overflow: hidden; }
.example-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 22px;
  max-width: 46ch;
}
.example-item {
  display: grid;
  grid-template-columns: 14px 1fr;
  column-gap: 10px;
}
.example-item::before {
  content: "";
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  justify-self: center;
  width: 6px;
  height: 6px;
  background: var(--accent);
}
.example-title {
  display: inline-block;
  grid-column: 2;
  grid-row: 1;
  justify-self: start;
  font-size: 1rem;
  font-weight: 560;
  color: var(--ink);
  background-image: linear-gradient(var(--ink), var(--ink));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size 0.3s;
}
.example-item:hover .example-title { background-size: 100% 1px; }
.example-desc {
  display: block;
  grid-column: 2;
  grid-row: 2;
  margin-top: 6px;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
}
.example-placeholder {
  padding-top: 22px;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--faint);
}

/* ─── PROOF (logo marquee) ─── */
#proof { padding: 48px 0 56px; }
#proof .section-label-centered { margin-bottom: 40px; }
.proof-marquee-wrapper {
  overflow: hidden;
  width: 100%;
  mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent);
}
.proof-marquee {
  display: flex;
  align-items: center;
  gap: 88px;
  animation: marquee 36s linear infinite;
  width: max-content;
}
@media (pointer: fine) {
  .proof-marquee:hover {
    animation-play-state: paused;
  }
}
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.proof-logo {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  opacity: 0.5;
  filter: grayscale(100%) contrast(0.85);
  mix-blend-mode: multiply;
  transition: opacity 0.3s, filter 0.3s;
}
.proof-logo:hover {
  opacity: 0.95;
  filter: grayscale(0%);
}
.proof-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ─── TESTIMONIALS (editorial pull-quotes on paper) ─── */
.testimonials { border-top: 1px solid var(--hairline); }
.testimonials-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
}
.testimonial-card {
  position: relative;
  border-left: 2px solid var(--accent);
  padding: 6px 0 6px 32px;
}
.testimonial-card blockquote {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 400;
  font-size: 1.15rem;
  line-height: 1.6;
  letter-spacing: -0.005em;
  color: var(--ink-soft);
  margin-bottom: 24px;
}
.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
}
.testimonial-name::before { content: '\2014\00a0'; color: var(--faint); }
.testimonial-avatar {
  display: none;
}
.testimonial-name {
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}
.testimonials-dots { display: none; }
.testimonial-role {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 2px;
}

/* ─── CONTACT ─── */
.contact { border-top: 1px solid var(--hairline); }
.contact-inner {
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}
.contact-inner .section-label {
  justify-content: center;
}
.contact-inner .section-label::after {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--accent);
  flex-shrink: 0;
}
.contact-inner .section-desc {
  margin-left: auto;
  margin-right: auto;
}
.contact-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 15px 26px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}
.contact-btn.primary {
  background: var(--ink);
  color: var(--paper);
}
.contact-btn.primary:hover { background: var(--accent-deep); }
.contact-btn.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--hairline);
}
.contact-btn.secondary:hover { border-color: var(--ink); }

/* ─── ABOUT PAGE ─── */
.about-hero {
  padding: 168px 0 60px;
}
.about-hero .container {
  max-width: 720px;
}
.about-hero h1 {
  font-size: clamp(2.25rem, 4.5vw, 3rem);
  font-weight: 540;
  margin-bottom: 24px;
}
.about-hero h1 span {
  font-style: italic;
  font-weight: 480;
  color: var(--accent);
}
.about-content {
  padding: 0 0 96px;
}
.about-content .container {
  max-width: 720px;
}
.about-content p {
  font-size: 1.0625rem;
  color: var(--body);
  margin-bottom: 20px;
  line-height: 1.8;
}
.about-content h2 {
  font-size: 1.6rem;
  font-weight: 560;
  margin-top: 56px;
  margin-bottom: 16px;
}
.about-content .highlight {
  border-left: 2px solid var(--accent);
  padding: 4px 0 4px 28px;
  margin: 36px 0;
}
.about-content .highlight p {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ink-soft);
  margin-bottom: 0;
}
.about-photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--hairline);
  margin-bottom: 32px;
}
.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ─── FOOTER ─── */
footer {
  padding: 40px 0;
  border-top: 1px solid var(--hairline);
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--faint);
}
footer a { color: var(--muted); border-bottom: 1px solid var(--hairline); transition: color 0.25s, border-color 0.25s; }
footer a:hover { color: var(--accent); border-color: var(--accent); }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  section { padding: 72px 0; }
  #proof { padding: 32px 0 40px; }
  .nav-links { display: none; }
  .nav-links.show {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--paper);
    padding: 28px;
    border-bottom: 1px solid var(--hairline);
    gap: 18px;
  }
  .mobile-toggle { display: block; }
  /* the panel becomes an inline sub-list inside the stacked mobile menu */
  .nav-more { flex-direction: column; align-items: center; }
  .nav-more-menu {
    position: static;
    display: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    box-shadow: none;
    border: none;
    background: transparent;
    width: auto;
    padding: 0;
    margin-top: 6px;
    gap: 0;
  }
  .nav-more-menu::before { content: none; }
  .nav-more-menu a { justify-content: center; min-height: 44px; }
  .nav-more.open .nav-more-menu { display: flex; }
  /* must match the desktop .nav-more.open rule's specificity, otherwise its
     translateX(-50%) survives and shifts the stacked menu half its width left */
  .nav-more.open > .nav-more-menu { transform: none; }
  .hero { padding: 132px 0 64px; }
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 44px;
    text-align: center;
  }
  .hero-text h1 { font-size: clamp(2.35rem, 9vw, 2.75rem); }
  .hero-text p { font-size: 1.1rem; margin-left: auto; margin-right: auto; }
  .hero-ctas { justify-content: center; }
  .hero-photo { order: -1; justify-content: center; }
  .hero-photo .photo-wrapper { width: 240px; }
  .skills-grid { grid-template-columns: 1fr; gap: 0; }
  .testimonials-grid {
    display: flex;
    grid-template-columns: none;
    gap: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .testimonials-grid::-webkit-scrollbar { display: none; }
  .testimonial-card {
    flex: 0 0 100%;
    scroll-snap-align: start;
  }
  .testimonials-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
  }
  .testimonials-dots .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--hairline);
    transition: background 0.25s;
  }
  .testimonials-dots .dot.active { background: var(--accent); }
  .section-title { font-size: 1.75rem; }
  .about-hero h1 { font-size: 2rem; }
}

/* ─── FADE-IN ANIMATION ─── */
/* Scoped to .js (set by an inline script in <head>) so that if scripts fail to
   run, content stays visible instead of being stranded at opacity 0. */
.js .fade-in {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.js .fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger animation for grid children */
.skills-grid .fade-in:nth-child(2) { transition-delay: 0.08s; }
.skills-grid .fade-in:nth-child(3) { transition-delay: 0.16s; }
.skills-grid .fade-in:nth-child(4) { transition-delay: 0.24s; }
.testimonials-grid .fade-in:nth-child(2) { transition-delay: 0.08s; }

/* ─── REDUCED MOTION ─── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .proof-marquee { animation: none; flex-wrap: wrap; justify-content: center; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
