:root {
  --bg: #fbfaf8;
  --bg-alt: #f3efe9;
  --surface: #ffffff;
  --text: #1c1917;
  --muted: #6b635b;
  --border: #e7e1d9;
  --accent: #d97706;
  --accent-2: #f59e0b;
  --accent-soft: rgba(217, 119, 6, 0.1);
  --shadow: 0 10px 30px -12px rgba(28, 25, 23, 0.18);
  --radius: 16px;
  --font: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0f0e0d;
  --bg-alt: #171513;
  --surface: #1c1a18;
  --text: #f5f2ee;
  --muted: #a39b92;
  --border: #2c2925;
  --accent: #f59e0b;
  --accent-2: #fbbf24;
  --accent-soft: rgba(245, 158, 11, 0.12);
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0e0d;
    --bg-alt: #171513;
    --surface: #1c1a18;
    --text: #f5f2ee;
    --muted: #a39b92;
    --border: #2c2925;
    --accent: #f59e0b;
    --accent-2: #fbbf24;
    --accent-soft: rgba(245, 158, 11, 0.12);
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.accent { color: var(--accent); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em; }
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 32px; }
.nav-links a { font-size: .95rem; color: var(--muted); font-weight: 500; transition: color .2s; position: relative; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px;
  background: var(--accent); border-radius: 2px;
}
.nav-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); cursor: pointer; transition: border-color .2s, transform .2s;
}
.icon-btn:hover { border-color: var(--accent); }
.menu-btn { display: none; }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 24px; border-radius: 12px; font-weight: 600; font-size: .95rem;
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 20px -8px var(--accent); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -8px var(--accent); }
.btn-ghost { border-color: var(--border); background: var(--surface); }
.btn-ghost:hover { border-color: var(--accent); transform: translateY(-2px); }

/* ---------- Hero ---------- */
.hero { padding: 150px 0 90px; position: relative; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(600px 400px at 85% 20%, var(--accent-soft), transparent 70%),
    radial-gradient(500px 300px at 10% 80%, var(--accent-soft), transparent 70%);
}
.hero-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 64px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .85rem; font-weight: 500; color: var(--muted);
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  margin-bottom: 24px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.18); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(34,197,94,0); } }
.hero-role {
  font-family: var(--mono); font-size: .9rem; font-weight: 500; color: var(--accent);
  text-transform: uppercase; letter-spacing: .12em; margin-bottom: 10px;
}
h1 { font-size: clamp(2.6rem, 6.5vw, 4.4rem); line-height: 1.05; letter-spacing: -0.04em; font-weight: 800; margin-bottom: 16px; }
.tagline {
  font-size: clamp(1.25rem, 2.4vw, 1.6rem); line-height: 1.35; font-weight: 600;
  letter-spacing: -0.02em; color: var(--text); max-width: 560px;
  padding-left: 16px; border-left: 3px solid var(--accent); margin-bottom: 22px;
}
.lead { font-size: 1.12rem; color: var(--muted); max-width: 580px; margin-bottom: 32px; }
.lead strong { color: var(--text); }
.cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 36px; }
.platforms { list-style: none; display: flex; gap: 10px; flex-wrap: wrap; }
.platforms li {
  font-family: var(--mono); font-size: .8rem; color: var(--muted);
  padding: 4px 12px; border-radius: 6px; background: var(--bg-alt); border: 1px solid var(--border);
}

.hero-photo { position: relative; justify-self: center; }
.photo-frame {
  width: 320px; aspect-ratio: 4/5; border-radius: 28px; position: relative; overflow: hidden;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow);
  display: grid; place-items: center;
}
.photo-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 52% 30%; z-index: 1; }
.initials { font-size: 6rem; font-weight: 800; color: rgba(255,255,255,.9); letter-spacing: -0.04em; }
.stat-card {
  position: absolute; z-index: 2; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; line-height: 1.2;
  animation: float 6s ease-in-out infinite;
}
.stat-card b { font-size: 1.5rem; color: var(--accent); }
.stat-card span { font-size: .78rem; color: var(--muted); }
.s1 { left: -40px; bottom: 40px; }
.s2 { right: -30px; top: 36px; animation-delay: -3s; }
@keyframes float { 50% { transform: translateY(-10px); } }

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section:nth-of-type(odd) { background: var(--bg-alt); }
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -0.03em; font-weight: 800;
  margin-bottom: 48px; display: flex; align-items: baseline; gap: 14px;
}
.section-title span { font-family: var(--mono); font-size: .95rem; color: var(--accent); font-weight: 500; }

/* About */
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; }
.about-grid p { color: var(--muted); font-size: 1.05rem; margin-bottom: 18px; }
.about-grid p strong { color: var(--text); }
.highlights { list-style: none; display: grid; gap: 14px; }
.highlights li {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; display: grid; gap: 4px; border-left: 3px solid var(--accent);
}
.highlights b { font-size: .95rem; }
.highlights span { color: var(--muted); font-size: .92rem; }

/* Timeline */
.timeline { list-style: none; position: relative; }
.timeline::before { content: ""; position: absolute; left: 200px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.timeline > li { display: grid; grid-template-columns: 200px 1fr; gap: 40px; padding-bottom: 44px; position: relative; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before {
  content: ""; position: absolute; left: 194px; top: 6px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent);
}
.tl-meta { text-align: right; padding-right: 24px; }
.date { font-family: var(--mono); font-size: .85rem; color: var(--muted); }
.tl-body h3 { font-size: 1.2rem; letter-spacing: -0.01em; }
.company { color: var(--accent); font-weight: 600; font-size: .95rem; margin-bottom: 12px; }
.tl-body ul { padding-left: 18px; color: var(--muted); display: grid; gap: 6px; }
.tl-body li::marker { color: var(--accent); }

/* Projects */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin: -20px 0 32px; }
.chip {
  font: 500 .88rem var(--font); padding: 8px 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); transition: all .2s;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 26px;
  display: flex; flex-direction: column; gap: 16px;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.card.hidden { display: none; }
.card-head { display: flex; align-items: center; gap: 14px; }
.card-head > div:nth-child(2) { flex: 1; }
.app-icon {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.05rem;
  box-shadow: 0 6px 14px -6px var(--c1);
}
.card h3 { font-size: 1.15rem; line-height: 1.3; }
.role { font-size: .85rem; color: var(--muted); }
.card-link {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px;
  border: 1px solid var(--border); color: var(--muted); font-size: 1.05rem; transition: all .2s;
}
.card-link:hover { color: #fff; background: var(--accent); border-color: var(--accent); }
.card > p { color: var(--muted); font-size: .95rem; }
.points { list-style: none; display: grid; gap: 7px; font-size: .9rem; }
.points li { padding-left: 20px; position: relative; }
.points li::before { content: "▹"; position: absolute; left: 0; color: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.tags span {
  font-family: var(--mono); font-size: .74rem; padding: 3px 10px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent);
}

.store-links { display: flex; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 16px; }
.store-links a {
  flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 14px; border-radius: 10px; font-size: .86rem; font-weight: 600;
  background: var(--text); color: var(--bg); transition: transform .2s, opacity .2s;
}
.store-links a:hover { transform: translateY(-2px); opacity: .88; }

.region-note {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border-top: 1px solid var(--border); padding-top: 16px;
  font-size: .85rem; font-weight: 500; color: var(--muted);
}
.region-note svg { color: var(--accent); }
.store-links, .region-note { margin-top: auto; } /* keep links/notes pinned to the card bottom */
.store-links + .region-note { border-top: 0; padding-top: 0; margin-top: -6px; }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.skill-col { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 28px; }
.skill-col h3 { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; margin-bottom: 18px; }
.pf { width: 12px; height: 12px; border-radius: 4px; }
.pf.android { background: #3ddc84; }
.pf.ios { background: #0a84ff; }
.pf.flutter { background: #02569b; box-shadow: inset 0 0 0 3px #54c5f8; }
.skill-col ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.skill-col li {
  font-size: .86rem; padding: 6px 10px; border-radius: 8px;
  background: var(--bg-alt); border: 1px solid var(--border);
}
.edu {
  margin-top: 32px; display: flex; gap: 20px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 24px 28px;
}
.edu-icon { font-size: 2rem; width: 60px; height: 60px; display: grid; place-items: center; border-radius: 14px; background: var(--accent-soft); flex-shrink: 0; }
.edu h3 { font-size: 1.05rem; }
.edu p { color: var(--muted); }
.edu-link { color: var(--accent); font-weight: 500; white-space: nowrap; }
.edu-link:hover { text-decoration: underline; }

/* Contact */
.contact-card {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center;
  padding: 56px; border-radius: 24px; position: relative; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.contact-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.contact-intro h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); line-height: 1.2; letter-spacing: -0.03em; margin-bottom: 16px; }
.contact-intro p { color: var(--muted); margin-bottom: 28px; max-width: 460px; }
.contact-list { list-style: none; display: grid; gap: 14px; }
.contact-list a, .contact-list div {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 18px; border-radius: 14px;
  background: var(--bg-alt); border: 1px solid var(--border);
  transition: border-color .2s, transform .2s;
}
.contact-list a:hover { border-color: var(--accent); transform: translateX(4px); }
.contact-list .social-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-list .social-row a:hover { transform: translateY(-2px); }
.ci-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.ci-text { display: flex; flex-direction: column; line-height: 1.35; font-weight: 600; font-size: .95rem; min-width: 0; overflow-wrap: anywhere; }
.ci-text small { font-weight: 500; font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

.footer { padding: 32px 0; text-align: center; color: var(--muted); font-size: .88rem; border-top: 1px solid var(--border); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .stat-card, .dot { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1060px) {
  .skills { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .hero { padding-top: 120px; }
  .hero-inner { grid-template-columns: 1fr; gap: 56px; }
  .hero-photo { order: -1; }
  .photo-frame { width: 240px; }
  .s1 { left: -50px; } .s2 { right: -50px; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .skills { grid-template-columns: 1fr; }
  .contact-card { grid-template-columns: 1fr; gap: 32px; padding: 40px 28px; }
  .timeline::before { left: 6px; }
  .timeline > li { grid-template-columns: 1fr; gap: 6px; padding-left: 36px; }
  .timeline > li::before { left: 0; }
  .tl-meta { text-align: left; padding: 0; }

  .menu-btn { display: grid; }
  .nav-links {
    position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav-links.open { max-height: 320px; }
  .nav-links a { padding: 14px 24px; }
  .nav-links a.active::after { display: none; }
}
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .section { padding: 72px 0; }
  .projects { grid-template-columns: 1fr; }
  .s1 { left: -24px; } .s2 { right: -24px; }
  .btn { width: 100%; justify-content: center; }
  .contact-card { padding: 32px 20px; }
  .edu { flex-direction: column; align-items: flex-start; }
}
