/* ===========================
   Sabarish Raja — Portfolio
   Dark editorial mono · accent #7DD3FC
   =========================== */

:root {
  --bg: #0A0A0B;
  --bg-elev: #111114;
  --text: #EDEDED;
  --muted: #8A8A8E;
  --muted-2: #5C5C61;
  --rule: #1F1F22;
  --rule-soft: #161618;
  --accent: #7DD3FC;
  --accent-dim: rgba(125, 211, 252, 0.18);

  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Inter", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;

  --container: 1200px;
  --pad-x: clamp(1.25rem, 4vw, 3rem);
  --section-y: clamp(5rem, 10vw, 8rem);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #000; }

/* Subtle ambient gradient that doesn't compete */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 15% 0%, rgba(125,211,252,0.06), transparent 60%),
    radial-gradient(700px 400px at 100% 100%, rgba(125,211,252,0.04), transparent 60%);
  z-index: 0;
}

main, nav, footer { position: relative; z-index: 1; }

/* ---------- TYPE ---------- */

h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }

.mono { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
em { font-style: normal; color: var(--accent); font-weight: 500; }

a {
  color: var(--text);
  text-decoration: none;
  transition: color 200ms ease, opacity 200ms ease;
}
a:hover { color: var(--accent); }

p { color: #C8C8CC; }

/* ---------- NAV ---------- */

nav {
  position: sticky;
  top: 0;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad-x);
  background: rgba(10, 10, 11, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule-soft);
  z-index: 100;
}

.logo {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.logo:hover { color: var(--text); opacity: 0.7; }
.logo-dot { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 2.25rem;
  list-style: none;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav-links a {
  color: var(--muted);
  position: relative;
  padding-bottom: 4px;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 280ms ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }

/* Active section (scroll-spy) */
.nav-links a.active { color: var(--text); }
.nav-links a.active::after { transform: scaleX(1); transform-origin: left; }

#hamburger-nav { display: none; }

.hamburger-icon { display: flex; flex-direction: column; justify-content: space-between; width: 28px; height: 18px; cursor: pointer; }
.hamburger-icon span { width: 100%; height: 1.5px; background: var(--text); transition: all 250ms ease; }
.menu-links {
  position: absolute;
  top: 72px;
  right: 0;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: 4px;
  width: 220px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 280ms ease;
}
.menu-links li { list-style: none; }
.menu-links a {
  display: block;
  padding: 0.85rem 1.25rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-bottom: 1px solid var(--rule-soft);
}
.menu-links a:hover { color: var(--accent); }
.menu-links.open { max-height: 400px; }
.hamburger-icon.open span:first-child { transform: rotate(45deg) translate(5px, 5px); }
.hamburger-icon.open span:nth-child(2) { opacity: 0; }
.hamburger-icon.open span:last-child { transform: rotate(-45deg) translate(5px, -5px); }

/* ---------- LAYOUT ---------- */

main { max-width: var(--container); margin: 0 auto; padding: 0 var(--pad-x); }

section { padding: var(--section-y) 0; border-top: 1px solid var(--rule-soft); scroll-margin-top: 90px; }
section:first-of-type { border-top: none; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  margin-bottom: 3.5rem;
}
.section-num { color: var(--accent); }
.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.025em;
}

/* ---------- HERO ---------- */

#profile { padding-top: clamp(4rem, 8vw, 7rem); }

.profile-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
  position: relative;
  padding-left: 1.5rem;
}
.eyebrow::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 1rem; height: 1px;
  background: var(--accent);
}

/* Availability status dot — replaces the accent line in the hero */
#profile .eyebrow { padding-left: 0; display: inline-flex; align-items: center; gap: 0.6rem; }
#profile .eyebrow::before { display: none; }
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4ADE80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5);
  animation: pulse-dot 2.4s ease-out infinite;
  flex-shrink: 0;
}
@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.hero-title {
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  font-family: var(--display);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin-bottom: 1.5rem;
}
.hero-title em { color: var(--text); font-style: normal; font-weight: 300; }

.hero-role {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.hero-role .mono { color: var(--accent); font-size: 0.95rem; text-transform: none; letter-spacing: 0; }

#role::after {
  content: "▌";
  color: var(--accent);
  animation: blink 1s steps(2) infinite;
  margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-tagline {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 38ch;
  margin-bottom: 2.5rem;
  line-height: 1.6;
}

.btn-container { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid var(--rule);
  cursor: pointer;
  transition: all 250ms ease;
}
.btn-primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: #fff;
  border-color: #fff;
  color: #000;
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.arrow-ico { display: inline-block; transition: transform 250ms ease; }
.btn:hover .arrow-ico { transform: translate(2px, -2px); }

/* Photo */
.profile-photo {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid var(--rule);
}
.profile-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(20%) contrast(1.05);
  transition: filter 400ms ease, transform 600ms ease;
}
.profile-photo:hover img { filter: grayscale(0%) contrast(1.05); transform: scale(1.02); }

/* ---------- ABOUT ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  margin-bottom: 4rem;
}
.about-lead {
  font-family: var(--display);
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
  letter-spacing: -0.015em;
}

.about-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-self: start;
  padding-top: 0.5rem;
  border-top: 1px solid var(--rule);
}
.about-meta div { padding-top: 1.25rem; border-bottom: 1px solid var(--rule-soft); padding-bottom: 1.25rem; }
.about-meta div:last-child { border-bottom: none; }
.about-meta dt {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 0.35rem;
}
.about-meta dd { font-size: 0.95rem; color: var(--text); }
.about-meta dd a:hover { color: var(--accent); }

.education-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--rule);
}
.edu .edu-period { color: var(--accent); margin-bottom: 0.75rem; }
.edu h3 { font-size: 1.35rem; font-weight: 600; margin-bottom: 0.35rem; letter-spacing: -0.02em; }
.edu .muted { font-size: 0.95rem; }
.edu .small { margin-top: 0.5rem; color: var(--muted-2); }

/* ---------- TIMELINE ---------- */

.timeline-v {
  list-style: none;
  position: relative;
  padding-left: 0;
}

.tl-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 3rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--rule);
  position: relative;
}
.tl-item:first-child { border-top: none; padding-top: 0; }
.tl-item:last-child { padding-bottom: 0; }

.tl-period {
  color: var(--accent);
  padding-top: 0.5rem;
}

.tl-body h3 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.tl-body h3 .muted {
  font-style: normal;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--muted);
}
.tl-body p { margin-bottom: 0.85rem; color: #B8B8BC; }
.tl-body p:last-of-type { margin-bottom: 1.25rem; }

.tag-row {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  list-style: none;
  margin-top: 0.5rem;
}
.tag-row li {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--bg-elev);
}

/* ---------- PROJECTS ---------- */

.projects-list { display: flex; flex-direction: column; }

.project-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 3rem;
  padding: 3rem 0;
  border-top: 1px solid var(--rule);
  color: var(--text);
  position: relative;
  transition: background 300ms ease;
}
.project-row:first-child { border-top: 1px solid var(--rule); }
.project-row:hover { background: linear-gradient(90deg, transparent, rgba(125,211,252,0.03), transparent); }

.project-row[data-no-link] { cursor: default; }
.project-row:not([data-no-link]) { cursor: pointer; }

.project-meta h3 {
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0.5rem 0 0.25rem;
}
.project-sub {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.project-body p { margin-bottom: 1rem; color: #B8B8BC; }
.project-body p:last-of-type { margin-bottom: 1.25rem; }

.row-arrow {
  position: absolute;
  top: 3rem;
  right: 0;
  color: var(--muted);
  font-size: 1rem;
  transition: transform 250ms ease, color 250ms ease;
}
.project-row:hover .row-arrow { color: var(--accent); transform: translate(4px, -4px); }

/* Earlier work */
.subhead {
  margin-top: 4rem;
  margin-bottom: 1.25rem;
  color: var(--muted-2);
}
.earlier-list { list-style: none; }
.earlier-list li { border-top: 1px solid var(--rule-soft); }
.earlier-list li:last-child { border-bottom: 1px solid var(--rule-soft); }
.earlier-list a {
  display: grid;
  grid-template-columns: 1.2fr 2fr auto;
  gap: 2rem;
  align-items: center;
  padding: 1.25rem 0;
  position: relative;
}
.earlier-list a > span:first-child { font-family: var(--display); font-size: 1.05rem; font-weight: 600; letter-spacing: -0.015em; }
.earlier-list a:hover > span:first-child { color: var(--accent); }
.earlier-list .row-arrow { position: static; }

/* ---------- SKILLS ---------- */

.skills-grid {
  display: grid;
  grid-template-columns: 1fr;
}
.skill-group {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 3rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--rule);
}
.skill-group:last-child { border-bottom: 1px solid var(--rule); }
.skill-group h4 {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.skill-group p {
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.7;
}

/* ---------- RESEARCH ---------- */

.research-list { list-style: none; }
.research-list li { border-top: 1px solid var(--rule); }
.research-list li:last-child { border-bottom: 1px solid var(--rule); }
.research-list a {
  display: block;
  padding: 2rem 0;
  position: relative;
  padding-right: 5rem;
}
.research-list .mono.small { color: var(--accent); margin-bottom: 0.5rem; }
.research-list h3 {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  max-width: 60ch;
}
.research-list a:hover h3 { color: var(--accent); }
.research-list .row-arrow {
  position: absolute;
  top: 2rem;
  right: 0;
  font-size: 0.8rem;
  font-family: var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- CONTACT ---------- */

.contact-lead {
  font-family: var(--display);
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.015em;
  color: var(--text);
  max-width: 34ch;
  margin-bottom: 3rem;
}
.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.75rem, 4.5vw, 3rem);
  letter-spacing: -0.03em;
  color: var(--text);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.5rem;
  margin-bottom: 4rem;
}
.contact-email:hover { color: var(--accent); border-bottom-color: var(--accent); }
.contact-email .arrow-ico { font-size: 0.6em; }

.contact-links { list-style: none; }
.contact-links li { border-top: 1px solid var(--rule-soft); }
.contact-links li:last-child { border-bottom: 1px solid var(--rule-soft); }
.contact-links a {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  align-items: center;
  gap: 2rem;
  padding: 1.25rem 0;
  font-size: 1.15rem;
}
.contact-links a:hover { color: var(--accent); padding-left: 0.5rem; }
.contact-links .mono { color: var(--muted-2); }

/* ---------- FOOTER ---------- */

footer {
  border-top: 1px solid var(--rule-soft);
  padding: 2rem var(--pad-x);
  margin-top: 4rem;
}
.footer-row {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-row .mono { color: var(--muted-2); }

/* ---------- REVEAL ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms ease, transform 700ms ease;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- ACCESSIBILITY ---------- */

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .status-dot { animation: none; }
}

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