/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg:        #e9eef8;
  --bg-soft:   #dbe3f3;
  --paper:     #ffffff;
  --glass:     rgba(255, 255, 255, 0.6);
  --glass-2:   rgba(255, 255, 255, 0.35);
  --ink:       #0a142b;
  --ink-soft:  #2c3a55;
  --ink-mute:  #5c6b87;
  --accent:    #16255c;
  --accent-2:  #1d4fd8;
  --accent-ink:#ffffff;
  --line:      rgba(10, 20, 43, 0.12);

  --sans-display: "Sora", "Inter", system-ui, sans-serif;
  --sans-body:    "Inter", system-ui, sans-serif;

  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:     cubic-bezier(0.7, 0, 0.84, 0);
  --ease-soft:   cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  --nav-h: 92px;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  scroll-behavior: smooth;
}
body {
  font-family: var(--sans-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 {
  font-family: var(--sans-display);
  color: var(--ink);
  text-wrap: balance;
  line-height: 1.08;
  letter-spacing: -0.02em;
}
ul { list-style: none; padding: 0; }
::selection { background: var(--accent); color: #fff; }

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

/* =============================================================
   3. Utilities
   ============================================================= */
.container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 24px;
}

.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--ink); color: #fff;
  z-index: 9999; border-radius: 8px; font-weight: 500;
  transition: top .2s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

.eyebrow {
  font-family: var(--sans-display);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .5rem;
}

.section-title {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 700;
  margin-bottom: 2.5rem;
}

/* Reveal-on-scroll */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; }

/* =============================================================
   4. Typography helpers
   ============================================================= */
em {
  font-style: normal;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* =============================================================
   5. Components
   ============================================================= */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .9rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out), background .3s var(--ease-out);
  will-change: transform;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 10px 30px -8px rgba(37, 99, 235, .55);
}
.btn-primary:hover { box-shadow: 0 16px 38px -8px rgba(37, 99, 235, .65); }
.btn-ghost {
  background: var(--glass);
  color: var(--ink);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.btn-ghost:hover { background: #fff; }
.btn-sm { padding: .6rem 1.2rem; font-size: .85rem; }

/* Glass cards */
.glass-card {
  background: var(--glass);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 24px;
  padding: 2.2rem;
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 20px 50px -24px rgba(15, 27, 45, .18);
}
@supports not (backdrop-filter: blur(1px)) {
  .glass-card { background: rgba(255,255,255,0.92); }
}

/* =============================================================
   6. Mesh gradient background
   ============================================================= */
.mesh-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(at 15% 20%, rgba(29, 79, 216, .35) 0%, transparent 55%),
    radial-gradient(at 85% 15%, rgba(22, 37, 92, .4) 0%, transparent 50%),
    radial-gradient(at 50% 85%, rgba(37, 68, 173, .32) 0%, transparent 55%),
    var(--bg);
  filter: blur(40px) saturate(140%);
  animation: meshDrift 34s ease-in-out infinite;
}
@keyframes meshDrift {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50%      { transform: scale(1.15) rotate(6deg); }
}

/* =============================================================
   7. Nav
   ============================================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: background .35s var(--ease-out), box-shadow .35s var(--ease-out), border-color .35s var(--ease-out);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 30px -20px rgba(15,27,45,.3);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-brand { display: flex; align-items: center; }

.logo-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(155deg, #0a1130, #0d1a44);
  border-radius: 6px;
  box-shadow: 0 10px 26px -10px rgba(6, 12, 32, .55), inset 0 0 0 1px rgba(255,255,255,.06);
}
.logo-chip-nav { padding: .4rem .85rem; }
.nav-logo { height: 52px; width: auto; display: block; }
@media (min-width: 540px) {
  :root { --nav-h: 104px; }
  .logo-chip-nav { padding: .5rem 1.05rem; }
  .nav-logo { height: 66px; }
}
@media (min-width: 960px) {
  :root { --nav-h: 116px; }
  .nav-logo { height: 76px; }
}

.logo-chip-footer { padding: .75rem 1.5rem; margin-bottom: .5rem; }
.footer-logo { height: 78px; width: auto; display: block; }
@media (min-width: 540px) {
  .footer-logo { height: 96px; }
}

.logo-chip-contact {
  padding: .85rem 1.7rem;
  margin-bottom: 1.6rem;
}
.logo-chip-contact img { height: 84px; width: auto; display: block; }
@media (min-width: 540px) {
  .logo-chip-contact img { height: 108px; }
}

.nav-links {
  display: none;
  gap: 1.8rem;
  margin-inline: auto;
}
.nav-links a {
  position: relative;
  font-weight: 500;
  font-size: .95rem;
  color: var(--ink-soft);
}
.nav-links a span { position: relative; display: inline-block; }
.nav-links a span::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -4px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: right .35s var(--ease-out);
}
.nav-links a:hover span::after { right: 0; }
.nav-links a:hover { color: var(--ink); }

.nav-cta { display: none; }

.nav-toggle {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
}
.nav-toggle span {
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .3s var(--ease-out), opacity .3s var(--ease-out);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile {
  position: fixed;
  top: var(--nav-h); left: 0; right: 0;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 1.2rem 24px 1.8rem;
  gap: 1rem;
  transform: translateY(-12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease-out), transform .3s var(--ease-out);
}
.nav-mobile.is-open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.nav-mobile a { font-weight: 600; font-size: 1.05rem; color: var(--ink); padding: .3rem 0; }

/* =============================================================
   8. Sections
   ============================================================= */
.section {
  padding: 6.5rem 0;
  position: relative;
}
.section-alt { background: rgba(255,255,255,.4); }

/* --- Hero --- */
.hero {
  min-height: 92vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
}
.hero-inner { max-width: 760px; }
.kicker {
  font-family: var(--sans-display);
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .04em;
  color: var(--accent);
  margin-bottom: 1.2rem;
}
.hero-title {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 800;
  margin-bottom: 1.5rem;
}
.hero-sub {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  max-width: 56ch;
  margin-bottom: 2.4rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; }

/* --- Skills --- */
.skills-grid {
  display: grid;
  gap: 1.6rem;
  grid-template-columns: 1fr;
}
.skill-card { transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out); }
.skill-card:hover { transform: translateY(-6px); box-shadow: 0 30px 60px -28px rgba(15,27,45,.28); }
.skill-icon {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(14,165,233,.12));
  color: var(--accent);
  margin-bottom: 1.4rem;
}
.skill-icon svg { width: 28px; height: 28px; }
.skill-card h3 { font-size: 1.35rem; margin-bottom: .7rem; }
.skill-card > p { margin-bottom: 1.2rem; }
.skill-list li {
  position: relative;
  padding-left: 1.4rem;
  font-size: .95rem;
  color: var(--ink-soft);
  margin-bottom: .55rem;
}
.skill-list li::before {
  content: "";
  position: absolute; left: 0; top: .55em;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

/* --- About --- */
.about-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}
.about-photo-frame {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  max-width: 380px;
  margin-inline: auto;
  box-shadow: 0 40px 70px -30px rgba(15,27,45,.35);
  animation: floatY 7s ease-in-out infinite;
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
.about-lead { font-size: 1.15rem; color: var(--ink); margin-bottom: 1.1rem; }
.about-copy p { margin-bottom: 1.1rem; }
.about-tags {
  display: flex; flex-wrap: wrap; gap: .6rem;
  margin-top: 1.6rem;
}
.about-tags span {
  padding: .5rem 1rem;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line);
  font-size: .85rem;
  font-weight: 500;
  color: var(--ink-soft);
  backdrop-filter: blur(10px);
}

/* --- Project --- */
.project-card { max-width: 820px; }
.project-title { margin-bottom: .9rem; }
.project-lead { margin-bottom: 2rem; font-size: 1.1rem; }
.project-points {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--line);
  padding-top: 1.6rem;
}
.project-points div { display: flex; flex-direction: column; gap: .3rem; }
.project-points strong { color: var(--ink); font-family: var(--sans-display); }
.project-points span { font-size: .92rem; color: var(--ink-mute); }

/* --- Contact --- */
.section-contact { padding-bottom: 8rem; }
.contact-card { text-align: center; max-width: 720px; margin-inline: auto; }
.contact-lead { max-width: 44ch; margin: 0 auto 2.2rem; }
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.contact-link {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: 1.2rem 1.6rem;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out), border-color .35s var(--ease-out);
}
.contact-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px -20px rgba(37,99,235,.35);
  border-color: rgba(37,99,235,.35);
}
.contact-link-label {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
}
.contact-link-value {
  font-family: var(--sans-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}

/* =============================================================
   9. Footer
   ============================================================= */
.footer {
  padding: 2.6rem 0;
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.6);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: .8rem;
  text-align: center;
}
.footer-logo { opacity: .95; }
.footer p { font-size: .85rem; color: var(--ink-mute); }

/* =============================================================
   10. Responsive
   ============================================================= */
@media (min-width: 720px) {
  .about-grid { grid-template-columns: 0.85fr 1.15fr; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .project-points { grid-template-columns: repeat(3, 1fr); }
  .contact-links { flex-direction: row; }
  .contact-link { flex: 1; }
}

@media (min-width: 960px) {
  .nav-links { display: flex; }
  .nav-cta { display: inline-flex; }
  .nav-toggle { display: none; }
}

/* =============================================================
   11. Reduced motion — only truly intrusive effects
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .mesh-bg { animation: none; }
  .about-photo-frame { animation: none; }
}
