/* ============================================================
   Rohit Roy — portfolio
   Plain, self-contained stylesheet. Dark by default, light toggle.
   ============================================================ */

:root {
  --bg: #0d1117;
  --bg-soft: #161b22;
  --surface: #161b22;
  --border: #232b36;
  --text: #e6edf3;
  --text-muted: #8b97a7;
  --accent: #4f9cf9;
  --accent-soft: rgba(79, 156, 249, 0.12);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --maxw: 920px;
}

[data-theme="light"] {
  --bg: #fbfcfe;
  --bg-soft: #f2f5f9;
  --surface: #ffffff;
  --border: #e3e8ef;
  --text: #1a2230;
  --text-muted: #5b6675;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --shadow: 0 10px 30px rgba(20, 30, 50, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Clear keyboard focus indicator (mouse clicks stay clean via :focus-visible) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.muted {
  color: var(--text-muted);
  font-weight: 400;
}

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

.skip-link:focus {
  left: 16px;
  top: 16px;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.nav.is-scrolled {
  border-bottom-color: var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav__brand {
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  font-size: 1.05rem;
}

.nav__brand:hover {
  text-decoration: none;
  color: var(--accent);
}

.nav__links {
  display: flex;
  gap: 28px;
  margin-left: auto;
  margin-right: 22px;
}

.nav__links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav__links a:hover {
  color: var(--text);
  text-decoration: none;
}

.nav__links a.is-active {
  color: var(--text);
}

/* Hamburger (mobile only) */
.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  margin-left: auto;
  margin-right: 10px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}

.nav__toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}

[data-theme="dark"] .icon-sun {
  display: block;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

[data-theme="light"] .icon-sun {
  display: none;
}

[data-theme="light"] .icon-moon {
  display: block;
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: center;
  padding-top: 72px;
  padding-bottom: 32px;
}

.hero__eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.02em;
  margin: 0 0 12px;
}

.hero__name {
  font-size: clamp(2.6rem, 6vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
  font-weight: 700;
}

.hero__role {
  font-size: clamp(1.15rem, 2.5vw, 1.4rem);
  font-weight: 600;
  margin: 0 0 20px;
}

.hero__tagline {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 46ch;
  margin: 0 0 28px;
}

.hero__cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.hero__media {
  display: flex;
  justify-content: center;
}

.hero__photo {
  position: relative;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: radial-gradient(circle at 50% 32%,
      color-mix(in srgb, var(--accent) 55%, var(--surface)),
      var(--surface) 72%);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero__photo::after {
  /* subtle inner ring */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
  pointer-events: none;
}

.hero__photo img {
  position: absolute;
  left: 50%;
  bottom: -2%;
  transform: translateX(-50%);
  height: 110%;
  width: auto;
  display: block;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  color: #fff;
  filter: brightness(1.05);
}

.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Social ---------- */
.social {
  display: flex;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.social a:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* ---------- Sections ---------- */
.section {
  padding-top: 64px;
  padding-bottom: 64px;
}

.section__title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 32px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.section__no {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 500;
}

.prose p {
  margin: 0 0 18px;
  max-width: 70ch;
}

.prose strong {
  color: var(--text);
}

/* ---------- Timeline ---------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.timeline__item {
  position: relative;
  padding: 0 0 36px 28px;
  border-left: 1px solid var(--border);
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 6px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  transform-origin: center;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.45s ease;
}

/* Dot grows + glows while its entry sits in the viewport's focus band */
.timeline__item.is-focused::before {
  transform: scale(1.7);
  box-shadow: 0 0 0 5px var(--accent-soft),
    0 0 16px 3px color-mix(in srgb, var(--accent) 75%, transparent);
}

.timeline__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 18px;
  margin-bottom: 12px;
}

.timeline__head h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.timeline__meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.timeline__points {
  margin: 0;
  padding-left: 20px;
  color: var(--text-muted);
}

.timeline__points li {
  margin-bottom: 8px;
}

.timeline__points li::marker {
  color: var(--accent);
}

.edu__detail {
  margin: 0;
  color: var(--text-muted);
}

/* ---------- Skills ---------- */
.skills {
  display: grid;
  gap: 28px;
}

.skills__group h3 {
  margin: 0 0 14px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.chips li {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.9rem;
  color: var(--text);
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.chips li:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ---------- Contact ---------- */
.section--contact {
  padding-bottom: 80px;
}

.contact__lead {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 58ch;
  margin: 0 0 26px;
}

.contact__links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ---------- Reveal animation ---------- */
/* Only hide for the reveal animation when JS is available to bring it back. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

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

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn:hover,
  .social a:hover,
  .chips li:hover,
  .theme-toggle:hover {
    transform: none;
  }

  .timeline__item::before,
  .timeline__item.is-focused::before {
    transition: none;
    transform: none;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-top: 48px;
    padding-bottom: 56px;
    text-align: center;
  }

  .hero__media {
    order: -1;
  }

  .hero__tagline {
    margin-left: auto;
    margin-right: auto;
  }

  .hero__cta,
  .social {
    justify-content: center;
  }

  .nav__toggle {
    display: flex;
  }

  /* Stack heading + meta and let long lines wrap (avoids horizontal overflow) */
  .timeline__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .timeline__meta {
    white-space: normal;
  }

  .timeline__head h3,
  .timeline__meta {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .nav__links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 6px 24px 14px;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    backdrop-filter: saturate(140%) blur(10px);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--border);
    transform-origin: top;
    transform: scaleY(0);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.22s ease, opacity 0.22s ease;
  }

  .nav__links.is-open {
    transform: scaleY(1);
    opacity: 1;
    pointer-events: auto;
  }

  .nav__links a {
    padding: 12px 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .nav__links a:last-child {
    border-bottom: none;
  }
}

@media (max-width: 460px) {
  body {
    font-size: 16px;
  }

  .hero__photo {
    width: 210px;
    height: 210px;
  }
}
