/* ============================================================
   jayaramhariharan.com — Style System
   Dark minimal theme inspired by kestrelintelligence.com
   ============================================================ */

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

/* === Design Tokens === */
:root {
  --bg: #0a0a0a;
  --bg-elevated: #0f0f0f;
  --bg-hover: #141414;
  --text-primary: #e8e6e1;
  --text-secondary: #7a7870;
  --text-tertiary: #4a4a44;
  --accent: #d4a853;
  --accent-soft: rgba(212, 168, 83, 0.08);
  --accent-glow: rgba(212, 168, 83, 0.15);
  --border: #1a1a1a;
  --border-hover: #2a2a28;
  --font-heading: 'Playfair Display', 'Georgia', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Base === */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

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

a {
  color: inherit;
  text-decoration: none;
}

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

/* === Navigation === */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 3rem;
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background 0.4s var(--ease-smooth),
              border-color 0.4s var(--ease-smooth);
}

.nav--scrolled {
  background: rgba(10, 10, 10, 0.92);
  border-bottom-color: var(--border-hover);
}

.nav__name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.03em;
  transition: color 0.3s var(--ease-smooth);
}

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

.nav__links {
  display: flex;
  align-items: center;
  gap: 2.25rem;
}

.nav__link {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  position: relative;
  transition: color 0.3s var(--ease-smooth);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s var(--ease-out);
}

.nav__link:hover {
  color: var(--text-primary);
}

.nav__link:hover::after {
  width: 100%;
}

/* === Hero Section === */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: 0 3rem;
  position: relative;
}

.hero__content {
  max-width: 840px;
  margin: 0 auto;
  width: 100%;
}

.hero__label {
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--accent);
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateY(16px);
  animation: fadeSlideUp 0.8s var(--ease-out) 0.2s forwards;
}

.hero__title {
  font-family: var(--font-heading);
  font-size: clamp(3.25rem, 9vw, 6rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
  opacity: 0;
  transform: translateY(24px);
  animation: fadeSlideUp 0.9s var(--ease-out) 0.35s forwards;
}

.hero__bio {
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--text-secondary);
  max-width: 520px;
  margin-bottom: 3rem;
  opacity: 0;
  transform: translateY(16px);
  animation: fadeSlideUp 0.8s var(--ease-out) 0.55s forwards;
}

.hero__links {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  opacity: 0;
  transform: translateY(12px);
  animation: fadeSlideUp 0.8s var(--ease-out) 0.7s forwards;
}

.hero__link {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-secondary);
  padding-bottom: 3px;
  border-bottom: 1px solid var(--border);
  transition: color 0.3s var(--ease-smooth),
              border-color 0.3s var(--ease-smooth);
}

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

/* Scroll indicator */
.hero__scroll {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  opacity: 0;
  animation: fadeIn 1s var(--ease-smooth) 1.2s forwards;
}

.hero__scroll-text {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-tertiary);
}

.hero__scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--text-tertiary), transparent);
  animation: scrollPulse 2s var(--ease-smooth) infinite;
}

/* === Section Common === */
.section {
  padding: 8rem 3rem;
  max-width: 1100px;
  margin: 0 auto;
}

.section__heading {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.section__subheading {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 480px;
  margin-bottom: 4rem;
  line-height: 1.7;
}

/* === Projects === */
.projects {
  display: flex;
  flex-direction: column;
}

.project {
  border-top: 1px solid var(--border);
  padding: 2.75rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  transition: background 0.4s var(--ease-smooth),
              border-color 0.3s var(--ease-smooth);
  position: relative;
  cursor: default;
}

.project:last-child {
  border-bottom: 1px solid var(--border);
}

.project:hover {
  background: var(--accent-soft);
}

.project:hover .project__title {
  color: var(--accent);
}

.project__tag {
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  opacity: 0.7;
}

.project__title {
  font-family: var(--font-heading);
  font-size: clamp(1.375rem, 3vw, 1.875rem);
  font-weight: 600;
  transition: color 0.3s var(--ease-smooth);
  letter-spacing: -0.01em;
}

.project__desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.65;
}

.project__links {
  display: flex;
  gap: 1.75rem;
  margin-top: 0.5rem;
}

.project__link {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--border);
  transition: color 0.3s var(--ease-smooth),
              border-color 0.3s var(--ease-smooth);
}

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

/* === Contact Section === */
.contact {
  padding: 8rem 3rem;
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

.contact__heading {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.contact__email {
  font-size: 1.125rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
  transition: color 0.3s var(--ease-smooth),
              border-color 0.3s var(--ease-smooth);
  display: inline-block;
}

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

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

.footer__text {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
}

/* === Scroll Animations === */
[data-animate] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease-out),
              transform 0.7s var(--ease-out);
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.project:nth-child(1) { transition-delay: 0s; }
.project:nth-child(2) { transition-delay: 0.06s; }
.project:nth-child(3) { transition-delay: 0.12s; }
.project:nth-child(4) { transition-delay: 0.18s; }
.project:nth-child(5) { transition-delay: 0.24s; }
.project:nth-child(6) { transition-delay: 0.3s; }
.project:nth-child(7) { transition-delay: 0.36s; }
.project:nth-child(8) { transition-delay: 0.42s; }

/* === Keyframes === */
@keyframes fadeSlideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50% { opacity: 0.7; transform: scaleY(1.1); }
}

/* === Responsive — Tablet === */
@media (max-width: 1024px) {
  .nav {
    padding: 1rem 2rem;
  }

  .hero {
    padding: 0 2rem;
  }

  .section {
    padding: 6rem 2rem;
  }

  .contact {
    padding: 6rem 2rem;
  }

  .hero__title {
    font-size: clamp(2.75rem, 7vw, 4.5rem);
  }
}

/* === Responsive — Mobile === */
@media (max-width: 768px) {
  .nav {
    padding: 1rem 1.5rem;
  }

  .nav__links {
    gap: 1.25rem;
  }

  .nav__link {
    font-size: 0.75rem;
  }

  .hero {
    padding: 0 1.5rem;
    min-height: 90vh;
    min-height: 90dvh;
  }

  .hero__label {
    font-size: 0.625rem;
    margin-bottom: 1.5rem;
  }

  .hero__title {
    font-size: clamp(2.5rem, 12vw, 3.75rem);
    margin-bottom: 1.75rem;
  }

  .hero__bio {
    font-size: 1rem;
    margin-bottom: 2.25rem;
  }

  .hero__links {
    gap: 1.5rem;
  }

  .hero__scroll {
    display: none;
  }

  .section {
    padding: 5rem 1.5rem;
  }

  .section__heading {
    font-size: 2rem;
    margin-bottom: 0.75rem;
  }

  .section__subheading {
    margin-bottom: 3rem;
  }

  .project {
    padding: 2rem 0.75rem;
  }

  .project__title {
    font-size: 1.375rem;
  }

  .project__desc {
    font-size: 0.875rem;
  }

  .project__links {
    gap: 1.25rem;
  }

  .contact {
    padding: 5rem 1.5rem;
  }

  .footer {
    padding: 2rem 1.5rem;
  }
}

/* === Responsive — Small Mobile === */
@media (max-width: 420px) {
  .nav {
    padding: 0.875rem 1rem;
  }

  .nav__links {
    gap: 1rem;
  }

  .hero {
    padding: 0 1rem;
  }

  .hero__title {
    font-size: 2.5rem;
  }

  .section {
    padding: 4rem 1rem;
  }

  .contact {
    padding: 4rem 1rem;
  }

  .project {
    padding: 1.75rem 0.5rem;
  }
}

/* === Print === */
@media print {
  .nav, .hero__scroll {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .hero {
    min-height: auto;
    padding: 2rem 0;
  }

  .project:hover {
    background: none;
  }
}
