/* ==============================
   SOHAM ROY — Portfolio Styles
   Minimalist Research-Oriented
   ============================== */

/* --- CSS Variables (Light Theme) --- */
:root {
  --bg:          #fafaf9;
  --bg-alt:      #f3f2ef;
  --surface:     #ffffff;
  --text:        #1a1a1a;
  --text-muted:  #6b6b6b;
  --text-light:  #999999;
  --accent:      #0e6e55;
  --accent-hover:#0a5843;
  --accent-soft: #e8f5f0;
  --accent-warm: #a16f0b;
  --border:      #e5e5e5;
  --border-light:#efefef;
  --shadow:      0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg:   0 10px 40px rgba(0,0,0,0.06);
  --radius:      8px;
  --radius-lg:   12px;
  --font-sans:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif:  'Source Serif 4', 'Georgia', serif;
  --font-mono:   'JetBrains Mono', 'Fira Code', monospace;
  --max-width:   920px;
  --nav-height:  64px;
  --transition:  0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Dark Theme --- */
[data-theme="dark"] {
  --bg:          #0f0f0f;
  --bg-alt:      #171717;
  --surface:     #1e1e1e;
  --text:        #e8e8e8;
  --text-muted:  #a0a0a0;
  --text-light:  #666666;
  --accent:      #34d399;
  --accent-hover:#2fc48a;
  --accent-soft: rgba(52,211,153,0.1);
  --accent-warm: #d4a033;
  --border:      #2a2a2a;
  --border-light:#222222;
  --shadow:      0 1px 3px rgba(0,0,0,0.3);
  --shadow-lg:   0 10px 40px rgba(0,0,0,0.4);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

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

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

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

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  display: block;
}

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

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: 1000;
  background: transparent;
  transition: background var(--transition), box-shadow var(--transition), backdrop-filter var(--transition);
}

.nav.scrolled {
  background: rgba(250,250,249,0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 0 var(--border);
}

[data-theme="dark"] .nav.scrolled {
  background: rgba(15,15,15,0.85);
}

.nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.5px;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav__links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.3px;
  transition: color var(--transition);
}

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

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.icon-moon { display: none; }

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

/* --- Intro / Hero --- */
.intro {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--nav-height);
  padding-bottom: 0;
  position: relative;
}

.intro__grid {
  display: flex;
  align-items: center;
  gap: 48px;
}

.intro__photo-wrap {
  flex-shrink: 0;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--border);
  background: var(--bg-alt);
  position: relative;
}

.intro__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Placeholder when no photo is loaded */
.intro__photo-wrap::after {
  content: 'SR';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 48px;
  font-weight: 600;
  color: var(--accent);
  opacity: 0.3;
  pointer-events: none;
}

.intro__photo-wrap:has(img[src]:not([src=""]))::after {
  display: none;
}

.intro__bio {
  flex: 1;
  min-width: 0;
}

.intro__name {
  font-family: var(--font-serif);
  font-size: 48px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 4px;
}

.intro__role {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.intro__tagline {
  font-family: var(--font-serif);
  font-size: 20px;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  letter-spacing: -0.3px;
}

.intro__desc {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.intro__desc strong {
  color: var(--text);
  font-weight: 500;
}

.intro__links {
  display: flex;
  gap: 14px;
}

.intro__links a {
  color: var(--text-light);
  transition: color var(--transition), transform var(--transition);
}

.intro__links a:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

/* --- Skills row --- */
.skills__row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* --- Education --- */
.education {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.education__main h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.education__degree {
  font-size: 14px;
  color: var(--text-muted);
}

.education__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.education__gpa {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
}

.education__year {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-light);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 24px;
  border-radius: var(--radius);
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  letter-spacing: 0.2px;
}

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

.btn--primary:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(14,110,85,0.25);
}

[data-theme="dark"] .btn--primary:hover {
  box-shadow: 0 4px 12px rgba(52,211,153,0.2);
}

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

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

.btn--lg {
  padding: 14px 32px;
  font-size: 15px;
}

/* --- Sections --- */
.section {
  padding: 100px 0;
}

.section--alt {
  background: var(--bg-alt);
}

.section__title {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 48px;
  letter-spacing: -0.5px;
  position: relative;
}

.section__title::after {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background: var(--accent);
  margin-top: 12px;
}

/* --- Scroll Hint --- */
.scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-light);
  opacity: 0.4;
  animation: hint-bounce 2.5s ease infinite;
  transition: opacity var(--transition);
}

.nav.scrolled ~ .intro .scroll-hint {
  opacity: 0;
}

@keyframes hint-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* --- Skills & Tags --- */

.skill-group {
  margin-bottom: 0;
}

.skill-group h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-light);
  margin-bottom: 8px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tags span {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* --- Research --- */
.paper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  margin-bottom: 32px;
  transition: box-shadow var(--transition), transform var(--transition);
}

.paper:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.paper__venue {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}

.paper__title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.35;
}

.paper__authors {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.paper__abstract {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 20px;
}

.paper__links {
  display: flex;
  gap: 12px;
}

.paper__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: all var(--transition);
}

.paper__link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* Research Areas */
.research__areas {
  margin-top: 16px;
}

.research__areas-title {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-light);
  margin-bottom: 28px;
}

.research__areas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.research-area {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: all var(--transition);
}

.research-area:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.research-area__icon {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 600;
  color: var(--accent);
  opacity: 0.4;
  margin-bottom: 16px;
}

.research-area h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.research-area p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* --- Timeline (Experience) --- */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border);
}

.timeline__item {
  position: relative;
  margin-bottom: 40px;
}

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

.timeline__marker {
  position: absolute;
  left: -36px;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  transition: background var(--transition);
}

.timeline__item:hover .timeline__marker {
  background: var(--accent);
}

.timeline__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  gap: 16px;
}

.timeline__header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.timeline__org {
  font-size: 14px;
  color: var(--accent);
  font-weight: 500;
  margin-top: 2px;
}

.timeline__date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-light);
  white-space: nowrap;
  flex-shrink: 0;
}

.timeline__details {
  list-style: none;
  padding: 0;
}

.timeline__details li {
  position: relative;
  padding-left: 16px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 4px;
}

.timeline__details li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--text-light);
}

/* --- Projects --- */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.project {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.project:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.project__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  color: var(--text-light);
}

.project__links {
  display: flex;
  gap: 10px;
}

.project__links a {
  color: var(--text-light);
  transition: color var(--transition);
}

.project__links a:hover {
  color: var(--accent);
}

.project__title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.project__desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 20px;
  flex: 1;
}

.project__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project__tags span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-light);
  padding: 3px 8px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
}

/* --- Achievements --- */
.achievements__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.achievement {
  display: flex;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: all var(--transition);
}

.achievement:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.achievement__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.achievement h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.achievement p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- Contact --- */
.contact {
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
  padding: 40px 0;
}

.contact__title {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.contact__text {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.7;
}

.contact__links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 24px;
}

.contact__links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.contact__links a:hover {
  color: var(--accent);
}

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

.footer p {
  font-size: 13px;
  color: var(--text-light);
}

/* --- Reveal Animation --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal:nth-child(4) { transition-delay: 0.3s; }
.reveal:nth-child(5) { transition-delay: 0.4s; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav__links a:not(:last-child) {
    display: none;
  }

  .nav__links {
    gap: 12px;
  }

  .intro {
    min-height: auto;
    padding-top: calc(var(--nav-height) + 48px);
    padding-bottom: 64px;
  }

  .intro__grid {
    flex-direction: column;
    text-align: center;
    gap: 24px;
  }

  .intro__photo-wrap {
    width: 120px;
    height: 120px;
  }

  .intro__links {
    justify-content: center;
  }

  .intro__name {
    font-size: 34px;
  }

  .intro__tagline {
    font-size: 17px;
  }

  .scroll-hint {
    display: none;
  }

  .skills__row {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .education {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .education__meta {
    align-items: center;
  }

  .section {
    padding: 64px 0;
  }

  .section__title {
    font-size: 26px;
    margin-bottom: 32px;
  }

  .research__areas-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .projects__grid {
    grid-template-columns: 1fr;
  }

  .achievements__grid {
    grid-template-columns: 1fr;
  }

  .timeline {
    padding-left: 24px;
  }

  .timeline__marker {
    left: -28px;
  }

  .timeline__header {
    flex-direction: column;
    gap: 4px;
  }

  .paper {
    padding: 24px;
  }

  .contact__title {
    font-size: 28px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .intro__name {
    font-size: 28px;
  }

  .research-area {
    padding: 20px;
  }

  .project {
    padding: 20px;
  }

  .achievement {
    padding: 16px;
    flex-direction: column;
    gap: 12px;
  }
}

/* --- Print --- */
@media print {
  .nav, .theme-toggle { display: none; }
  .section { padding: 32px 0; }
  .reveal { opacity: 1; transform: none; }
}
