/* =========================================================
   Collins Osas — Portfolio
   Main stylesheet
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  --bg: #0a2520;
  --bg-alt: #12211f;
  --surface: #163330;
  --line: rgba(255, 255, 255, 0.08);
  --text: #e8f1ee;
  --muted: #9db3ad;
  --accent: #1c907c;
  --accent-hover: #cf8a3c;
  --accent-soft: rgba(28, 144, 124, 0.15);
  --accent-ink: #7fd6c4;
  --danger: #e06c5a;
  --dash: rgba(255, 255, 255, 0.15);
  --nav-bg: rgba(10, 37, 32, 0.85);
  --overlay: rgba(5, 18, 16, 0.4);
  --card-shadow: none;
  --frame-gap: var(--bg-alt);
  --glow: rgba(28, 144, 124, 0.35);
  --stripe: rgba(255, 255, 255, 0.03);
  --hero-bg-opacity: 0.08;
  --mock-bg: #0d1a18;
  --mock-bar: #081311;

  --radius: 0.75rem;
  --nav-h: 68px;
  --font-display: "Anton", Impact, sans-serif;
  --font-logo: "Unbounded", sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

[data-theme="light"] {
  --bg: #f6faf8;
  --bg-alt: #eaf2ef;
  --surface: #ffffff;
  --line: rgba(10, 37, 32, 0.12);
  --text: #0f1f1c;
  --muted: #4f625d;
  --accent: #178270;
  --accent-soft: rgba(23, 130, 112, 0.12);
  --accent-ink: #0f6b5c;
  --dash: rgba(10, 37, 32, 0.22);
  --nav-bg: rgba(246, 250, 248, 0.88);
  --overlay: rgba(10, 37, 32, 0.25);
  --card-shadow: 0 8px 24px rgba(10, 37, 32, 0.07);
  --frame-gap: var(--bg);
  --glow: rgba(23, 130, 112, 0.18);
  --stripe: rgba(10, 37, 32, 0.04);
  --hero-bg-opacity: 0.06;
  /* --mock-bg / --mock-bar stay dark: editor and browser mockups keep the dark palette */
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  min-width: 320px;
  transition: background-color 0.35s ease, color 0.35s ease;
}
body.menu-open { overflow: hidden; }

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

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

.container { width: min(1120px, 100% - 2rem); margin-inline: auto; }
.muted { color: var(--muted); }

/* ---------- Typography ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.05;
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  margin-bottom: 1.5rem;
}

.eyebrow {
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font: 600 0.95rem var(--font-body);
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius);
  border: 2px solid var(--accent);
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, color 0.25s, transform 0.25s;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; transform: translateY(-2px); }
.btn-small { padding: 0.45rem 1rem; font-size: 0.85rem; }
.btn-ghost { background: transparent; color: var(--text); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-inline: max(1rem, calc((100% - 1120px) / 2));
  transition: background-color 0.3s, box-shadow 0.3s;
}
.nav.scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 1px 0 var(--line);
}

.logo { font-family: var(--font-logo); font-weight: 800; font-size: 1.35rem; }
.logo span { color: var(--accent-hover); }

.nav-links { display: flex; align-items: center; gap: 1.75rem; margin-left: auto; }
.nav-links a:not(.btn) {
  font-size: 0.92rem;
  color: var(--muted);
  position: relative;
  transition: color 0.2s;
}
.nav-links a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.25s;
}
.nav-links a:not(.btn):hover,
.nav-links a.active { color: var(--text); }
.nav-links a:not(.btn):hover::after,
.nav-links a.active::after { width: 100%; }

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  width: 32px; height: 24px;
  position: relative;
  z-index: 110;
}
.nav-toggle span {
  position: absolute;
  left: 0;
  width: 100%; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s, top 0.3s;
}
.nav-toggle span:nth-child(1) { top: 2px; }
.nav-toggle span:nth-child(2) { top: 11px; }
.nav-toggle span:nth-child(3) { top: 20px; }
.nav-toggle.open span:nth-child(1) { top: 11px; transform: rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { top: 11px; transform: rotate(-45deg); }

/* Theme toggle */
.theme-toggle {
  width: 40px; height: 40px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.25s, color 0.25s, transform 0.4s;
}
.theme-toggle:hover { background: var(--accent-hover); color: #fff; transform: rotate(20deg); }
.theme-toggle svg {
  width: 18px; height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-toggle .icon-moon,
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* Overlay behind the mobile menu */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 99;                       /* below .nav (z-index: 100) */
  background: var(--overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
body.menu-open::before { opacity: 1; visibility: visible; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 2rem) 0 4rem;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: var(--hero-bg-opacity);   /* subtle photo texture */
  filter: blur(3px);
  transform: scale(1.05);
}
.hero::after {
  content: "";
  position: absolute;
  width: 520px; height: 520px;
  right: -160px; top: -120px;
  background: radial-gradient(circle, var(--glow), transparent 65%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
  align-items: center;
}
.hero .display { font-size: clamp(2.8rem, 8vw, 5.5rem); margin-bottom: 1rem; }
.hero-role { font-size: clamp(1.1rem, 2.5vw, 1.4rem); font-weight: 600; margin-bottom: 1rem; }
.typed { color: var(--accent-hover); }
.cursor { color: var(--accent); animation: blink 1s steps(1) infinite; margin-left: 2px; }

.hero-sub { color: var(--muted); max-width: 34rem; margin-bottom: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-top: 2rem; color: var(--muted); font-size: 0.88rem; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid rgba(28, 144, 124, 0.35);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #3ddc97;
  box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.6);
  animation: pulse 2s infinite;
}

.hero-photo { position: relative; justify-self: center; }
.photo-frame {
  width: min(360px, 78vw);
  aspect-ratio: 4 / 5;
  border-radius: 1.25rem;
  overflow: hidden;
  border: 2px solid var(--accent);
  box-shadow: 18px 18px 0 -2px var(--frame-gap), 18px 18px 0 0 var(--accent-hover);
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }

.badge {
  position: absolute;
  left: -1.5rem; bottom: 2rem;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.8rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  animation: float 4s ease-in-out infinite;
}
.badge strong { font-family: var(--font-display); font-size: 2rem; color: var(--accent); font-weight: 400; }
.badge span { font-size: 0.78rem; color: var(--muted); line-height: 1.3; }

.scroll-hint {
  position: absolute;
  left: 50%; bottom: 1.5rem;
  transform: translateX(-50%);
  width: 26px; height: 42px;
  border: 2px solid var(--muted);
  border-radius: 20px;
  z-index: 1;
}
.scroll-hint span {
  position: absolute;
  left: 50%; top: 8px;
  width: 4px; height: 8px;
  margin-left: -2px;
  background: var(--accent);
  border-radius: 2px;
  animation: scrollDot 1.8s infinite;
}

/* ---------- Tech marquee ---------- */
.marquee {
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: var(--bg-alt);
  padding: 1rem 0;
  transition: background-color 0.35s ease;
}
.marquee-track { display: flex; gap: 3rem; width: max-content; animation: scroll 35s linear infinite; }
.marquee-track span {
  font-family: var(--font-display);
  font-size: 1.4rem;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.marquee-track span::before { content: "✦"; color: var(--accent); margin-right: 3rem; font-size: 0.9rem; vertical-align: middle; }
.marquee:hover .marquee-track { animation-play-state: paused; }

/* ---------- Sections ---------- */
.section { padding: 6rem 0; }
.section-alt { background: var(--bg-alt); transition: background-color 0.35s ease; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 4rem; align-items: center; }
.about-photo {
  border-radius: 1.25rem;
  overflow: hidden;
  aspect-ratio: 1 / 1.15;
  position: relative;
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s; }
.about-text p { color: var(--muted); margin-bottom: 1rem; }
.about-text strong { color: var(--text); }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}
.stats li {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem;
  transition: background-color 0.35s ease;
}
.stats strong { display: block; font-family: var(--font-display); font-size: 2.2rem; font-weight: 400; color: var(--accent); line-height: 1; }
.stats span { font-size: 0.8rem; color: var(--muted); }

/* ---------- Services & process ---------- */
.services { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
.service {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--card-shadow);
}
.service-num { font-family: var(--font-display); font-size: 2.2rem; color: var(--accent-hover); line-height: 1; }
.service h3 { font-size: 1.1rem; margin: 1rem 0 0.5rem; }
.service p { color: var(--muted); font-size: 0.93rem; }

.process {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 3rem;
  counter-reset: step;
}
.step {
  position: relative;
  padding: 1.25rem 1rem 0;
  border-top: 2px solid var(--line);
  display: flex;
  flex-direction: column;
}
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: -14px; left: 1rem;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
}
.step b { margin-top: 0.4rem; }
.step span { color: var(--muted); font-size: 0.85rem; }

/* ---------- Projects ---------- */
.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-hover);
}
.tag-live { display: inline-flex; align-items: center; gap: 0.45rem; }
.tag-live::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-hover);
  animation: pulse 2s infinite;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }
.chips li {
  font-size: 0.78rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.checks li { position: relative; padding-left: 1.6rem; color: var(--muted); font-size: 0.95rem; margin-bottom: 0.35rem; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

/* Case study */
.case {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 3rem;
  align-items: center;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--card-shadow);
  transition: background-color 0.35s, border-color 0.35s;
}
.case-info h3 { font-size: 1.8rem; margin: 0.4rem 0 0.25rem; }
.lead { color: var(--text); margin-bottom: 1.25rem; }
.case-block { margin-bottom: 1.1rem; }
.case-block h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--accent); margin-bottom: 0.35rem; }
.case-block p { color: var(--muted); font-size: 0.95rem; }

/* Browser and editor mockups */
.browser { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.browser-bar,
.editor-bar { display: flex; align-items: center; gap: 6px; background: var(--mock-bar); }
.browser-bar { padding: 0.6rem 0.9rem; background: var(--mock-bg); }
.editor-bar { padding: 0.7rem 1rem; }
.browser-bar i,
.editor-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); flex-shrink: 0; }
.browser-bar i:nth-child(2),
.editor-bar i:nth-child(2) { background: #cf8a3c; }
.browser-bar i:nth-child(3),
.editor-bar i:nth-child(3) { background: #3ddc97; }
.browser-bar span,
.editor-bar span {
  margin-left: 0.75rem;
  font: 0.75rem var(--font-mono);
  color: #9db3ad;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.browser img,
.browser .img-placeholder { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 0; border: 0; }

/* Project cards */
.projects { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.project {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--card-shadow);
}
.project h3 { font-size: 1.3rem; margin: 0.5rem 0 0.75rem; }
.project p { color: var(--muted); margin-bottom: 1.25rem; }
.project .checks { margin-bottom: 1.25rem; }

/* ---------- Experience: tabs & ticket cards ---------- */
.tabs { display: inline-flex; background: var(--surface); padding: 0.3rem; border-radius: var(--radius); margin-bottom: 2.5rem; }
.tab {
  background: none;
  border: 0;
  color: var(--muted);
  font: 600 0.9rem var(--font-body);
  padding: 0.55rem 1.3rem;
  border-radius: 0.55rem;
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
}
.tab.active { background: var(--accent); color: #fff; }

.tab-panel { display: none; }
.tab-panel.active { display: grid; }
.timeline { gap: 1.5rem; }

.ticket {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  overflow: hidden;
  transition: background-color 0.35s ease;
}
/* Dashed divider between head and body, with a notch at each end */
.ticket-head { position: relative; padding: 1.75rem; border-right: 2px dashed var(--dash); }
.ticket-head::before,
.ticket-head::after {
  content: "";
  position: absolute;
  right: -13px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--bg-alt);
}
.ticket-head::before { top: -12px; }
.ticket-head::after { bottom: -12px; }

.ticket .date { font-size: 0.8rem; color: var(--accent-hover); font-weight: 600; letter-spacing: 0.05em; }
.ticket h3 { font-size: 1.15rem; margin: 0.4rem 0; line-height: 1.35; }
.ticket .org { color: var(--muted); font-size: 0.9rem; }
.ticket-body { padding: 1.75rem; }
.ticket-body li { position: relative; padding-left: 1.2rem; color: var(--muted); margin-bottom: 0.5rem; }
.ticket-body li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.65em;
  width: 7px; height: 7px;
  border-radius: 2px;
  background: var(--accent);
}

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.skill-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 2rem; }
.skill-group h3 { font-size: 0.85rem; margin-bottom: 0.6rem; }
.skill-group .chips { margin-bottom: 0; }

.editor {
  background: var(--mock-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.editor pre { padding: 1.5rem; overflow-x: auto; font: 0.88rem/1.7 var(--font-mono); color: #e8f1ee; }
.editor .k { color: #c792ea; }
.editor .v { color: #82aaff; }
.editor .p { color: #7fd6c4; }
.editor .s { color: #cf8a3c; }
.editor .b { color: #f78c6c; }
.editor .f { color: #ffcb6b; cursor: pointer; }
.editor .c { color: #6b8580; font-style: italic; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 4rem; align-items: start; }
.contact-text > p { color: var(--muted); margin-bottom: 2rem; }
.contact-text > .btn { margin-top: 2rem; }
.contact-list li { display: flex; flex-direction: column; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.contact-list span { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--muted); }
.contact-list a { font-weight: 600; overflow-wrap: anywhere; transition: color 0.2s; }
.contact-list a:hover { color: var(--accent-hover); }

.copy-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.copy-btn {
  font: 600 0.72rem var(--font-body);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.copy-btn:hover { background: var(--accent-hover); color: #fff; }

.contact-form {
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius);
  transition: background-color 0.35s ease;
}
.field { margin-bottom: 1.25rem; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem; }
.field input,
.field textarea {
  width: 100%;
  font: 16px var(--font-body);   /* 16px prevents iOS auto-zoom on focus */
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  padding: 0.8rem 1rem;
  resize: vertical;
  transition: border-color 0.2s;
}
.field input:focus,
.field textarea:focus { outline: none; border-color: var(--accent); }
.field.invalid input,
.field.invalid textarea { border-color: var(--danger); }
.error { display: block; min-height: 1.1em; color: var(--danger); font-size: 0.8rem; margin-top: 0.3rem; }
.form-status { margin-top: 1rem; font-size: 0.9rem; color: var(--accent-ink); }

/* ---------- Footer ---------- */
.footer { padding: 2rem 0; border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.footer p { color: var(--muted); font-size: 0.85rem; }

/* ---------- Back-to-top & toast ---------- */
.to-top {
  position: fixed;
  right: 1.25rem; bottom: 1.25rem;   /* bottom is offset above the footer in JS */
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 90;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s, background 0.2s, bottom 0.15s ease-out;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--accent-hover); }

.toast {
  position: fixed;
  left: 50%; bottom: 1.5rem;
  transform: translate(-50%, 150%);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius);
  z-index: 300;
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Image fallback (injected when an image fails to load) ---------- */
.img-placeholder {
  width: 100%;
  height: 100%;
  min-height: 200px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
  background:
    repeating-linear-gradient(45deg, var(--stripe) 0 10px, transparent 10px 20px),
    var(--surface);
  border-radius: inherit;
}

/* ---------- Scroll reveal ---------- */
/* Uses `translate` so it never competes with hover effects that use `transform` */
.reveal { opacity: 0; translate: 0 30px; transition: opacity 0.8s ease, translate 0.8s ease; }
.reveal.visible { opacity: 1; translate: none; }

/* Cards are revealed and lift on hover, so they carry both transitions */
.service,
.project { transition: opacity 0.8s ease, translate 0.8s ease, transform 0.3s, border-color 0.3s, background-color 0.35s; }

/* ---------- Animations ---------- */
@keyframes blink { 50% { opacity: 0; } }
@keyframes float { 50% { transform: translateY(-8px); } }
@keyframes scrollDot { 0% { opacity: 1; top: 8px; } 100% { opacity: 0; top: 24px; } }
@keyframes scroll { to { transform: translateX(-50%); } }
@keyframes pulse {
  70% { box-shadow: 0 0 0 10px rgba(61, 220, 151, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); }
}

/* Hover lifts only on devices that can hover (avoids sticky hover on touch) */
@media (hover: hover) {
  .service:hover,
  .project:hover { transform: translateY(-6px); border-color: var(--accent); }
  .about-photo:hover img { transform: scale(1.04); }
}

/* Allow grid items to shrink below their content width */
.case > *,
.skills-grid > *,
.contact-grid > *,
.about-grid > * { min-width: 0; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1000px) {
  .services { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .hero-inner,
  .about-grid,
  .contact-grid,
  .case,
  .skills-grid { grid-template-columns: 1fr; gap: 2.5rem; }

  .hero { flex-direction: column; justify-content: center; padding-bottom: 2.5rem; }
  .hero-text { order: 2; }
  .hero-photo { order: 1; }
  .hero-meta { flex-direction: column; gap: 0.6rem; margin-top: 1.75rem; }
  .hero-meta li {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0.6rem;
    padding: 0.55rem 0.9rem;
    width: fit-content;
  }
  .scroll-hint {
    position: relative;
    left: auto;
    bottom: auto;
    transform: none;
    margin: 2.75rem auto 0;
    flex-shrink: 0;
  }
  .about-photo { max-width: 420px; }
}

@media (max-width: 760px) {
  /* Navigation: logo left; theme and menu toggles right */
  .nav { gap: 0.75rem; }
  .nav-toggle { display: block; order: 3; }
  .theme-toggle { order: 2; margin-left: auto; width: 36px; height: 36px; position: relative; z-index: 110; }

  /* Drawer. backdrop-filter on .nav makes it the containing block for
     fixed children, so the drawer is sized explicitly. */
  .nav-links {
    position: fixed;
    top: 0; right: 0;
    width: min(280px, 80vw);
    height: 100vh;
    height: 100dvh;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    margin-left: 0;
    padding: calc(var(--nav-h) + 1.5rem) 2rem 2rem;
    background: var(--bg-alt);
    border-left: 1px solid var(--line);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.35s ease, visibility 0.35s ease;
  }
  .nav-links.open { transform: none; visibility: visible; box-shadow: -20px 0 40px rgba(0, 0, 0, 0.25); }
  .nav-links a:not(.btn) {
    width: 100%;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 1.05rem;
    color: var(--text);
  }
  .nav-links a:not(.btn)::after { display: none; }
  .nav-links a.active { color: var(--accent); }
  .nav-links .btn { margin-top: 1.25rem; width: 100%; text-align: center; padding: 0.8rem 1rem; }

  .section { padding: 4.5rem 0; }
  .process { grid-template-columns: 1fr 1fr; row-gap: 2rem; }
  .case { padding: 1.25rem; }

  .ticket { grid-template-columns: 1fr; }
  .ticket-head { border-right: 0; border-bottom: 2px dashed var(--dash); }
  .ticket-head::before { top: auto; bottom: -13px; left: -12px; right: auto; }
  .ticket-head::after { bottom: -13px; right: -12px; }
}

@media (max-width: 480px) {
  .services,
  .skill-groups,
  .stats { grid-template-columns: 1fr; }
  .badge { left: 0; bottom: 1rem; }
  .contact-form,
  .project { padding: 1.25rem; }
  .editor pre { font-size: 0.78rem; padding: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; translate: none; }
  .marquee-track { flex-wrap: wrap; width: auto; }
}
