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

/* ── Custom easings ── */
:root {
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out-quart: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

/* ── Variables ── */
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;
  --indigo-50: #eef2ff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --white: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-heading: Georgia, 'Times New Roman', serif;
}

/* ── prefers-reduced-motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Base ── */
html { font-size: 112.5%; line-height: 1.7; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--slate-700);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--indigo-500); color: white; }
a { color: var(--indigo-500); text-decoration: none; transition: color 0.2s var(--ease-out-quart); }
a:hover { color: var(--indigo-600); text-decoration: underline; }
img { max-width: 100%; height: auto; }
.container { max-width: 960px; margin: 0 auto; padding: 0 1.75rem; }

/* ── Scroll reveals ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out-quint), transform 0.7s var(--ease-out-quint);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.05s; }
.reveal-delay-2 { transition-delay: 0.1s; }
.reveal-delay-3 { transition-delay: 0.15s; }
.reveal-delay-4 { transition-delay: 0.2s; }
.reveal-delay-5 { transition-delay: 0.25s; }
.reveal-delay-6 { transition-delay: 0.3s; }

/* ── Eyebrow badge ── */
.eyebrow {
  display: inline-block;
  background: var(--indigo-50);
  color: var(--indigo-600);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.75rem;
}

/* ── Header ── */
#header {
  background: var(--slate-900);
  padding: 3.5rem 0;
  position: relative;
  overflow: hidden;
}
#header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(99,102,241,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(99,102,241,0.06) 0%, transparent 50%);
}
#header::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.5;
  pointer-events: none;
}
#header .container { position: relative; z-index: 1; text-align: center; }
.site-title {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.site-title a { color: var(--white); }
.site-title a:hover { text-decoration: none; color: var(--white); }
.site-title .part-0 { color: var(--white); }
.site-title .part-1 { color: var(--indigo-500); }
.site-title .part-2 { color: var(--white); }
.site-slogan {
  color: var(--slate-400);
  font-size: 0.95rem;
  margin-top: 0.4rem;
  font-style: italic;
}

/* ── Nav ── */
#nav {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
}
#nav .container {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  padding: 0.9rem 1.75rem;
}
#nav a {
  color: var(--slate-500);
  font-weight: 500;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.25s var(--ease-out-quart), border-color 0.25s var(--ease-out-quart);
  text-decoration: none;
}
#nav a:hover {
  color: var(--indigo-500);
  border-bottom-color: var(--indigo-500);
  text-decoration: none;
}
#nav a.active {
  color: var(--indigo-500);
  border-bottom-color: var(--indigo-500);
}

/* ── Sections ── */
section { padding: 5rem 0; }
section:nth-child(even) { background: var(--white); }
section h1, section h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--slate-900);
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
h1.centred, h2.centred { text-align: center; }
.section-rule {
  width: 48px;
  height: 3px;
  background: var(--indigo-500);
  border-radius: 2px;
  margin: 0.6rem 0 0;
}
.section-rule.centred { margin: 0.6rem auto 0; }

h3 {
  font-family: var(--font-heading);
  color: var(--slate-900);
  margin-bottom: 0.5rem;
  margin-top: 2rem;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}
h4 {
  color: var(--indigo-600);
  margin-bottom: 0.15rem;
  margin-top: 1.5rem;
  font-size: 1rem;
  font-weight: 600;
}
p { margin-bottom: 0.8rem; color: var(--slate-700); line-height: 1.8; }
ul { margin: 0.5rem 0 1.5rem 1.25rem; }
li { color: var(--slate-700); line-height: 1.8; margin-bottom: 0.25rem; }
em.date { color: var(--slate-400); font-size: 0.88rem; font-style: italic; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--indigo-500);
  color: var(--white);
  padding: 0.75rem 2rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.25s var(--ease-out-quart), transform 0.15s var(--ease-out-quart), box-shadow 0.25s var(--ease-out-quart);
}
.btn:hover { background: var(--indigo-600); color: var(--white); text-decoration: none; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,0.3); }
.btn:active { transform: scale(0.97); }
.btn-outline {
  background: transparent;
  border: 2px solid var(--gray-200);
  color: var(--slate-700);
  box-shadow: none;
}
.btn-outline:hover { border-color: var(--indigo-500); color: var(--indigo-500); background: transparent; box-shadow: none; }
.btn-outline:active { transform: scale(0.97); }
.btn + .btn { margin-left: 0.75rem; }
@media (max-width: 500px) {
  .btn + .btn { margin-left: 0; margin-top: 0.6rem; display: block; }
}

/* ── Hero ── */
#hero {
  background: linear-gradient(180deg, var(--white) 0%, var(--gray-50) 100%);
  padding: 6rem 0;
  text-align: center;
  position: relative;
}
#hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gray-200), transparent);
}
#hero h1 {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  color: var(--slate-900);
  margin-bottom: 1.2rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
#hero p {
  font-size: 1.1rem;
  color: var(--slate-500);
  max-width: 640px;
  margin: 0 auto 2rem;
  line-height: 1.8;
}
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}
.hero-tags span {
  background: var(--indigo-50);
  color: var(--indigo-600);
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.2s var(--ease-out-quart), box-shadow 0.2s var(--ease-out-quart);
}
@media (hover: hover) and (pointer: fine) {
  .hero-tags span:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
  }
}

/* ── Skill cards (double-bezel inspired) ── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}
.skill-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 0.75rem;
  box-shadow: inset 0 0 0 1px var(--gray-200);
  transition: box-shadow 0.35s var(--ease-out-quart), transform 0.25s var(--ease-out-quart);
}
.skill-card-inner {
  background: var(--gray-50);
  border-radius: calc(var(--radius) - 3px);
  padding: 1.25rem;
}
@media (hover: hover) and (pointer: fine) {
  .skill-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.06), inset 0 0 0 1px var(--indigo-500);
    transform: translateY(-2px);
  }
}
.skill-card h3 {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--slate-900);
  margin-top: 0;
  margin-bottom: 0.35rem;
  font-weight: 600;
}
.skill-card p {
  font-size: 0.88rem;
  color: var(--slate-500);
  line-height: 1.6;
  margin-bottom: 0;
}

/* ── Project cards ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 0.5rem;
}
.project-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 0.75rem;
  box-shadow: inset 0 0 0 1px var(--gray-200);
  transition: box-shadow 0.35s var(--ease-out-quart), transform 0.25s var(--ease-out-quart);
}
.project-card-inner {
  border-radius: calc(var(--radius) - 3px);
  padding: 1.25rem;
}
@media (hover: hover) and (pointer: fine) {
  .project-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08), inset 0 0 0 1px var(--indigo-400);
    transform: translateY(-3px);
  }
}
.project-card h3 {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--slate-900);
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-weight: 700;
}
.project-card p {
  font-size: 0.9rem;
  color: var(--slate-500);
  line-height: 1.65;
  margin-bottom: 0;
}
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.8rem;
}
.project-tags span {
  background: var(--indigo-50);
  color: var(--indigo-600);
  padding: 0.15rem 0.6rem;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ── Resume detail ── */
.resume-section { max-width: 700px; }
.resume-section p, .resume-section li { font-size: 0.95rem; }

/* ── Contact card ── */
.contact-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 0.75rem;
  box-shadow: inset 0 0 0 1px var(--gray-200);
  max-width: 400px;
  margin: 1.5rem auto 0;
}
.contact-card-inner {
  background: var(--gray-50);
  border-radius: calc(var(--radius) - 3px);
  padding: 1.25rem;
}
.contact-card h3 {
  font-family: var(--font-body);
  color: var(--slate-900);
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.contact-card ul { list-style: none; margin: 0; }
.contact-card li {
  margin-bottom: 0.5rem;
  font-size: 0.92rem;
  color: var(--slate-700);
}
.contact-card li a { color: var(--indigo-500); font-weight: 500; }
.contact-card li a:hover { color: var(--indigo-600); }
.contact-card li::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--indigo-500);
  border-radius: 50%;
  margin-right: 0.6rem;
  vertical-align: middle;
}
.contact-card.inline { margin-left: 0; }

/* ── Footer ── */
#footer {
  background: var(--slate-900);
  color: var(--slate-500);
  text-align: center;
  padding: 3rem 0;
  font-size: 0.88rem;
}

/* ── Mobile ── */
@media (max-width: 768px) {
  html { font-size: 106.25%; }
  .site-title { font-size: 2rem; }
  #hero h1 { font-size: 1.7rem; }
  #hero { padding: 4rem 0; }
  section h1, section h2 { font-size: 1.4rem; }
  section { padding: 3.5rem 0; }
  #nav .container { gap: 1.5rem; }
  #nav a { font-size: 0.78rem; }
  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
}
