/* =========================================================
   Sampreeth Miriyala — portfolio
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --max: 1120px;
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.22, 1, .36, 1);

  color-scheme: dark;

  --bg:            #0b1020;
  --bg-soft:       #10162c;
  --surface:       rgba(255, 255, 255, .038);
  --surface-hover: rgba(255, 255, 255, .062);
  --border:        rgba(255, 255, 255, .10);
  --border-strong: rgba(255, 255, 255, .18);

  --text:    #e8ecf6;
  --text-mid:#aab3c8;
  --text-dim:#7c869e;

  --accent:   #6ea8fe;
  --accent-2: #a78bfa;
  --accent-3: #34d399;

  --shadow: 0 18px 50px -18px rgba(0, 0, 0, .75);
  --glow-1: rgba(110, 168, 254, .30);
  --glow-2: rgba(167, 139, 250, .24);
  --grid-line: rgba(255, 255, 255, .035);
  --header-bg: rgba(11, 16, 32, .72);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { max-width: 100%; }
ul, ol { list-style: none; margin: 0; padding: 0; }
p { margin: 0 0 1rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.18; margin: 0; letter-spacing: -.022em; }

strong { color: var(--text); font-weight: 650; }

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

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: 24px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--accent); color: #fff; padding: 10px 18px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Background decoration ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 40%, transparent 100%);
}
.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(46rem 26rem at 12% -6%, var(--glow-1), transparent 65%),
    radial-gradient(40rem 24rem at 92% 8%, var(--glow-2), transparent 62%);
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: var(--header-bg);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--border); }

.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 13px; font-weight: 800; letter-spacing: .04em;
  box-shadow: 0 6px 18px -6px var(--glow-1);
}
.brand-text { font-size: 15px; letter-spacing: -.01em; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  display: block; padding: 8px 12px; border-radius: 8px;
  color: var(--text-mid); font-size: 14px; font-weight: 500;
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.nav-links a.active { color: var(--accent); background: var(--surface); }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; padding: 0 9px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; transition: transform .25s var(--ease), opacity .2s; }
.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); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 20px; border-radius: 11px;
  font-size: 14.5px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .25s var(--ease), background .2s, border-color .2s, color .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 10px 26px -10px var(--glow-1);
}
.btn-primary:hover { box-shadow: 0 16px 34px -10px var(--glow-1); }

.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-hover); border-color: var(--border-strong); }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center;
  padding-block: clamp(48px, 9vw, 104px) clamp(32px, 5vw, 56px);
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  margin: 0 0 22px; padding: 6px 14px 6px 11px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  font-size: 12.5px; font-weight: 600; letter-spacing: .012em; color: var(--text-mid);
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-3); box-shadow: 0 0 0 0 var(--accent-3);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); }
  70%  { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.hero h1 { font-size: clamp(2.1rem, 5.2vw, 3.65rem); font-weight: 800; letter-spacing: -.035em; margin-bottom: 22px; }
.grad {
  background: linear-gradient(110deg, var(--accent) 8%, var(--accent-2) 55%, var(--accent-3) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.lede { font-size: clamp(1rem, 1.6vw, 1.12rem); color: var(--text-mid); max-width: 58ch; margin-bottom: 30px; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 30px; }

.social { display: flex; gap: 10px; }
.social a {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--border); border-radius: 11px; background: var(--surface); color: var(--text-mid);
  transition: color .2s, border-color .2s, transform .2s var(--ease), background .2s;
}
.social a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-3px); background: var(--surface-hover); }
.social svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.social svg.fill, .ext svg.fill { fill: currentColor; stroke: none; }

/* Terminal card */
.hero-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-soft); box-shadow: var(--shadow); overflow: hidden;
}
.term-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 12px 15px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--border-strong); }
.term-bar i:nth-child(1) { background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; }
.term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: 8px; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-dim); }

.term { margin: 0; padding: 20px 18px; overflow-x: auto; }
.term code { font-family: var(--font-mono); font-size: 12.6px; line-height: 1.85; color: var(--text-mid); white-space: pre; }
.c-key { color: var(--accent); }
.c-num { color: var(--accent-3); }
.c-str { color: var(--accent-2); }
.c-cm  { color: var(--text-dim); font-style: italic; }

/* ---------- Metrics ---------- */
.metrics {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px;
  margin-block: 24px 8px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--border); overflow: hidden;
}
.metrics li { display: grid; gap: 4px; padding: 24px 16px; text-align: center; background: var(--bg); transition: background .2s; }
.metrics li:hover { background: var(--bg-soft); }
.metric-num { font-size: clamp(1.35rem, 2.6vw, 1.85rem); font-weight: 800; letter-spacing: -.03em; color: var(--text); font-variant-numeric: tabular-nums; }
.metric-label { font-size: 12px; color: var(--text-dim); letter-spacing: .015em; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(56px, 8vw, 96px); }

.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 36px; }
.section-index { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--accent); }
.section-head h2 { font-size: clamp(1.6rem, 3.2vw, 2.15rem); font-weight: 750; }
.section-head::after {
  content: ""; flex: 1; height: 1px; margin-left: 6px;
  background: linear-gradient(90deg, var(--border), transparent);
}

/* ---------- Card ---------- */
.card {
  padding: 24px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
  transition: transform .28s var(--ease), border-color .28s var(--ease), box-shadow .28s var(--ease), background .28s;
}
.card-title { font-size: 15.5px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 9px; }
.ico { color: var(--accent); font-family: var(--font-mono); font-size: 14px; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.25fr .95fr; gap: 32px; align-items: start; }
.about-copy p { color: var(--text-mid); }
.about-cta { padding-top: 6px; border-top: 1px solid var(--border); margin-top: 22px; padding-top: 18px; font-size: 15px; }
.about-side { display: grid; gap: 18px; }

.ticks { display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 24px; font-size: 14.3px; color: var(--text-mid); }
.ticks li::before {
  content: "▹"; position: absolute; left: 0; top: -1px; color: var(--accent); font-size: 13px;
}

.edu-school { font-weight: 650; margin-bottom: 2px; }
.edu-meta { font-size: 13.6px; color: var(--text-dim); margin-bottom: 2px; }
.edu-gpa { margin: 10px 0 0; font-size: 14px; color: var(--accent-3); }

/* ---------- Timeline ---------- */
.timeline { position: relative; display: grid; gap: 26px; padding-left: 30px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2), transparent);
  opacity: .45; border-radius: 2px;
}
.tl-item { position: relative; }
.tl-dot {
  position: absolute; left: -30px; top: 26px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px var(--bg), 0 0 14px var(--glow-1);
}
.tl-item:first-child .tl-dot { border-color: var(--accent-3); }

.tl-body:hover { transform: translateX(4px); border-color: var(--border-strong); box-shadow: var(--shadow); }

.tl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.role { font-size: 17px; font-weight: 700; }
.at { color: var(--text-dim); font-weight: 400; margin-inline: 2px; }
.org { color: var(--accent); font-weight: 650; }
.tl-meta { margin: 5px 0 0; font-size: 13.2px; color: var(--text-dim); font-family: var(--font-mono); }

.chip {
  flex-shrink: 0; padding: 4px 11px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); font-size: 11.5px; font-weight: 600; color: var(--text-dim); letter-spacing: .02em;
}
.chip-live { color: var(--accent-3); border-color: color-mix(in srgb, var(--accent-3) 40%, transparent); }

.bullets { display: grid; gap: 11px; margin-bottom: 18px; }
.bullets li { position: relative; padding-left: 22px; font-size: 14.6px; color: var(--text-mid); }
.bullets li::before { content: "▹"; position: absolute; left: 0; top: 0; color: var(--accent); }

/* ---------- Tags ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tags li {
  padding: 4px 11px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--surface);
  font-family: var(--font-mono); font-size: 11.6px; color: var(--text-dim);
  transition: color .2s, border-color .2s, background .2s;
}
.tags li:hover { color: var(--accent); border-color: var(--accent); background: var(--surface-hover); }
.tags-lg li { font-size: 12.2px; padding: 5px 12px; }

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.skills-grid .card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow); }

/* ---------- Projects ---------- */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 18px; }
.project { display: flex; flex-direction: column; }
.project:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.project-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.folder svg { width: 34px; height: 34px; fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; }
.ext { color: var(--text-dim); display: grid; place-items: center; transition: color .2s, transform .2s var(--ease); }
.ext:hover { color: var(--accent); transform: translateY(-2px); }
.ext svg { width: 19px; height: 19px; }
.project-title { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.project-desc { font-size: 14.3px; color: var(--text-mid); flex: 1; }

/* ---------- Achievements ---------- */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.ach { text-align: center; }
.ach:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.ach-ico { display: block; font-size: 26px; color: var(--accent); margin-bottom: 8px; }
.ach .card-title { justify-content: center; margin-bottom: 8px; }
.ach p { font-size: 13.8px; color: var(--text-mid); margin: 0; }

/* ---------- Contact ---------- */
.contact {
  text-align: center; padding: clamp(40px, 6vw, 64px) 28px;
  border: 1px solid var(--border); border-radius: 22px;
  background:
    radial-gradient(30rem 16rem at 50% -20%, var(--glow-1), transparent 70%),
    var(--surface);
}
.contact .section-index { display: block; margin-bottom: 10px; }
.contact h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; margin-bottom: 14px; }
.contact-lede { max-width: 56ch; margin: 0 auto 30px; color: var(--text-mid); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding-block: 26px; flex-wrap: wrap;
}
.footer-inner p { margin: 0; font-size: 13.2px; color: var(--text-dim); }
.built { font-family: var(--font-mono); font-size: 12px !important; }
.to-top {
  display: grid; place-items: center; width: 36px; height: 36px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  color: var(--text-mid); font-size: 16px;
  transition: color .2s, border-color .2s, transform .2s var(--ease);
}
.to-top:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-3px); text-decoration: none; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; gap: 40px; }
  .hero-card { order: 2; }
  .about-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(3, 1fr); }
  .br-lg { display: none; }
}

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 14px 20px 20px;
    background: var(--bg-soft); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity .22s var(--ease), transform .22s var(--ease);
  }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 11px 12px; font-size: 15px; }
  .brand-text { display: none; }
}

@media (max-width: 560px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .container { padding-inline: 18px; }
  .timeline { padding-left: 22px; }
  .tl-dot { left: -22px; width: 13px; height: 13px; }
  .card { padding: 20px 18px; }
  .footer-inner { justify-content: center; text-align: center; }
}

/* ---------- Motion / print ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .bg-grid, .bg-glow, .hero-actions, .social, .contact-actions, .to-top { display: none !important; }
  body { background: #fff; color: #000; }
  .reveal { opacity: 1; transform: none; }
  .card { border: 1px solid #ccc; break-inside: avoid; }
}
