:root {
  --bg: #09090b;
  --bg-subtle: #0f0f12;
  --surface: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #fafafa;
  --muted: #a1a1aa;
  --muted2: #71717a;
  --accent: #e4e4e7;
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Outfit", var(--font);
  --header-h: 56px;
  --content-max: 40rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text);
  text-decoration-color: rgba(250, 250, 250, 0.35);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: rgba(250, 250, 250, 0.7);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 clamp(1rem, 4vw, 1.75rem);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
}

.logo-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.8125rem, 2.2vw, 0.9375rem);
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.15rem 0.85rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a {
  color: var(--muted2);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.35rem 0.4rem;
  border-radius: 6px;
  transition: color 0.12s ease;
}

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

.nav a.is-active {
  color: var(--text);
  font-weight: 600;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text);
  border-radius: 1px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.8125rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, opacity 0.12s ease;
}

.btn:hover {
  text-decoration: none;
  transform: none;
}

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

.btn-primary:hover {
  background: #e4e4e7;
  color: var(--bg);
  border-color: #e4e4e7;
}

.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-outline:hover {
  background: var(--surface);
  border-color: var(--border-strong);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--surface);
}

main {
  padding: 0 clamp(1.25rem, 5vw, 2rem) 3.5rem;
  max-width: var(--content-max);
  margin: 0 auto;
}

/* Desktop: use full viewport width; mobile (≤768px) unchanged */
@media (min-width: 769px) {
  main {
    max-width: none;
    width: 100%;
    margin: 0;
    padding-left: clamp(1.5rem, 4vw, 3rem);
    padding-right: clamp(1.5rem, 4vw, 3rem);
  }
}

/* Full-viewport intro band: hero + about (bleeds past main padding) */
.intro-canvas {
  position: relative;
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  background-color: #070708;
  border-bottom: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.intro-canvas::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 90% 50% at 50% -20%,
    rgba(255, 255, 255, 0.06),
    transparent 55%
  );
  opacity: 0.9;
}

.intro-canvas > * {
  position: relative;
  z-index: 1;
}

.hero {
  padding: clamp(2.5rem, 9vw, 4.5rem) 0 2.25rem;
}

.hero.hero--immersive {
  padding: clamp(2.5rem, 9vw, 4.5rem) clamp(1.25rem, 5vw, 2rem)
    clamp(1.75rem, 4vw, 2.75rem);
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.35rem;
}

.hero-photo-wrap {
  flex-shrink: 0;
  width: clamp(5.75rem, 22vw, 7.75rem);
  height: clamp(5.75rem, 22vw, 7.75rem);
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border-strong);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.hero-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transform: scale(1.22);
  transform-origin: center center;
}

.hero-copy {
  flex: 1;
  min-width: 0;
}

@media (min-width: 600px) {
  .hero-inner {
    flex-direction: row;
    align-items: center;
    gap: clamp(1.5rem, 4vw, 2.75rem);
  }
}

@media (min-width: 769px) {
  .hero.hero--immersive {
    min-height: min(88vh, 52rem);
    display: flex;
    align-items: center;
    padding-left: clamp(1.5rem, 4vw, 3rem);
    padding-right: clamp(1.5rem, 4vw, 3rem);
    padding-top: clamp(3rem, 10vh, 5rem);
    padding-bottom: clamp(2.5rem, 8vh, 4rem);
  }

  .hero.hero--immersive .hero-inner {
    max-width: 72rem;
    margin: 0 auto;
    width: 100%;
  }

  .hero.hero--immersive .hero-title {
    max-width: 22em;
    font-size: clamp(2rem, 3.5vw, 3.35rem);
    line-height: 1.12;
    letter-spacing: -0.042em;
  }

  .hero.hero--immersive .hero-photo-wrap {
    width: clamp(7rem, 9vw, 9rem);
    height: clamp(7rem, 9vw, 9rem);
  }
}

.hero-hello {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.125rem, 2.5vw, 1.25rem);
  letter-spacing: -0.02em;
  color: var(--muted);
}

.hero-name-inline {
  color: var(--text);
}

.hero-title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.65rem, 4.5vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.035em;
  color: var(--text);
  max-width: 26ch;
}

.hero-sub {
  margin: 0;
  color: var(--muted2);
  font-size: 0.9375rem;
}

.hero-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
}

.badge-open {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted2);
  background: transparent;
  border: 1px solid var(--border);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
}

.section {
  padding: 2.5rem 0;
  scroll-margin-top: calc(var(--header-h) + 12px);
}

.section-surface {
  margin: 0 -999px;
  padding: 2.5rem 999px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* Projects: true edge-to-edge band (full-width rules + grid) */
#projects.section-surface {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  width: 100vw;
  max-width: 100vw;
  padding: 2.5rem clamp(1.25rem, 5vw, 2rem);
  box-sizing: border-box;
}

@media (min-width: 769px) {
  #projects.section-surface {
    padding-left: clamp(1.5rem, 4vw, 3rem);
    padding-right: clamp(1.5rem, 4vw, 3rem);
  }
}

#projects .section-title {
  max-width: none;
}

.section-title {
  margin: 0 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted2);
}

.section-intro {
  margin: -0.25rem 0 1.35rem;
  color: var(--muted);
  font-size: 0.9375rem;
  max-width: 40ch;
  line-height: 1.6;
}

.about-lede {
  margin: 0 0 1.35rem;
  font-size: 0.9375rem;
  color: var(--muted);
  max-width: 48ch;
  line-height: 1.7;
}

.about-lede strong {
  font-weight: 600;
  color: var(--text);
}

.section--in-intro {
  padding-top: 0;
  padding-bottom: 2.75rem;
}

.section--in-intro .about-lede {
  max-width: none;
  width: 100%;
  margin: 0;
}

.intro-canvas__about-inner {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0 clamp(1.25rem, 5vw, 2rem);
  box-sizing: border-box;
}

@media (min-width: 769px) {
  .intro-canvas__about-inner {
    padding-left: clamp(1.5rem, 4vw, 3rem);
    padding-right: clamp(1.5rem, 4vw, 3rem);
  }

  .section--in-intro {
    padding-bottom: clamp(3.25rem, 7vw, 5rem);
  }

  .section--in-intro .section-title {
    letter-spacing: 0.12em;
    border-bottom-color: rgba(255, 255, 255, 0.1);
    max-width: none;
  }

  .section--in-intro .about-lede {
    font-size: clamp(1rem, 1.2vw, 1.125rem);
    line-height: 1.78;
    color: rgba(228, 228, 231, 0.82);
    margin-bottom: 0;
  }
}

.org-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.org-card {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 1.35rem 0;
  box-shadow: none;
}

.org-card:first-of-type {
  border-top: 1px solid var(--border);
}

.org-head {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}

.org-logo {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
}

.org-logo-alt,
.org-logo-warm {
  background: var(--surface);
}

.org-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.org-dates {
  margin: 0.15rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted2);
  font-variant-numeric: tabular-nums;
}

.org-role {
  margin: 0.85rem 0 0.4rem;
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--muted);
}

.org-desc {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.65;
}

.edu-primary {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 0 0 1.25rem;
  box-shadow: none;
  margin-bottom: 1.25rem;
}

.edu-school {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.edu-dates {
  margin: 0.3rem 0 0.6rem;
  font-size: 0.8125rem;
  color: var(--muted2);
}

.edu-degree {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.65;
}

.edu-more {
  display: grid;
  gap: 0;
}

@media (min-width: 560px) {
  .edu-more {
    grid-template-columns: 1fr 1fr;
    gap: 0 1.5rem;
  }
}

.edu-card {
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  border-radius: 0;
  padding: 0 0 0 1rem;
  margin-bottom: 1.1rem;
}

.edu-card-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.edu-card-meta {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted2);
  line-height: 1.5;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.stack-block {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 0 0 1.1rem;
  box-shadow: none;
}

.stack-block:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.stack-label {
  margin: 0 0 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted2);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.chips span {
  padding: 0.28rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
}

.org-card .chips span {
  color: var(--muted);
  background: transparent;
  border-color: var(--border);
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.project-card:not(.has-media) .project-body {
  padding: 1rem 1.1rem 1.15rem;
}

.project-card.has-media .project-body {
  padding: 1rem 1.1rem 1.15rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

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

/* Project screenshot carousel (Jewellery ERP, CX Linux, …) */
.project-media.project-media-carousel .project-carousel-panes {
  position: absolute;
  inset: 0;
}

.project-media.project-media-carousel .project-carousel-pane {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .project-media.project-media-carousel .project-carousel-pane {
    transition: none;
  }
}

.project-media.project-media-carousel .project-carousel-pane.is-active {
  opacity: 1;
  z-index: 1;
}

.project-media.project-media-carousel .project-carousel-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.5rem 0.65rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.35) 55%, transparent 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.project-media.project-media-carousel .project-carousel-dot {
  margin: 0;
  padding: 0;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.project-media.project-media-carousel .project-carousel-dot:hover {
  background: rgba(255, 255, 255, 0.4);
  border-color: rgba(255, 255, 255, 0.5);
}

.project-media.project-media-carousel .project-carousel-dot.is-active {
  background: var(--text);
  border-color: var(--text);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
  transform: scale(1.15);
}

.project-media.project-media-carousel .project-carousel-dot:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.project-media-carousel--light .project-carousel-panes {
  background: #d4d4d8;
}

.project-media-carousel--light .project-carousel-pane {
  object-fit: contain;
  object-position: center center;
}

/* Full-width featured project cards — wider hero for screenshots */
.project-card--featured .project-media {
  aspect-ratio: 2.15 / 1;
}

.project-card--featured .project-body {
  max-width: none;
}

@media (min-width: 720px) {
  .projects-grid .project-card--featured {
    grid-column: 1 / -1;
  }
}

.project-title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.project-desc {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.65;
  flex: 1;
}

.project-link {
  margin: 0 0 0.4rem;
  font-size: 0.8125rem;
  font-weight: 500;
}

.project-link:last-of-type {
  margin-bottom: 0.65rem;
}

.project-link a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border-strong);
}

.project-link a:hover {
  border-bottom-color: var(--muted);
}

.external-mark {
  font-size: 0.85em;
  opacity: 0.65;
}

.project-body .chips {
  margin-top: auto;
}

@media (min-width: 720px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 1rem;
    align-items: stretch;
  }
}

.cta-band {
  margin-top: 0.5rem;
  padding: 2.25rem 0 1rem;
}

.cta-inner {
  text-align: center;
  padding: 2rem 1.25rem;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.cta-kicker {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--muted);
}

.cta-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
}

.cta-you {
  margin: 0.35rem 0 1.1rem;
  font-size: 0.8125rem;
  color: var(--muted2);
  font-weight: 500;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.cta-inner .btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.cta-inner .btn-primary:hover {
  background: #e4e4e7;
}

.cta-inner .btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.cta-inner .btn-outline:hover {
  background: color-mix(in srgb, var(--text) 6%, transparent);
}

.cta-inner .btn-ghost {
  color: var(--muted2);
}

.cta-inner .btn-ghost:hover {
  color: var(--text);
  background: var(--surface);
}

.cta-meta {
  margin: 1.1rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted2);
}

.cta-meta a {
  color: var(--text);
  text-decoration: none;
}

.cta-meta a:hover {
  text-decoration: underline;
}

.site-footer {
  padding: 1.75rem clamp(1.25rem, 5vw, 2rem) 2.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted2);
  border-top: 1px solid var(--border);
}

.site-footer p {
  margin: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .nav {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--header-h);
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1.25rem 1rem;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
    gap: 0;
  }

  .nav a {
    padding: 0.55rem 0.35rem;
  }

  .nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media print {
  .site-header,
  .menu-toggle,
  .cta-band,
  .hero-actions .badge-open {
    display: none !important;
  }

  .intro-canvas {
    width: auto;
    max-width: none;
    margin: 0;
    background: #fff;
    background-image: none;
    border-bottom: 1px solid #ddd;
    box-shadow: none;
  }

  .intro-canvas::before {
    display: none;
  }

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

  .section-surface {
    background: #fafafa;
    margin: 0;
    padding: 1rem 0;
  }

  #projects.section-surface {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 1rem 0;
  }

  .section-title {
    color: #444;
    border-color: #ddd;
  }

  .org-card,
  .edu-primary,
  .stack-block,
  .project-card {
    border-color: #eee !important;
  }
}
