:root {
  --bg: #06110a;
  --bg-2: #0a1a10;
  --card: #0d2015;
  --border: #1d3d29;
  --text: #dcf5e3;
  --muted: #8fb39b;
  --accent: #4ade80;
  --accent-2: #a3e635;
  --accent-dark: #166534;
  --on-accent: #04210f;
  --max: 1080px;
  --pixel: "Pixel", "Courier New", monospace; /* defined in fonts/fonts.css */
  --mono: var(--pixel);
  --shadow: 4px 4px 0 var(--accent-dark);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  font-family: var(--pixel);
  font-synthesis: none; /* the pixel font has one weight; fake bold would blur it */
  font-size: 1.05rem;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  background-image:
    radial-gradient(700px 450px at 85% -10%, rgba(74, 222, 128, .12), transparent 70%),
    radial-gradient(500px 400px at -10% 35%, rgba(163, 230, 53, .06), transparent 70%),
    linear-gradient(rgba(74, 222, 128, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 222, 128, .035) 1px, transparent 1px);
  background-size: auto, auto, 24px 24px, 24px 24px;
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--pixel); font-weight: 600; line-height: 1.15; margin: 0; }
::selection { background: var(--accent); color: var(--on-accent); }

.mono { font-family: var(--mono); font-size: 1rem; }
.accent { color: var(--accent); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem clamp(1rem, 5vw, 3rem);
  background: rgba(6, 17, 10, .82);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid transparent;
  transition: border-color .3s;
}
.nav.is-scrolled { border-color: var(--border); }
.nav__logo { font-family: var(--pixel); font-weight: 700; font-size: 1.6rem; }
.nav__logo span { color: var(--accent); }
.nav__links { display: flex; gap: 2rem; margin-left: auto; }
.nav__links a { font-family: var(--pixel); color: var(--muted); font-size: 1.05rem; transition: color .15s; }
.nav__links a:hover, .nav__links a.is-active { color: var(--accent); }
.nav__links a.is-active::before { content: "> "; }
.nav__toggle { display: none; }

/* Language switch */
.lang {
  position: relative; z-index: 11;
  display: inline-flex; gap: 2px; margin-left: 1.75rem; padding: 3px;
  background: var(--card); border: 2px solid var(--border);
}
.lang button {
  font: 500 .85rem/1 var(--pixel); letter-spacing: .05em;
  color: var(--muted); background: none; border: 0;
  padding: .4rem .55rem; cursor: pointer; transition: color .15s, background .15s;
}
.lang button:hover { color: var(--text); }
.lang button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.lang button:focus-visible, .tab:focus-visible, .nav__toggle:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ---------- Layout ---------- */
main { max-width: var(--max); margin: 0 auto; padding: 0 clamp(1rem, 5vw, 2rem); }
.section { padding: 6rem 0 2rem; }
.section__title {
  display: flex; align-items: center; gap: .75rem;
  font-size: clamp(1.6rem, 3.2vw, 2.2rem); margin-bottom: 2.5rem;
}
.section__title::after {
  content: ""; flex: 1; max-width: 300px; height: 2px;
  background: repeating-linear-gradient(90deg, var(--border) 0 8px, transparent 8px 12px);
}

/* ---------- Hero ---------- */
.hero {
  min-height: calc(100vh - 70px);
  display: grid; grid-template-columns: 1.4fr 1fr; align-items: center; gap: 3rem;
  padding: 3rem 0;
}
.hero h1 {
  font-size: clamp(2.6rem, 7vw, 4.8rem); font-weight: 700; margin: .5rem 0;
  text-shadow: 4px 4px 0 var(--accent-dark);
}
.hero__role { font-size: clamp(1.4rem, 3.6vw, 2.4rem); color: var(--muted); font-weight: 500; }
.typed { color: var(--accent); }
.typed::after {
  content: ""; display: inline-block; width: .55em; height: .9em; margin-left: 4px;
  vertical-align: -.08em; background: var(--accent);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.hero__intro { color: var(--muted); max-width: 560px; margin: 1.5rem 0 2rem; }
.hero__intro strong { color: var(--text); font-weight: 500; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 1rem; }

.btn {
  display: inline-block; padding: .8rem 1.4rem;
  font-family: var(--pixel); font-weight: 600; font-size: 1.05rem;
  border: 2px solid var(--accent);
  transition: transform .1s, box-shadow .1s, background .15s, color .15s;
}
.btn--primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow); }
.btn--primary:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--accent-dark); }
.btn--primary:active { transform: translate(4px, 4px); box-shadow: none; }
.btn--ghost { color: var(--accent); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--accent); background: rgba(74, 222, 128, .08); }

.socials { list-style: none; display: flex; gap: 1.1rem; padding: 0; margin: 2rem 0 0; }
.socials a {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--mono); font-size: 1rem; line-height: 1; color: var(--muted);
  overflow-wrap: anywhere; transition: color .15s;
}
.socials svg { flex-shrink: 0; width: 20px; height: 20px; fill: currentColor; transform: translateY(1px); }
.socials a:hover { color: var(--accent); }

.hero__photo { display: flex; flex-direction: column; align-items: center; gap: 1.25rem; }
.photo-wrap { position: relative; width: min(320px, 100%); }
.photo-frame {
  position: relative; width: 100%; aspect-ratio: 1;
  display: grid; place-items: center; overflow: hidden;
  background: var(--bg-2);
  border: 3px solid var(--accent);
  box-shadow: 10px 10px 0 var(--accent-dark);
}
/* Slideshow: images sit side by side in a strip that slides left */
.photo-frame__track {
  position: absolute; inset: 0; z-index: 2;
  display: flex;
  transition: transform .6s steps(8);
}
.photo-frame__track:not(.is-ready) { visibility: hidden; } /* until missing photos are filtered out */
.photo-frame__track img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; }
/* "my dog" style note: text + curved arrow poking into the frame's top-left corner
   (on phones it switches to the right side, see the mobile section) */
.photo-note {
  position: absolute; z-index: 3; top: -3.4rem; left: -3.6rem;
  display: flex; flex-direction: column; align-items: flex-start;
  pointer-events: none;
}
.photo-note[hidden] { display: none; }
.photo-note.is-showing { animation: note-in .4s steps(4) .45s both; }
.photo-note__text {
  font-size: 1.15rem; color: var(--accent-2); white-space: nowrap;
  transform: rotate(6deg); text-shadow: 2px 2px 0 var(--bg);
}
.photo-note__arrow {
  width: 64px; height: 64px; margin: .15rem 0 0 1.4rem;
  fill: none; stroke: var(--accent-2); stroke-width: 4; stroke-linecap: square; stroke-linejoin: miter;
  transform: scaleX(-1); /* the drawing points left; mirror it to point right into the frame */
  filter: drop-shadow(-2px 2px 0 var(--bg));
}
@keyframes note-in {
  from { opacity: 0; transform: translate(-8px, -8px); }
  to { opacity: 1; transform: none; }
}

.photo-dots { display: flex; gap: .5rem; }
.photo-dots button {
  width: 12px; height: 12px; padding: 0; cursor: pointer;
  background: var(--border); border: 0; transition: background .15s;
}
.photo-dots button:hover { background: var(--muted); }
.photo-dots button[aria-current="true"] { background: var(--accent); }
.photo-dots button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.photo-frame__initials {
  font-family: var(--pixel); font-size: 6rem; font-weight: 700; color: var(--accent);
  text-shadow: 6px 6px 0 var(--accent-dark);
}

/* ---------- Skills ---------- */
.skills { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; padding: 1rem 0; }
.skills span {
  font-family: var(--pixel); font-size: .95rem; color: var(--muted);
  padding: .35rem .85rem; border: 2px solid var(--border);
  background: var(--card); transition: color .15s, border-color .15s;
}
.skills span:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Experience ---------- */
.tabs {
  display: inline-flex; flex-wrap: wrap; max-width: 100%; gap: .25rem; padding: .3rem;
  background: var(--card); border: 2px solid var(--border); margin-bottom: 2rem;
}
.tab {
  font-family: var(--pixel); font-size: 1rem; font-weight: 500;
  color: var(--muted); background: none; border: 0;
  padding: .5rem 1.1rem; cursor: pointer; transition: color .15s, background .15s;
}
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--accent); color: var(--on-accent); }

.timeline { list-style: none; margin: 0; padding: 0 0 0 1.5rem; border-left: 2px dashed var(--border); }
.timeline[hidden] { display: none; }
.timeline__item { position: relative; padding: 0 0 2.5rem 1rem; }
.timeline__item::before {
  content: ""; position: absolute; left: calc(-1.5rem - 7px); top: .4rem;
  width: 12px; height: 12px;
  background: var(--accent); box-shadow: 0 0 0 3px var(--bg);
}
.timeline__date { color: var(--muted); font-size: .95rem; }
.timeline__item h3 { font-size: 1.3rem; margin: .35rem 0 .75rem; }
.timeline__item ul { margin: 0; padding-left: 1.1rem; color: var(--muted); list-style: square; }
.timeline__item li::marker { color: var(--accent); }

/* ---------- Projects ---------- */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.card {
  display: flex; flex-direction: column;
  padding: 1.75rem;
  background: var(--card); border: 2px solid var(--border);
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.card:hover { transform: translate(-3px, -3px); border-color: var(--accent); box-shadow: 6px 6px 0 var(--accent-dark); }
.card__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.card__icon {
  width: 38px; height: 38px; fill: none; stroke: var(--accent); stroke-width: 2;
  stroke-linecap: square; stroke-linejoin: miter;
}
.card__links { display: flex; gap: 1rem; font-size: 1rem; font-family: var(--pixel); color: var(--muted); }
.card__links a:hover { color: var(--accent); }
.card h3 { font-size: 1.35rem; margin-bottom: .6rem; }
.card p { color: var(--muted); margin: 0 0 1.25rem; flex: 1; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1rem; padding: 0; margin: 0; font-family: var(--mono); font-size: .9rem; color: var(--accent-2); }

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 4rem 1rem 2rem; color: var(--muted); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s steps(6), transform .6s steps(6); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .typed::after, .photo-note.is-showing { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 2rem; }
  .hero__photo { order: -1; align-items: flex-start; }
  .photo-wrap { width: 140px; }
  .photo-frame { box-shadow: 6px 6px 0 var(--accent-dark); }
  /* photo hugs the left edge on phones, so the note goes on the right */
  .photo-note { top: -2.4rem; left: auto; right: -5.2rem; align-items: flex-end; }
  .photo-note__text { transform: rotate(-6deg); }
  .photo-note__arrow {
    width: 48px; height: 48px; margin: .15rem 2.6rem 0 0;
    transform: none; filter: drop-shadow(2px 2px 0 var(--bg));
  }
  .photo-frame__initials { font-size: 3rem; text-shadow: 3px 3px 0 var(--accent-dark); }

  .lang { margin-left: auto; margin-right: .75rem; }
  .nav__toggle {
    display: flex; flex-direction: column; gap: 6px; background: none; border: 0; cursor: pointer; padding: .5rem; z-index: 11;
  }
  .nav__toggle span { width: 24px; height: 3px; background: var(--accent); transition: transform .2s; }
  .nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(4.5px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-4.5px) rotate(-45deg); }
  .nav__links {
    position: fixed; inset: 0 0 0 30%; flex-direction: column; justify-content: center; align-items: center; gap: 2.5rem;
    background: var(--bg-2); border-left: 2px solid var(--border);
    /* clipped in place (not moved off-screen) so the closed menu doesn't widen the page */
    clip-path: inset(0 0 0 100%); visibility: hidden;
    transition: clip-path .25s steps(5), visibility 0s .25s;
  }
  .nav__links.is-open { clip-path: inset(0); visibility: visible; transition: clip-path .25s steps(5); }
  .nav__links a { font-size: 1.4rem; }
}
