/* =============================================================
   Hitesh Chandra Das — Portfolio
   Design tokens
   ============================================================= */
:root {
  --bg:            #12141a;
  --bg-alt:        #181b22;
  --surface:       #1e222b;
  --surface-hover: #262b36;
  --border:        #2a2f3a;
  --border-soft:   #23272f;

  --text:          #edede9;
  --text-muted:    #9599a3;
  --text-faint:    #5f6470;

  --accent:        #8fb39b;   /* muted sage green */
  --accent-strong: #b8d4c2;
  --accent-dim:    rgba(143, 179, 155, 0.12);
  --gold:          #c9a876;   /* soft brass, used sparingly */

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;

  --max-width: 1120px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 18px;

  color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 15% 0%, rgba(143, 179, 155, 0.07), transparent 45%),
    radial-gradient(circle at 100% 30%, rgba(201, 168, 118, 0.05), transparent 40%);
  background-attachment: fixed;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; font-weight: 600; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--accent); color: #10120f; }

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

/* =============================================================
   Layout helpers
   ============================================================= */
.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--accent);
  display: inline-block;
}

section { padding: 88px 0; }

.section-head { margin-bottom: 48px; max-width: 640px; }

.section-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  margin-top: 14px;
  color: var(--text);
}

.section-head p {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 1rem;
}

/* =============================================================
   Header / Nav
   ============================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(18, 20, 26, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  position: relative;
}

.logo {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text);
}

.logo span { color: var(--accent); }

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

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-links a:hover { color: var(--text); background: var(--surface); }

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

.nav-cta { border: 1px solid var(--border); margin-left: 6px; }
.nav-cta:hover { border-color: var(--accent); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
}

/* =============================================================
   Hero
   ============================================================= */
.hero {
  padding: 88px 0 64px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}

.hero-copy h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.08;
  margin-top: 16px;
}

.hero-copy h1 em { font-style: normal; color: var(--accent-strong); }

.hero-intro {
  margin-top: 22px;
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 52ch;
}

.terminal {
  margin-top: 30px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  max-width: 560px;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.terminal-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.terminal-dot:nth-child(1) { background: #d97b6c; }
.terminal-dot:nth-child(2) { background: #c9a876; }
.terminal-dot:nth-child(3) { background: #8fb39b; }

.terminal-label {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}

.terminal-body {
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--accent-strong);
  min-height: 92px;
}

.terminal-body .muted { color: var(--text-faint); }
.terminal-body .string { color: var(--gold); }
.terminal-body .string-line { color: var(--gold); }
.terminal-body .cursor {
  display: inline-block;
  width: 7px;
  height: 1em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.hero-actions { margin-top: 34px; display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-primary { background: var(--accent); color: #0e120f; }
.btn-primary:hover { background: var(--accent-strong); transform: translateY(-2px); }

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

/* Photo frame */
.hero-photo { position: relative; justify-self: center; }

.photo-frame {
  width: 300px;
  height: 360px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-frame img { width: 100%; height: 100%; object-fit: cover; }

.photo-fallback {
  font-family: var(--font-display);
  font-size: 4.2rem;
  color: var(--accent);
  opacity: 0.55;
}

.photo-corner { position: absolute; width: 26px; height: 26px; border: 2px solid var(--accent); }
.photo-corner.tl { top: -1px; left: -1px; border-right: none; border-bottom: none; border-top-left-radius: var(--radius-lg); }
.photo-corner.br { bottom: -1px; right: -1px; border-left: none; border-top: none; border-bottom-right-radius: var(--radius-lg); }

.status-chip {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 9px 18px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

/* =============================================================
   Timeline (Education)
   ============================================================= */
.timeline { border-left: 1px solid var(--border); margin-left: 6px; }

.timeline-item { position: relative; padding: 0 0 40px 34px; }
.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: attr(data-index);
  position: absolute;
  left: -13px;
  top: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--accent);
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeline-item h3 { font-size: 1.15rem; color: var(--text); }

.timeline-meta {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.timeline-item p.desc { margin-top: 10px; color: var(--text-muted); max-width: 62ch; }

/* =============================================================
   Skills
   ============================================================= */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}

.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
}

.skill-card h3 {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 500;
}

.chip-row { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--accent-strong);
}

.chip::before { content: '#'; color: var(--text-faint); }

/* =============================================================
   Cards / Projects
   ============================================================= */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.project-card:hover { border-color: var(--accent); transform: translateY(-4px); }

.project-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

.project-index { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); }

.project-card h3 { font-size: 1.28rem; margin-top: 4px; }

.project-card p.desc { color: var(--text-muted); font-size: 0.94rem; }

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

.project-links {
  margin-top: auto;
  display: flex;
  gap: 18px;
  padding-top: 8px;
  border-top: 1px solid var(--border-soft);
}

.project-links a { font-size: 0.85rem; color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.project-links a:hover { color: var(--accent-strong); }

/* =============================================================
   Contact
   ============================================================= */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 48px; }

.contact-info-list { display: flex; flex-direction: column; gap: 22px; }

.contact-info-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.contact-info-item .icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  color: var(--accent-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-info-item h4 { font-size: 0.95rem; font-family: var(--font-body); color: var(--text); }
.contact-info-item p, .contact-info-item a { margin-top: 4px; color: var(--text-muted); font-size: 0.9rem; }
.contact-info-item a:hover { color: var(--accent-strong); }

.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.form-row { margin-bottom: 20px; }

.form-row label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-row input,
.form-row textarea {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.94rem;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.form-row input:focus,
.form-row textarea:focus { border-color: var(--accent); outline: none; }

.form-row .error {
  display: none;
  margin-top: 6px;
  color: #d97b6c;
  font-size: 0.78rem;
  font-family: var(--font-mono);
}

.form-row.invalid input,
.form-row.invalid textarea { border-color: #d97b6c; }
.form-row.invalid .error { display: block; }

.form-status {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-strong);
  display: none;
}
.form-status.visible { display: block; }

/* =============================================================
   Footer
   ============================================================= */
.site-footer { border-top: 1px solid var(--border-soft); padding: 36px 0; margin-top: 40px; }

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

.footer-note { color: var(--text-faint); font-size: 0.82rem; font-family: var(--font-mono); }

.social-links { display: flex; gap: 18px; }
.social-links a { font-size: 0.85rem; color: var(--text-muted); }
.social-links a:hover { color: var(--accent-strong); }

/* =============================================================
   Page intro (Projects / Contact top banners)
   ============================================================= */
.page-hero { padding: 72px 0 32px; }
.page-hero h1 { font-size: clamp(2rem, 4vw, 2.9rem); margin-top: 16px; }
.page-hero p { margin-top: 16px; color: var(--text-muted); max-width: 60ch; }

/* =============================================================
   Responsive
   ============================================================= */
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; }
  .hero-photo { order: -1; margin-bottom: 24px; }
  .contact-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }

  .site-header.nav-open .nav-links {
    display: flex;
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 4px;
  }
}

@media (max-width: 520px) {
  .wrap { padding: 0 20px; }
  section { padding: 64px 0; }
  .photo-frame { width: 100%; max-width: 280px; height: 320px; }
}
