/* ============================================================
   Vaibhav Patidar - Portfolio
   Design tokens and shared styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* --- tokens --- */
:root {
  --bg: #0C0C0C;
  --surface: #1A1A16;
  --accent: #D4A853;
  --text: #F0EBE0;
  --muted: #6B6A65;
  --border: #2A2A24;

  --font-display: 'JetBrains Mono', monospace;
  --font-body: 'Inter', sans-serif;

  --max-width: 1120px;
  --gutter: 24px;
  --radius: 4px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.8;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

ul, ol {
  list-style: none;
}

/* --- layout --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

section {
  padding: 80px 0;
}

/* --- section labels (code comment style) --- */
.section-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--accent);
  text-transform: lowercase;
  margin-bottom: 40px;
}

/* --- hairline dividers --- */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

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

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(12, 12, 12, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.nav-logo:hover {
  color: var(--accent);
  opacity: 1;
}

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s ease;
  position: relative;
}

.nav-links a:hover {
  color: var(--text);
  opacity: 1;
}

.nav-links a.active {
  color: var(--accent);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
}

/* hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

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

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 48px;
    gap: 24px;
    background: rgba(12, 12, 12, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-links a {
    font-size: 18px;
  }
}

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

.hero {
  padding-top: 140px;
  padding-bottom: 80px;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-content {
  max-width: 680px;
}

/* ---- Terminal code panel ---- */

.terminal {
  background: #141414;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.terminal-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #1C1C1C;
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot--red { background: #FF5F57; }
.terminal-dot--yellow { background: #FEBC2E; }
.terminal-dot--green { background: #28C840; }

.terminal-filename {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--muted);
  margin-left: 8px;
}

.terminal-code {
  font-family: var(--font-display);
  font-size: 12px;
  line-height: 1.7;
  padding: 20px;
  margin: 0;
  color: var(--text);
  overflow-x: auto;
  min-height: 320px;
}

/* syntax highlighting tokens */
.terminal-code .kw  { color: #7EB6E3; }  /* keywords: def, for, if, in, return */
.terminal-code .fn  { color: #E08B6E; }  /* function name / call */
.terminal-code .bi  { color: #C792EA; }  /* builtins: len, range */
.terminal-code .st  { color: #C3E88D; }  /* strings and f-strings */
.terminal-code .op  { color: #89DDFF; }  /* operators: =, @, *, // */
.terminal-code .nr  { color: #F78C6C; }  /* numbers */
.terminal-code .cm  { color: #546E7A; }  /* comments */
.terminal-code .tc  { color: var(--text); } /* default text */

.terminal-cursor {
  display: inline-block;
  width: 7px;
  height: 15px;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

@media (max-width: 1100px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .terminal {
    max-width: 560px;
  }
}

@media (max-width: 768px) {
  .terminal {
    display: none;
  }
}

.hero-status {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(16px, 2.5vw, 20px);
  font-weight: 400;
  color: var(--accent);
  margin-bottom: 12px;
  min-height: 1.4em;
}

.hero-tagline .cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-desc {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 560px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

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

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  background: #c4983f;
  border-color: #c4983f;
}

.hero-social {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: 8px;
}

.hero-social a {
  color: var(--muted);
  transition: color 0.2s ease;
}

.hero-social a:hover {
  color: var(--accent);
  opacity: 1;
}

.hero-social svg {
  width: 20px;
  height: 20px;
}

/* ============================================================
   Stats bar
   ============================================================ */

.stats {
  padding: 48px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
}

.stat-item {
  padding: 20px 24px;
  border-right: 1px solid var(--border);
}

.stat-item:last-child {
  border-right: none;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
  line-height: 1.2;
}

.stat-label {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .stat-item:nth-child(3) {
    border-right: none;
  }

  .stat-item:nth-child(4),
  .stat-item:nth-child(5) {
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-item {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
  }

  .stat-item:last-child {
    border-bottom: none;
  }
}

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

.about-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 64px;
  align-items: start;
}

.about-photo-wrapper {
  position: relative;
}

.about-photo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.about-initials {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  color: var(--accent);
}

.about-text h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}

.about-text p {
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.7;
}

.about-text p:last-of-type {
  margin-bottom: 32px;
}

/* skills block */
.skills-block {
  margin-top: 32px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.skills-block h4 {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  text-transform: lowercase;
  margin-bottom: 16px;
}

.skill-row {
  margin-bottom: 14px;
}

.skill-row-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

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

.skill-tag {
  font-size: 12px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius);
  font-family: var(--font-body);
}

@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .about-photo-wrapper {
    max-width: 220px;
  }
}

/* ============================================================
   Project cards
   ============================================================ */

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

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease;
  display: flex;
  flex-direction: column;
}

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

.project-img-wrapper {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--bg);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-img-placeholder {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--muted);
}

.project-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.3;
}

.project-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 20px;
  flex: 1;
}

.project-note {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  margin-top: -12px;
  margin-bottom: 20px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  margin-top: auto;
}

.project-link svg {
  width: 14px;
  height: 14px;
}

@media (max-width: 1100px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Achievements
   ============================================================ */

.achievements-group {
  margin-bottom: 48px;
}

.achievements-group:last-child {
  margin-bottom: 0;
}

.achievements-group-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
}

.achievement-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.achievement-item:last-child {
  border-bottom: none;
}

.achievement-marker {
  width: 6px;
  height: 6px;
  min-width: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 8px;
}

.achievement-text {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
}

.achievement-text strong {
  color: var(--text);
  font-weight: 600;
}

.achievement-text a {
  color: var(--accent);
}

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

.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.footer-copy {
  font-size: 12px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.footer-links a {
  color: var(--muted);
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent);
  opacity: 1;
}

.footer-links svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 480px) {
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================================
   Page header (for inner pages)
   ============================================================ */

.page-header {
  padding-top: 120px;
  padding-bottom: 40px;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 16px;
  color: var(--muted);
}

/* ============================================================
   Scroll reveal (JS-driven)
   ============================================================ */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

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

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero-tagline .cursor {
    animation: none;
  }
}

/* ============================================================
   Utility
   ============================================================ */

.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;
}
