/* Design Tokens */
:root {
  --bg: #faf6ef;
  --paper: #ffffff;
  --ink: #15140f;
  --body: #2a2820;
  --muted: #6b6657;
  --rule: rgba(21, 20, 15, 0.14);
  --rule-soft: rgba(21, 20, 15, 0.12);
  --chip-bg: rgba(21, 20, 15, 0.05);
  --chip-bg-hover: rgba(21, 20, 15, 0.09);
  --accent: #0891b2;
  --accent-ink: #075b76;
  --available: #22c55e;

  /* Preserve Pico CSS variables */
  --pico-primary: #0891b2;
  --pico-primary-hover: #0e7490;
  --pico-primary-focus: rgba(8, 145, 178, 0.25);
  --pico-primary-inverse: #fff;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  margin: 0;
  padding: 0;
}

main {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* ──────────────────────────────────────────────────────────
   Cover Section
   ────────────────────────────────────────────────────────── */

.cover {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  /* Padding for all sizes — overridden per breakpoint below */
  padding: 16px 28px 36px;
}

/* The meta row and desktop menu are only meaningful on desktop */
.cover .meta {
  display: none;
}

/* Desktop: ≥ 1025px */
@media (min-width: 1025px) {
  .cover {
    min-height: 900px;
    padding: 56px 72px 64px;
  }

  .cover .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0.06em;
  }

  .cover .meta .left {
    flex: 1;
  }

  .cover .meta .right {
    display: flex;
    align-items: center;
    /* Keep clear of the fixed MENU pill (approx 120px wide) */
    padding-right: 140px;
  }

  .cover .avail {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--ink);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.14em;
    white-space: nowrap;
  }

  .cover .avail.hidden {
    display: none;
  }

  .cover .avail .dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--available);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
    flex-shrink: 0;
  }
}

/* Cover display block */
.cover .display-block {
  padding-top: 12px;
}

/* ──────────────────────────────────────────────────────────
   Kicker
   ────────────────────────────────────────────────────────── */

.kicker {
  font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.18em;
  margin: 8px 0 22px;
}

.kicker::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--ink);
  display: inline-block;
  flex-shrink: 0;
}

@media (min-width: 1025px) {
  .kicker {
    font-size: 12px;
    margin-bottom: 22px;
    margin-top: 0;
  }

  .kicker::before {
    width: 36px;
  }
}

/* ──────────────────────────────────────────────────────────
   Display name
   ────────────────────────────────────────────────────────── */

.display {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  margin: 0;
  color: var(--ink);
  /* Mobile (≤599px): 76px at 390px, scales up toward 120px */
  font-size: clamp(76px, 18vw, 120px);
  letter-spacing: -0.02em;
  line-height: 0.92;
}

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

/* Tablet (600–1024px): 120–180px range */
@media (min-width: 600px) and (max-width: 1024px) {
  .display {
    font-size: clamp(120px, 16vw, 180px);
    letter-spacing: -0.025em;
  }
}

/* Small desktop (1025–1439px): scale up toward 248px */
@media (min-width: 1025px) and (max-width: 1439px) {
  .display {
    font-size: clamp(180px, 17vw, 248px);
    letter-spacing: -0.035em;
    line-height: 0.86;
  }
}

/* Full desktop (1440+): exactly 248px */
@media (min-width: 1440px) {
  .display {
    font-size: 248px;
    letter-spacing: -0.035em;
    line-height: 0.86;
  }
}

/* ──────────────────────────────────────────────────────────
   Cover bottom
   ────────────────────────────────────────────────────────── */

@media (min-width: 1025px) {
  .cover .bottom {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 48px;
    align-items: end;
    margin-top: 56px;
  }
}

/* Role section */
.cover .role-section {
  max-width: 520px;
  margin-top: 32px;
}

@media (min-width: 1025px) {
  .cover .role-section {
    margin-top: 0;
  }
}

.cover .role-title {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  color: var(--ink);
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
}

.cover .role-title em {
  font-style: italic;
  color: var(--accent);
}

@media (min-width: 1025px) {
  .cover .role-title {
    font-size: 28px;
    line-height: 1.15;
  }
}

/* Tagline */
.cover .tagline {
  font-size: 16px;
  line-height: 1.5;
  color: #4b4838;
  max-width: 460px;
  margin-top: 14px;
  margin-bottom: 0;
}

/* ──────────────────────────────────────────────────────────
   CTA buttons
   ────────────────────────────────────────────────────────── */

.cta-row {
  display: flex;
  gap: 8px;
  margin-top: 28px;
}

.cta {
  padding: 13px 22px;
  border-radius: 999px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  transition: background-color 150ms ease;
  cursor: pointer;
}

.cta:hover {
  background-color: var(--chip-bg);
}

.cta svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex-shrink: 0;
}

.cta.primary {
  background: var(--ink);
  color: var(--bg);
}

.cta.primary:hover {
  background: var(--body);
}

@media (max-width: 768px) {
  .cta {
    flex: 1;
    padding: 14px 16px;
    text-align: center;
    justify-content: center;
  }
}

/* ──────────────────────────────────────────────────────────
   Anchor chips
   ────────────────────────────────────────────────────────── */

.anchors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 28px;
}

@media (min-width: 1025px) {
  .anchors {
    justify-content: flex-end;
    max-width: 580px;
    margin-top: 0;
  }
}

.anchors a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--chip-bg);
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  transition: background 0.15s ease;
  font-weight: 400;
}

.anchors a:hover {
  background: var(--chip-bg-hover);
}

.anchors a.active {
  font-weight: 700;
  background: var(--chip-bg-hover);
}

.anchors a .num {
  color: var(--accent);
  font-weight: 700;
}

@media (min-width: 1025px) {
  .anchors a {
    font-size: 12px;
    letter-spacing: 0.08em;
    padding: 11px 16px;
  }
}

/* ──────────────────────────────────────────────────────────
   Floating menu pill (desktop)
   Starts absolute within the cover, becomes fixed after scroll
   ────────────────────────────────────────────────────────── */

.floating-menu-desk {
  display: none;
}

@media (min-width: 1025px) {
  .floating-menu-desk {
    position: absolute;
    right: 56px;
    top: 56px;
    padding: 10px 18px 10px 14px;
    background: var(--ink);
    color: var(--bg);
    border-radius: 999px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
    cursor: pointer;
    z-index: 35;
  }

  /* JS adds this class once user scrolls past the cover */
  .floating-menu-desk.is-fixed {
    position: fixed;
    top: 24px;
    right: 24px;
  }
}

.floating-menu-desk .lines {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.floating-menu-desk .lines span {
  display: block;
  width: 14px;
  height: 1.5px;
  background: var(--bg);
}

/* ──────────────────────────────────────────────────────────
   Floating menu button (mobile)
   ────────────────────────────────────────────────────────── */

.floating-menu-btn {
  position: fixed;
  bottom: 24px;
  right: 18px;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  z-index: 40;
}

@media (min-width: 1025px) {
  .floating-menu-btn {
    display: none;
  }
}

/* ──────────────────────────────────────────────────────────
   Mobile divider (between cover and about on mobile)
   ────────────────────────────────────────────────────────── */

.cover-divider {
  display: none;
}

@media (max-width: 1024px) {
  .cover-divider {
    display: block;
    height: 1px;
    background: var(--rule-soft);
    margin: 36px 28px 0;
  }
}

/* ──────────────────────────────────────────────────────────
   Content Sections (About, Experience, AI in QA, Projects)
   ────────────────────────────────────────────────────────── */

section {
  background: var(--bg);
}

/* Base: mobile single-column — 36px top / 28px sides per spec */
.about-row,
.experience-row,
.ai-row,
.projects-row {
  padding: 36px 28px;
  border-top: 1px solid var(--rule-soft);
  display: block;
}

/* Desktop: two-column grid */
@media (min-width: 1025px) {
  .about-row,
  .experience-row,
  .ai-row,
  .projects-row {
    padding: 96px 72px;
    border-top: 1px solid var(--rule);
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 96px;
    align-items: start;
  }
}

/* Tablet: comfortable padding */
@media (min-width: 600px) and (max-width: 1024px) {
  .about-row,
  .experience-row,
  .ai-row,
  .projects-row {
    padding: 40px 40px;
  }
}

/* Section number */
.sec-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  display: block;
  margin-bottom: 0;
}

@media (min-width: 1025px) {
  .sec-num {
    font-size: 12px;
    letter-spacing: 0.14em;
    margin-bottom: 28px;
  }
}

/* Section title */
.sec-title {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  margin: 16px 0 0;
  line-height: 1;
  font-size: 36px;
  letter-spacing: -0.02em;
}

.sec-title em {
  color: var(--accent);
  font-style: italic;
}

@media (min-width: 600px) and (max-width: 1024px) {
  .sec-title {
    font-size: clamp(40px, 8vw, 72px);
    letter-spacing: -0.025em;
    line-height: 0.95;
    margin-top: 20px;
  }
}

@media (min-width: 1025px) {
  .sec-title {
    font-size: 88px;
    letter-spacing: -0.025em;
    line-height: 0.95;
    margin-top: 0;
  }
}

/* Body text */
.body-text {
  font-family: 'IBM Plex Sans', sans-serif;
  color: var(--body);
  font-size: 15px;
  line-height: 1.55;
  margin: 16px 0 0;
}

@media (min-width: 1025px) {
  .body-text {
    font-size: 19px;
    line-height: 1.6;
    max-width: 680px;
    margin-top: 0;
  }
}

/* Desktop column constraints */
@media (min-width: 1025px) {
  .about-left,
  .experience-left,
  .ai-left,
  .projects-left {
    max-width: 520px;
  }
}

/* ──────────────────────────────────────────────────────────
   Skills
   ────────────────────────────────────────────────────────── */

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}

@media (min-width: 1025px) {
  .skills {
    gap: 8px;
    margin-top: 32px;
  }
}

.skill {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12px;
  background: var(--paper);
  border: 1px solid var(--rule-soft);
  padding: 6px 10px;
  border-radius: 4px;
  display: inline-block;
  text-decoration: none;
  color: var(--ink);
}

.skill.accent {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

@media (min-width: 1025px) {
  .skill {
    font-size: 13px;
    padding: 7px 14px;
    border-radius: 6px;
  }
}

/* ──────────────────────────────────────────────────────────
   Experience entries
   ────────────────────────────────────────────────────────── */

.experience-entry {
  margin-top: 0;
  padding: 0;
}

.experience-entry + .experience-entry {
  padding-top: 24px;
  margin-top: 24px;
  border-top: 1px solid var(--rule-soft);
}

@media (min-width: 1025px) {
  .experience-entry + .experience-entry {
    border-top: none;
    border-bottom: 1px solid var(--rule-soft);
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 24px;
    margin-bottom: 24px;
  }

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

.company-header {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.company-location {
  color: var(--muted);
  font-weight: 400;
}

.role-item {
  margin-bottom: 10px;
  padding-left: 0;
}

.role-item .title {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
}

.role-item .dates {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.82rem;
  color: var(--muted);
}

.role-item p {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.875rem;
  color: var(--muted);
  margin: 4px 0 0;
  line-height: 1.5;
}

/* ──────────────────────────────────────────────────────────
   Card grid (AI / Projects)
   ────────────────────────────────────────────────────────── */

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (min-width: 600px) {
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

article {
  background: var(--paper);
  border: 1px solid var(--rule-soft);
  border-radius: 18px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

article h3 {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 10px;
}

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

article h3 a:hover {
  text-decoration: underline;
}

article p {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--body);
  margin: 0 0 16px;
  line-height: 1.55;
  flex: 1;
}

article .cta {
  margin-top: 18px;
}

/* ──────────────────────────────────────────────────────────
   Pico overrides
   ────────────────────────────────────────────────────────── */

.container {
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ──────────────────────────────────────────────────────────
   Footer
   ────────────────────────────────────────────────────────── */

footer {
  background: var(--bg);
  border-top: 1px solid var(--rule);
  padding: 32px 28px;
  text-align: center;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
}

@media (min-width: 1025px) {
  footer {
    padding: 32px 72px;
  }
}

/* Extra space at bottom on mobile so floating button doesn't cover content */
@media (max-width: 1024px) {
  footer {
    padding-bottom: 96px;
  }
}

/* ──────────────────────────────────────────────────────────
   Menu overlay
   ────────────────────────────────────────────────────────── */

.menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 50;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  animation: fadeIn 200ms ease-out;
}

.menu-overlay.open {
  display: flex;
}

.menu-overlay a {
  font-family: 'Instrument Serif', serif;
  color: var(--ink);
  text-decoration: none;
  font-weight: 400;
  /* Mobile: 40px per spec */
  font-size: 40px;
}

.menu-overlay a em {
  font-style: italic;
  color: var(--accent);
}

.menu-overlay a:hover {
  color: var(--accent);
}

/* Desktop overlay: 64px per spec */
@media (min-width: 1025px) {
  .menu-overlay a {
    font-size: 64px;
  }
}

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