:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-alt: #eaf4fd;
  --text: #0f2a44;
  --muted: #4a6380;
  --accent: #1565c0;
  --accent-contrast: #ffffff;
  --border: #c9def2;
  --blue-gradient: linear-gradient(rgb(34, 125, 170) 0%, rgb(81, 172, 205) 100%);
  --orange: rgb(205, 120, 81);
  --radius: 10px;
  --max-width: 960px;
  --header-height: 3.5rem;
}

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

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

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

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

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}

/* Hero: full-width gradient that fills the viewport below the sticky header */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100svh - var(--header-height));
  padding: 4rem 0;
}

.hero > .container {
  position: relative;
  width: 100%;
}

/* Seasonal easter-egg decorations, drawn behind the hero content by script.js */
.season-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Konami code shortcut, added by script.js */
.konami-btn {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 1;
  padding: 0.3rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  background: rgba(15, 42, 68, 0.25);
  color: rgba(255, 255, 255, 0.85);
  font: 600 0.75rem/1 ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s, background-color 0.2s, border-color 0.2s;
}

.konami-btn:hover,
.konami-btn:focus-visible {
  opacity: 1;
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

.konami-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.eyebrow {
  color: #e0f2fe;
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.hero h1 {
  font-family: "Playpen Sans", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(2.5rem, 6vw, 3.75rem);
}

.tagline {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  color: #ffb38a;
  font-weight: 500;
}

/* Blinking text-entry caret after the title of the section in view (moved by script.js). */
.has-caret::after {
  content: "";
  display: inline-block;
  width: 0.08em;
  height: 1.1em;
  margin-left: 0.3em;
  vertical-align: -0.15em;
  background: currentColor;
  animation: caret-blink 1.06s steps(1) infinite;
}

@keyframes caret-blink {
  50% {
    opacity: 0;
  }
}

.lead {
  max-width: 60ch;
  font-size: 1.1rem;
  color: #ffffff;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 500;
}

.btn:hover {
  text-decoration: none;
  border-color: var(--accent);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

.hero .btn {
  border-color: rgba(255, 255, 255, 0.7);
  color: #ffffff;
}

.hero .btn:hover {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.hero .btn-primary {
  background: var(--orange);
  border-color: rgb(170, 79, 34);
  color: #ffffff;
  font-weight: 600;
}

.hero .btn-primary:hover {
  background: rgb(170, 79, 34);
  border-color: rgb(170, 79, 34);
}

/* Sections */
.section {
  padding: 3.5rem 0;
}

/* Sections alternate blue gradient (starting with the hero) and white. */
main > section:nth-of-type(odd) {
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.85);
  --accent: #ffffff;
  --border: rgba(255, 255, 255, 0.45);
  color: var(--text);
  background: var(--blue-gradient);
}

.section-title {
  font-size: 1.6rem;
  margin: 0;
}

/* Title + icon in a left column, content to the right. */
.section-layout {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  column-gap: 2rem;
  row-gap: 3rem;
  align-items: start;
}

.section-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.section-icon {
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
}

.section-body > :first-child {
  margin-top: 0;
}

main > section:nth-of-type(even) .section-heading {
  color: var(--orange);
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}

.skill-group h3 {
  font-size: 1rem;
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tags li {
  padding: 0.3rem 0.75rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
}

.tags-small li {
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
}

/* Skills are listed most to least familiar; fade each step down the list. */
.skill-group .tags li {
  background-color: var(--orange);
  border-color: rgb(170, 79, 34);
  color: #ffffff;
}

.skill-group .tags li:nth-child(n+2) { opacity: 0.95; }
.skill-group .tags li:nth-child(n+3) { opacity: 0.9; }
.skill-group .tags li:nth-child(n+4) { opacity: 0.85; }
.skill-group .tags li:nth-child(n+5) { opacity: 0.8; }
.skill-group .tags li:nth-child(n+6) { opacity: 0.75; }
.skill-group .tags li:nth-child(n+7) { opacity: 0.7; }
.skill-group .tags li:nth-child(n+8) { opacity: 0.65; }
.skill-group .tags li:nth-child(n+9) { opacity: 0.6; }
.skill-group .tags li:nth-child(n+10) { opacity: 0.55; }

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.card p {
  margin: 0;
  color: var(--muted);
  flex-grow: 1;
}

/* Project years, tucked up under the card title */
.card .card-date {
  flex-grow: 0;
  margin-top: -0.6rem;
  font-size: 0.9rem;
}

.card-links {
  display: flex;
  gap: 1rem;
  font-weight: 500;
}

/* Project thumbnail that opens a screenshot gallery */
.card-clickable {
  cursor: pointer;
}

.card-thumb {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  overflow: hidden;
  background: none;
  cursor: pointer;
}

.card-thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: top;
  transition: transform 0.3s ease;
}

.card-thumb:hover img,
.card-thumb:focus-visible img {
  transform: scale(1.04);
}

.card-thumb:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

/* Thumbnail with no gallery behind it: no pointer or zoom, so it doesn't look clickable */
.card-thumb-static {
  cursor: default;
}

.card-thumb-static:hover img {
  transform: none;
}

.card-thumb-hint {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: rgba(15, 42, 68, 0.85);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 500;
}

/* Screenshot gallery modal */
html:has(.gallery[open]) {
  overflow: hidden;
}

.gallery {
  width: min(1100px, 100vw - 2rem);
  max-width: none;
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: none;
  border-radius: var(--radius);
  background: #0f2a44;
  color: #ffffff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.gallery::backdrop {
  background: rgba(8, 22, 36, 0.8);
  backdrop-filter: blur(4px);
}

.gallery-inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
}

.gallery-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.gallery-title {
  margin: 0;
  font-size: 1.1rem;
}

.gallery-counter {
  margin-right: auto;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.gallery button {
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: transparent;
  color: #ffffff;
  font: inherit;
  cursor: pointer;
}

.gallery .gallery-close,
.gallery .gallery-prev,
.gallery .gallery-next {
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.6rem;
  line-height: 1;
}

.gallery button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.gallery button:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

.gallery-track {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.gallery-track::-webkit-scrollbar {
  display: none;
}

.gallery-track > li {
  flex: 0 0 100%;
  scroll-snap-align: center;
}

.gallery-track figure {
  margin: 0;
}

.gallery-track img,
.gallery-track video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 11rem);
  object-fit: contain;
  border-radius: calc(var(--radius) - 4px);
}

.gallery-track figcaption {
  padding-top: 0.5rem;
  text-align: center;
  font-weight: 500;
}

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

.gallery-dots {
  display: flex;
  gap: 0.5rem;
}

.gallery-dots button {
  width: 0.7rem;
  height: 0.7rem;
  border-color: rgba(255, 255, 255, 0.6);
}

.gallery-dots button[aria-current="true"] {
  background: var(--orange);
  border-color: var(--orange);
}

/* Experience timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.25rem;
  border-left: 2px solid var(--border);
}

.timeline > li {
  position: relative;
  padding-bottom: 1.5rem;
}

.timeline > li:last-child {
  padding-bottom: 0.25rem;
}

.timeline > li::before {
  content: "";
  position: absolute;
  left: calc(-1.25rem - 6px);
  top: 0.45rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

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

/* Long titles wrap; the date always stays on the right. */
.timeline-header h3 {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.1rem;
}

.date {
  flex-shrink: 0;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.9rem;
}

.timeline ul {
  margin: 0.25rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.timeline-meta {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.timeline-meta + ul {
  margin-top: 0.5rem;
}

/* Contact */
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  font-weight: 500;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

/* Responsive */
@media (max-width: 720px) {
  /* Stack title above content, icon inline before the title. */
  .section-layout {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 1.25rem;
  }

  .section-body + .section-heading {
    margin-top: 1.75rem;
  }

  .section-heading {
    flex-direction: row;
    align-items: center;
    gap: 0.6rem;
  }

  .section-icon {
    order: -1;
    width: 1.75rem;
    height: 1.75rem;
  }
}

@media (max-width: 600px) {
  .nav-links {
    gap: 0.85rem;
  }

  .nav-links a {
    font-size: 0.85rem;
  }

  .hero {
    padding-top: 4rem;
  }

  .timeline-header {
    flex-direction: column;
    gap: 0;
  }
}

@media (max-width: 400px) {
  .logo {
    display: none;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
    gap: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .card {
    transition: none;
  }

  .card-thumb img {
    transition: none;
  }

  .has-caret::after {
    animation: none;
  }
}

/* Print as a resume */
@media print {
  .site-header,
  .hero-actions,
  .card-links,
  .season-fx,
  .konami-btn,
  .has-caret::after {
    display: none;
  }

  body {
    color: #000;
    background: #fff;
  }

  main > section:nth-of-type(odd) {
    --text: #000;
    --muted: #333;
    --accent: #000;
    --border: #ccc;
    background: none;
  }

  .hero {
    min-height: auto;
    padding: 0 0 1rem;
    background: none;
  }

  .hero,
  .eyebrow,
  .tagline,
  .lead {
    color: #000;
  }

  .section {
    padding: 1rem 0;
    break-inside: avoid;
  }

  .card:hover {
    transform: none;
  }
}
