:root {
  --bg: #f6f8f5;
  --bg-elevated: rgba(255, 255, 255, 0.78);
  --surface: #ffffff;
  --surface-strong: #eef5ef;
  --border: rgba(21, 42, 36, 0.1);
  --text: #12231f;
  --muted: #52625d;
  --accent: #0f8f6f;
  --accent-strong: #0a6d57;
  --accent-soft: rgba(15, 143, 111, 0.12);
  --shadow: 0 24px 60px rgba(20, 36, 31, 0.08);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 143, 111, 0.14), transparent 30%),
    radial-gradient(circle at bottom right, rgba(10, 109, 87, 0.1), transparent 28%),
    linear-gradient(180deg, #fbfcfa 0%, var(--bg) 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(18, 35, 31, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 35, 31, 0.03) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0));
  transform: translateY(calc(var(--scroll-progress, 0) * -28px));
  transition: transform 160ms linear;
}

body::after {
  content: "";
  position: fixed;
  right: -120px;
  bottom: -120px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(15, 143, 111, 0.2), transparent 68%);
  filter: blur(10px);
  z-index: 0;
  animation: orbDrift 12s ease-in-out infinite;
}

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

p,
li,
dd {
  color: var(--muted);
  line-height: 1.7;
}

h1,
h2,
h3,
strong,
.brand-copy,
.metric-value,
.button,
.eyebrow {
  font-family: "Space Grotesk", sans-serif;
}

h1,
h2,
h3,
p,
ul,
dl {
  margin-top: 0;
}

.page-shell {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  padding-bottom: 4rem;
}

.site-header {
  position: sticky;
  top: 1rem;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #ffffff;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
}

.brand-copy {
  display: grid;
  gap: 0.1rem;
}

.brand-copy span {
  font-size: 0.85rem;
  color: var(--muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.95rem;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.contact-card a:hover,
.contact-card a:focus-visible,
.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--accent-strong);
}

.menu-toggle {
  display: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem;
}

.section {
  padding: 5rem 0 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 2rem;
  align-items: stretch;
  padding-top: 4.5rem;
}

.hero-copy,
.hero-panel,
.highlight-band,
.timeline-item,
.case-card,
.skill-grid article,
.split-section .section-content,
.contact-section,
.focus-card {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 3rem;
  border-radius: var(--radius-lg);
}

.eyebrow {
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  color: var(--accent-strong);
}

.hero h1 {
  max-width: 14ch;
  font-size: clamp(3rem, 5vw, 5.25rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
  margin-bottom: 1.5rem;
}

.hero-summary {
  max-width: 62ch;
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.25rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.6rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  transition: border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.social-links a:hover,
.social-links a:focus-visible {
  color: var(--accent-strong);
  border-color: rgba(10, 109, 87, 0.28);
  transform: translateY(-1px);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  transition: transform 180ms ease, background-color 180ms ease, color 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--text);
  color: #ffffff;
}

.button-secondary {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.75);
}

.hero-panel {
  display: grid;
  gap: 1.25rem;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  animation: panelBreathe 8s ease-in-out infinite;
}

.panel-grid {
  display: grid;
  gap: 1rem;
}

.metric-card {
  display: grid;
  gap: 0.4rem;
  padding: 1.4rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid rgba(18, 35, 31, 0.06);
  animation: metricFloat 5s ease-in-out infinite;
}

.panel-grid .metric-card:nth-child(2) {
  animation-delay: 0.8s;
}

.panel-grid .metric-card:nth-child(3) {
  animation-delay: 1.4s;
}

.accent-card {
  background: linear-gradient(135deg, rgba(15, 143, 111, 0.15), rgba(10, 109, 87, 0.06));
}

.metric-value {
  font-size: 2rem;
  color: var(--text);
}

.metric-label {
  color: var(--muted);
}

.focus-card {
  padding: 1.4rem;
  border-radius: var(--radius-md);
}

.focus-title {
  margin-bottom: 0.85rem;
  color: var(--text);
  font-weight: 600;
}

.focus-card ul,
.timeline-body ul,
.credential-block ul {
  padding-left: 1.15rem;
  margin-bottom: 0;
}

.highlight-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding: 1.2rem;
  border-radius: var(--radius-lg);
}

.highlight-band article {
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.7);
}

.section-heading {
  display: grid;
  gap: 0.5rem;
  max-width: 52rem;
  margin-bottom: 1.75rem;
}

.section-heading h2 {
  font-size: clamp(2rem, 3vw, 3.25rem);
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 2rem;
  align-items: start;
}

.split-section .section-content {
  padding: 2rem;
  border-radius: var(--radius-lg);
}

.timeline {
  display: grid;
  gap: 1.25rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.75rem;
  border-radius: var(--radius-lg);
}

.timeline-meta p,
.timeline-company,
.credential-block h3,
.case-card h3,
.skill-grid h3,
.highlight-band h2 {
  color: var(--text);
}

.timeline-meta span,
.timeline-company {
  color: var(--muted);
}

.timeline-company {
  margin-bottom: 1rem;
}

.case-study-grid,
.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.case-card,
.skill-grid article {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
}

.case-tag {
  display: inline-flex;
  margin-bottom: 1rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-family: "Space Grotesk", sans-serif;
}

.case-card dl,
.case-card dd {
  margin: 0;
}

.case-card dl {
  display: grid;
  gap: 0.85rem;
}

.case-card dt {
  margin-bottom: 0.25rem;
  color: var(--text);
  font-weight: 600;
}

.skills-section .skill-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.credential-block + .credential-block {
  margin-top: 1.5rem;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 2rem;
  padding: 2rem;
  border-radius: var(--radius-lg);
}

.contact-card {
  display: grid;
  gap: 0.8rem;
  align-content: start;
  padding: 1.4rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid rgba(18, 35, 31, 0.06);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 3rem 0 0;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms ease, transform 600ms ease;
}

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

/* ─── Scroll progress bar ──────────────────────────────────────────────────── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #06d6a0);
  z-index: 9999;
  border-radius: 0 2px 2px 0;
  transition: width 80ms linear;
  box-shadow: 0 0 8px rgba(15, 143, 111, 0.55);
}

/* ─── Active nav link ───────────────────────────────────────────────────────── */
.site-nav a.is-active {
  color: var(--accent-strong);
  font-weight: 600;
}

/* ─── Cursor spotlight ──────────────────────────────────────────────────────── */
.cursor-spotlight {
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 340px;
  height: 340px;
  margin-left: -170px;
  margin-top: -170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 143, 111, 0.09) 0%, transparent 70%);
  z-index: 0;
  transition: transform 60ms linear;
  will-change: transform;
}

/* ─── Emoji particles ───────────────────────────────────────────────────────── */
.emoji-particle {
  position: absolute;
  font-size: 1.6rem;
  pointer-events: none;
  user-select: none;
  z-index: 9998;
  animation: particleFly 900ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  will-change: transform, opacity;
}

@keyframes particleFly {
  0%   { transform: translate(0, 0) scale(1);   opacity: 1; }
  100% { transform: translate(
           calc((var(--rx, 1) - 0.5) * 180px),
           calc(-80px - var(--ry, 0.5) * 80px)
         ) scale(0.3); opacity: 0; }
}

.emoji-particle:nth-child(1)  { --rx: 0.1; --ry: 0.2; }
.emoji-particle:nth-child(2)  { --rx: 0.3; --ry: 0.8; }
.emoji-particle:nth-child(3)  { --rx: 0.6; --ry: 0.1; }
.emoji-particle:nth-child(4)  { --rx: 0.9; --ry: 0.7; }
.emoji-particle:nth-child(5)  { --rx: 0.2; --ry: 0.5; }
.emoji-particle:nth-child(6)  { --rx: 0.8; --ry: 0.3; }
.emoji-particle:nth-child(7)  { --rx: 0.5; --ry: 0.9; }
.emoji-particle:nth-child(8)  { --rx: 0.7; --ry: 0.6; }

/* ─── Brand mark pulse ring on load ────────────────────────────────────────── */
.brand-mark {
  animation: pulseRing 2.8s ease-out 1.2s 1;
}

@keyframes pulseRing {
  0%   { box-shadow: 0 0 0 0 rgba(15, 143, 111, 0.5); }
  70%  { box-shadow: 0 0 0 18px rgba(15, 143, 111, 0); }
  100% { box-shadow: 0 0 0 0 rgba(15, 143, 111, 0); }
}

/* ─── Hero h1 letter-reveal ─────────────────────────────────────────────────── */
.hero h1 {
  animation: heroReveal 900ms cubic-bezier(0.16, 1, 0.3, 1) 400ms both;
}

@keyframes heroReveal {
  from { opacity: 0; transform: translateY(28px) skewY(2deg); }
  to   { opacity: 1; transform: translateY(0)    skewY(0); }
}

/* ─── Highlight band bounce-in ──────────────────────────────────────────────── */
@keyframes bandBounce {
  0%   { opacity: 0; transform: translateY(24px) scale(0.95); }
  60%  { transform: translateY(-5px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.highlight-band article.band-bounce {
  animation: bandBounce 520ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ─── Timeline slide-in ─────────────────────────────────────────────────────── */
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-32px); }
  to   { opacity: 1; transform: translateX(0); }
}

.timeline-item.slide-in {
  animation: slideInLeft 560ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ─── Skill card wiggle ──────────────────────────────────────────────────────── */
@keyframes wiggle {
  0%   { transform: rotate(0deg); }
  20%  { transform: rotate(-4deg); }
  40%  { transform: rotate(4deg); }
  60%  { transform: rotate(-2deg); }
  80%  { transform: rotate(2deg); }
  100% { transform: rotate(0deg); }
}

.skill-grid article.wiggle {
  animation: wiggle 420ms ease;
}

/* ─── Case & skill card tilt transition ─────────────────────────────────────── */
.case-card,
.metric-card,
.skill-grid article {
  transition: transform 180ms ease, box-shadow 180ms ease;
  will-change: transform;
}

.case-card {
  position: relative;
  overflow: hidden;
}

.case-card::after {
  content: "";
  position: absolute;
  top: -120%;
  left: -120%;
  width: 230%;
  height: 230%;
  transform: rotate(26deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.38), transparent);
  transition: transform 650ms ease;
  pointer-events: none;
}

.case-card:hover::after,
.case-card:focus-within::after {
  transform: translate(52%, 52%) rotate(26deg);
}

.button,
.social-links a,
.contact-card a,
.brand-mark {
  position: relative;
  overflow: hidden;
}

.magnetic-item {
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ripple-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(1);
  background: rgba(255, 255, 255, 0.62);
  pointer-events: none;
  animation: rippleExpand 560ms ease-out forwards;
}

.ripple-host {
  isolation: isolate;
}

.stagger-list li {
  opacity: 0;
  transform: translateX(-10px);
}

.stagger-list.is-list-visible li {
  animation: staggerIn 460ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--stagger-index, 0) * 70ms);
}

.ambient-particle {
  position: fixed;
  bottom: -20px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle, rgba(15, 143, 111, 0.7), rgba(15, 143, 111, 0.05));
  animation: ambientRise linear forwards;
}

/* ─── Confetti pieces ───────────────────────────────────────────────────────── */
.confetti-piece {
  position: fixed;
  top: -20px;
  border-radius: 3px;
  z-index: 9999;
  pointer-events: none;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0deg);    opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}

/* ─── Konami toast ──────────────────────────────────────────────────────────── */
.konami-msg {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  padding: 1rem 1.75rem;
  border-radius: 999px;
  z-index: 9999;
  animation: toastIn 300ms cubic-bezier(0.34, 1.56, 0.64, 1) both,
             toastOut 300ms ease 2800ms forwards;
  white-space: nowrap;
  box-shadow: var(--shadow);
}

@keyframes toastIn  { from { opacity:0; transform: translateX(-50%) translateY(24px); } to { opacity:1; transform: translateX(-50%) translateY(0); } }
@keyframes toastOut { from { opacity:1; } to { opacity:0; } }

/* ─── Eyebrow cursor blink ──────────────────────────────────────────────────── */
.hero .eyebrow::after {
  content: '|';
  opacity: 1;
  animation: blink 800ms step-end infinite;
  margin-left: 1px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ─── Social links fly-in ───────────────────────────────────────────────────── */
.social-links a {
  animation: flyIn 500ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.social-links a:nth-child(1) { animation-delay: 1.1s; }
.social-links a:nth-child(2) { animation-delay: 1.25s; }

@keyframes flyIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── CTA buttons pop-in ────────────────────────────────────────────────────── */
.hero-actions .button {
  animation: popIn 500ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.hero-actions .button:nth-child(1) { animation-delay: 0.85s; }
.hero-actions .button:nth-child(2) { animation-delay: 1.0s; }

@keyframes popIn {
  from { opacity: 0; transform: scale(0.85) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes rippleExpand {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.75;
  }
  100% {
    transform: translate(-50%, -50%) scale(16);
    opacity: 0;
  }
}

@keyframes staggerIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes ambientRise {
  0% {
    transform: translateY(0) scale(0.8);
  }
  100% {
    transform: translateY(-112vh) scale(1.18);
  }
}

@keyframes metricFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes panelBreathe {
  0%,
  100% {
    box-shadow: 0 24px 60px rgba(20, 36, 31, 0.08);
  }
  50% {
    box-shadow: 0 28px 72px rgba(20, 36, 31, 0.12);
  }
}

@keyframes orbDrift {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(-38px, -26px, 0);
  }
}

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

  .reveal,
  .button {
    transition: none;
    transform: none;
    opacity: 1;
  }

  .brand-mark,
  .hero h1,
  .hero .eyebrow::after,
  .social-links a,
  .hero-actions .button,
  .emoji-particle,
  .highlight-band article,
  .timeline-item,
  .confetti-piece,
  .konami-msg,
  .metric-card,
  .hero-panel,
  .ambient-particle,
  body::after {
    animation: none;
  }

  .case-card,
  .metric-card,
  .skill-grid article {
    transition: none;
  }

  .stagger-list li {
    opacity: 1;
    transform: none;
  }

  body::before {
    transform: none;
  }

  .cursor-spotlight {
    display: none;
  }
}

@media (max-width: 1024px) {
  .hero,
  .split-section,
  .contact-section,
  .timeline-item,
  .skills-section .skill-grid,
  .case-study-grid,
  .highlight-band {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    gap: 0.5rem;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(calc(100% - 1rem), var(--max-width));
  }

  .site-header {
    flex-wrap: wrap;
    border-radius: 28px;
  }

  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding-top: 0.5rem;
  }

  .site-nav.is-open {
    display: flex;
  }

  .hero-copy,
  .hero-panel,
  .split-section .section-content,
  .contact-section {
    padding: 1.4rem;
  }

  .hero h1 {
    max-width: none;
    font-size: clamp(2.5rem, 16vw, 4rem);
  }

  .hero-panel,
  .metric-card,
  body::after {
    animation: none;
  }

  .case-card::after {
    display: none;
  }

  .ambient-particle {
    width: 6px;
    height: 6px;
    opacity: 0.22;
  }

  .hero .eyebrow::after {
    animation-duration: 1200ms;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}