/* —— Base —— */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #f0f4f8;
  --bg-subtle: #e8eef2;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --border: rgba(15, 23, 42, 0.1);
  --accent: #0d9488;
  --accent-hover: #0f766e;
  --accent-2: #6366f1;
  --accent-soft: rgba(13, 148, 136, 0.12);
  --accent-glow: rgba(13, 148, 136, 0.22);
  --on-accent: #ffffff;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: clamp(4rem, 12vw, 7rem);
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --header-h: 4rem;
  --max-w: 72rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  background-image: linear-gradient(180deg, #f8fbfc 0%, var(--bg) 35%, #eef2f7 100%);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-hover);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  color: var(--accent);
}

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

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-sm);
  z-index: 100;
  padding: var(--space-xs) var(--space-sm);
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: top 0.2s var(--ease-out);
}

.skip-link:focus {
  top: var(--space-sm);
}

.container {
  width: min(100% - var(--space-md) * 2, var(--max-w));
  margin-inline: auto;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, #ffffff 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.logo:hover {
  color: var(--accent-hover);
  text-decoration: none;
}

.logo-dot {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.nav-toggle-bar {
  display: block;
  width: 1.35rem;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.25s var(--ease-out), opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-nav .nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: color 0.2s;
}

.site-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.site-nav .nav-cta {
  padding: 0.5rem 1rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

.site-nav .nav-cta:hover {
  background: color-mix(in srgb, var(--accent) 25%, transparent);
  color: var(--text);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: color-mix(in srgb, #ffffff 94%, var(--bg-subtle));
    backdrop-filter: blur(16px);
    padding: var(--space-lg);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.35s var(--ease-out), opacity 0.25s, visibility 0.35s;
  }

  .site-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .site-nav .nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }

  .site-nav a {
    font-size: 1.125rem;
  }
}

/* —— Hero —— */
.hero {
  position: relative;
  padding: clamp(3rem, 10vw, 5rem) 0 var(--space-2xl);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: -40% -20% auto;
  height: 85%;
  background: radial-gradient(
      ellipse 75% 55% at 50% -5%,
      color-mix(in srgb, var(--accent) 18%, transparent),
      transparent 68%
    ),
    radial-gradient(
      ellipse 45% 35% at 85% 15%,
      color-mix(in srgb, var(--accent-2) 14%, transparent),
      transparent 60%
    ),
    radial-gradient(ellipse 35% 30% at 15% 25%, rgba(13, 148, 136, 0.1), transparent 55%);
  pointer-events: none;
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(15, 23, 42, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.06) 1px, transparent 1px);
  background-size: min(56px, 11vw) min(56px, 11vw);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 20%, transparent 75%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
}

.hero-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Row 1: name —————————————— image */
.hero-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  width: 100%;
  margin-bottom: var(--space-lg);
}

.hero-title-block {
  flex: 1 1 12rem;
  min-width: 0;
}

.hero-portrait {
  flex: 0 0 auto;
  margin-left: auto;
}

@media (max-width: 639px) {
  .hero-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .hero-title-block {
    flex: 1 1 auto;
    width: 100%;
  }

  .hero-title {
    margin-inline: auto;
  }

  .hero-portrait {
    margin-left: 0;
  }

  .hero-title-block {
    order: -1;
  }
}

@media (min-width: 640px) {
  .hero-row {
    flex-wrap: nowrap;
    gap: var(--space-xl);
  }
}

.hero-portrait img {
  display: block;
  width: min(200px, 56vw);
  max-width: 240px;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center top;
  border-radius: 50%;
  border: 4px solid var(--bg-elevated);
  box-shadow: 0 16px 48px -16px rgba(15, 23, 42, 0.18), 0 0 0 1px var(--border);
}

.hero-kicker {
  margin: 0 0 var(--space-sm);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-hover);
}

.hero-title {
  margin: 0;
  max-width: min(100%, 28ch);
}

.hero-name {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw + 1rem, 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
}

.hero-about {
  width: 100%;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

.hero-about-heading {
  margin: 0 0 var(--space-sm);
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2vw + 0.75rem, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hero-intro {
  margin: 0 0 var(--space-lg);
  max-width: 62ch;
}

@media (max-width: 639px) {
  .hero-about {
    text-align: left;
  }
}

.hero-intro p {
  margin: 0 0 var(--space-sm);
  color: var(--text-muted);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.hero-intro p:last-child {
  margin-bottom: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.35rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s var(--ease-out);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-hover);
  text-decoration: none;
  box-shadow: 0 6px 24px var(--accent-glow);
}

.btn-ghost {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  color: var(--accent-hover);
  text-decoration: none;
}

/* —— Sections —— */
.section {
  padding: var(--space-2xl) 0;
}

.section-header {
  margin-bottom: var(--space-lg);
}

.section-title {
  margin: 0 0 var(--space-xs);
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw + 1rem, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 36ch;
}

/* —— Work —— */
.work {
  border-top: 1px solid var(--border);
}

.project-grid {
  display: grid;
  gap: var(--space-md);
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 640px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .project-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.project-grid--solo {
  max-width: 42rem;
  margin-inline: auto;
}

@media (min-width: 640px) {
  .project-grid--solo {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1024px) {
  .project-grid--solo {
    grid-template-columns: 1fr;
  }
}

.project-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 24px -8px rgba(15, 23, 42, 0.08);
  transition: border-color 0.25s, transform 0.3s var(--ease-out), box-shadow 0.3s;
}

.project-card:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -20px rgba(15, 23, 42, 0.12), 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent);
}

.project-card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--accent, #5b8cff) 35%, var(--bg-elevated)),
    var(--bg-elevated)
  );
}

/* Solid white behind P&C badge (overrides .project-card-media gradient) */
.project-card-media.project-card-media--img {
  background-color: #ffffff;
  background-image: none;
}

.project-card-media--img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 0.5rem 0.75rem;
  box-sizing: border-box;
  background-color: #ffffff;
}

.project-card-tag {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  z-index: 1;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.project-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--space-md);
}

.project-card-title {
  margin: 0 0 var(--space-xs);
  font-size: 1.125rem;
  font-weight: 600;
}

.project-card-lede {
  margin: 0 0 var(--space-sm);
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.project-card-lede strong {
  color: var(--text);
  font-weight: 600;
}

.project-card-bullets strong {
  color: var(--text);
  font-weight: 600;
}

.project-card-desc {
  margin: 0 0 var(--space-md);
  flex: 1;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.project-card-bullets {
  margin: 0 0 var(--space-md);
  padding-left: 1.15rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  flex: 1;
}

.project-card-bullets li {
  margin-bottom: 0.5rem;
}

.project-card-bullets li:last-child {
  margin-bottom: 0;
}

.project-card-link {
  display: inline-flex;
  align-self: flex-start;
  margin-top: var(--space-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-hover);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent-hover) 40%, transparent);
}

.project-card-link:hover {
  color: var(--accent-hover);
  text-decoration: none;
}

.project-card-tech {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  list-style: none;
  margin: 0;
  padding: 0;
}

.project-card-tech li {
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* —— Experience —— */
.experience {
  border-top: 1px solid var(--border);
}

.experience-list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: 52rem;
}

.experience-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  box-shadow: 0 4px 24px -8px rgba(15, 23, 42, 0.06);
  border-left: 3px solid var(--accent);
}

.experience-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
}

.experience-org {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.experience-role {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--accent-hover);
}

.experience-note {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
}

.experience-meta {
  margin: 0;
  text-align: right;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.experience-dates {
  display: block;
  font-weight: 600;
  color: var(--text);
}

.experience-loc {
  display: block;
}

.experience-bullets {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.experience-bullets li {
  margin-bottom: 0.45rem;
}

.experience-bullets li:last-child {
  margin-bottom: 0;
}

@media (max-width: 600px) {
  .experience-card {
    padding: var(--space-md);
  }

  .experience-meta {
    text-align: left;
    width: 100%;
  }
}

/* —— Education —— */
.education {
  border-top: 1px solid var(--border);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent-2) 4%, transparent),
    transparent 40%
  );
}

.education-list {
  max-width: 52rem;
  margin: 0 auto;
}

.education-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  box-shadow: 0 4px 24px -8px rgba(15, 23, 42, 0.06);
  border-left: 3px solid var(--accent-2);
}

.education-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
}

.education-school {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.education-degree {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--accent-hover);
}

.education-meta {
  margin: 0;
  text-align: right;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.education-meta .education-dates {
  display: block;
  font-weight: 600;
  color: var(--text);
}

.education-meta .education-loc {
  display: block;
}

.education-coursework-title {
  margin: 0 0 var(--space-sm);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.education-courses {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  list-style: none;
  margin: 0;
  padding: 0;
}

.education-courses li {
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
}

@media (max-width: 600px) {
  .education-card {
    padding: var(--space-md);
  }

  .education-meta {
    text-align: left;
    width: 100%;
  }
}

/* —— Skills —— */
.skills {
  border-top: 1px solid var(--border);
}

.skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  list-style: none;
  margin: 0;
  padding: 0;
}

.skill-chips li {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.skill-chips li:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: var(--accent-soft);
  box-shadow: 0 4px 12px -4px rgba(13, 148, 136, 0.15);
}

/* —— Contact —— */
.contact {
  border-top: 1px solid var(--border);
  padding-bottom: calc(var(--space-2xl) + var(--space-md));
}

.contact-inner {
  max-width: 40rem;
}

.contact-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.contact-phone {
  margin: 0;
  font-size: 1rem;
}

.contact-phone a {
  color: var(--text-muted);
  font-weight: 500;
  text-decoration: none;
}

.contact-phone a:hover {
  color: var(--accent);
}

.contact-social {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.contact-social a {
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.contact-social a:hover {
  color: var(--accent);
  border-bottom-color: color-mix(in srgb, var(--accent) 50%, transparent);
}

/* —— Footer —— */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-md) 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.footer-copy {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.to-top {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  font-size: 1.125rem;
  line-height: 1;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.to-top:hover {
  color: var(--accent-hover);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: var(--accent-soft);
}
