/* ==========================================================================
   Shubham Shrivastav - portfolio
   Technical / terminal register: monospace for structure and metadata,
   a readable sans for prose. Dark is the native theme; light is a paper
   terminal rather than an afterthought.
   ========================================================================== */

:root {
  /* Light: paper terminal */
  --bg: #fbfaf8;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f2ee;
  --border: #e4e0d8;
  --border-strong: #d2ccc0;
  --text: #16202b;
  --text-dim: #55606d;
  --text-faint: #8a929c;
  --accent: #0f766e;
  --accent-soft: rgba(15, 118, 110, 0.1);
  --accent-line: rgba(15, 118, 110, 0.25);
  --amber: #b45309;
  --shadow: 0 1px 2px rgba(16, 32, 43, 0.04), 0 8px 24px -12px rgba(16, 32, 43, 0.12);

  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --container: 1080px;
  --radius: 8px;
  --section-y: 6rem;
}

body.dark-mode {
  --bg: #0a0e14;
  --bg-elev: #0f141b;
  --surface: #111821;
  --surface-2: #151d27;
  --border: #1e2731;
  --border-strong: #2c3846;
  --text: #d6dee8;
  --text-dim: #8b96a5;
  --text-faint: #5f6b78;
  --accent: #5eead4;
  --accent-soft: rgba(94, 234, 212, 0.1);
  --accent-line: rgba(94, 234, 212, 0.22);
  --amber: #fbbf24;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}

/* A faint grid, the way a terminal has a faint scanline. Never loud enough
   to compete with the text sitting on top of it. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 80% 50% at 50% 0%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 50% at 50% 0%, #000 20%, transparent 75%);
}

.container {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

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

a:hover {
  opacity: 0.72;
}

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

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

/* ---------------------------------------------------------------- nav */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.navbar .container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 3.75rem;
}

.logo {
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.logo span::before {
  content: '~/';
  color: var(--accent);
}

.logo span {
  text-transform: lowercase;
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  margin-left: auto;
}

.nav-links a {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--text-dim);
  text-transform: lowercase;
  position: relative;
  padding-block: 0.25rem;
}

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

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

.nav-links a.active::before {
  content: '';
  position: absolute;
  left: -0.7rem;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  background: var(--accent);
}

.theme-switch {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 0.75rem;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.theme-switch:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  cursor: pointer;
}

.hamburger .bar {
  width: 16px;
  height: 1.5px;
  background: var(--text-dim);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.hamburger.active .bar:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}

.hamburger.active .bar:nth-child(2) {
  opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

/* ---------------------------------------------------------------- hero */

.hero {
  padding: 9rem 0 5rem;
  border-bottom: 1px solid var(--border);
}

.hero .container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4rem;
  align-items: center;
}

.hero-content h1 {
  font-family: var(--mono);
  font-size: clamp(1.9rem, 4.4vw, 2.9rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.035em;
  color: var(--text);
  margin-bottom: 0.6rem;
}

.hero-content h1 .highlight {
  color: var(--accent);
}

/* Blinking block cursor. Purely decorative, and the first thing that says
   "terminal" before a single word is read. */
.hero-content h1::after {
  content: '';
  display: inline-block;
  width: 0.55em;
  height: 0.95em;
  margin-left: 0.14em;
  background: var(--accent);
  vertical-align: -0.13em;
  animation: blink 1.15s step-end infinite;
}

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

.hero-content h2 {
  font-family: var(--mono);
  font-size: clamp(0.95rem, 1.6vw, 1.0625rem);
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: -0.01em;
  margin-bottom: 1.75rem;
}

.hero-content > p {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--text-dim);
  max-width: 46ch;
  margin-bottom: 2rem;
  padding-left: 1.25rem;
  position: relative;
  line-height: 1.75;
}

.hero-content > p::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.hero-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.btn {
  font-family: var(--mono);
  font-size: 0.8125rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn.primary {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}

.btn.primary:hover {
  opacity: 0.85;
}

.btn.secondary {
  border-color: var(--border-strong);
  color: var(--text);
  background: transparent;
}

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

.hero-social {
  display: flex;
  gap: 0.6rem;
}

.hero-social a {
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  transition: border-color 0.15s ease, color 0.15s ease;
}

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

.hero-image img {
  width: clamp(160px, 20vw, 210px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  filter: grayscale(1) contrast(1.05);
  transition: filter 0.3s ease;
}

.hero-image img:hover {
  filter: grayscale(0);
}

/* ------------------------------------------------------- section header */

.section {
  padding: var(--section-y) 0;
  border-bottom: 1px solid var(--border);
}

.section-header {
  margin-bottom: 3rem;
}

.section-header h2 {
  font-family: var(--mono);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.015em;
  text-transform: lowercase;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-header h2::before {
  content: '##';
  color: var(--accent);
  font-weight: 500;
}

.section-header h2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* The old decorative gradient rule. The header rule replaces it. */
.section-divider {
  display: none;
}

/* ---------------------------------------------------------------- about */

.about-content {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 3.5rem;
  align-items: start;
}

.about-text p,
.about-info > p {
  color: var(--text-dim);
  margin-bottom: 1.15rem;
  max-width: 68ch;
}

.about-details {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 1.75rem 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--text-dim);
}

.about-details > div,
.about-details .detail,
.about-details p {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.about-details i {
  color: var(--accent);
  width: 1rem;
  font-size: 0.8rem;
}

.about-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.core-competencies,
.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.core-competencies h3,
.about-card h3 {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: lowercase;
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.core-competencies ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.core-competencies li {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--text-dim);
  padding-left: 1.1rem;
  position: relative;
}

.core-competencies li::before {
  content: '-';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* --------------------------------------------------- skills + timeline */

.skills-experience-content {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* Categories run across rather than down, so the block stays short. */
.skills-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem 2rem;
  align-items: start;
}

.skill-category {
  min-width: 0;
}

.skills-column,
.experience-column {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.column-header h3 {
  font-family: var(--mono);
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-transform: lowercase;
}

.skill-category {
  margin-bottom: 1.5rem;
}

.skill-category h3 {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-faint);
  text-transform: lowercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.7rem;
}

.skill-tags,
.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
}

.skill-tag,
.skill-tags span,
.skill-list li {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.skill-tag:hover,
.skill-tags span:hover,
.skill-list li:hover {
  border-color: var(--accent-line);
  color: var(--text);
}

/* Timeline reads as a log: a rule down the left, an entry per line. */
.timeline {
  position: relative;
  padding-left: 1.5rem;
}

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

.timeline-item {
  position: relative;
  padding-bottom: 2rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -1.5rem;
  top: 0.5rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--border-strong);
  transform: translateX(-3px);
}

.timeline-item:first-child .timeline-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.timeline-header h3 {
  font-family: var(--mono);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

.timeline-date {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  white-space: nowrap;
}

.timeline-content h4 {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent);
  margin-top: 0.15rem;
}

.timeline-location {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-top: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tech-environment {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  background: var(--surface-2);
  border-left: 2px solid var(--accent-line);
  border-radius: 0 4px 4px 0;
  padding: 0.5rem 0.7rem;
  margin: 0.85rem 0;
  line-height: 1.6;
}

.tech-environment strong {
  color: var(--text-dim);
  font-weight: 500;
}

.timeline-description {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.timeline-description li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--text-dim);
  font-size: 0.875rem;
}

.timeline-description li::before {
  content: '\2022';
  position: absolute;
  left: 0.15rem;
  color: var(--accent);
}

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

/* ------------------------------------------------------------- projects */

.projects-grid {
  display: grid;
  gap: 1.5rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

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

.project-image {
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background: var(--surface-2);
  min-height: 100%;
}

.project-image img,
.project-image video {
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
  object-position: top left;
  transition: transform 0.35s ease;
}

.project-card:hover .project-image img {
  transform: scale(1.02);
}

.image-overlay {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(2px);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text);
}

.image-overlay i {
  font-size: 1rem;
  color: var(--accent);
}

.project-image:hover .image-overlay {
  opacity: 1;
}

.project-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.project-content h3 {
  font-family: var(--mono);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 0.15rem;
}

.project-description-text p,
.project-description-expandable p {
  color: var(--text-dim);
  font-size: 0.875rem;
  margin-bottom: 0.7rem;
}

.project-description,
.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.project-description li,
.feature-list li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--text-dim);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.project-description li::before,
.feature-list li::before {
  content: '\2022';
  position: absolute;
  left: 0.15rem;
  color: var(--accent);
}

.project-description strong,
.feature-list strong {
  color: var(--text);
  font-weight: 600;
}

.project-description-expandable {
  display: none;
}

.project-description-expandable.show {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.show-more-btn,
.show-more-text {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.4rem 0;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.show-more-btn:hover,
.show-more-text:hover {
  opacity: 0.75;
}

.project-links {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 1.1rem;
}

.project-links a,
.project-link {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.35rem 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.project-links a:hover,
.project-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  opacity: 1;
}

/* Earlier work: same content, a quieter register, so the five that matter
   are not competing with a college Arduino project. */
.projects-archive-header {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-faint);
  text-transform: lowercase;
  letter-spacing: 0.02em;
  margin: 3.5rem 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

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

.projects-archive-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.projects-archive {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  align-items: start;
}

.projects-archive .project-card {
  height: 100%;
}

.projects-archive .project-card {
  grid-template-columns: 1fr;
  box-shadow: none;
}

/* One fixed height for every thumbnail, so the row tops line up instead of
   stepping with each image's natural aspect ratio. */
.projects-archive .project-image {
  border-right: none;
  border-bottom: 1px solid var(--border);
  height: 140px;
  min-height: 0;
  max-height: none;
  flex: none;
}

.projects-archive .project-image img,
.projects-archive .project-image video {
  min-height: 0;
  height: 100%;
  width: 100%;
  object-fit: cover;
  object-position: top center;
}

.projects-archive .project-content {
  padding: 1.1rem;
}

.projects-archive .project-content h3 {
  font-size: 0.8125rem;
}

.projects-archive .tech-environment {
  font-size: 0.6875rem;
  margin: 0.6rem 0;
}

.projects-archive .project-description li,
.projects-archive .feature-list li {
  font-size: 0.75rem;
}

/* ------------------------------------------------------------- lightbox */
/* #lightbox is the .lightbox-overlay backdrop and takes .active; the
   .lightbox-container inside it is the content box, not the modal itself. */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 2rem;
}

.lightbox-overlay.active {
  display: grid;
  place-items: center;
}

.lightbox-container {
  position: relative;
  width: min(1100px, 94vw);
  max-height: 88vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 0;
}

.lightbox-image-container {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
}

#lightbox-image {
  max-width: 100%;
  max-height: 68vh;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
}

.lightbox-close,
.lightbox-btn {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 0.85rem;
  z-index: 2;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.lightbox-close:hover,
.lightbox-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.lightbox-close {
  top: -0.9rem;
  right: -0.9rem;
}

.lightbox-prev { left: 0.6rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 0.6rem; top: 50%; transform: translateY(-50%); }

.lightbox-info {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.lightbox-info h3 {
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.lightbox-counter {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-faint);
}

.lightbox-dots {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  flex-wrap: wrap;
}

.lightbox-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-strong);
  border: none;
  padding: 0;
  cursor: pointer;
}

.lightbox-dot.active {
  background: var(--accent);
}

/* -------------------------------------------------------------- contact */

.contact-content,
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 3rem;
  align-items: start;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact-item {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}

.contact-item i {
  color: var(--accent);
  font-size: 0.9rem;
  margin-top: 0.3rem;
  width: 1.1rem;
}

.contact-item h3 {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-faint);
  text-transform: lowercase;
  letter-spacing: 0.03em;
}

.contact-item p,
.contact-item a {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--text-dim);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  text-transform: lowercase;
}

.contact-form input,
.contact-form textarea {
  font-family: var(--mono);
  font-size: 0.8125rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  color: var(--text);
  width: 100%;
  transition: border-color 0.15s ease;
}

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

.contact-form textarea {
  min-height: 120px;
  resize: vertical;
}

/* --------------------------------------------------------------- footer */

footer {
  padding: 2rem 0;
  text-align: center;
}

footer p {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-faint);
}

.back-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 90;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.back-to-top.active,
.back-to-top.show,
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ------------------------------------------------------- scroll reveal */

[data-reveal],
[data-stagger-item] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Before the script arms itself, everything must be visible. Otherwise a
   JS failure leaves a blank page rather than an unanimated one. */
body:not(.reveal-ready) [data-reveal],
body:not(.reveal-ready) [data-stagger-item] {
  opacity: 1;
  transform: none;
}

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

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

[data-stagger].is-visible [data-stagger-item]:nth-child(1) { transition-delay: 0.04s; }
[data-stagger].is-visible [data-stagger-item]:nth-child(2) { transition-delay: 0.08s; }
[data-stagger].is-visible [data-stagger-item]:nth-child(3) { transition-delay: 0.12s; }
[data-stagger].is-visible [data-stagger-item]:nth-child(4) { transition-delay: 0.16s; }
[data-stagger].is-visible [data-stagger-item]:nth-child(n + 5) { transition-delay: 0.2s; }

@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;
  }
  [data-reveal],
  [data-stagger-item] {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---------------------------------------------------------- responsive */

@media (max-width: 900px) {
  .about-content,
  .contact-content,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }

  .project-card {
    grid-template-columns: 1fr;
  }

  .project-image {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .project-image img {
    min-height: 0;
    max-height: 240px;
  }
}

@media (max-width: 720px) {
  :root { --section-y: 3.5rem; }

  .hamburger { display: flex; }

  .nav-links {
    position: fixed;
    inset: 3.75rem 0 auto 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1.25rem 1rem;
    display: none;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    display: block;
    padding: 0.6rem 0;
    font-size: 0.875rem;
  }

  .nav-links a.active::before {
    display: none;
  }

  .hero {
    padding: 7rem 0 3.5rem;
  }

  .hero .container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-image {
    order: -1;
  }

  .hero-image img {
    width: 84px;
  }

  .projects-archive {
    grid-template-columns: 1fr;
  }

  .lightbox-overlay { padding: 1rem; }
  .lightbox-container { padding: 0.9rem; }
  .lightbox-close { top: -0.7rem; right: -0.7rem; }
}


/* ------------------------------------------------- markup-specific fixes */



.lightbox-info {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 0.75rem;
}

.about-info {
  min-width: 0;
}

.contact-social {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.contact-social a {
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: var(--text-dim);
  transition: border-color 0.15s ease, color 0.15s ease;
}

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

.form-response {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  min-height: 1rem;
}

.footer-content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .skills-content {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }
}


/* toggleProjectDescription() sets an inline display:block, which beats any
   flex layout here, so space the revealed bullets with margin instead. */
.project-description-expandable > li {
  margin-bottom: 0.5rem;
}

/* ========================================================================
   Terminal
   ======================================================================== */

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

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

.btn kbd,
.term-launch kbd {
  font-family: var(--mono);
  font-size: 0.6875rem;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  padding: 0.05rem 0.3rem;
  color: var(--text-faint);
  line-height: 1.4;
}

.term-launch {
  position: fixed;
  left: 1.5rem;
  bottom: 1.5rem;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.term-launch:hover {
  border-color: var(--accent);
  color: var(--text);
}

.term-launch-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  flex: none;
}

.term-root {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  padding: 2rem 1.5rem;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.term-root.active {
  display: grid;
  place-items: center;
}

.term-window {
  width: min(760px, 100%);
  height: min(520px, 78vh);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.55);
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  flex: none;
}

.term-dots {
  display: flex;
  gap: 0.35rem;
}

.term-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border-strong);
}

.term-dots i:first-child { background: #ff5f57; }
.term-dots i:nth-child(2) { background: #febc2e; }
.term-dots i:nth-child(3) { background: #28c840; }

.term-title {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-inline: auto;
}

.term-close {
  background: transparent;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.15rem 0.3rem;
  line-height: 1;
}

.term-close:hover { color: var(--text); }

.term-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.9rem 1rem 1rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--text-dim);
  cursor: text;
}

.term-line {
  white-space: pre-wrap;
  word-break: break-word;
}

.term-echo { color: var(--text); }
.term-dim { color: var(--text-faint); }
.term-accent { color: var(--accent); }
.term-key { color: var(--text); display: inline-block; }
.term-ok { color: var(--accent); }
.term-warn { color: var(--amber); }

.term-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.term-prompt {
  color: var(--accent);
  flex: none;
}

.term-inputline {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: 0.15rem;
}

.term-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  caret-color: var(--accent);
}

@media (max-width: 720px) {
  .term-launch {
    left: 1rem;
    bottom: 1rem;
    padding: 0.4rem 0.6rem;
  }

  .term-launch kbd { display: none; }

  .term-root { padding: 1rem; }

  .term-window { height: 72vh; }
}

/* ========================================================================
   Contact
   ======================================================================== */

.contact-lead {
  color: var(--text-dim);
  max-width: 62ch;
  margin: -1.5rem 0 2.5rem;
}

.contact-item > div {
  min-width: 0;
}

.contact-note {
  display: block;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--text-faint);
  margin-top: 0.15rem;
}

.copy-btn {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--text-faint);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
  margin-top: 0.35rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

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

.copy-btn.copied {
  border-color: var(--accent);
  color: var(--accent);
}

.copy-btn.inline {
  margin-top: 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.form-group .req {
  color: var(--amber);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--text-faint);
  opacity: 0.7;
}

.contact-form input.invalid,
.contact-form textarea.invalid {
  border-color: var(--amber);
}

.char-count {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--text-faint);
  align-self: flex-end;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.form-hint {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--text-faint);
  max-width: 34ch;
  line-height: 1.5;
}

.form-response {
  font-family: var(--mono);
  font-size: 0.75rem;
  min-height: 1rem;
  line-height: 1.6;
}

.form-response.success { color: var(--accent); }
.form-response.error { color: var(--amber); }

@media (max-width: 720px) {
  .form-row { grid-template-columns: 1fr; }
  .contact-lead { margin-top: -0.75rem; }
}
