/* =========================================================
   Saina — personal portfolio
   Tech-forward, academic, minimalist. Mobile-first.
   ========================================================= */

:root {
  --bg: #0A1628;
  --bg-2: #0C1A31;
  --surface: #0F1F3A;
  --surface-2: #152A4A;
  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.22);
  --text: #E6EEF8;
  --text-dim: #94A3B8;
  --text-muted: #64748B;
  --accent: #3B82F6;
  --accent-hi: #60A5FA;
  --accent-glow: rgba(59, 130, 246, 0.35);
  --emerald: #10B981;
  --warn: #F59E0B;
  --danger: #EF4444;

  --radius: 14px;
  --radius-lg: 22px;
  --shadow-1: 0 1px 2px rgba(0,0,0,.25), 0 8px 24px -12px rgba(0,0,0,.45);
  --shadow-2: 0 30px 60px -30px rgba(0,0,0,.6);

  --maxw: 1180px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  background-image:
    radial-gradient(1200px 600px at 90% -10%, rgba(59,130,246,0.14), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(16,185,129,0.08), transparent 60%);
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--accent-hi); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* --------- Skip + header --------- */
.skip-link {
  position: absolute; left: -999px; top: 8px;
  background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100;
}
.skip-link:focus { left: 8px; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(160%) blur(12px);
  background: rgba(10, 22, 40, 0.72);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background .2s ease;
}
.site-header[data-scrolled="true"] {
  border-bottom-color: var(--border);
  background: rgba(10, 22, 40, 0.9);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 600; letter-spacing: -0.01em;
}
.brand:hover { color: var(--text); }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #7C3AED 120%);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 0 30px var(--accent-glow);
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 5px; border-radius: 5px;
  background: var(--bg);
}
.brand-name { font-size: 15px; }

.nav-links {
  list-style: none; display: flex; gap: 28px; padding: 0; margin: 0; align-items: center;
}
.nav-links a {
  color: var(--text-dim); font-size: 14px; font-weight: 500;
  padding: 8px 0; position: relative;
}
.nav-links a:hover { color: var(--text); }
.nav-cta {
  color: var(--text) !important;
  border: 1px solid var(--border-strong);
  padding: 8px 16px !important;
  border-radius: 999px;
  transition: all .2s;
}
.nav-cta:hover { background: var(--accent); border-color: var(--accent); }

.nav-toggle {
  display: none; background: transparent; border: 0; cursor: pointer;
  width: 44px; height: 44px; padding: 10px; flex-direction: column; gap: 5px;
}
.nav-toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s; }

@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; right: 20px; top: 72px;
    flex-direction: column; gap: 8px; align-items: stretch;
    background: var(--surface); padding: 16px; border-radius: 14px;
    border: 1px solid var(--border);
    min-width: 220px; display: none;
  }
  .nav-links[data-open="true"] { display: flex; }
  .nav-links a { padding: 10px 12px; }
}

/* --------- Hero --------- */
.hero { padding: 64px 0 48px; position: relative; overflow: hidden; }
.hero-grid {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center;
}
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 40px; } }

.eyebrow {
  color: var(--text-dim); font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.16em; text-transform: uppercase; margin: 0 0 14px;
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.hero-headline {
  font-size: clamp(34px, 5.6vw, 58px);
  line-height: 1.05; letter-spacing: -0.02em;
  margin: 0 0 20px; font-weight: 700;
}
.hero-headline .hl { color: var(--text); }
.hero-headline .accent { color: var(--accent-hi); }
.hero-headline .sep { color: var(--text-muted); margin: 0 6px; font-weight: 300; }

.hero-tagline {
  color: var(--text-dim); font-size: clamp(16px, 1.6vw, 18px); max-width: 560px;
  margin: 0 0 28px;
}

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 14px;
  border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: transform .15s, background .2s, border-color .2s, color .2s;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 24px -8px var(--accent-glow); }
.btn-primary:hover { background: var(--accent-hi); color: #fff; transform: translateY(-1px); }
.btn-ghost { color: var(--text); border-color: var(--border-strong); background: transparent; }
.btn-ghost:hover { background: var(--surface); border-color: var(--text-dim); color: var(--text); }

.hero-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px;
  margin: 42px 0 0; padding: 22px 24px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
}
.hero-stats div { margin: 0; }
.hero-stats dt { color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; font-family: var(--mono); }
.hero-stats dd { margin: 6px 0 0; color: var(--text); font-weight: 600; font-size: 18px; }

.hero-visual { position: relative; aspect-ratio: 1/1; }
.portrait-frame {
  position: relative; z-index: 2; width: 100%; height: 100%;
  border-radius: var(--radius-lg); overflow: hidden;
  border: 0;
  box-shadow: none;
  background: transparent;
}
.portrait-frame img {
  width: 100%; height: 100%; object-fit: cover; object-position: top center;
  filter: saturate(1.02);
}
.portrait-badge {
  position: absolute; left: 16px; bottom: 16px; z-index: 3;
  background: rgba(15, 31, 58, 0.82); backdrop-filter: blur(8px);
  color: var(--text); border: 1px solid var(--border-strong);
  padding: 10px 14px; border-radius: 999px; font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 10px;
}
.portrait-badge .dot { width: 8px; height: 8px; background: var(--emerald); border-radius: 50%; box-shadow: 0 0 10px rgba(16,185,129,.6); }

.hero-bg-grid {
  position: absolute; inset: -30px; z-index: 1;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(300px 320px at 70% 50%, #000 30%, transparent 75%);
}

/* --------- Section scaffolding --------- */
.section { padding: 96px 0; position: relative; }
.section-alt { background: linear-gradient(180deg, transparent, rgba(15,31,58,0.6), transparent); }
.section-narrow { padding: 72px 0; }
.section-head { max-width: 720px; margin: 0 0 48px; }
.section-head h2 { margin: 0 0 12px; font-size: clamp(28px, 3.6vw, 42px); letter-spacing: -0.02em; line-height: 1.1; font-weight: 700; }
.section-sub { color: var(--text-dim); font-size: 17px; margin: 0; }
.section-cta { margin-top: 40px; }

/* --------- Timeline --------- */
.timeline-tabs {
  display: inline-flex; padding: 4px; gap: 4px; border: 1px solid var(--border);
  background: var(--surface); border-radius: 999px; margin-bottom: 28px;
}
.t-tab {
  background: transparent; border: 0; color: var(--text-dim);
  padding: 8px 18px; border-radius: 999px; cursor: pointer; font-weight: 500; font-size: 14px;
  transition: background .2s, color .2s;
}
.t-tab.is-active { background: var(--accent); color: #fff; box-shadow: 0 6px 18px -8px var(--accent-glow); }

.t-panel { display: none; }
.t-panel.is-active { display: block; }

.timeline {
  list-style: none; margin: 0; padding: 0 0 0 28px;
  position: relative;
}
.timeline::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 10px;
  width: 1px; background: linear-gradient(180deg, var(--border-strong), transparent);
}
.t-item { position: relative; padding: 0 0 28px; }
.t-dot {
  position: absolute; left: -28px; top: 18px; width: 22px; height: 22px;
  border-radius: 50%; background: var(--bg); border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(59,130,246,0.12);
}
.t-past .t-dot { border-color: var(--text-muted); box-shadow: 0 0 0 4px rgba(100,116,139,0.12); }
.t-future .t-dot { border-color: var(--emerald); box-shadow: 0 0 0 4px rgba(16,185,129,0.14); }

.t-card {
  background: var(--surface); border: 1px solid var(--border);
  padding: 20px 22px; border-radius: var(--radius);
  transition: transform .15s, border-color .2s;
}
.t-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.t-period { color: var(--text-dim); font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 6px; }
.t-title { margin: 0 0 4px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.t-org { color: var(--text-dim); font-size: 14px; margin: 0 0 10px; }
.t-desc { color: var(--text-dim); margin: 0; font-size: 15px; }

/* --------- Achievement vault --------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filter {
  background: transparent; color: var(--text-dim); border: 1px solid var(--border);
  padding: 8px 16px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 500;
  transition: all .2s;
}
.filter:hover { color: var(--text); border-color: var(--border-strong); }
.filter.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }

.vault-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.vault-card {
  position: relative; padding: 22px 22px 18px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 8px;
  transition: transform .2s, border-color .2s;
}
.vault-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.vault-tag {
  align-self: flex-start; font-size: 11px; font-family: var(--mono);
  letter-spacing: .14em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; background: rgba(148,163,184,0.1); color: var(--text-dim);
}
.tag-academic { background: rgba(59,130,246,0.15); color: var(--accent-hi); }
.tag-extracurricular { background: rgba(16,185,129,0.14); color: #34D399; }
.tag-leadership { background: rgba(251,146,60,0.14); color: #FB923C; }
.tag-certification { background: rgba(139,92,246,0.14); color: #A78BFA; }

.vault-title { margin: 4px 0 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.vault-year { color: var(--text-muted); font-family: var(--mono); font-size: 12px; margin: 0; }
.vault-desc { color: var(--text-dim); font-size: 14px; margin: 0; }
.vault-link { font-size: 13px; margin-top: auto; }

/* --------- Posts --------- */
.posts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.posts-grid-wide { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.post-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 22px 20px; transition: transform .2s, border-color .2s;
}
.post-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.post-topic { color: var(--accent-hi); font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 10px; }
.post-title { margin: 0 0 8px; font-size: 19px; letter-spacing: -0.01em; }
.post-title a { color: var(--text); }
.post-title a:hover { color: var(--accent-hi); }
.post-excerpt { color: var(--text-dim); margin: 0 0 10px; font-size: 15px; }
.post-meta { color: var(--text-muted); font-size: 13px; margin: 0; }

.post-wrap { max-width: 760px; }
.post-h1 { font-size: clamp(30px, 4vw, 44px); letter-spacing: -0.02em; margin: 10px 0 14px; line-height: 1.1; }
.post-body { color: var(--text); font-size: 18px; line-height: 1.72; }
.post-body p { margin: 0 0 22px; }
.post-body h2 { margin: 40px 0 14px; font-size: 24px; }
.post-body h3 { margin: 28px 0 12px; font-size: 19px; }
.post-body blockquote { border-left: 3px solid var(--accent); padding: 4px 18px; color: var(--text-dim); margin: 22px 0; }
.post-body code { font-family: var(--mono); background: var(--surface); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.post-body pre { background: var(--surface); padding: 18px; border-radius: var(--radius); overflow: auto; border: 1px solid var(--border); }
.post-back { margin-top: 40px; }

/* --------- Skills --------- */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px; }
.skill-col-title {
  color: var(--text); font-size: 15px; letter-spacing: .04em; text-transform: uppercase;
  font-weight: 600; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.skill-list { list-style: none; margin: 0; padding: 0; }
.skill-row { margin: 0 0 18px; }
.skill-meta { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.skill-name { color: var(--text); font-weight: 500; font-size: 14px; }
.skill-pct { color: var(--text-dim); font-family: var(--mono); font-size: 12px; }
.skill-bar { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.skill-bar span {
  display: block; height: 100%; width: var(--lv, 0%);
  background: linear-gradient(90deg, var(--accent), var(--accent-hi));
  border-radius: 999px; transition: width 1.1s cubic-bezier(.22,.8,.28,1);
}

/* --------- Contact --------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; gap: 32px; } }
.connect-list { list-style: none; margin: 22px 0 0; padding: 0; }
.connect-list li { padding: 14px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 20px; color: var(--text); }
.connect-list li span { color: var(--text-dim); font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .14em; }

.contact-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px; display: grid; gap: 16px; }
.contact-form label { display: grid; gap: 6px; color: var(--text-dim); font-size: 13px; font-weight: 500; }
.contact-form input, .contact-form textarea {
  background: var(--bg-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; font-family: inherit; font-size: 15px;
  resize: vertical; transition: border-color .15s, box-shadow .15s;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(59,130,246,0.12); }

/* --------- Flash --------- */
.flash-wrap { padding-top: 24px; }
.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 8px; font-size: 14px; border: 1px solid transparent; }
.flash-success { background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.35); color: #6EE7B7; }
.flash-warning { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.35); color: #FCD34D; }
.flash-danger { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.35); color: #FCA5A5; }

/* --------- Footer --------- */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0 64px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; align-items: start; color: var(--text-dim); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand { margin: 0 0 4px; color: var(--text); font-weight: 600; }
.footer-tag { margin: 0; font-size: 14px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: var(--text-dim); font-size: 14px; }
.footer-links a:hover { color: var(--text); }
.footer-meta { font-size: 13px; color: var(--text-muted); }

.empty { color: var(--text-muted); font-style: italic; }

/* --------- Focus styles --------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* --------- Reveal animations --------- */
[data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s cubic-bezier(.22,.8,.28,1); }
[data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
