/* Personal portfolio — clean engineering aesthetic */

:root {
  --bg: #0f1117;
  --bg-card: #181b24;
  --bg-elevated: #1e2230;
  --text: #e8eaef;
  --text-muted: #97a0b5;
  --accent: #3b9eff;
  --accent-soft: rgba(59, 158, 255, 0.12);
  --border: #2a3042;
  --border-strong: #39415a;
  --radius: 12px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.35rem;
  --text-2xl: clamp(1.5rem, 3vw, 1.9rem);
  --text-3xl: clamp(1.9rem, 4.5vw, 2.75rem);
  --tracking-tight: -0.02em;
  --leading-tight: 1.25;
  --leading-normal: 1.6;
  --max-prose: 42rem;
  --max-wide: 1080px;
  --space-section: 4.5rem;
  --space-section-heading: 1.15rem;
  --space-page-header: 3.25rem;
  --space-zone: 4.5rem;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-lift: 0 16px 44px rgba(0, 0, 0, 0.32);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

/* Accessibility: skip link + visible focus */

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: #0f1117;
  font-weight: 600;
  border-radius: 8px;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0.75rem;
  opacity: 1;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.15s;
}

a:hover {
  opacity: 0.85;
}

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

/* Layout */

.container {
  width: min(900px, 92vw);
  margin: 0 auto;
}

.prose {
  max-width: var(--max-prose);
  line-height: var(--leading-normal);
}

/* Header / Nav */

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(15, 17, 23, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
  padding-top: env(safe-area-inset-top, 0);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  padding: 1rem 0;
}

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

.logo:hover {
  opacity: 1;
  color: var(--accent);
}

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

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

.nav-links a:hover,
.nav-links a.active,
.nav-links a[aria-current="page"] {
  color: var(--text);
}

.nav-links a[aria-current="page"] {
  font-weight: 600;
}

.nav-link--external::after {
  content: "↗";
  display: inline-block;
  margin-left: 0.2em;
  font-size: 0.75em;
  opacity: 0.65;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  flex-shrink: 0;
}

.lang-switch-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.35rem 0.5rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.lang-switch-btn:hover {
  color: var(--text);
}

.lang-switch-btn[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Desktop: shell is transparent to flex layout. Mobile media query turns it into a real wrapper. */
.nav-scroll-shell {
  display: contents;
}

.nav-scroll-fade,
.nav-scroll-more {
  display: none;
}

@keyframes nav-scroll-nudge {
  0%,
  100% {
    transform: translateY(-50%) translateX(0);
  }
  50% {
    transform: translateY(-50%) translateX(3px);
  }
}

/* Larger switcher when mounted inside the hero */
.lang-switch-slot {
  display: flex;
  margin-bottom: 0.35rem;
}

.lang-switch--hero {
  gap: 0.45rem;
  padding: 0.45rem;
  border-radius: 999px;
}

.lang-switch--hero .lang-switch-btn {
  font-size: 1.35rem;
  padding: 0.75rem 1.5rem;
}

@media (max-width: 600px) {
  .lang-switch--hero .lang-switch-btn {
    font-size: 1.15rem;
    padding: 0.6rem 1.15rem;
  }
}

@media (max-width: 600px) {
  .site-header .container {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "logo lang"
      "nav nav";
    align-items: center;
    gap: 0.45rem 0.65rem;
    padding: 0.65rem 0;
  }

  .site-header .logo {
    grid-area: logo;
    min-width: 0;
    font-size: 1rem;
  }

  .site-header .lang-switch {
    grid-area: lang;
    padding: 0.1rem;
    gap: 0.05rem;
  }

  .site-header .lang-switch-btn {
    font-size: 0.62rem;
    padding: 0.28rem 0.36rem;
  }

  .site-header .nav-scroll,
  .site-header .nav-scroll-shell {
    grid-area: nav;
    width: 100%;
    min-width: 0;
    margin: 0 -4vw;
  }

  .site-header .nav-scroll-shell {
    display: block;
    position: relative;
  }

  .site-header .nav-scroll-shell .nav-scroll {
    margin: 0;
  }

  .nav-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 -4vw;
    padding: 0 4vw;
    overscroll-behavior-x: contain;
  }

  .nav-scroll::-webkit-scrollbar {
    display: none;
  }

  .nav-scroll .nav-links {
    flex-wrap: nowrap;
    width: max-content;
    padding-bottom: 0.15rem;
    padding-right: 1.85rem;
  }

  /* Fade + chevron: make overflow look swipeable, not "cut off" */
  .nav-scroll-fade {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3.25rem;
    pointer-events: none;
    opacity: 0;
    z-index: 1;
    transition: opacity 0.2s var(--ease-out);
  }

  .nav-scroll-fade--left {
    left: 0;
    background: linear-gradient(
      to right,
      rgba(15, 17, 23, 1) 0%,
      rgba(15, 17, 23, 0.75) 40%,
      rgba(15, 17, 23, 0) 100%
    );
  }

  .nav-scroll-fade--right {
    right: 0;
    background: linear-gradient(
      to left,
      rgba(15, 17, 23, 1) 0%,
      rgba(15, 17, 23, 0.75) 40%,
      rgba(15, 17, 23, 0) 100%
    );
  }

  .nav-scroll-shell.is-scrollable.can-scroll-left .nav-scroll-fade--left,
  .nav-scroll-shell.is-scrollable.can-scroll-right .nav-scroll-fade--right {
    opacity: 1;
  }

  /* Soften the clipped label itself so the cutoff reads as a fade */
  .nav-scroll-shell.is-scrollable.can-scroll-right .nav-scroll {
    -webkit-mask-image: linear-gradient(
      to right,
      #000 0%,
      #000 calc(100% - 2.75rem),
      transparent 100%
    );
    mask-image: linear-gradient(
      to right,
      #000 0%,
      #000 calc(100% - 2.75rem),
      transparent 100%
    );
  }

  .nav-scroll-shell.is-scrollable.can-scroll-left.can-scroll-right .nav-scroll {
    -webkit-mask-image: linear-gradient(
      to right,
      transparent 0%,
      #000 2.25rem,
      #000 calc(100% - 2.75rem),
      transparent 100%
    );
    mask-image: linear-gradient(
      to right,
      transparent 0%,
      #000 2.25rem,
      #000 calc(100% - 2.75rem),
      transparent 100%
    );
  }

  .nav-scroll-shell.is-scrollable.can-scroll-left:not(.can-scroll-right) .nav-scroll {
    -webkit-mask-image: linear-gradient(
      to right,
      transparent 0%,
      #000 2.25rem,
      #000 100%
    );
    mask-image: linear-gradient(
      to right,
      transparent 0%,
      #000 2.25rem,
      #000 100%
    );
  }

  .nav-scroll-more {
    display: grid;
    place-items: center;
    position: absolute;
    right: 0.2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: rgba(30, 34, 48, 0.96);
    color: var(--text);
    font-size: 0.85rem;
    line-height: 1;
    pointer-events: none;
    opacity: 0;
    z-index: 2;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
    transition: opacity 0.2s var(--ease-out);
  }

  .nav-scroll-shell.is-scrollable.can-scroll-right .nav-scroll-more {
    opacity: 1;
    animation: nav-scroll-nudge 1.7s var(--ease-out) infinite;
  }

  .nav-scroll-more::before {
    content: "›";
    display: block;
    translate: 0.02em -0.05em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-scroll-shell.is-scrollable.can-scroll-right .nav-scroll-more {
    animation: none;
  }
}

/* Hero */

.hero {
  position: relative;
  padding: 4rem 0 3rem;
  background-color: var(--bg);
  background-image: url("/assets/hero-backdrop.png");
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--border);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(15, 17, 23, 0.96) 0%,
    rgba(15, 17, 23, 0.9) 55%,
    rgba(15, 17, 23, 0.65) 100%
  );
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: var(--max-prose);
}

.hero-head {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hero-eyebrow {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.02em;
  margin: 0;
}

.hero h1 {
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: var(--tracking-tight);
  margin: 0;
  text-wrap: balance;
}

.credibility-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.credibility-strip li:not(:last-child)::after {
  content: "·";
  margin-left: 0.5rem;
  opacity: 0.45;
}

.hero .subtitle,
.hero-text {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.65;
}

.hero-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hero-about-text {
  display: block;
  font-size: 0.98rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.65;
  padding-left: 0.9rem;
  border-left: 2px solid var(--border-strong);
  text-decoration: none;
  transition: color 0.18s ease, border-color 0.18s ease;
}

a.hero-about-text:hover,
a.hero-about-text:focus-visible {
  color: var(--text);
  border-left-color: var(--accent);
  outline: none;
}

.hero-about-more {
  display: inline-block;
  margin-left: 0.35rem;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

a.hero-about-text:hover .hero-about-more,
a.hero-about-text:focus-visible .hero-about-more {
  text-decoration: underline;
}

.hero-skills .chip {
  font-size: 0.85rem;
  padding: 0.45rem 0.85rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
}

.hero-actions .btn-ghost {
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, color 0.2s, opacity 0.15s;
}

.btn:hover {
  opacity: 1;
}

.btn-primary {
  background: var(--accent);
  color: #0f1117;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: #5aadff;
  border-color: #5aadff;
  color: #0f1117;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.btn-ghost:hover {
  color: var(--accent);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.contact-links a {
  color: var(--text-muted);
}

.contact-links a:hover {
  color: var(--accent);
  opacity: 1;
}

/* Section */

.section {
  padding: 3.5rem 0 4rem;
}

.section--compact {
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}

.featured-project {
  display: grid;
  grid-template-columns: 1fr min(44%, 22rem);
  align-items: center;
  gap: 2rem 2.5rem;
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 2rem 2.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.featured-project:hover {
  border-color: rgba(59, 158, 255, 0.45);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.featured-project-body {
  min-width: 0;
}

.featured-project h3 {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  margin: 0 0 0.5rem;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

.featured-outcome {
  display: block;
  margin: 0 0 0.85rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
  letter-spacing: 0.02em;
}

.featured-project p {
  color: var(--text-muted);
  margin: 0 0 1.25rem;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  max-width: var(--max-prose);
}

.featured-project-media {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
}

.featured-project-media img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: transform 0.5s var(--ease-out);
}

.featured-project:hover .featured-project-media img {
  transform: scale(1.04);
}

.contact-strip {
  padding: 2.5rem 0 3.5rem;
  border-top: 1px solid var(--border);
}

.contact-strip-lead {
  color: var(--text-muted);
  margin: -1rem 0 1rem;
  max-width: 480px;
}

.contact-links {
  font-size: 1rem;
}

.contact-links a {
  color: var(--accent);
}

/* Project facts panel */

.project-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 2rem;
  margin: 2.25rem 0 2.5rem;
  padding: 1.35rem 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  align-items: start;
}

.project-fact {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.35rem;
  min-width: 0;
}

.project-fact dt {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  line-height: 1.2;
  min-height: 0.85rem;
}

.project-fact dd {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text);
}

.project-outcomes {
  list-style: none;
  margin: 0 0 2.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}

.project-outcomes li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0 0 0.65rem;
  font-size: var(--text-sm);
  color: var(--text);
  line-height: 1.45;
}

.project-outcomes li:last-child {
  margin-bottom: 0;
}

.project-outcomes li::before {
  content: "";
  flex: 0 0 3px;
  width: 3px;
  height: 1.1em;
  margin-top: 0.15em;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.85);
}

.project-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
  margin: 0 0 2.5rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.content-block[data-section] {
  scroll-margin-top: calc(var(--site-header-offset, 5.5rem) + 0.75rem);
}

.project-section-nav a {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

@media (max-width: 768px) {
  .project-section-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 1.75rem;
    padding-bottom: 0.85rem;
    margin-left: -4vw;
    margin-right: -4vw;
    padding-left: 4vw;
    padding-right: 4vw;
  }

  .project-section-nav::-webkit-scrollbar {
    display: none;
  }

  .project-section-nav a {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

.project-section-nav a:hover {
  color: var(--text);
  border-color: var(--accent);
  opacity: 1;
}

@media (min-width: 720px) {
  .project-facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem 2.25rem;
  }
}

.section-title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 0 0 2rem;
}

.section-heading {
  font-size: clamp(1.15rem, 2.5vw, 1.35rem);
  font-weight: 600;
  margin: 0 0 1.25rem;
  color: var(--text);
}

.project-group {
  margin-bottom: 2.5rem;
}

.project-group:last-child {
  margin-bottom: 0;
}

.project-group-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

/* Project cards */

.project-grid {
  display: grid;
  gap: 1.75rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s, transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}

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

.project-card h3 {
  font-size: 1.25rem;
  margin: 0 0 0.35rem;
  line-height: var(--leading-tight);
}

.project-outcome {
  display: block;
  margin: 0 0 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.project-card p {
  color: var(--text-muted);
  margin: 0 0 1rem;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.project-card .tag,
.featured-project .tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.card-link {
  font-size: 0.9rem;
  font-weight: 500;
}

.project-card--with-media {
  display: grid;
  grid-template-columns: 1fr min(42%, 22rem);
  align-items: center;
  gap: 1.75rem 2rem;
}

.project-card-body {
  min-width: 0;
}

.project-card-media {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
}

.project-card-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  transition: transform 0.4s var(--ease-out);
}

.project-card:hover .project-card-media img {
  transform: scale(1.05);
}

@media (max-width: 640px) {
  .project-card--with-media {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .project-card-media {
    width: 100%;
    order: -1;
  }
}

/* Project page */

.page-header {
  padding: 3rem 0 var(--space-page-header);
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
}

.page-header .tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.page-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin: 0 0 0.75rem;
  letter-spacing: var(--tracking-tight);
  line-height: 1.15;
}

.page-header .lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0;
}

.page-header--with-photo {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.page-header-body {
  flex: 1 1 0;
  min-width: 0;
}

.page-header-photo {
  flex: 0 0 auto;
  width: min(11rem, 34%);
  max-width: 200px;
}

.page-header-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 7;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

@media (max-width: 640px) {
  .page-header--with-photo {
    flex-direction: column;
    align-items: stretch;
  }

  .page-header-photo {
    width: 100%;
    max-width: 10rem;
    align-self: flex-end;
  }
}

.content-block {
  margin-bottom: var(--space-section);
  padding-top: 0.25rem;
}

.content-block:last-child {
  margin-bottom: 0;
}

main.container {
  padding-bottom: var(--space-section);
}

.content-block h2 {
  font-size: 1.1rem;
  margin: 0 0 var(--space-section-heading);
  color: var(--text);
}

.content-block p,
.content-block li {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.content-block ul {
  padding-left: 1.25rem;
}

.content-block li {
  margin-bottom: 0.55rem;
}

.profile-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem 2.5rem;
  margin-bottom: var(--space-section);
  align-items: start;
}

.profile-pair__col {
  margin-bottom: 0;
}

.profile-pair__col h2 {
  margin-bottom: 1rem;
}

.chip-grid,
.interest-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.chip-grid .chip,
.interest-grid .interest-chip {
  margin: 0;
}

.chip,
.interest-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color 0.2s, background 0.2s;
}

.chip:hover,
.interest-chip:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.achievement-grid,
.achievement-featured {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
}

.project-card--featured {
  grid-column: 1 / -1;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft) inset;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--accent-soft) 100%);
}

.project-card--featured p {
  max-width: 52rem;
}

.project-highlight {
  margin: 1rem 0;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text);
}

.project-highlight strong {
  color: var(--accent);
}

.achievement-card {
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: 0 0 0 1px var(--accent-soft) inset;
}

.achievement-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.achievement-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.achievement-card--headline {
  grid-column: 1 / -1;
  border-width: 2px;
  padding: 1.35rem 1.5rem;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--accent-soft) 100%);
}

.achievement-card--headline h3 {
  font-size: 1.15rem;
}

.achievement-card--headline p {
  font-size: 0.95rem;
  color: var(--text);
}

.forum-invite {
  margin: 0 0 2rem;
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  font-style: italic;
}

.forum-topics-block {
  padding-bottom: 0.5rem;
}

.forum-topics-label {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.forum-topic-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.forum-topic-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.forum-topic-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.forum-topic-btn[aria-current="page"],
.forum-topic-btn[aria-current="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.forum-admin-bar {
  margin: 1rem 0 1.5rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.forum-admin-bar-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.forum-admin-bar-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.forum-admin-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.forum-admin-delete,
.forum-admin-ban,
.forum-admin-unban {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
  text-decoration: underline;
  color: inherit;
  opacity: 0.75;
}

.forum-admin-delete:hover,
.forum-admin-ban:hover,
.forum-admin-unban:hover {
  opacity: 1;
}

.forum-admin-ban:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: none;
}

.forum-admin-ban-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

.forum-admin-ban-list li {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.8125rem;
  margin: 0.25rem 0;
  color: var(--text-muted);
}

.forum-admin-bans-title {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

.forum-comments-panel {
  margin-top: 0.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}

.forum-comments-panel h2 {
  margin-bottom: 0.65rem;
  font-size: 1.35rem;
}

.forum-moderation-note {
  margin: 0 0 1.25rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.forum-comments-loading {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.forum-comment-form-wrap {
  margin-bottom: 1.75rem;
}

.forum-comment-form {
  display: grid;
  gap: 1rem;
}

.forum-field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
}

.forum-field input,
.forum-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  padding: 0.7rem 0.85rem;
}

.forum-field textarea {
  resize: vertical;
  min-height: 7rem;
}

.forum-field input:focus-visible,
.forum-field textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.forum-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.forum-form-status {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.forum-form-status--error {
  color: #f87171;
}

.forum-comments-count {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.forum-comments-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.forum-comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.forum-comment {
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.forum-comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.55rem;
}

.forum-comment-author {
  font-size: 0.95rem;
  color: var(--text);
}

.forum-comment-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.forum-comment-body {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.55;
  color: var(--text);
}

.forum-comment-actions {
  margin-top: 0.75rem;
}

.forum-reply-btn {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}

.forum-reply-btn:hover {
  text-decoration: underline;
}

.forum-comment-replies {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0 0 0 1rem;
  border-left: 2px solid var(--border);
  display: grid;
  gap: 0.85rem;
}

.forum-comment--reply {
  background: var(--bg-elevated);
}

.forum-reply-slot[hidden] {
  display: none !important;
}

.forum-reply-form {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border);
}

.forum-comments-block {
  margin-bottom: 3rem;
}

.forum-comments {
  margin-top: 1.25rem;
  min-height: 12rem;
}

.forum-setup-notice {
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
}

.forum-setup-notice h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.forum-setup-notice p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

@media (max-width: 720px) {
  .profile-pair {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 640px) {
  .achievement-grid,
  .achievement-featured {
    grid-template-columns: 1fr;
  }
}

.content-block kbd {
  font-family: var(--font-mono);
  font-size: 0.8em;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.spec-grid {
  display: grid;
  gap: 0.75rem;
}

.spec-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.spec-item dt {
  color: var(--text-muted);
}

.spec-item dd {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin: 0;
}

.doc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.doc-list li {
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.doc-list a {
  font-weight: 500;
}

/* Photo gallery */

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.photo-gallery figure {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.photo-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.2s;
}

.photo-gallery a:hover img {
  transform: scale(1.03);
}

.photo-gallery figcaption {
  padding: 0.4rem 0.6rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* Image carousel — horizontal infinite scroll gallery */

.image-carousel {
  position: relative;
  margin-top: 0.75rem;
}

.carousel-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.carousel-frame {
  position: relative;
  width: min(100%, 56rem);
  aspect-ratio: 4 / 3;
  max-height: 78vh;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

.carousel-viewport {
  position: absolute;
  inset: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  cursor: grab;
}

.carousel-viewport::-webkit-scrollbar {
  display: none;
}

.carousel-viewport.is-grabbing {
  cursor: grabbing;
  scroll-snap-type: none;
}

.carousel-track {
  display: flex;
  height: 100%;
}

.reel-progress {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  right: 0.85rem;
  z-index: 5;
  display: flex;
  gap: 0.28rem;
  pointer-events: auto;
}

.reel-progress-segment {
  flex: 1;
  height: 0.2rem;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s ease;
}

.reel-progress-segment:hover {
  transform: scaleY(1.35);
}

.reel-progress-fill {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: #fff;
  transition: width 0.12s linear;
}

.reel-progress-segment.is-past .reel-progress-fill {
  width: 100%;
}

.reel-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.65rem 1rem 0.75rem;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.12) 70%,
    transparent 100%
  );
}

.carousel-count {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.72);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

.carousel-count-current {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
}

.carousel-count-total {
  color: rgba(255, 255, 255, 0.62);
}

.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  margin: 0;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.reel-progress:empty {
  display: none;
}

/* Prev / next arrows */
.carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 6;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.carousel-arrow svg {
  width: 1.3rem;
  height: 1.3rem;
}

.carousel-arrow--prev {
  left: 0.75rem;
}

.carousel-arrow--next {
  right: 0.75rem;
}

.carousel-frame:hover .carousel-arrow,
.carousel-arrow:focus-visible {
  opacity: 1;
}

.carousel-arrow:hover {
  background: rgba(0, 0, 0, 0.62);
}

/* Thumbnail strip */
.carousel-thumbs {
  display: flex;
  gap: 0.55rem;
  width: min(100%, 56rem);
  padding: 0.15rem;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.carousel-thumbs::-webkit-scrollbar {
  display: none;
}

.carousel-thumb {
  flex: 0 0 auto;
  width: 4.5rem;
  height: 3.375rem;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--bg-card);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.carousel-thumb:hover {
  opacity: 0.85;
}

.carousel-thumb.is-active {
  opacity: 1;
  border-color: var(--accent, #fff);
}

.carousel-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.carousel-slide-media {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(
      110deg,
      var(--bg-card) 8%,
      var(--bg-elevated) 18%,
      var(--bg-card) 33%
    );
  background-size: 200% 100%;
  animation: carousel-shimmer 1.4s ease-in-out infinite;
}

.carousel-slide-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 70%,
    rgba(0, 0, 0, 0.45) 100%
  );
  pointer-events: none;
}

.carousel-slide-media.is-loaded {
  animation: none;
  background: var(--bg-card);
}

@keyframes carousel-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.carousel-slide-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  user-select: none;
  opacity: 1;
}

.carousel-slide-media:not(.is-loaded) img {
  opacity: 0.92;
}

.carousel-slide-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1rem;
  z-index: 2;
  text-align: center;
  font-size: clamp(0.95rem, 2.4vw, 1.25rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

.carousel-hint {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  text-align: center;
  transition: opacity 0.35s ease;
}

.carousel-hint span {
  position: relative;
  display: inline-block;
  padding: 0 1.9rem;
}

.carousel-hint span::before,
.carousel-hint span::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -7px;
  border-top: 2px solid var(--text-muted);
  border-right: 2px solid var(--text-muted);
}

.carousel-hint span::before {
  left: 0;
  transform: rotate(-135deg);
  animation: carousel-hint-left 1.8s ease-in-out infinite;
}

.carousel-hint span::after {
  right: 0;
  transform: rotate(45deg);
  animation: carousel-hint-right 1.8s ease-in-out infinite;
}

@keyframes carousel-hint-left {
  0%, 100% { transform: translateX(0) rotate(-135deg); }
  50% { transform: translateX(-4px) rotate(-135deg); }
}

@keyframes carousel-hint-right {
  0%, 100% { transform: translateX(0) rotate(45deg); }
  50% { transform: translateX(4px) rotate(45deg); }
}

.carousel-hint.is-hidden {
  opacity: 0;
}

@media (max-width: 640px) {
  .carousel-frame {
    width: 100%;
    max-height: 70vh;
    border-radius: 0.65rem;
  }

  .reel-overlay {
    padding: 1.35rem 0.75rem 0.65rem;
  }

  .carousel-hint {
    font-size: 0.85rem;
  }

  .carousel-thumb {
    width: 3.6rem;
    height: 2.7rem;
  }

  .carousel-arrow {
    width: 2.2rem;
    height: 2.2rem;
    opacity: 1;
  }

  .project-facts {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.1rem 1.15rem;
  }

  .page-header {
    padding-top: 2rem;
  }

  .content-block h2 {
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .carousel-hint span::before,
  .carousel-hint span::after {
    animation: none;
  }

  .carousel-thumbs,
  .carousel-viewport {
    scroll-behavior: auto;
  }

  .carousel-track,
  .carousel-thumb,
  .carousel-arrow,
  .carousel-slide-media img {
    transition: none;
  }
}

/* Embedded video */

.video-embed {
  margin-top: 0.75rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}

.video-embed + .video-embed {
  margin-top: 1rem;
}

.video-embed video,
.video-embed iframe {
  display: block;
  width: 100%;
  max-height: min(540px, 70vh);
  background: #000;
  border: 0;
}

.video-embed iframe {
  aspect-ratio: 16 / 9;
}

.video-embed-caption {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* MakeCode embed */

.makecode-embed {
  margin-top: 0.75rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
}

.makecode-embed iframe {
  display: block;
  width: 100%;
  height: min(560px, 75vh);
  min-height: 420px;
  border: 0;
}

.makecode-embed-link {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.makecode-embed-link a {
  font-weight: 500;
}

/* Embedded web apps */

.app-embed {
  position: relative;
  margin-top: 0.75rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
}

.app-embed iframe {
  display: block;
  width: 100%;
  height: min(640px, 80vh);
  min-height: 480px;
  border: 0;
}

.app-embed--game iframe {
  height: min(720px, 85vh);
  min-height: 520px;
}

.app-embed-link {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.app-embed-link a {
  font-weight: 500;
}

.vibe-project {
  margin-bottom: var(--space-section);
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.vibe-project:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0 calc(2rem + env(safe-area-inset-bottom, 0));
  margin-top: var(--space-zone);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

/* Responsive */

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

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

  .hero {
    padding: 2.5rem 0 2rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
    text-align: center;
  }

  .featured-project {
    grid-template-columns: 1fr;
    padding: 1.5rem;
  }

  .featured-project-media {
    order: -1;
    width: 100%;
    max-width: none;
  }

  .site-footer .container {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Respect users who prefer reduced motion */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .project-card:hover,
  .featured-project:hover {
    transform: none;
  }
}

/* Scroll-driven drone footage (Apple Mac Studio style) */

.scroll-scrub {
  position: relative;
  background: #05070c;
}

.scroll-scrub-track {
  position: relative;
  height: 600vh;
}

.scroll-scrub-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  background: #05070c;
}

.scroll-scrub-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.scroll-scrub-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #05070c;
  z-index: 1;
}

.scroll-scrub-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.scroll-scrub-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(5, 7, 12, 0.55) 0%, rgba(5, 7, 12, 0) 28%),
    linear-gradient(to top, rgba(5, 7, 12, 0.7) 0%, rgba(5, 7, 12, 0) 38%),
    linear-gradient(to right, rgba(5, 7, 12, 0.45) 0%, rgba(5, 7, 12, 0) 42%);
}

.scroll-scrub-specs {
  position: absolute;
  top: clamp(5rem, 18vh, 9rem);
  left: clamp(1.25rem, 6vw, 4.5rem);
  z-index: 2;
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: min(90vw, 420px);
  pointer-events: none;
}

.scroll-scrub-spec {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin: 0 0 1.35rem;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  line-height: 1.35;
  font-weight: 500;
  color: #fff;
  opacity: 0;
  will-change: opacity, transform;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
}

.scroll-scrub-spec::before {
  content: "";
  flex: 0 0 3px;
  width: 3px;
  height: 1.15em;
  margin-top: 0.12em;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.92);
}

.scroll-scrub-spec:last-child {
  margin-bottom: 0;
}

.scroll-scrub-overlay {
  position: absolute;
  left: 50%;
  bottom: clamp(2.5rem, 9vh, 6rem);
  transform: translateX(-50%);
  width: min(90%, 760px);
  text-align: center;
  padding: 0 1rem;
  pointer-events: none;
  will-change: opacity;
  z-index: 3;
}

.scroll-scrub-overlay .btn {
  pointer-events: auto;
}

.scroll-scrub-overlay--outro {
  opacity: 0;
}

.scroll-scrub-eyebrow {
  margin: 0 0 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.scroll-scrub-title {
  margin: 0;
  font-size: clamp(1.7rem, 4.5vw, 3.2rem);
  line-height: 1.1;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.45);
}

.scroll-scrub-overlay--outro .btn {
  margin-top: 1.5rem;
}

.scroll-scrub-hint {
  margin: 1.5rem 0 0;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.82);
}

.scroll-scrub-hint span {
  position: relative;
  display: inline-block;
  padding-bottom: 1.6rem;
}

.scroll-scrub-hint span::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  border-right: 2px solid rgba(255, 255, 255, 0.8);
  border-bottom: 2px solid rgba(255, 255, 255, 0.8);
  transform: rotate(45deg);
  animation: scroll-scrub-bounce 1.8s ease-in-out infinite;
}

@keyframes scroll-scrub-bounce {
  0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: 0.4; }
  50% { transform: rotate(45deg) translate(4px, 4px); opacity: 1; }
}

/* Fallback: reduced motion shows a single still frame, no scrub track */
.scroll-scrub.is-static .scroll-scrub-track {
  height: 70vh;
}

.scroll-scrub.is-static .scroll-scrub-stage {
  position: relative;
  height: 70vh;
}

.scroll-scrub.is-static .scroll-scrub-overlay--outro {
  display: none;
}

.scroll-scrub.is-static .scroll-scrub-spec {
  opacity: 1;
  transform: none;
}

#projects,
#contact {
  scroll-margin-top: 5.5rem;
}

@media (max-width: 640px) {
  .scroll-scrub-track {
    height: 480vh;
  }

  .scroll-scrub-specs {
    top: clamp(4.5rem, 14vh, 6.5rem);
    left: 1rem;
    max-width: calc(100% - 2rem);
  }

  .scroll-scrub-spec {
    font-size: 1rem;
    margin-bottom: 1rem;
  }

  .scroll-scrub-hint span::after {
    animation: none;
  }
}

/* ============================================================
   UI/UX polish additions
   ============================================================ */

/* Header: subtle elevation once the page is scrolled */
.site-header {
  transition: box-shadow 0.25s var(--ease-out), background 0.25s var(--ease-out);
}

.site-header.is-scrolled {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  background: rgba(15, 17, 23, 0.96);
}

/* Nav: animated underline indicator for hover + active section */
.nav-links a {
  position: relative;
  padding-bottom: 2px;
}

.nav-links a:not(.nav-link--external)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.2s var(--ease-out);
}

.nav-links a:not(.nav-link--external):hover::after,
.nav-links a:not(.nav-link--external)[aria-current="page"]::after {
  transform: scaleX(1);
}

/* Credibility strip: a touch more presence */
.credibility-strip li {
  color: var(--text-muted);
}

/* Honors strip — surfaced headline achievements on the homepage */
.honor-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.honor-strip:empty {
  display: none;
}

.honor-strip li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.8rem 0.4rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  line-height: 1.2;
  transition: border-color 0.2s, background 0.2s;
}

.honor-strip li:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.honor-strip li::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  flex: 0 0 auto;
}

/* Reveal-on-scroll (progressive enhancement) */
.reveal-ready [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.reveal-ready [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Enriched footer */
.site-footer .footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer .footer-nav a {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.site-footer .footer-nav a:hover {
  color: var(--accent);
  opacity: 1;
}

.site-footer .footer-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.8rem;
}

.site-footer .footer-meta a {
  color: var(--text-muted);
}

.site-footer .footer-meta a:hover {
  color: var(--accent);
  opacity: 1;
}

/* Back-to-top floating button */
.back-to-top {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: calc(clamp(1rem, 3vw, 2rem) + env(safe-area-inset-bottom, 0));
  z-index: 90;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  box-shadow: var(--shadow-lift);
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out), border-color 0.2s, background 0.2s;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.back-to-top:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-card);
}

.back-to-top svg {
  width: 1.15rem;
  height: 1.15rem;
}

@media (prefers-reduced-motion: reduce) {
  .reveal-ready [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .back-to-top {
    transition: opacity 0.2s;
    transform: none;
  }

  .nav-links a:not(.nav-link--external)::after {
    transition: none;
  }
}
