/* ============================================================
   Vinay B R — Portfolio
   Palette: deep navy/slate base + electric cyan/teal accents
   Dark by default; html.light switches to the light theme.
   ============================================================ */

:root {
  --bg: #020617;          /* slate-950 */
  --bg-alt: #0b1120;      /* between slate-950/900 */
  --panel: #0f172a;       /* slate-900 */
  --border: #1e293b;      /* slate-800 */
  --text: #e2e8f0;        /* slate-200 */
  --text-strong: #f8fafc; /* slate-50 */
  --muted: #94a3b8;       /* slate-400 */
  --accent: #22d3ee;      /* cyan-400 */
  --accent-strong: #67e8f9;
  --accent-text: #67e8f9; /* readable accent on dark */
  --accent-contrast: #062a33;
  --amber: #fbbf24;
  --grid-line: rgba(148, 163, 184, 0.06);
  --vignette: rgba(2, 6, 23, 0.92);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

html.light {
  --bg: #f8fafc;
  --bg-alt: #eef2f7;
  --panel: #ffffff;
  --border: #dbe3ee;
  --text: #334155;
  --text-strong: #0f172a;
  --muted: #64748b;
  --accent: #0891b2;      /* cyan-600 — contrast-safe on light */
  --accent-strong: #0e7490;
  --accent-text: #0e7490;
  --accent-contrast: #ffffff;
  --amber: #b45309;
  --grid-line: rgba(15, 23, 42, 0.05);
  --vignette: rgba(248, 250, 252, 0.9);
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand {
  font-family: "Space Grotesk", "Inter", ui-sans-serif, system-ui, sans-serif;
  color: var(--text-strong);
  line-height: 1.15;
}

a { color: var(--accent-text); }
::selection { background: rgba(34, 211, 238, 0.3); }

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

.muted { color: var(--muted); }

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: #062a33;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 1rem; }

/* ---------- Header / nav ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.7rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-strong);
}
.brand span { color: var(--accent); }

.nav-right { display: flex; align-items: center; gap: 0.4rem; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  list-style: none;
}
.nav-links a:not(.btn) {
  display: block;
  padding: 0.5rem 0.8rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-radius: 8px;
  transition: color 0.2s ease;
}
.nav-links a:not(.btn):hover { color: var(--accent-text); }
.nav-resume-item { margin-left: 0.5rem; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}
.icon-btn:hover { color: var(--text-strong); background: color-mix(in srgb, var(--border) 55%, transparent); }

/* theme toggle shows the icon of the mode you'd switch TO */
html:not(.light) .icon-moon { display: none; }
html.light .icon-sun { display: none; }

.menu-btn { display: none; }
.menu-btn .icon-close { display: none; }
.nav.open .menu-btn .icon-burger { display: none; }
.nav.open .menu-btn .icon-close { display: block; }

@media (max-width: 767px) {
  .menu-btn { display: inline-flex; }
  .nav { flex-wrap: wrap; }
  .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    order: 3;
    padding: 0.5rem 0 0.8rem;
    gap: 0.1rem;
  }
  .nav.open .nav-links { display: flex; }
  .nav-resume-item { margin: 0.4rem 0 0; }
  .nav-resume-item .btn { display: block; text-align: center; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.3rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) {
  .btn:hover { transform: none; }
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: 0 8px 24px rgba(34, 211, 238, 0.25);
}
html.light .btn-primary { box-shadow: 0 8px 24px rgba(8, 145, 178, 0.25); }
.btn-primary:hover { background: var(--accent-strong); }

.btn-outline {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--accent-text);
  background: transparent;
}
.btn-outline:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }

.btn-icon {
  padding: 0.75rem;
  border-color: var(--border);
  color: var(--muted);
  background: transparent;
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent-text); }

.btn-sm { padding: 0.5rem 0.95rem; font-size: 0.85rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--bg);
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
}

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 30%, var(--vignette) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
  padding: 6.5rem 1.25rem 0;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: end;
  gap: 1.5rem;
}

.hero-text {
  text-align: left;
  padding-bottom: 4rem;
}

.hero-photo {
  position: relative;
  align-self: end;
  justify-self: center;
  opacity: 0;
  animation: rise 0.8s ease-out 0.35s forwards;
}
.hero-photo::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 6%;
  width: 115%;
  height: 62%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at center,
    rgba(34, 211, 238, 0.22) 0%, transparent 68%);
  filter: blur(12px);
  pointer-events: none;
}
html.light .hero-photo::before {
  background: radial-gradient(ellipse at center,
    rgba(8, 145, 178, 0.18) 0%, transparent 68%);
}
.hero-photo img {
  position: relative;
  display: block;
  width: auto;
  max-height: min(76svh, 660px);
  filter: drop-shadow(0 14px 34px rgba(34, 211, 238, 0.18));
  -webkit-mask-image: linear-gradient(to bottom, #000 90%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 90%, transparent 100%);
}

@media (max-width: 860px) {
  .hero-content {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 0.5rem;
    padding-top: 5.5rem;
    text-align: center;
  }
  .hero-text {
    text-align: center;
    order: 2;
    padding-bottom: 3rem;
  }
  .hero-photo { order: 1; }
  .hero-photo img { max-height: 36svh; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-photo { animation: none; opacity: 1; }
}

.hero-eyebrow {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.hero h1 {
  margin-top: 1rem;
  font-size: clamp(2.8rem, 8vw, 4.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-title {
  margin-top: 0.9rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  font-weight: 600;
  color: var(--text);
}
.hero-title span { color: var(--accent); }

.hero-tagline {
  max-width: 42rem;
  margin: 1.2rem 0 0;
  font-size: 1.05rem;
  color: var(--muted);
}
@media (max-width: 860px) {
  .hero-tagline { margin: 1.2rem auto 0; }
}

.hero-ctas {
  margin-top: 2.4rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.8rem;
}
@media (max-width: 860px) {
  .hero-ctas { justify-content: center; }
}

/* ---------- Hero stats strip ---------- */
.hero-stats {
  margin-top: 2.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 2.2rem;
}
.stat { display: flex; flex-direction: column; }
.stat-num {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--accent-text);
  line-height: 1.2;
}
.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
@media (max-width: 860px) {
  .hero-stats { justify-content: center; gap: 0.8rem 1.6rem; }
}

.scroll-hint {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  margin-top: 4rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.scroll-hint:hover { color: var(--accent-text); }
.scroll-hint svg { animation: bounce 1.6s infinite; }
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-hint svg { animation: none; }
}

/* Staggered entrance for hero content */
.hero-text > * {
  opacity: 0;
  transform: translateY(22px);
  animation: rise 0.65s ease-out forwards;
}
.hero-text > *:nth-child(1) { animation-delay: 0.1s; }
.hero-text > *:nth-child(2) { animation-delay: 0.22s; }
.hero-text > *:nth-child(3) { animation-delay: 0.34s; }
.hero-text > *:nth-child(4) { animation-delay: 0.46s; }
.hero-text > *:nth-child(5) { animation-delay: 0.58s; }
.hero-text > *:nth-child(6) { animation-delay: 0.75s; }
.hero-text > *:nth-child(7) { animation-delay: 0.9s; }
@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-text > * { animation: none; opacity: 1; transform: none; }
}

/* ---------- Sections ---------- */
.section { padding: 5.5rem 1.25rem; }
.section-alt { background: var(--bg-alt); }

.container { max-width: 64rem; margin: 0 auto; }
.container-narrow { max-width: 52rem; }

.section-head .eyebrow {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.section-head h2 {
  margin-top: 0.5rem;
  font-size: clamp(1.7rem, 4.5vw, 2.4rem);
  font-weight: 700;
}
.rule {
  width: 3.5rem;
  height: 4px;
  margin-top: 1rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #2dd4bf);
}
.section-sub { margin-top: 1rem; color: var(--muted); }

/* ---------- Highlights (scannability for recruiters) ---------- */
/* Key skill / phrase: subtle marker-style highlight */
.hl {
  font-weight: 600;
  color: var(--text-strong);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border-radius: 4px;
  padding: 0.08em 0.28em;
  /* keep the highlight painted on every line when the phrase wraps */
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
/* Metric / number: bold accent so results pop out of bullets */
.hl-num {
  font-weight: 700;
  color: var(--accent-text);
  white-space: nowrap;
}

/* Scroll-reveal */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.reveal.in-view { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- About ---------- */
.about-grid {
  margin-top: 2.5rem;
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 3fr 2fr;
}
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
}
.about-text p + p { margin-top: 1rem; }
.about-text strong { color: var(--text-strong); }

.edu-card {
  margin-top: 1.5rem;
  padding: 1.1rem 1.25rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.92rem;
}
.edu-school { font-weight: 600; color: var(--text-strong); }

.focus h3 {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.focus-list { list-style: none; margin-top: 1.1rem; }
.focus-list li {
  position: relative;
  padding: 0.45rem 0 0.45rem 1.4rem;
  font-size: 0.93rem;
}
.focus-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.95rem;
  width: 8px; height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #2dd4bf);
}

/* ---------- Experience timeline ---------- */
.timeline {
  list-style: none;
  margin-top: 2.5rem;
  margin-left: 0.5rem;
  border-left: 2px solid var(--border);
}
.timeline-item {
  position: relative;
  padding: 0 0 3rem 2rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -9px; top: 0.45rem;
  width: 14px; height: 14px;
  border-radius: 999px;
  background: var(--bg);
  border: 3px solid var(--accent);
}

.timeline-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.9rem;
}
.timeline-head h3 { font-size: 1.3rem; font-weight: 700; }
.period { font-size: 0.88rem; font-weight: 600; color: var(--accent-text); }
.role { margin-top: 0.2rem; font-weight: 600; font-size: 0.98rem; }

.award-chip {
  display: inline-block;
  margin-top: 0.7rem;
  padding: 0.25rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--amber);
  background: color-mix(in srgb, var(--amber) 12%, transparent);
  border-radius: 999px;
}

.impact { list-style: none; margin-top: 1.1rem; }
.impact li {
  position: relative;
  padding: 0.35rem 0 0.35rem 1.3rem;
  font-size: 0.93rem;
  color: var(--muted);
}
html.light .impact li { color: #475569; }
.impact li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.95rem;
  width: 6px; height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 70%, transparent);
}

/* ---------- Skills ---------- */
.skills-grid {
  margin-top: 2.5rem;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 960px) { .skills-grid { grid-template-columns: 1fr; } }

.skill-card {
  padding: 1.5rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.skill-card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); transform: translateY(-3px); }
@media (prefers-reduced-motion: reduce) { .skill-card:hover { transform: none; } }

.skill-card h3 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.02rem;
  font-weight: 600;
}
.dot { width: 10px; height: 10px; border-radius: 999px; flex-shrink: 0; }
.dot-cyan { background: #22d3ee; }
.dot-teal { background: #2dd4bf; }
.dot-blue { background: #38bdf8; }

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.1rem;
}
.tags li {
  padding: 0.32rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.tags li:hover {
  border-color: var(--accent);
  color: var(--accent-text);
  transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) { .tags li:hover { transform: none; } }

/* Tag stagger on reveal */
.stagger li {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease-out, transform 0.45s ease-out,
              border-color 0.2s ease, color 0.2s ease;
  transition-delay: calc(var(--i, 0) * 35ms), calc(var(--i, 0) * 35ms), 0s, 0s;
}
.reveal.in-view .stagger li { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .stagger li { opacity: 1; transform: none; transition-delay: 0s; }
}

/* ---------- Projects ---------- */
.projects-grid {
  margin-top: 2.5rem;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 860px) { .projects-grid { grid-template-columns: 1fr; } }

.project-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.project-card:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  transform: translateY(-4px);
}
@media (prefers-reduced-motion: reduce) { .project-card:hover { transform: none; } }

.project-context {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.project-card h3 { margin-top: 0.5rem; font-size: 1.15rem; font-weight: 700; }
.project-card > p:not(.project-context):not(.placeholder) {
  margin-top: 0.7rem;
  font-size: 0.92rem;
  color: var(--muted);
  flex-grow: 1;
}
html.light .project-card > p:not(.project-context):not(.placeholder) { color: #475569; }
.project-card .tags { margin-top: 1rem; }

.placeholder {
  margin-top: 0.8rem;
  font-size: 0.78rem;
  font-style: italic;
  color: color-mix(in srgb, var(--muted) 75%, transparent);
}

/* ---------- Contact ---------- */
.contact-pitch {
  margin-top: 2.2rem;
  max-width: 44rem;
  font-size: 1.12rem;
  line-height: 1.7;
}
.contact-pitch em {
  font-style: normal;
  color: var(--accent-text);
  font-weight: 600;
}

.contact-links {
  margin-top: 2.2rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
}
@media (max-width: 640px) { .contact-links { grid-template-columns: 1fr; } }
.contact-links a {
  display: block;
  padding: 0.9rem 1.1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.92rem;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.contact-links a:hover { border-color: var(--accent); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .contact-links a:hover { transform: none; } }
.contact-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 0.15rem;
}
.contact-closing {
  margin-top: 2.8rem;
  text-align: center;
}
.contact-closing p:first-child {
  font-size: 1.02rem;
  color: var(--text);
  margin-bottom: 1.3rem;
}
.location { margin-top: 1.3rem; font-size: 0.85rem; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 2.2rem 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}
