/* ==========================================================================
   Sreekar Kakumani — portfolio
   NES.css pixel styling on a deep-navy palette. 60/30/10 color rule:
   60% bg navy, 30% surface/mid structure, 10% cream accents.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --color-bg:       #111844;   /* deep navy — primary background */
  --color-surface:  #1a2460;   /* slightly lighter navy — card/container bg */
  --color-mid:      #4B5694;   /* medium navy-blue — borders, dividers, secondary UI */
  --color-muted:    #7288AE;   /* muted blue-slate — muted text, secondary labels */
  --color-cream:    #EAE0CF;   /* warm cream — primary text, headings */
  --color-accent:   #EAE0CF;   /* cream as the ONE accent (pixel glow effect) */

  /* Tint of muted toward cream (70/30 mix) — used ONLY for secondary text
     sitting on --color-surface, where raw muted lands at ~4.0:1 and misses
     WCAG AA (4.5:1). This tint measures ~5.6:1 on surface. */
  --color-muted-lift: #96A2B8;

  /* Motion tokens */
  --dur-micro:     150ms;
  --dur-standard:  250ms;
  --dur-celebrate: 500ms;
  --ease-out:      cubic-bezier(0, 0, 0.2, 1);
  --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px; /* clear the fixed nav on anchor jumps */
}

body {
  margin: 0;
  background-color: var(--color-bg) !important;
  color: var(--color-cream) !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden; /* AOS slide-in transforms must not create a horizontal scrollbar */
  overflow-x: clip;   /* where supported: also blocks programmatic/focus-driven panning */
}

::selection {
  background: var(--color-cream);
  color: var(--color-bg);
}

a { color: var(--color-cream); }

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--color-cream);
  outline-offset: 3px;
}

img, svg { max-width: 100%; }

h1, h2, h3 {
  font-family: 'Press Start 2P', monospace;
  line-height: 1.5;
  font-weight: 400;
}

/* Visually hidden (screen-reader only) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link — hidden until keyboard-focused */
.skip-link {
  position: absolute;
  top: -80px;
  left: 12px;
  z-index: 200;
  background: var(--color-surface);
  color: var(--color-cream);
  border: 4px solid var(--color-cream);
  padding: 10px 14px;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  text-decoration: none;
  transition: top var(--dur-micro) var(--ease-out);
}
.skip-link:focus { top: 12px; }

/* ==========================================================================
   NES.css theming overrides (dark navy palette)
   NES.css draws pixel borders with border-image SVGs, so recoloring means
   swapping the SVG fill — border-color alone doesn't reach them.
   ========================================================================== */

.nes-container {
  background-color: var(--color-surface) !important;
  border-color: var(--color-mid) !important;
  color: var(--color-cream) !important;
  transition: box-shadow var(--dur-standard) var(--ease-out);
}

/* Rounded containers: NES.css 8x8 corner SVG, recolored to --color-mid */
.nes-container.is-rounded {
  border-image-source: url('data:image/svg+xml;utf8,<?xml version="1.0" encoding="UTF-8" ?><svg version="1.1" width="8" height="8" xmlns="http://www.w3.org/2000/svg"><path d="M3 1 h1 v1 h-1 z M4 1 h1 v1 h-1 z M2 2 h1 v1 h-1 z M5 2 h1 v1 h-1 z M1 3 h1 v1 h-1 z M6 3 h1 v1 h-1 z M1 4 h1 v1 h-1 z M6 4 h1 v1 h-1 z M2 5 h1 v1 h-1 z M5 5 h1 v1 h-1 z M3 6 h1 v1 h-1 z M4 6 h1 v1 h-1 z" fill="rgb(75,86,148)" /></svg>') !important;
}

.nes-container.with-title > .title {
  background-color: var(--color-surface) !important;
  color: var(--color-cream);
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  line-height: 1.6;
  margin: -1.75rem 0 1rem;
}

/* Pixel glow on hover — offset mid-navy shadows simulate a CRT halo */
.nes-container:hover,
.project-card:hover {
  box-shadow: 4px 4px 0 var(--color-mid), -4px -4px 0 var(--color-mid);
}

/* --- Buttons --- */
.nes-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  padding: 12px 18px;
  background-color: var(--color-mid) !important;
  color: var(--color-cream) !important;
  border-image-source: url('data:image/svg+xml;utf8,<?xml version="1.0" encoding="UTF-8" ?><svg version="1.1" width="5" height="5" xmlns="http://www.w3.org/2000/svg"><path d="M2 1 h1 v1 h-1 z M1 2 h1 v1 h-1 z M3 2 h1 v1 h-1 z M2 3 h1 v1 h-1 z" fill="rgb(234,224,207)" /></svg>') !important;
  transition: background-color var(--dur-micro) var(--ease-out),
              color var(--dur-micro) var(--ease-out);
}

.nes-btn::after { box-shadow: inset -4px -4px var(--color-bg); }

.nes-btn:hover {
  background-color: var(--color-cream) !important;
  color: var(--color-bg) !important;
}
.nes-btn:hover::after { box-shadow: inset -6px -6px rgba(17, 24, 68, 0.4); }
.nes-btn:active:not(.is-disabled)::after { box-shadow: inset 4px 4px rgba(17, 24, 68, 0.4); }
.nes-btn:focus { box-shadow: 0 0 0 6px rgba(234, 224, 207, 0.25); }

/* --- Progress bars --- */
.nes-progress {
  height: 24px;
  margin: 0;
  background-color: var(--color-surface) !important;
  border-image-source: url('data:image/svg+xml;utf8,<?xml version="1.0" encoding="UTF-8" ?><svg version="1.1" width="5" height="5" xmlns="http://www.w3.org/2000/svg"><path d="M2 1 h1 v1 h-1 z M1 2 h1 v1 h-1 z M3 2 h1 v1 h-1 z M2 3 h1 v1 h-1 z" fill="rgb(75,86,148)" /></svg>') !important;
}
.nes-progress::-webkit-progress-bar { background-color: var(--color-surface); }
.nes-progress::-webkit-progress-value { background-color: var(--color-muted); }
.nes-progress::-moz-progress-bar { background-color: var(--color-muted); }

/* ==========================================================================
   Layout primitives
   ========================================================================== */

.section {
  padding: 96px 24px;
  /* AOS fade-left pre-positions cards +100px right; clip that overflow here so
     it never widens the document on narrow viewports (x-axis only — fade-up's
     vertical offset must stay unclipped). */
  overflow-x: clip;
}
.section-inner { max-width: 1080px; margin: 0 auto; }

.section-heading {
  font-size: 16px;
  letter-spacing: 1px;
  margin: 0 0 44px;
  text-shadow: 2px 2px 0 var(--color-surface);
}
.section-heading::after {
  content: '';
  display: block;
  width: 56px;
  height: 6px;
  margin-top: 14px;
  background: var(--color-mid);
}
.section-heading--center { text-align: center; }
.section-heading--center::after { margin-left: auto; margin-right: auto; }

/* ==========================================================================
   Navigation
   ========================================================================== */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 4px solid var(--color-mid);
}

.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: 'Press Start 2P', monospace;
  font-size: 16px;
  color: var(--color-cream);
  text-decoration: none;
}

.nav-toggle {
  background: transparent;
  border: none;
  padding: 10px 8px;
  cursor: pointer;
  display: block;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 3px;
  background: var(--color-cream);
  margin: 4px 0;
}

.nav-menu {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-menu.is-open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-bottom: 4px solid var(--color-mid);
  padding: 14px 24px 22px;
  gap: 8px;
}

.nav-link {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-muted);
  text-decoration: none;
  padding: 8px 2px;
  transition: color var(--dur-micro) var(--ease-out);
}
.nav-link:hover { color: var(--color-cream); }
.nav-link.active {
  color: var(--color-cream);
  box-shadow: 0 3px 0 var(--color-cream);
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 110px 24px 72px;
  overflow: hidden;
}

/* Site-wide particle backdrop: fixed behind all content (negative z-index
   keeps it under every section and card). 140vh tall so the parallax drift
   (clamped to the slack below the viewport) can never expose a gap. */
#tsparticles {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 140vh;
  z-index: -1;
  pointer-events: none;
}
#tsparticles canvas { position: absolute !important; inset: 0; }

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 840px;
}

.pixel-caret {
  display: block;
  margin: 0 auto 26px;
  image-rendering: pixelated;
  animation: caret-blink 1.2s step-end infinite;
}
@keyframes caret-blink {
  0%, 55% { opacity: 1; }
  56%, 100% { opacity: 0; }
}

.hero-name {
  font-size: clamp(20px, 5.2vw, 32px);
  margin: 0 0 30px;
  color: var(--color-cream);
  text-shadow: 3px 3px 0 var(--color-mid), 0 0 18px rgba(234, 224, 207, 0.25);
}

.hero-tagline {
  font-size: 18px;
  color: var(--color-muted);
  min-height: 3.4em; /* reserve space so the typed loop never shifts layout */
  margin: 0 0 38px;
}

.hero-ctas {
  display: flex;
  gap: 22px;
  justify-content: center;
  flex-wrap: wrap;
}

.scroll-hint {
  position: absolute;
  bottom: 26px;
  left: 50%;
  z-index: 1;
  padding: 10px;
  line-height: 0;
  transform: translateX(-50%);
  animation: hint-bounce 1.6s ease-in-out infinite;
}
@keyframes hint-bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 8px); }
}

/* ==========================================================================
   About
   ========================================================================== */

.about-grid { display: grid; gap: 36px; }

.about-copy p { margin: 0 0 20px; }
.about-copy p:last-child { margin-bottom: 0; }

.about-stats { word-break: break-word; }

.stats-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 15px;
}
.stat-icon { margin-right: 8px; }

.stats-list a,
.contact-list a {
  color: var(--color-cream);
  text-decoration-color: var(--color-mid);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--dur-micro) var(--ease-out);
}
.stats-list a:hover,
.contact-list a:hover { text-decoration-color: var(--color-cream); }

/* ==========================================================================
   Experience (timeline)
   ========================================================================== */

.timeline {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.xp-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: var(--color-mid);
}

.xp-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.xp-role {
  font-size: 12px;
  margin: 0 0 10px;
  line-height: 1.7;
}
.xp-company {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.xp-meta {
  font-size: 13px;
  color: var(--color-muted-lift);
  text-align: right;
  font-feature-settings: 'tnum';
}
.xp-meta p { margin: 0 0 4px; }

.xp-bullets,
.lead-bullets {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 15px;
}
.xp-bullets li,
.lead-bullets li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 10px;
}
.xp-bullets li:last-child,
.lead-bullets li:last-child { margin-bottom: 0; }
.xp-bullets li::before,
.lead-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  background: var(--color-muted);
}

/* ==========================================================================
   Tag chips
   ========================================================================== */

.chip-row {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
}
.chip {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  line-height: 1;
  background: var(--color-mid);
  color: var(--color-cream);
  padding: 7px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.chip--lg { font-size: 10px; padding: 10px 14px; }
.chip-row--loose { gap: 10px; margin: 0; }

/* ==========================================================================
   Projects
   ========================================================================== */

.projects-grid { display: grid; gap: 24px; }

.project-card {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform var(--dur-standard) var(--ease-out),
              box-shadow var(--dur-standard) var(--ease-out);
}
.project-card:hover { transform: translateY(-6px); }

.pr-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.pr-name { font-size: 12px; margin: 0; line-height: 1.7; }
.pr-date {
  font-size: 12px;
  color: var(--color-muted-lift);
  margin: 0;
  white-space: nowrap;
  font-feature-settings: 'tnum';
}
.pr-subtitle {
  font-size: 13px;
  color: var(--color-muted-lift);
  margin: 10px 0 0;
}
.pr-subtitle .nes-icon { vertical-align: middle; }

.pixel-divider {
  border: none;
  height: 3px;
  margin: 16px 0;
  background-image: linear-gradient(90deg, var(--color-mid) 0 8px, transparent 8px 14px);
  background-size: 14px 3px;
  background-repeat: repeat-x;
}

.pr-desc { font-size: 15px; margin: 0; }

.project-card .chip-row { margin-top: auto; padding-top: 18px; }

/* ==========================================================================
   Leadership
   ========================================================================== */

.leadership-grid { display: grid; gap: 24px; }

.lead-card { padding: 1.4rem 1.6rem !important; }
.lead-role { font-size: 10px; margin: 0 0 12px; line-height: 1.8; }
.lead-org { font-size: 14px; font-weight: 600; margin: 0 0 4px; }
.lead-dates {
  font-size: 12px;
  color: var(--color-muted-lift);
  margin: 0 0 14px;
  font-feature-settings: 'tnum';
}
.lead-bullets { font-size: 14px; }

/* ==========================================================================
   Skills & certifications
   ========================================================================== */

.skills-grid { display: grid; gap: 56px; }

.skills-subhead { font-size: 12px; margin: 0 0 26px; }

.skill { margin-bottom: 22px; }
.skill:last-child { margin-bottom: 0; }
.skill-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  gap: 12px;
}
.skill-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  letter-spacing: 0.5px;
}
.skill-val {
  font-size: 12px;
  color: var(--color-muted);
  font-feature-settings: 'tnum';
}

.cert-block { margin-top: 72px; }

.cert-list { list-style: none; margin: 0; padding: 0; }
.cert-row {
  display: flex;
  justify-content: space-between;
  gap: 6px 16px;
  flex-wrap: wrap;
  padding: 14px 2px;
  border-bottom: 2px solid rgba(75, 86, 148, 0.5);
}
.cert-row:first-child { border-top: 2px solid rgba(75, 86, 148, 0.5); }
.cert-name { font-size: 15px; }
.cert-meta {
  font-size: 13px;
  color: var(--color-muted);
  white-space: nowrap;
  font-feature-settings: 'tnum';
}

/* ==========================================================================
   Contact
   ========================================================================== */

.contact-wrap {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.contact-copy { font-size: 16px; margin: 0 0 34px; }

.contact-box { text-align: left; margin-bottom: 38px; }

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 15px;
  word-break: break-word;
}

/* Flash overlay for the one celebratory moment (PRESS START).
   An overlay keeps the effect independent of the button's !important colors. */
#press-start { position: relative; }
.btn-flash {
  position: absolute;
  inset: 0;
  background: var(--color-cream);
  opacity: 0;
  pointer-events: none;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 4px solid var(--color-mid);
  padding: 30px 24px;
}
.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  line-height: 1.9;
  color: var(--color-muted);
}
.footer-inner p { margin: 0; }

/* ==========================================================================
   AOS resilience gate
   Until script.js confirms AOS is loaded (html.aos-ready), force every
   [data-aos] element visible — a blocked CDN must never blank the page.
   ========================================================================== */

html:not(.aos-ready) [data-aos] {
  opacity: 1 !important;
  transform: none !important;
}

/* ==========================================================================
   Breakpoints — mobile-first
   ========================================================================== */

@media (min-width: 768px) {
  .nav-toggle { display: none; }
  .nav-menu {
    display: flex;
    flex-direction: row;
    gap: 28px;
  }

  .about-grid {
    grid-template-columns: 1.35fr 1fr;
    align-items: start;
  }

  .leadership-grid { grid-template-columns: repeat(2, 1fr); }

  .section-heading { font-size: 18px; }

  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

@media (min-width: 1024px) {
  .timeline { max-width: 760px; margin: 0 auto; } /* ~70% width, centered */
  .projects-grid { grid-template-columns: repeat(3, 1fr); }
  .leadership-grid { grid-template-columns: repeat(3, 1fr); }
  .skills-grid { grid-template-columns: 1.2fr 1fr; }
}

@media (max-width: 767px) {
  .xp-meta { text-align: left; }
  .section { padding: 72px 20px; }
}

/* ==========================================================================
   Reduced motion — delight is deletable
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  html { scroll-behavior: auto; }
  .pixel-caret,
  .scroll-hint { animation: none !important; }
}
