/* ==========================================================================
   TreVince Gibson — Electrical & Field Service Technician
   Design language: industrial panel schedules + clinical calm.
   Dark theme = the shop floor. Light theme = the scan room.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Avenir Next", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Segoe UI Mono", Consolas, "Liberation Mono", monospace;

  --max-w: 1140px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1318;
  --bg-alt: #121922;
  --panel: #18212b;
  --panel-2: #1d2834;
  --line: #2b3642;
  --line-soft: #232d38;
  --text: #e9edf1;
  --muted: #9fadba;
  --accent: #ffb454;          /* voltage amber */
  --accent-strong: #ffc676;
  --accent-ink: #1a1206;
  --teal: #5fd4c4;            /* clinical teal */
  --led-red: #ff5d5d;
  --grid-line: rgba(95, 212, 196, 0.05);
  --photo-edge: #2b3642;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7f9;
  --bg-alt: #eaeff3;
  --panel: #ffffff;
  --panel-2: #f1f5f8;
  --line: #ccd6de;
  --line-soft: #dde4ea;
  --text: #16202a;
  --muted: #51606e;
  --accent: #b05f00;
  --accent-strong: #8f4d00;
  --accent-ink: #ffffff;
  --teal: #0c7d6f;
  --led-red: #cf3434;
  --grid-line: rgba(12, 125, 111, 0.06);
  --photo-edge: #ccd6de;
  --shadow: 0 10px 30px rgba(22, 32, 42, 0.10);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0 0 0.6em;
  letter-spacing: -0.015em;
  font-weight: 800;
}

h1 { font-size: clamp(2.4rem, 6vw, 3.9rem); }
h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }
a { color: var(--teal); }

.container {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2rem);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 200;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

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

/* ---------- Signature: wire tags & LEDs ---------- */
.wire-tag {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.75rem;
  border-radius: 3px;
  background: var(--panel);
  margin: 0 0 1.1rem;
  text-transform: uppercase;
}

.led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex: 0 0 auto;
  box-shadow: 0 0 0 2px var(--line-soft);
}
.led-on {
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal);
  animation: led-pulse 2.4s infinite;
}
@keyframes led-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.nav {
  max-width: var(--max-w);
  margin-inline: auto;
  padding: 0.7rem clamp(1.1rem, 4vw, 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.brand-led {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.brand-sub { color: var(--muted); font-weight: 400; }

.nav-menu { display: flex; align-items: center; gap: 1.1rem; }

.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.2rem;
}
.nav-links a {
  display: block;
  padding: 0.45rem 0.7rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: color 0.2s ease, background-color 0.2s ease;
}
.nav-links a:hover { color: var(--text); background: var(--panel); }
.nav-links a.active { color: var(--accent); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent); }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.55rem;
  cursor: pointer;
}
.nav-toggle-bar {
  width: 20px;
  height: 2px;
  background: var(--text);
  transition: transform 0.25s var(--ease), opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(2.5rem, 6vw, 4rem);
  background:
    linear-gradient(transparent 0%, var(--bg) 92%),
    repeating-linear-gradient(0deg, var(--grid-line) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(90deg, var(--grid-line) 0 1px, transparent 1px 44px),
    var(--bg);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero-role {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
}

.hero-lede {
  max-width: 56ch;
  color: var(--muted);
  font-size: 1.12rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 1.6rem 0 2.2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
  border-radius: var(--radius-sm);
  padding: 0.78rem 1.35rem;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font-body);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background-color 0.2s ease, border-color 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 28%, transparent);
}
.btn-primary:hover { background: var(--accent-strong); }

.btn-ghost {
  color: var(--text);
  border-color: var(--line);
  background: var(--panel);
}
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}
.stat {
  padding: 0.95rem 1.05rem;
  border-left: 1px solid var(--line-soft);
}
.stat:first-child { border-left: none; }
.stat dd {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  color: var(--accent);
  letter-spacing: -0.01em;
}
.stat dt {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.3rem;
  line-height: 1.4;
}

.hero-photo { justify-self: center; width: min(100%, 380px); }

.photo-frame {
  margin: 0;
  position: relative;
  border: 1px solid var(--photo-edge);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 0.65rem;
  box-shadow: var(--shadow);
}
.photo-frame::before,
.photo-frame::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent);
  opacity: 0.85;
}
.photo-frame::before { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.photo-frame::after { bottom: -2px; right: -2px; border-left: none; border-top: none; }

.photo-frame img {
  border-radius: calc(var(--radius) - 5px);
  width: 100%;
  height: auto;
}
.photo-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-align: center;
  padding-top: 0.6rem;
}

.hero-trace {
  display: block;
  width: 100%;
  height: 56px;
  margin-top: clamp(1.5rem, 4vw, 3rem);
  color: var(--line);
}

/* ---------- Sections ---------- */
.section { padding: clamp(3.2rem, 8vw, 5.5rem) 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line-soft); }
.section-lede { color: var(--muted); max-width: 62ch; margin-bottom: 2.2rem; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(1.8rem, 4vw, 3rem);
  align-items: start;
  margin-top: 1.4rem;
}
.about-body p { color: var(--text); }
.about-body p + p { margin-top: 1.1em; }

.about-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.2rem 0.9rem;
  position: sticky;
  top: 84px;
}
.panel-title {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.7rem;
  margin-bottom: 0.4rem;
}
.panel-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}
.panel-rows li {
  display: flex;
  gap: 0.9rem;
  align-items: baseline;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 0.95rem;
}
.panel-rows li:last-child { border-bottom: none; }
.row-id {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  flex: 0 0 auto;
}

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}
.skill-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem 1.3rem 1rem;
  transition: border-color 0.2s ease, transform 0.25s var(--ease);
}
.skill-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.skill-card h3 {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 1.08rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line-soft);
}
.skill-num {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 0.18rem 0.4rem;
}
.skill-card ul {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
}
.skill-card li {
  position: relative;
  padding: 0.38rem 0 0.38rem 1.15rem;
  font-size: 0.95rem;
  color: var(--muted);
}
.skill-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.95em;
  width: 7px;
  height: 2px;
  background: var(--teal);
}

/* ---------- Projects ---------- */
.project {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.6rem, 4vw, 3rem);
  align-items: start;
  padding: clamp(1.8rem, 4vw, 2.6rem) 0;
  border-top: 1px solid var(--line-soft);
}
.project:first-of-type { border-top: none; }
.project-flip .project-media { order: 2; }
.project-flip .project-body { order: 1; }

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.gallery-main {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--photo-edge);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
  background: var(--panel);
}
.gallery-main img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}
.gallery-main:hover img { transform: scale(1.025); }

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.gallery-thumbs button {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  background: var(--panel);
  transition: border-color 0.2s ease, opacity 0.2s ease;
  opacity: 0.85;
}
.gallery-thumbs button:hover { border-color: var(--accent); opacity: 1; }
.gallery-thumbs img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.case-points { margin: 0; }
.case-points > div { margin-bottom: 0.95rem; }
.case-points dt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.18rem;
}
.case-points dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.99rem;
}
.case-points dd::first-letter { text-transform: uppercase; }

/* ---------- Timeline ---------- */
.timeline {
  list-style: none;
  margin: 1.6rem 0 0;
  padding: 0;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--line);
}
.timeline-item {
  position: relative;
  padding: 0 0 2rem 2.6rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-node {
  position: absolute;
  left: 0;
  top: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 2px solid var(--accent);
}
.timeline-node::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem 1.5rem;
}
.timeline-when {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}
.timeline-card h3 { margin-bottom: 0.15rem; }
.timeline-where { color: var(--muted); font-size: 0.93rem; margin-bottom: 0.8rem; }
.timeline-card ul { margin: 0; padding-left: 1.1rem; }
.timeline-card li { margin-bottom: 0.45rem; color: var(--muted); font-size: 0.97rem; }
.timeline-card li::marker { color: var(--teal); }

/* ---------- Education ---------- */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
  margin-top: 1.4rem;
}
.edu-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--teal);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
}
.edu-type {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.5rem;
}
.edu-where { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.7rem; }
.edu-card p:last-child { margin-bottom: 0; color: var(--muted); font-size: 0.95rem; }
.edu-badges {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.edu-badges li {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  color: var(--muted);
}

/* ---------- Why hire me ---------- */
.why-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
  margin-top: 1.4rem;
}
.why-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
}
.why-card h3 { font-size: 1.12rem; }
.why-card p { margin: 0; color: var(--muted); font-size: 0.99rem; }
.why-cta { margin-top: 2rem; text-align: center; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: clamp(1.6rem, 4vw, 3rem);
  align-items: start;
}
.contact-cards { display: grid; gap: 0.9rem; }
.contact-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.9rem;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.05rem 1.2rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s ease, transform 0.2s var(--ease);
}
a.contact-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.contact-card svg { grid-row: span 2; color: var(--accent); }
.contact-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.contact-value { font-weight: 600; }

.contact-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
}
.form-note { font-size: 0.85rem; color: var(--muted); margin-bottom: 1.2rem; }
.form-row { margin-bottom: 1rem; }
.form-row label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.form-row input,
.form-row textarea {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  font: inherit;
  transition: border-color 0.2s ease;
}
.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.form-error { color: var(--led-red); font-size: 0.9rem; font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 1.8rem 0;
  background: var(--bg-alt);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.footer-inner p { margin: 0; }
.footer-tag { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; }
.footer-top { color: var(--muted); text-decoration: none; }
.footer-top:hover { color: var(--accent); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(8, 11, 14, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.lightbox[hidden] { display: none; }
.lightbox-figure { margin: 0; max-width: min(1100px, 92vw); text-align: center; }
.lightbox-figure img {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  margin-inline: auto;
  border-radius: var(--radius-sm);
  border: 1px solid #2b3642;
}
.lightbox-figure figcaption {
  color: #c6d0d9;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  margin-top: 0.8rem;
}
.lightbox button {
  position: absolute;
  background: rgba(24, 33, 43, 0.85);
  color: #e9edf1;
  border: 1px solid #2b3642;
  border-radius: 50%;
  width: 46px;
  height: 46px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.lightbox button:hover { border-color: #ffb454; }
.lightbox-close { top: 1.2rem; right: 1.2rem; }
.lightbox-prev { left: 1.2rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 1.2rem; top: 50%; transform: translateY(-50%); }

/* ---------- Reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
/* If JS is unavailable, content stays visible */
.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .led-on { animation: none; }
  .btn, .skill-card, .gallery-main img, a.contact-card { transition: none; }
  .gallery-main:hover img { transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { order: -1; width: min(70%, 320px); }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(odd) { border-left: none; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line-soft); }
  .skills-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .edu-grid { grid-template-columns: 1fr; }
  .project,
  .project-flip { grid-template-columns: 1fr; }
  .project-flip .project-media { order: 1; }
  .project-flip .project-body { order: 2; }
  .about-grid { grid-template-columns: 1fr; }
  .about-panel { position: static; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 0.8rem clamp(1.1rem, 4vw, 2rem) 1.2rem;
    display: none;
  }
  .nav-menu.open { display: flex; }
  .nav-links { flex-direction: column; }
  .nav-links a { padding: 0.7rem 0.4rem; font-size: 1rem; }
  .theme-toggle { align-self: flex-start; margin-top: 0.4rem; }
}

@media (max-width: 540px) {
  body { font-size: 1rem; }
  .skills-grid { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: 1fr; }
  .gallery-thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .lightbox { padding: 0.8rem; }
  .lightbox-prev { left: 0.4rem; }
  .lightbox-next { right: 0.4rem; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .hero-actions, .contact-form, .lightbox, .footer-top, .nav-toggle { display: none !important; }
  body { background: #fff; color: #000; }
  .section { padding: 1.2rem 0; }
}
