/* ===== Reset & base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0c0b09;
  --bg-alt: #131210;
  --surface: #17150f;
  --border: #2b2822;
  --text: #f3efe6;
  --text-dim: #b4ac9d;
  --text-dimmer: #847c6d;
  --accent: #e3a23f;
  --accent-dim: #a6782f;
  --accent-soft: rgba(227, 162, 63, 0.12);
  --radius: 10px;
  --max-width: 1140px;
  --font-serif: 'Fraunces', serif;
  --font-sans: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

ul { list-style: none; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.2;
}

/* ===== Header / Nav ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 11, 9, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

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

.logo {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--text);
}
.logo .accent { color: var(--accent); }

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

.nav-link {
  position: relative;
  font-size: 0.88rem;
  color: var(--text-dim);
  padding-bottom: 4px;
  transition: color 0.2s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.25s ease;
}
.nav-link:hover { color: var(--text); }
.nav-link:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  width: 100%;
  height: 1px;
  background: var(--text);
}

/* ===== Hero ===== */
.hero {
  padding: 150px 28px 110px;
  display: flex;
  align-items: center;
  min-height: 72vh;
}

.hero-inner { max-width: 760px; }

.kicker {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 22px;
}

.hero-name {
  font-size: clamp(2.8rem, 7vw, 5.2rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 28px;
  color: var(--text);
}

.hero-desc {
  max-width: 600px;
  color: var(--text-dim);
  font-size: 1.08rem;
  margin-bottom: 38px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 44px;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 13px 28px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform 0.15s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--accent);
  color: #1a1304;
}
.btn-primary:hover { background: #edb059; }

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.btn-link:hover { color: var(--accent); border-color: var(--accent); }
.btn-link .arrow { font-size: 0.85em; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 28px;              /* groups wrap whole — no dangling dividers */
  color: var(--text-dimmer);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}
.hero-meta-group { white-space: nowrap; }
.hero-meta-group .meta-divider { margin: 0 4px; }
.hero-meta a { color: var(--text-dimmer); transition: color 0.2s ease; }
.hero-meta a:hover { color: var(--accent); }
.meta-divider { color: var(--border); }

/* ===== Sections ===== */
.section {
  padding: 96px 0;
}
.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  margin-bottom: 20px;
}

.kicker-num {
  display: block;
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 14px;
}

.section-heading {
  font-size: clamp(1.9rem, 3.8vw, 2.6rem);
  font-weight: 500;
  line-height: 1.15;
  color: var(--text);
  max-width: 22ch;
}
/* One italic amber phrase per heading: the same voice as the Experience lead line */
.section-heading em {
  font-style: italic;
  color: var(--accent);
}

.section-intro {
  color: var(--text-dim);
  margin-bottom: 24px;
  max-width: 680px;
}

/* ===== Experience block (top of #work) ===== */
.exp {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  background: var(--bg-alt); /* lemonilab-logo.png's background is matched to this */
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.exp-story { padding: 40px 44px; }
.exp-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.exp-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: exp-pulse 2.4s ease-in-out infinite;
}
@keyframes exp-pulse {
  50% { box-shadow: 0 0 0 7px rgba(227, 162, 63, 0); }
}
.exp-lead {
  margin-top: 18px;
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 3.3vw, 2.4rem);
  line-height: 1.15;
  color: var(--text);
  max-width: 16ch;
}
.exp-kicker > span:not(.exp-live) { white-space: nowrap; }
.exp-loc::before { content: '· '; }
.exp-lead em { font-style: italic; color: var(--accent); }
.exp-text {
  margin-top: 18px;
  color: var(--text-dim);
  max-width: 54ch;
}
.exp-sectors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
  list-style: none;
  padding: 0;
}
.exp-sectors li {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.exp .company-badges {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* Career path: vertical rail with dots */
.exp-path {
  list-style: none;
  margin: 0;
  padding: 40px 40px 40px 44px;
  border-left: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, var(--accent-soft));
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 30px;
}
.exp-path li {
  position: relative;
  padding-left: 26px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.exp-path li::before { /* dot */
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--accent-dim);
  background: var(--bg-alt);
}
.exp-path li:not(:last-child)::after { /* rail to the next dot */
  content: '';
  position: absolute;
  left: 5.5px;
  top: 19px;
  bottom: -35px; /* li gap (30px) + next dot's top offset (5px) */
  width: 2px;
  background: var(--border);
}
.exp-path li.is-now::before {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.exp-when {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dimmer);
}
.exp-path li.is-now .exp-when { color: var(--accent); }
.exp-path strong {
  color: var(--text);
  font-weight: 600;
  font-size: 1rem;
}
.exp-path li > span:last-child {
  color: var(--text-dim);
  font-size: 0.88rem;
}

/* Impact numbers */
.exp-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
  border-bottom: 1px solid var(--border);
}
.exp-stats > div {
  padding: 28px 24px 26px;
  border-left: 1px solid var(--border);
}
.exp-stats > div:first-child { border-left: 0; padding-left: 4px; }
.exp-stats dt {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.6vw, 2.7rem);
  line-height: 1;
  color: var(--text);
}
.exp-stats dd {
  margin: 10px 0 0;
  color: var(--text-dim);
  font-size: 0.92rem;
}
.exp-stats small {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-dim);
}

.exp-grid-label {
  margin: 48px 0 20px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dimmer);
}

@media (max-width: 900px) {
  .exp { grid-template-columns: 1fr; }
  .exp-path { border-left: 0; border-top: 1px solid var(--border); }
  .exp-stats { grid-template-columns: repeat(2, 1fr); }
  .exp-stats > div:nth-child(3) { border-left: 0; padding-left: 4px; }
  .exp-stats > div:nth-child(n+3) { border-top: 1px solid var(--border); }
}
@media (max-width: 640px) {
  .exp-story, .exp-path { padding: 28px 22px; }
  /* Location drops to its own line, aligned with the text above, without a leading separator */
  .exp-kicker { display: grid; grid-template-columns: 7px auto; column-gap: 10px; justify-content: start; }
  .exp-loc { grid-column: 2; }
  .exp-loc::before { content: none; }
}
@media (prefers-reduced-motion: reduce) {
  .exp-live { animation: none; }
}

/* ===== Company logo badges ===== */
.company-badges {
  display: flex;
  align-items: center;
  gap: 24px;
}

.company-badge {
  display: inline-flex;
  align-items: center;
  height: 30px;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}
.company-badge:hover { opacity: 1; }
.company-badge img {
  height: 100%;
  width: auto;
  object-fit: contain;
}

/* ===== Job sub-label (reused by Education) ===== */
.job-sub {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.82rem;
  margin-bottom: 20px;
}

/* ===== Tag pill (reused across galleries) ===== */
.tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--accent);
}

/* ===== Tech-stack tags ===== */
.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stack-tags span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 9px;
  line-height: 1.3;
}
.section-alt .stack-tags span { background: var(--surface); }
.gallery-card:hover .stack-tags span { border-color: var(--accent-dim); color: var(--text); }

/* ===== Project link ===== */
.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  margin-top: auto;
  padding-top: 6px;
  width: fit-content;
}
.project-link .arrow {
  transition: transform 0.2s ease;
}
.project-link:hover .arrow {
  transform: translate(2px, -2px);
}

/* ===== Project gallery (Company + Personal) ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
}

.gallery-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.section-alt .gallery-card { background: var(--bg); }
.gallery-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-dim);
}

.gallery-media {
  aspect-ratio: 4 / 3;
  background: var(--bg-alt);
  overflow: hidden;
}
.gallery-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.gallery-media.logo-tile {
  background: #f4f1ea;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px;
}
.gallery-media.logo-tile img {
  width: auto;
  height: auto;
  max-width: 65%;
  max-height: 65%;
  object-fit: contain;
}

/* Tall phone screenshot shown whole inside a CSS device frame on a
   brand-tinted backdrop. Set --brand (and optionally --brand-2) inline. */
.gallery-media.device-showcase {
  --brand: var(--accent);
  --brand-2: var(--brand);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 115%, color-mix(in srgb, var(--brand) 55%, transparent), transparent 60%),
    radial-gradient(circle at 12% 10%, color-mix(in srgb, var(--brand-2) 22%, transparent), transparent 45%),
    linear-gradient(160deg, var(--bg-alt), #0a0907);
  isolation: isolate;
}
.gallery-media.device-showcase::before {
  /* faint dot grid for texture */
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 16px 16px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
  z-index: -1;
}
.device-showcase .device {
  height: 86%;
  aspect-ratio: 9 / 19.5;
  padding: 5px;
  border-radius: 22px;
  background: #050505;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 18px 40px -12px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 0 60px -10px color-mix(in srgb, var(--brand) 45%, transparent);
  transform: translateY(4px);
  transition: transform 0.35s ease;
}
.gallery-card:hover .device-showcase .device {
  transform: translateY(0);
}
.device-showcase .device img {
  width: 100%;
  height: 100%;
  border-radius: 17px;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Pre-rendered 3D mockup (tools/mockup) — transparent PNG/WebP over the backdrop. */
.device-showcase > img.mockup {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
}
.gallery-card:hover .device-showcase > img.mockup { transform: scale(1.03); }

/* Browser window — for websites. Rises from the bottom edge of the tile. */
.gallery-media.device-showcase:has(.browser) { align-items: flex-end; }
.device-showcase .browser {
  width: 84%;
  border-radius: 9px 9px 0 0;
  overflow: hidden;
  background: #1c1a16;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 0;
  box-shadow:
    0 -6px 40px -8px color-mix(in srgb, var(--brand) 40%, transparent),
    0 20px 40px -10px rgba(0, 0, 0, 0.8);
  transform: translateY(6px);
  transition: transform 0.35s ease;
}
.gallery-card:hover .device-showcase .browser { transform: translateY(0); }
.device-showcase .browser-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 9px;
  background: #24211c;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.device-showcase .browser-bar i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}
.device-showcase .browser-bar span {
  flex: 1;
  margin: 0 18px 0 10px;
  height: 11px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  font-family: var(--font-mono);
  font-size: 7px;
  line-height: 11px;
  color: var(--text-dimmer);
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
}
.device-showcase .browser img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
}

/* Laptop — for desktop apps. */
.device-showcase .laptop {
  width: 78%;
  transform: translateY(6px);
  transition: transform 0.35s ease;
}
.gallery-card:hover .device-showcase .laptop { transform: translateY(0); }
.device-showcase .laptop-screen {
  aspect-ratio: 16 / 10;
  padding: 6px;
  border-radius: 10px 10px 0 0;
  background: #050505;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 0;
  box-shadow: 0 0 60px -10px color-mix(in srgb, var(--brand) 45%, transparent);
}
.device-showcase .laptop-screen img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 3px;
  object-fit: cover;
  object-position: top center;
}
/* Logo-only screen (no app screenshot yet): logo centered on a light "splash". */
.device-showcase .laptop-screen.splash img {
  object-fit: contain;
  padding: 12%;
  background: #f4f1ea;
}
.device-showcase .laptop-base {
  position: relative;
  width: 118%;
  margin-left: -9%;
  height: 9px;
  border-radius: 0 0 12px 12px;
  background: linear-gradient(#3a3631, #1d1b18);
  box-shadow: 0 16px 30px -8px rgba(0, 0, 0, 0.8);
}
.device-showcase .laptop-base::before {
  content: "";
  position: absolute;
  top: 0;
  left: 42%;
  width: 16%;
  height: 4px;
  border-radius: 0 0 5px 5px;
  background: rgba(0, 0, 0, 0.45);
}

.gallery-media.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-alt), var(--surface));
}
.gallery-media.placeholder span {
  font-family: var(--font-serif);
  font-size: 2.6rem;
  color: var(--text-dimmer);
  letter-spacing: 0.02em;
}

.gallery-body {
  padding: 24px 26px 28px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
}

.gallery-body h3 {
  font-size: 1.15rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.gallery-body p {
  color: var(--text-dim);
  font-size: 0.93rem;
}

.no-shot-note {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dimmer);
  font-style: italic;
  margin-top: auto;
  padding-top: 4px;
}

/* ===== Skills ===== */
.skills {
  display: flex;
  flex-direction: column;
  gap: 36px;
  margin-top: 44px;
}

/* Each group is a frame hugging its tiles; the title is set into the top edge, right corner */
.skill-group {
  position: relative;
  padding: 18px 10px 10px;          /* tight: the frame wraps the tiles, not the section */
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-radius: calc(var(--radius) + 6px);   /* tile radius + padding, so corners nest */
}

.skill-group-label {
  position: absolute;
  top: 0;
  right: 22px;
  transform: translateY(-50%);
  padding: 0 10px;
  background: var(--bg);           /* masks the border line behind the title */
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
}

.skill {
  --brand: var(--accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.skill:hover {
  border-color: color-mix(in srgb, var(--brand) 55%, var(--border));
  transform: translateY(-2px);
}

/* Logo drawn as a mask so every icon shares one tone until hovered */
.skill-icon {
  width: 32px;
  height: 32px;
  background-color: var(--text-dim);
  -webkit-mask: var(--icon) center / contain no-repeat;
          mask: var(--icon) center / contain no-repeat;
  transition: background-color 0.2s ease;
}
.skill:hover .skill-icon { background-color: var(--brand); }

/* Fallback for tools without a published icon */
.skill-mono {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--text-dim);
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.skill:hover .skill-mono { color: var(--brand); border-color: var(--brand); }

.skill-name {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.3;
}

@media (max-width: 760px) {
  .skills { gap: 32px; margin-top: 40px; }
  .skill-group { padding: 16px 8px 8px; }
  .skill-group-label { right: 14px; padding: 0 8px; font-size: 0.68rem; }
  .skill-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
  .skill { padding: 14px 6px 12px; }
  .skill-icon, .skill-mono { width: 28px; height: 28px; }
}

/* ===== Git Activity ===== */
.activity { margin-top: 40px; }

.activity-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 36px;
}
.activity-stat {
  padding: 20px 22px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.activity-stat dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dimmer);
  margin-bottom: 6px;
}
.activity-stat dd {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1.1;
  color: var(--text);
}

/* Heatmap levels: empty cell + four steps of the amber accent */
.heatmap { --l0: #221f19; }
.heatmap .l0, .heatmap-legend .l0 { fill: var(--l0); background: var(--l0); }
.heatmap .l1, .heatmap-legend .l1 { fill: rgba(227, 162, 63, 0.28); background: rgba(227, 162, 63, 0.28); }
.heatmap .l2, .heatmap-legend .l2 { fill: rgba(227, 162, 63, 0.5);  background: rgba(227, 162, 63, 0.5); }
.heatmap .l3, .heatmap-legend .l3 { fill: rgba(227, 162, 63, 0.75); background: rgba(227, 162, 63, 0.75); }
.heatmap .l4, .heatmap-legend .l4 { fill: var(--accent); background: var(--accent); }
.heatmap-legend { --l0: #221f19; }

.heatmap-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  align-items: start;
  margin-bottom: 14px;
}
.heatmap-months { margin-bottom: 6px; }
.heatmap-months text {
  font-family: var(--font-mono);
  font-size: 9px;
  fill: var(--text-dimmer);
}
.heatmap-row svg { display: block; width: 100%; height: auto; }
.heatmap rect { transition: stroke 0.15s ease; }
.heatmap rect:hover { stroke: var(--text); stroke-width: 1; }

.heatmap-year {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.3;
}
.heatmap-year small {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dimmer);
}

.heatmap-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  padding-left: 140px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dimmer);
}
.heatmap-legend { display: inline-flex; align-items: center; gap: 4px; }
.heatmap-legend i { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }

@media (max-width: 760px) {
  .activity-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 28px; }
  .activity-stat { padding: 16px; }
  .heatmap-row { grid-template-columns: 1fr; gap: 6px; margin-bottom: 18px; }
  .heatmap-months { display: none; }
  .heatmap-year { display: flex; gap: 10px; align-items: baseline; }
  .heatmap-year small { display: inline; }
  .heatmap-foot { padding-left: 0; }
}

/* ===== Education ===== */
.edu-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 36px;
  padding: 36px 40px;
  background:
    radial-gradient(circle at 0% 50%, var(--accent-soft), transparent 45%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.edu-card::before {               /* thin accent rule on the leading edge */
  content: "";
  position: absolute;
  left: 0;
  top: 24px;
  bottom: 24px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.edu-logo {
  flex-shrink: 0;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  padding: 8px;
  background: #fff;
  box-shadow:
    0 0 0 1px var(--border),
    0 0 0 8px rgba(255, 255, 255, 0.03),
    0 12px 30px -10px rgba(0, 0, 0, 0.7);
}
.edu-logo img { width: 100%; height: 100%; display: block; }

.edu-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.edu-dates {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.edu-card h3 {
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  font-weight: 400;
  line-height: 1.2;
}
.edu-school { color: var(--text-dim); font-size: 0.95rem; }
.edu-school span { color: var(--text-dimmer); margin: 0 4px; }

.edu-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.edu-highlights li {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-dim);
  font-size: 0.85rem;
}
.edu-highlights strong { color: var(--text); font-weight: 600; }

@media (max-width: 640px) {
  .edu-card { flex-direction: column; align-items: flex-start; gap: 22px; padding: 28px 24px; }
  .edu-logo { width: 88px; height: 88px; }
}

/* ===== Contact ===== */
.contact-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.contact-email {
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 5.4vw, 2.6rem);
  font-weight: 400;
  color: var(--text);
  max-width: 100%;
  overflow-wrap: anywhere;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  display: inline-block;
  width: fit-content;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.contact-email:hover { color: var(--accent); border-color: var(--accent); }

.contact-secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.88rem;
}
.contact-phones { display: flex; flex-direction: column; gap: 8px; }
.contact-secondary a { color: var(--text-dim); transition: color 0.2s ease; }
.contact-secondary a:hover { color: var(--accent); }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 30px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text-dimmer);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.back-to-top { transition: color 0.2s ease; }
.back-to-top:hover { color: var(--accent); }

/* ===== Reveal animation ===== */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Project carousels (phones only) =====
   Below 760px each .gallery-grid becomes a horizontal swipe row: one card at a
   time with the next one peeking in, plus a "01 / 06" counter built by script.js. */
.carousel-status { display: none; }

@media (max-width: 760px) {
  .gallery-grid {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    margin: 0 -28px;           /* bleed to the screen edges... */
    padding: 4px 28px 6px;     /* ...while the first card still lines up with the text */
    scroll-padding: 0 28px;
    scrollbar-width: none;
  }
  .gallery-grid::-webkit-scrollbar { display: none; }
  .gallery-grid > .gallery-card {
    flex: 0 0 84%;
    scroll-snap-align: start;
  }
  /* Off-screen cards never intersect vertically, so skip the fade-in inside carousels */
  .gallery-grid > .gallery-card.reveal { opacity: 1; transform: none; }

  .carousel-status {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--text-dimmer);
  }
  .carousel-count b { color: var(--accent); font-weight: 500; }
  .carousel-track {
    flex: 1;
    height: 2px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
  }
  .carousel-track i {
    display: block;
    height: 100%;
    background: var(--accent);
    transition: width 0.25s ease;
  }
  .carousel-hint { text-transform: uppercase; }
}

/* ===== Responsive ===== */
@media (max-width: 760px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 28px 28px;
    gap: 18px;
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .hero { padding: 120px 28px 70px; min-height: auto; } /* 28px matches .container so the hero lines up with the nav */
  .section { padding: 68px 0; }
}
