:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --text: #111827;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #eff6ff;
  --shadow: 0 24px 70px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
.container { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
}
.logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--text);
  color: #fff;
  font-weight: 800;
  letter-spacing: -.04em;
}
.nav-links { display: flex; gap: 24px; color: var(--muted); font-size: 14px; }
.nav-links a:hover { color: var(--text); }

.hero {
  min-height: 720px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 85% 12%, rgba(37, 99, 235, .09), transparent 28%),
    linear-gradient(180deg, #fff 0%, var(--bg) 100%);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 56px;
  align-items: center;
  padding: 92px 0 112px;
}
.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 12px;
  font-weight: 800;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  font-size: clamp(46px, 8vw, 88px);
  line-height: .95;
  margin-bottom: 26px;
  letter-spacing: -.07em;
}
h2 {
  font-size: clamp(32px, 4vw, 50px);
  line-height: 1.08;
  letter-spacing: -.045em;
  margin-bottom: 18px;
}
h3 { margin-bottom: 10px; letter-spacing: -.02em; }
.lead {
  font-size: clamp(21px, 3vw, 30px);
  line-height: 1.28;
  max-width: 760px;
  color: #1f2937;
}
.summary { max-width: 690px; color: var(--muted); font-size: 18px; }
.hero-actions, .contact-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 34px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-weight: 700;
  transition: .2s ease;
}
.button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.button.primary:hover { background: var(--accent-dark); }
.button.secondary { background: #fff; color: var(--text); }
.button:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(15, 23, 42, .08); }

.hero-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .88);
  border-radius: 30px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.stat { padding: 22px 0; border-bottom: 1px solid var(--line); }
.stat:first-child { padding-top: 0; }
.stat strong { display: block; font-size: 32px; letter-spacing: -.04em; }
.stat span, .availability, .note { color: var(--muted); }
.availability {
  margin-top: 24px;
  padding: 18px;
  border-radius: 20px;
  background: var(--accent-soft);
  color: #1e3a8a;
}

.section { padding: 88px 0; }
.section-heading { max-width: 760px; margin-bottom: 34px; }
.skills-grid, .projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.skill-card, .project, .timeline article, .contact-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .035);
}
.skill-card p, .project p, .timeline p, .contact-card p { color: var(--muted); }
.project { min-height: 330px; display: flex; flex-direction: column; overflow: hidden; }
.project-thumb {
  height: 145px;
  margin: -24px -24px 20px;
  background: linear-gradient(135deg, #eef2ff, #f8fafc);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.project:hover .project-thumb img { transform: scale(1.035); }
.project-thumb--placeholder {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(37, 99, 235, .18), transparent 34%),
    linear-gradient(135deg, #f8fafc, #e0e7ff);
}
.project-thumb--placeholder span {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--accent);
  font-weight: 800;
  font-size: 22px;
  box-shadow: 0 14px 35px rgba(15, 23, 42, .10);
}
.project > a { color: var(--accent); font-weight: 700; margin-bottom: 18px; }
.project span {
  margin-top: auto;
  color: #334155;
  font-size: 14px;
  padding-top: 18px;
  font-weight: 600;
}
.timeline { display: grid; gap: 16px; }
.timeline article { display: grid; grid-template-columns: 210px 1fr; gap: 20px; }
time { color: var(--accent); font-weight: 700; font-size: 14px; }

.contact-section { padding-bottom: 54px; }
.contact-card {
  text-align: center;
  padding: 56px 28px;
  background: linear-gradient(135deg, #ffffff, #eff6ff);
}
.contact-card p { max-width: 680px; margin-left: auto; margin-right: auto; }
.contact-actions { justify-content: center; }
.note { font-size: 14px; margin-top: 20px; }
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 32px 0 46px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.footer a { color: var(--text); }

@media (max-width: 880px) {
  .nav-links { display: none; }
  .hero-grid, .timeline article { grid-template-columns: 1fr; }
  .hero-grid { padding-top: 54px; }
  .skills-grid, .projects { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .container { width: min(100% - 28px, 1120px); }
  .hero { min-height: auto; }
  .hero-grid, .section { padding: 56px 0; }
  .skills-grid, .projects { grid-template-columns: 1fr; }
  .footer { flex-direction: column; align-items: flex-start; }
  .button { width: 100%; }
}

/* Prevent accidental horizontal overflow on narrow screens */
html, body { max-width: 100%; overflow-x: hidden; }
.hero-copy, .hero-card, .skill-card, .project, .timeline article, .contact-card { min-width: 0; }
.project a, .project h3, .project p, .project span, .skill-card p, .timeline p { overflow-wrap: anywhere; }
img, svg, video { max-width: 100%; }

/* Project detail pages */
.project-detail-hero {
  background: linear-gradient(180deg, #fff 0%, var(--bg) 100%);
  overflow: hidden;
}
.project-detail-grid {
  display: grid;
  grid-template-columns: 1fr .9fr;
  gap: 52px;
  align-items: center;
  padding: 72px 0 92px;
}
.back-link {
  display: inline-flex;
  margin-bottom: 28px;
  color: var(--muted);
  font-weight: 700;
}
.back-link:hover { color: var(--accent); }
.project-detail-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 32px; }
.project-detail-cover {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 30px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}
.project-detail-cover img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
}
.project-detail-content {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 42px;
  align-items: start;
}
.project-facts {
  position: sticky;
  top: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .035);
}
.project-facts div { padding: 0 0 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.project-facts div:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.project-facts strong { display: block; margin-bottom: 8px; color: var(--text); }
.project-facts span, .project-story p { color: var(--muted); }
.tech-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.tech-tags span {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 700;
}
.project-story {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  padding: 34px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .035);
}
.project-story p { font-size: 17px; }
.project-results {
  margin: 28px 0 0;
  padding: 22px 24px;
  border-radius: 20px;
  background: var(--surface-soft);
  color: #334155;
  font-weight: 600;
}
.project-results li + li { margin-top: 8px; }
.project-gallery-section { padding-top: 20px; }
.project-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.project-gallery figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .035);
}
.project-gallery img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
@media (max-width: 880px) {
  .project-detail-grid, .project-detail-content { grid-template-columns: 1fr; }
  .project-facts { position: static; }
}
@media (max-width: 620px) {
  .project-detail-grid { padding: 44px 0 56px; }
  .project-story { padding: 24px; }
  .project-gallery { grid-template-columns: 1fr; }
  .project-detail-actions .button { width: 100%; }
}
.project-thumb { display: block; color: inherit; }
.project-thumb:focus-visible { outline: 3px solid rgba(37, 99, 235, .35); outline-offset: -3px; }

/* Experience layout experiments */
.experience-section .section-heading p,
.experience-themes-section .section-heading p { color: var(--muted); }
.experience-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.experience-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .035);
  min-width: 0;
}
.experience-card time {
  display: inline-flex;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #1e3a8a;
  font-size: 13px;
  margin-bottom: 18px;
}
.experience-card h3 { margin-bottom: 4px; }
.experience-card .role {
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 18px;
}
.experience-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}
.experience-card li + li { margin-top: 8px; }
.experience-themes-section { padding-top: 18px; }
.experience-themes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.experience-themes article {
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 26px;
  background: linear-gradient(180deg, #fff, #f8fafc);
  box-shadow: 0 10px 30px rgba(15, 23, 42, .035);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.experience-themes span {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--text);
  color: #fff;
  font-weight: 800;
  margin-bottom: 28px;
}
.experience-themes p { color: var(--muted); }
.experience-themes strong {
  margin-top: auto;
  color: var(--accent);
  font-size: 14px;
}
@media (max-width: 980px) {
  .experience-cards { grid-template-columns: repeat(2, 1fr); }
  .experience-themes { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .experience-cards, .experience-themes { grid-template-columns: 1fr; }
  .experience-themes article { min-height: auto; }
}
.experience-themes strong a { color: inherit; text-decoration: none; }
.experience-themes strong a:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }
