:root {
  color-scheme: dark;
  --bg: #000;
  --surface: #0c0c0c;
  --surface-raised: #121212;
  --text: #e8e8e8;
  --text-muted: #9b9b9b;
  --heading: #fff;
  --accent: #fff;
  --accent-hover: #d8c8aa;
  --accent-muted: var(--accent-hover);
  --border: #292929;
  --header-bg: rgba(0, 0, 0, 0.9);
  --shadow: 0 20px 55px rgba(0, 0, 0, 0.45);
  --radius-sm: 0.55rem;
  --radius-md: 0.9rem;
  --radius-lg: 1.2rem;
  --container: 72rem;
  --section-space: clamp(2.75rem, 5vw, 4.25rem);
  --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --reveal-distance: clamp(0.6rem, 1.5vw, 1rem);
}

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

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  scrollbar-color: #444 #000;
  scrollbar-gutter: stable;
}

body {
  width: 100%;
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

html:has(body.modal-open),
body.modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--heading);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

h1 {
  max-width: 100%;
  margin-bottom: 0.9rem;
  overflow-wrap: break-word;
  font-size: clamp(2.35rem, 11vw, 5.25rem);
  font-weight: 800;
}

h2 {
  margin-bottom: 0.75rem;
  font-size: clamp(1.75rem, 7vw, 3rem);
  font-weight: 750;
}

h3 {
  margin-bottom: 0.55rem;
  font-size: clamp(1.1rem, 2vw, 1.3rem);
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--accent);
  text-underline-offset: 0.22em;
}

a:hover {
  color: var(--accent-muted);
}

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

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

.container {
  width: min(calc(100% - clamp(1.75rem, 8vw, 4rem)), var(--container));
  min-width: 0;
  margin-inline: auto;
}

.content-narrow {
  max-width: 56rem;
}

.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;
}

.skip-link {
  position: fixed;
  top: 0.7rem;
  left: 0.7rem;
  z-index: 2000;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  background: #fff;
  color: #000;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-150%);
}

.skip-link:focus {
  color: #000;
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
}

.header-inner {
  min-height: calc(4.25rem + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: env(safe-area-inset-top);
  padding-inline: max(0px, env(safe-area-inset-left)) max(0px, env(safe-area-inset-right));
}

.logo {
  position: relative;
  z-index: 1002;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  text-decoration: none;
}

.logo span,
.eyebrow,
.card-label,
.skill-number {
  color: var(--text-muted);
}

.header-actions {
  position: relative;
  z-index: 1002;
  display: flex;
  align-items: center;
}

.icon-button {
  width: 2.75rem;
  height: 2.75rem;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--accent-hover);
  box-shadow: 0 0 1rem color-mix(in srgb, var(--accent-hover) 18%, transparent);
}

.menu-toggle {
  gap: 0.22rem;
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.menu-line {
  width: 1.1rem;
  height: 2px;
  display: block;
  border-radius: 2px;
  background: currentColor;
  transition: transform 180ms ease, opacity 180ms ease;
}

.menu-toggle[aria-expanded="true"] {
  border-color: var(--accent-hover);
  background: #0b0b0b;
  box-shadow: 0 0 1rem color-mix(in srgb, var(--accent-hover) 28%, transparent);
}

.menu-toggle[aria-expanded="true"] .menu-line:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-line:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-line:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

.site-nav {
  position: fixed;
  inset: 0;
  z-index: 1001;
  min-height: 0;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  display: grid;
  place-items: start center;
  overflow-y: auto;
  padding:
    calc(5.25rem + env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    calc(1.5rem + env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
  background: #000;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-0.75rem);
  transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 180ms;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-gutter: stable;
}

.site-nav[data-open="true"] {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 0s;
}

.nav-list,
.nav-submenu,
.social-list,
.tag-list,
.projects-grid,
.gallery-grid,
.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list {
  width: min(100%, 24rem);
  display: grid;
  gap: 0.35rem;
  margin: auto;
  text-align: center;
}

.nav-list a,
.nav-other-toggle {
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  color: #fff;
  overflow-wrap: anywhere;
  font-size: clamp(1.2rem, 6vw, 1.75rem);
  font-weight: 700;
  text-decoration: none;
}

.nav-list > li > a:hover,
.nav-list > li > a:focus-visible,
.nav-other-toggle:hover,
.nav-other-toggle:focus-visible {
  color: var(--accent-hover);
  text-shadow: 0 0 0.9rem color-mix(in srgb, var(--accent-hover) 38%, transparent);
}

.nav-other {
  min-width: 0;
  display: grid;
}

.nav-other-toggle {
  width: 100%;
  gap: 0.55rem;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-other-toggle svg {
  flex: 0 0 auto;
  transition: transform 180ms ease;
}

.nav-submenu {
  display: grid;
  max-height: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-0.35rem);
  transition: max-height 220ms ease, opacity 160ms ease, transform 180ms ease, visibility 180ms;
}

.nav-other[data-other-open="true"] .nav-other-toggle svg {
  transform: rotate(180deg);
}

.nav-other[data-other-open="true"] .nav-submenu {
  max-height: none;
  overflow: visible;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-submenu a {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 2.75rem;
  color: #c9c9c9;
  font-size: clamp(1rem, 4.5vw, 1.2rem);
  font-weight: 600;
}

.nav-submenu a:hover,
.nav-submenu a:focus-visible {
  color: var(--accent-hover);
}

.hero {
  padding-block: clamp(1.5rem, 3vw, 2.5rem);
}

.hero-grid {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: start;
}

.eyebrow,
.card-label {
  margin-bottom: 0.55rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero-role {
  margin-bottom: 0.75rem;
  color: var(--heading);
  font-size: clamp(1.15rem, 3.5vw, 1.55rem);
  font-weight: 600;
  line-height: 1.35;
}

.hero-summary {
  max-width: 36rem;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  font-size: clamp(1rem, 2vw, 1.12rem);
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.4rem;
}

.button {
  min-height: 2.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.68rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 180ms ease, background-color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: #fff;
  color: #000;
}

.button-primary:hover {
  background: var(--accent-hover);
  color: #000;
  box-shadow: 0 0 1.2rem color-mix(in srgb, var(--accent-hover) 22%, transparent);
}

.social-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.social-list li {
  min-width: 0;
}

.social-link {
  --social-brand: #fff;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.58rem 0.78rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #050505;
  color: #fff;
  font-size: clamp(0.74rem, 1.8vw, 0.82rem);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.social-link--github {
  --social-brand: #f0f6fc;
}

.social-link--linkedin {
  --social-brand: #0a66c2;
}

.social-link--gmail {
  --social-brand: #ea4335;
}

.social-icon {
  width: clamp(1.1rem, 2.5vw, 1.3rem);
  height: clamp(1.1rem, 2.5vw, 1.3rem);
  display: block;
  flex: 0 0 auto;
  color: var(--text-muted);
  transition: color 180ms ease;
}

.social-icon--gmail {
  filter: grayscale(1) saturate(0) brightness(1.65);
  opacity: 0.76;
  transition: filter 180ms ease, opacity 180ms ease;
}

.social-label {
  color: #fff;
}

.social-link:hover,
.social-link:focus-visible {
  border-color: var(--social-brand);
  background: color-mix(in srgb, var(--social-brand) 9%, #050505);
  color: #fff;
  box-shadow: 0 0 1rem color-mix(in srgb, var(--social-brand) 18%, transparent);
}

.social-link:hover .social-icon:not(.social-icon--gmail),
.social-link:focus-visible .social-icon:not(.social-icon--gmail) {
  color: var(--social-brand);
}

.social-link:hover .social-icon--gmail,
.social-link:focus-visible .social-icon--gmail {
  filter: none;
  opacity: 1;
}

.text-link {
  font-weight: 700;
  text-decoration-thickness: 1px;
}

.hero-visual {
  --terminal-width: clamp(13rem, 62vw, 16rem);
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: clamp(0.65rem, 2vw, 0.9rem);
}

.hero-terminal {
  width: min(100%, var(--terminal-width));
  min-width: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent-hover) 46%, var(--border));
  border-radius: var(--radius-sm);
  background: #050505;
  box-shadow:
    inset 0 0 1.35rem color-mix(in srgb, var(--accent-hover) 5%, transparent),
    0 0 1.4rem color-mix(in srgb, var(--accent-hover) 9%, transparent);
}

.hero-terminal-bar {
  min-height: 1.8rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.65rem;
  border-bottom: 1px solid color-mix(in srgb, var(--accent-hover) 20%, var(--border));
  background: #0b0b0b;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.6rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.hero-terminal-dots {
  display: flex;
  gap: 0.25rem;
}

.hero-terminal-dots i {
  width: 0.36rem;
  height: 0.36rem;
  display: block;
  border-radius: 50%;
  background: var(--accent-hover);
  box-shadow: 0 0 0.45rem color-mix(in srgb, var(--accent-hover) 35%, transparent);
}

.hero-terminal-dots i:nth-child(2) {
  opacity: 0.68;
}

.hero-terminal-dots i:nth-child(3) {
  opacity: 0.42;
}

.hero-terminal-screen {
  min-width: 0;
  display: grid;
  gap: 0.3rem;
  padding: clamp(0.65rem, 2vw, 0.8rem);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: clamp(0.62rem, 2.4vw, 0.74rem);
  line-height: 1.45;
}

.hero-terminal-command,
.hero-terminal-output {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.hero-terminal-command {
  min-height: 1.45em;
  color: var(--text);
}

.hero-terminal-command code {
  color: inherit;
  font: inherit;
}

.hero-terminal-output {
  min-height: 2.9em;
  color: var(--text-muted);
}

.hero-terminal-prompt {
  color: var(--accent-hover);
  font-weight: 800;
  text-shadow: 0 0 0.7rem color-mix(in srgb, var(--accent-hover) 38%, transparent);
}

.hero-terminal-cursor {
  width: 0.48em;
  height: 1em;
  display: inline-block;
  margin-left: 0.12em;
  background: var(--accent-hover);
  opacity: 0;
  vertical-align: -0.14em;
  box-shadow: 0 0 0.5rem color-mix(in srgb, var(--accent-hover) 34%, transparent);
}

.hero-terminal[data-terminal-active="command"] .hero-terminal-command-cursor,
.hero-terminal[data-terminal-active="output"] .hero-terminal-output-cursor {
  opacity: 1;
  animation: terminal-cursor-blink 820ms steps(1, end) infinite;
}

@keyframes terminal-cursor-blink {
  0%, 48% { opacity: 1; }
  49%, 100% { opacity: 0.18; }
}

.portrait-wrap {
  --portrait-size: clamp(13rem, 62vw, 16rem);
  position: relative;
  width: var(--portrait-size);
  height: var(--portrait-size);
  max-width: 100%;
  margin-inline: auto;
  overflow: hidden;
  contain: layout paint;
  border: 1px solid #353535;
  border-radius: var(--radius-lg);
  background: #fff;
}

.portrait {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  object-position: center top;
}

.section {
  padding-block: var(--section-space);
  scroll-margin-top: 4.5rem;
}

.section-tinted {
  border-block: 1px solid var(--border);
  background: #050505;
}

.section-heading {
  max-width: 41rem;
  margin: 0 auto clamp(1.5rem, 3vw, 2.25rem);
  text-align: center;
}

.section-heading > p:last-child,
.section-heading-row > p,
.contact-grid > div > p:last-child {
  color: var(--text-muted);
}

.about-premium {
  --about-accent: var(--accent-hover);
  --about-panel-pad: clamp(1rem, 4vw, 2rem);
  --about-icon-size: clamp(3rem, 10vw, 3.65rem);
  position: relative;
  display: grid;
  gap: clamp(1.5rem, 5vw, 3rem);
  align-items: stretch;
}

.about-editorial {
  position: relative;
  min-width: 0;
  min-height: clamp(17rem, 58vw, 22rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: clamp(1rem, 4vw, 2rem);
  isolation: isolate;
}

.about-editorial::before {
  content: "";
  position: absolute;
  left: clamp(-11rem, -26vw, -7rem);
  bottom: clamp(-13rem, -30vw, -8rem);
  z-index: 0;
  width: clamp(18rem, 60vw, 27rem);
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--about-accent) 28%, transparent);
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle, transparent 0 0.82rem, color-mix(in srgb, var(--about-accent) 16%, transparent) 0.86rem 0.91rem),
    repeating-conic-gradient(from 8deg, color-mix(in srgb, var(--about-accent) 16%, transparent) 0deg 1.5deg, transparent 1.5deg 12deg);
  opacity: 0.55;
  -webkit-mask-image: radial-gradient(circle, #000 15%, transparent 72%);
  mask-image: radial-gradient(circle, #000 15%, transparent 72%);
}

.about-editorial > * {
  position: relative;
  z-index: 1;
}

.about-eyebrow {
  width: fit-content;
  margin-bottom: clamp(1.2rem, 4vw, 2rem);
  color: var(--about-accent);
}

.about-eyebrow::after {
  content: "";
  width: 2.2rem;
  height: 1px;
  display: block;
  margin-top: 0.55rem;
  background: var(--about-accent);
}

.about-editorial-title {
  max-width: 10ch;
  margin: 0;
  color: var(--heading);
  font-size: clamp(2.55rem, 12vw, 4.8rem);
  font-weight: 780;
  line-height: 0.98;
  letter-spacing: -0.06em;
  text-wrap: balance;
}

.about-editorial-title span {
  display: block;
}

.about-ornament {
  width: min(15rem, 82%);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.55rem;
  margin-top: clamp(1.5rem, 5vw, 2.5rem);
  color: var(--about-accent);
}

.about-ornament::before,
.about-ornament::after {
  content: "";
  height: 1px;
  background: linear-gradient(90deg, transparent, currentColor);
}

.about-ornament::after {
  background: linear-gradient(90deg, currentColor, transparent);
}

.about-ornament span {
  position: relative;
  width: 0.78rem;
  height: 0.78rem;
  display: block;
  border: 1px solid currentColor;
  transform: rotate(45deg);
}

.about-ornament span::before,
.about-ornament span::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 0.22rem;
  height: 0.22rem;
  border-radius: 50%;
  background: currentColor;
  transform: translateY(-50%) rotate(-45deg);
}

.about-ornament span::before {
  right: calc(100% + 0.5rem);
}

.about-ornament span::after {
  left: calc(100% + 0.5rem);
}

.about-panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--about-accent) 76%, transparent);
  border-radius: var(--radius-md);
  background: #030303;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025), 0 1.5rem 4rem rgba(0, 0, 0, 0.38);
  isolation: isolate;
}

.about-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle at 12% 15%, color-mix(in srgb, var(--about-accent) 9%, transparent), transparent 38%);
}

.about-panel::after {
  content: "";
  position: absolute;
  top: -10%;
  right: -5%;
  bottom: -10%;
  z-index: 0;
  width: 38%;
  pointer-events: none;
  background:
    linear-gradient(45deg, transparent 42%, var(--about-accent) 43% 46%, transparent 47% 53%, var(--about-accent) 54% 57%, transparent 58%),
    linear-gradient(-45deg, transparent 42%, var(--about-accent) 43% 46%, transparent 47% 53%, var(--about-accent) 54% 57%, transparent 58%);
  background-position: 0 0, 0.8rem 0.8rem;
  background-size: 2rem 2rem;
  opacity: 0.13;
  transform: rotate(-2deg);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 48%);
  mask-image: linear-gradient(90deg, transparent, #000 48%);
}

.about-profile-list {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: var(--about-panel-pad);
  list-style: none;
}

.about-profile-item {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: var(--about-icon-size) minmax(0, 1fr);
  align-items: center;
  gap: clamp(0.8rem, 2.5vw, 1.25rem);
  padding-block: clamp(1.05rem, 3.5vw, 1.55rem);
}

.about-profile-item + .about-profile-item {
  border-top: 1px solid color-mix(in srgb, var(--about-accent) 24%, transparent);
}

.about-profile-item::before {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(0px - var(--about-panel-pad) - 0.25rem);
  z-index: 2;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--heading);
  box-shadow: 0 0 0 3px #030303;
  transform: translateY(-50%);
}

.about-profile-item::after {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(0px - var(--about-panel-pad));
  z-index: -1;
  width: calc(var(--about-panel-pad) + 1.8rem);
  border-top: 1px solid color-mix(in srgb, var(--about-accent) 42%, transparent);
}

.about-profile-icon {
  width: var(--about-icon-size);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--about-accent) 84%, transparent);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
  color: var(--about-accent);
  box-shadow: inset 0 0 1.2rem color-mix(in srgb, var(--about-accent) 7%, transparent);
}

.about-profile-icon svg {
  width: 48%;
  height: 48%;
}

.about-profile-item p {
  max-width: 52ch;
  margin: 0;
  padding-left: clamp(0.75rem, 2vw, 1.1rem);
  border-left: 1px solid color-mix(in srgb, var(--about-accent) 28%, transparent);
  color: var(--text);
  font-size: clamp(0.84rem, 1.45vw, 0.98rem);
  line-height: 1.58;
  text-wrap: pretty;
}

.about-editorial-title span,
.about-profile-item p,
.about-profile-item strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.about-profile-item strong {
  color: var(--heading);
  font-weight: 750;
}

@media (min-width: 38rem) {
  .about-premium {
    --about-panel-pad: clamp(1.35rem, 4vw, 2.1rem);
    --about-icon-size: clamp(3.25rem, 7vw, 3.8rem);
  }

  .about-editorial {
    min-height: 21rem;
  }
}

@media (min-width: 50rem) {
  .about-premium {
    grid-template-columns: minmax(15rem, 0.78fr) minmax(0, 1.22fr);
    gap: clamp(2rem, 5vw, 4rem);
  }

  .about-editorial {
    min-height: 100%;
    padding: clamp(1.5rem, 3vw, 2.5rem) 0 clamp(1.5rem, 3vw, 2.5rem) clamp(0.5rem, 2vw, 1.25rem);
  }

  .about-editorial-title {
    font-size: clamp(2.75rem, 5.3vw, 4.3rem);
  }
}

@media (min-width: 68rem) {
  .about-premium {
    grid-template-columns: minmax(19rem, 0.85fr) minmax(0, 1.15fr);
    gap: clamp(3rem, 6vw, 5rem);
  }

  .about-editorial-title {
    font-size: clamp(3.7rem, 5.3vw, 4.8rem);
  }

  .about-profile-list {
    padding-right: clamp(3rem, 7vw, 5.5rem);
  }
}

@media (max-width: 22rem) {
  .about-premium {
    --about-panel-pad: 0.85rem;
    --about-icon-size: 2.65rem;
  }

  .about-editorial {
    min-height: 14rem;
    padding-inline: 0.35rem;
  }

  .about-editorial-title {
    font-size: 2.25rem;
  }

  .about-profile-item {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 0.55rem;
  }

  .about-profile-item p {
    padding-left: 0;
    border-left: 0;
    font-size: 0.79rem;
  }
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.card,
.skill-card,
.experience-card,
.project-card,
.certificate-card,
.gallery-card,
.academic-pathway,
.about-panel,
.contact-grid,
.dialog-layout {
  min-width: 0;
  max-width: 100%;
}

.education-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid #fff;
  border-radius: var(--radius-md);
  background: #000;
  color: #fff;
}

.education-card h3 {
  color: #fff;
}

.education-identity {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: clamp(0.85rem, 2.5vw, 1.2rem);
  margin-bottom: 0.85rem;
}

.education-title {
  min-width: 0;
  flex: 1 1 12rem;
}

.education-title h3 {
  margin-bottom: 0.35rem;
  overflow-wrap: anywhere;
}

.education-title .institution {
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.education-logo {
  width: clamp(3.5rem, 14vw, 4.75rem);
  height: clamp(3.5rem, 14vw, 4.75rem);
  flex: 0 0 auto;
  object-fit: contain;
  padding: 0.4rem;
  border: 1px solid #d5d5d5;
  border-radius: var(--radius-sm);
  background: #f7f7f7;
}

.education-card p:last-of-type {
  margin-bottom: 1rem;
}

.education-status {
  width: fit-content;
  max-width: 100%;
  margin-top: auto;
  padding: 0.48rem 0.7rem;
  border: 1px solid #fff;
  border-radius: 999px;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.academic-pathway {
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
  display: grid;
  gap: clamp(0.85rem, 2vw, 1.25rem);
  padding: clamp(1rem, 3vw, 1.5rem);
  overflow: visible;
  scroll-margin-top: 6rem;
  border: 0;
  border-radius: var(--radius-lg);
  outline: 0;
  background: #000;
  color: #fff;
  box-shadow: none;
}

.academic-catalogue {
  min-width: 0;
  overflow: visible;
}

.academic-heading {
  display: grid;
  gap: 0.5rem 2rem;
  margin-bottom: clamp(0.85rem, 2vw, 1.25rem);
}

.academic-heading h3 {
  max-width: 26ch;
  margin-bottom: 0;
  color: #fff;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.academic-heading > p:last-child {
  max-width: 34rem;
  margin: 0;
  color: #fff;
  font-size: 0.85rem;
}

.academic-eyebrow,
.year-index {
  margin-bottom: 0.35rem;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.academic-grid {
  display: grid;
  grid-template-columns: minmax(0, min(100%, 20rem));
  justify-content: center;
  align-items: stretch;
  gap: 0.5rem;
  overflow: clip;
  overflow-clip-margin: 1.5rem;
  padding: 1rem 0.5rem 1.15rem;
}

.year-card {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 12rem;
  overflow: hidden;
  border: 1px solid #fff;
  border-radius: var(--radius-md);
  background: #000;
  color: #fff;
  transform: scale(0.96);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.year-card.is-active {
  z-index: 2;
  box-shadow: 0 0 0 1px #fff, 0 0 1.4rem rgba(255, 255, 255, 0.5);
  transform: scale(1.02);
}

.year-card-featured,
.year-card-current {
  border-color: #fff;
}

.year-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 1;
  padding: 0.25rem 0.5rem;
  border: 1px solid #fff;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.year-card-header {
  min-height: 7.5rem;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
}

.year-card-header > div:first-child {
  min-width: 0;
}

.year-card h4,
.year-focus {
  overflow-wrap: anywhere;
}

.year-card h4 {
  margin: 0 0 0.25rem;
  color: #fff;
  font-size: 1.35rem;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.year-card .year-index,
.year-focus,
.year-meta span {
  color: #fff;
}

.year-focus {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.4;
}

.year-meta {
  flex: 0 0 auto;
  display: grid;
  gap: 0.05rem;
  padding-bottom: 0.1rem;
  text-align: right;
}

.year-meta strong {
  color: #fff;
  font-size: 1rem;
}

.year-meta span {
  font-size: 0.65rem;
}

.year-card-actions {
  display: flex;
  padding: 0 0.85rem 0.85rem;
}

.academic-select,
.academic-view {
  width: 100%;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.75rem;
  border: 1px solid #fff;
  border-radius: var(--radius-sm);
  background: #000;
  color: #fff;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
  transition: background-color 180ms ease, color 180ms ease;
}

.academic-view {
  display: none;
  background: #fff;
  color: #000;
}

.year-card.is-active .academic-select {
  display: none;
}

.year-card.is-active .academic-view {
  display: inline-flex;
}

.academic-select:focus-visible,
.academic-view:focus-visible,
.gallery-card:focus-visible {
  outline-offset: -4px;
}

.year-card > .module-list {
  display: none;
}

.module-list {
  border-top: 1px solid #fff;
}

.module-item {
  border-bottom: 1px solid #fff;
  background: #000;
}

.module-item:last-child {
  border-bottom: 0;
}

.module-item summary {
  position: relative;
  min-height: 2.75rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 2rem 0.65rem 0.85rem;
  color: #fff;
  cursor: pointer;
  list-style: none;
  font-size: 0.73rem;
  font-weight: 700;
  line-height: 1.3;
}

.module-item summary::-webkit-details-marker {
  display: none;
}

.module-item summary::after {
  content: "+";
  position: absolute;
  right: 0.8rem;
  top: 50%;
  color: #fff;
  font-size: 1rem;
  font-weight: 400;
  transform: translateY(-50%);
  transition: transform 180ms ease;
}

.module-item summary span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.module-item summary small {
  overflow-wrap: anywhere;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.module-item[open] {
  background: #000;
}

.module-item[open] summary,
.module-item[open] summary::after {
  color: #fff;
}

.module-item[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}

.module-content {
  display: grid;
  gap: 0.55rem;
  padding: 0 0.85rem 0.85rem;
}

.module-content p {
  margin: 0;
  color: #fff;
  font-size: 0.7rem;
  line-height: 1.5;
}

.module-content strong {
  display: block;
  margin-bottom: 0.1rem;
  color: #fff;
  font-size: 0.59rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.academic-dialog {
  width: min(calc(100% - 1rem), 56rem);
  width: min(calc(100% - max(0.5rem, env(safe-area-inset-left)) - max(0.5rem, env(safe-area-inset-right))), 56rem);
  max-height: calc(100vh - 1rem);
  max-height: calc(100dvh - max(0.5rem, env(safe-area-inset-top)) - max(0.5rem, env(safe-area-inset-bottom)));
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #fff;
  border-radius: var(--radius-lg);
  background: #000;
  color: #fff;
  box-shadow: none;
}

.academic-dialog::backdrop {
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(5px);
}

.academic-dialog form {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 0;
}

.academic-dialog .dialog-close {
  border-color: #fff;
  background: #000;
  color: #fff;
}

.academic-dialog-shell {
  padding:
    max(clamp(1rem, 4vw, 2rem), env(safe-area-inset-top))
    max(clamp(1rem, 4vw, 2rem), env(safe-area-inset-right))
    max(clamp(1rem, 4vw, 2rem), env(safe-area-inset-bottom))
    max(clamp(1rem, 4vw, 2rem), env(safe-area-inset-left));
}

.academic-dialog-header {
  max-width: 42rem;
  min-width: 0;
  margin-bottom: 1rem;
  padding-right: max(3.75rem, env(safe-area-inset-right));
  overflow-wrap: anywhere;
}

.academic-dialog-year {
  margin-bottom: 0.35rem;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.academic-dialog h2 {
  margin-bottom: 0.5rem;
  color: #fff;
  font-size: clamp(1.65rem, 5vw, 2.5rem);
}

.academic-dialog-header p:last-child {
  margin: 0;
  color: #fff;
}

.academic-dialog-content .module-list {
  display: block;
  overflow: hidden;
  border: 1px solid #fff;
  border-radius: var(--radius-md);
  background: #000;
}

.academic-dialog-content .module-item summary {
  min-height: 3rem;
  font-size: 0.78rem;
}

.academic-dialog-content .module-content p {
  font-size: 0.74rem;
}

@media (hover: hover) and (pointer: fine) {
  .year-card:hover {
    transform: scale(0.98);
  }

  .year-card.is-active:hover {
    transform: scale(1.02) translateY(-2px);
  }

  .academic-select:hover {
    background: var(--accent-hover);
    color: #000;
  }

  .academic-view:hover {
    border-color: var(--accent-hover);
    background: #000;
    color: var(--accent-hover);
  }

  .module-item summary:hover {
    background: var(--accent-hover);
    color: #000;
  }

  .module-item summary:hover::after,
  .module-item summary:hover small {
    color: #000;
  }
}

@media (min-width: 48rem) {
  .academic-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 72rem) {
  .academic-pathway {
    grid-template-columns: minmax(16rem, 0.6fr) minmax(0, 1.4fr);
    align-items: stretch;
  }

  .academic-heading {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

.skills-section {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.skills-section::before,
.skills-section::after {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
}

.skills-section::before {
  top: clamp(-7rem, -10vw, -4.5rem);
  left: clamp(-8rem, -11vw, -4.5rem);
  width: clamp(20rem, 44vw, 34rem);
  height: min(clamp(13rem, 22vw, 17rem), 40%);
  background: repeating-radial-gradient(circle at 17% 14%, transparent 0 0.72rem, rgba(255, 255, 255, 0.13) 0.76rem 0.81rem, transparent 0.85rem 1.42rem);
  opacity: 0.7;
  transform: rotate(-3deg);
  -webkit-mask-image: linear-gradient(135deg, #000 0 15%, rgba(0, 0, 0, 0.78) 35%, transparent 74%);
  mask-image: linear-gradient(135deg, #000 0 15%, rgba(0, 0, 0, 0.78) 35%, transparent 74%);
}

.skills-section::after {
  bottom: clamp(-5rem, -7vw, -2.75rem);
  left: clamp(-5rem, -7vw, -2.75rem);
  width: clamp(17rem, 32vw, 27rem);
  height: min(clamp(11rem, 18vw, 15rem), 36%);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.11) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.11) 1px, transparent 1px);
  background-size: 0.78rem 0.78rem;
  opacity: 0.55;
  transform: rotate(4deg);
  -webkit-mask-image: radial-gradient(ellipse at bottom left, #000 0 18%, rgba(0, 0, 0, 0.68) 42%, transparent 78%);
  mask-image: radial-gradient(ellipse at bottom left, #000 0 18%, rgba(0, 0, 0, 0.68) 42%, transparent 78%);
}

.skills-section > .container {
  position: relative;
  z-index: 1;
}

.skills-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.8rem;
}

.skill-card {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(1rem, 3vw, 1.4rem);
}

.skill-card h3 {
  max-width: calc(100% - 2.5rem);
  margin-bottom: 1rem;
  overflow-wrap: anywhere;
}

.skill-number {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  font-size: 0.7rem;
  font-weight: 800;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-list li {
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #050505;
  color: #bdbdbd;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
}

.skills-grid .tag-list {
  align-content: flex-start;
}

.skills-grid .tag-list li {
  max-width: 100%;
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.34rem 0.58rem 0.34rem 0.44rem;
  overflow-wrap: anywhere;
}

.tech-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 1.25rem;
  padding: 0.12rem;
  border-radius: 0.2rem;
  background: #f7f7f7;
  object-fit: contain;
}

.tech-name {
  min-width: 0;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.timeline {
  position: relative;
  display: grid;
  gap: 1rem;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0.9rem;
  bottom: 0.9rem;
  left: 0.35rem;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-left: 1.65rem;
}

.timeline-marker {
  position: absolute;
  top: 1.5rem;
  left: 0;
  z-index: 1;
  width: 0.75rem;
  height: 0.75rem;
  border: 2px solid #000;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px #fff;
}

.experience-card {
  padding: clamp(1rem, 3vw, 1.5rem);
}

.experience-header {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}

.experience-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: clamp(0.65rem, 2vw, 0.9rem);
}

.experience-title {
  min-width: 0;
}

.experience-title h3,
.experience-title .institution {
  overflow-wrap: anywhere;
}

.experience-logo {
  flex: none;
  object-fit: contain;
  padding: 0.28rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  background: #f7f7f7;
}

.experience-logo-capaciti {
  width: clamp(5.75rem, 22vw, 8rem);
  height: clamp(2.6rem, 10vw, 3.5rem);
}

.experience-logo-huawei {
  width: clamp(2.75rem, 11vw, 3.75rem);
  height: clamp(2.75rem, 11vw, 3.75rem);
}

.date {
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 0.28rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #050505;
  color: #d6d6d6;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.bullet-list {
  margin: 0;
  padding-left: 1.05rem;
}

.bullet-list li + li {
  margin-top: 0.4rem;
}

.bullet-list li::marker {
  color: #fff;
}

.section-heading-row {
  max-width: none;
}

.section-heading-row > *,
.contact-grid > *,
.footer-inner > * {
  min-width: 0;
}

.section-heading-row p,
.footer-inner,
.footer-inner a {
  overflow-wrap: anywhere;
}

[hidden] {
  display: none !important;
}

.event-filter {
  max-width: 32rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem 1rem;
  margin: -0.35rem auto clamp(1.4rem, 3vw, 2rem);
}

.event-filter-label {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.event-filter-options {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #070707;
}

.event-filter-button {
  min-width: 6.75rem;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
  transition: background-color 180ms ease, color 180ms ease;
}

.event-filter-button:hover {
  color: var(--accent-hover);
}

.event-filter-button[aria-pressed="true"] {
  background: #fff;
  color: #000;
}

.event-filter-button:focus-visible {
  outline-offset: 3px;
}

.event-filter-count {
  min-width: 1.45rem;
  padding: 0.05rem 0.35rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.68rem;
  line-height: 1.45;
  opacity: 0.75;
}

.certificates-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.8rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.certificates-grid > li {
  min-width: 0;
}

.certificate-card {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.certificate-brand {
  min-height: 5.25rem;
  display: flex;
  align-items: center;
  padding: 1rem clamp(1rem, 3vw, 1.4rem);
  border-bottom: 1px solid var(--border);
  background: #050505;
}

.certificate-logo {
  width: auto;
  max-width: min(10rem, 72%);
  height: clamp(2.6rem, 8vw, 3.25rem);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  background: #f7f7f7;
  object-fit: contain;
  object-position: left center;
}

.certificate-logo-avatar {
  width: 3rem;
  max-width: 3rem;
  height: 3rem;
  padding: 0;
  border-radius: var(--radius-sm);
}

.certificate-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: clamp(1rem, 3vw, 1.4rem);
}

.certificate-body h3,
.certificate-body p,
.certificate-body .text-link {
  overflow-wrap: anywhere;
}

.certificate-body > p:not(.card-label) {
  color: var(--text-muted);
}

.certificate-body .text-link {
  width: fit-content;
  margin-top: auto;
}

.projects-grid,
.gallery-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.8rem;
  overflow: visible;
  padding: 0;
}

.projects-grid > li,
.gallery-grid > li {
  min-width: 0;
}

.project-card {
  height: 100%;
  display: flex;
}

.project-body {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(1rem, 3vw, 1.4rem);
}

.project-body h3,
.project-body p,
.project-body .text-link,
.gallery-copy strong,
.gallery-copy > span:last-child {
  overflow-wrap: anywhere;
}

.project-body > p:not(.card-label) {
  color: var(--text-muted);
}

.project-body .tag-list {
  margin: auto 0 1rem;
  padding-top: 0.2rem;
}

.project-body .text-link {
  width: fit-content;
}

.gallery-card {
  width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: zoom-in;
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.gallery-card:hover {
  border-color: var(--accent-hover);
  box-shadow: 0 0 1.2rem color-mix(in srgb, var(--accent-hover) 12%, transparent);
  transform: translateY(-3px);
}

.gallery-image-wrap {
  min-height: 0;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #050505;
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 220ms ease;
}

.gallery-card:hover img {
  transform: scale(1.015);
}

.gallery-copy {
  min-width: 0;
  display: grid;
  padding: 0.85rem 0.95rem 0.95rem;
}

.gallery-copy .card-label {
  margin-bottom: 0.2rem;
}

.gallery-copy strong {
  color: #fff;
  font-size: 0.98rem;
  line-height: 1.3;
}

.gallery-copy > span:last-child {
  color: var(--text-muted);
  font-size: 0.76rem;
}

.gallery-dialog {
  width: min(calc(100% - 1rem), 58rem);
  width: min(calc(100% - max(0.5rem, env(safe-area-inset-left)) - max(0.5rem, env(safe-area-inset-right))), 58rem);
  max-height: min(calc(100vh - 1rem), 46rem);
  max-height: min(calc(100dvh - max(0.5rem, env(safe-area-inset-top)) - max(0.5rem, env(safe-area-inset-bottom))), 46rem);
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.gallery-dialog::backdrop {
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(5px);
}

.gallery-dialog form {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 0;
}

.dialog-close {
  position: absolute;
  top: max(0.65rem, env(safe-area-inset-top));
  right: max(0.65rem, env(safe-area-inset-right));
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #444;
  border-radius: 50%;
  background: #000;
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.dialog-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.dialog-image-wrap {
  min-height: 0;
  max-height: 42vh;
  max-height: 42dvh;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #050505;
}

.dialog-image-wrap img {
  width: 100%;
  height: 100%;
  max-height: 42vh;
  max-height: 42dvh;
  object-fit: contain;
}

.dialog-copy {
  min-width: 0;
  padding:
    clamp(1rem, 3vw, 2rem)
    max(clamp(1rem, 3vw, 2rem), env(safe-area-inset-right))
    max(clamp(1rem, 3vw, 2rem), env(safe-area-inset-bottom))
    max(clamp(1rem, 3vw, 2rem), env(safe-area-inset-left));
  overflow-wrap: anywhere;
}

.dialog-copy h2,
.dialog-copy p {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.dialog-copy p:last-child {
  margin-bottom: 0;
}

.contact-section {
  border-top: 1px solid var(--border);
}

.contact-grid {
  display: grid;
  gap: 1.5rem clamp(2rem, 8vw, 6rem);
}

.contact-grid h2 {
  max-width: 13ch;
}

.contact-actions {
  display: grid;
  gap: 0.35rem;
  align-content: start;
}

.contact-link {
  min-width: 0;
  display: grid;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  color: #fff;
  text-decoration: none;
}

.contact-link span {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.contact-link strong {
  overflow-wrap: anywhere;
}

.contact-actions .button {
  width: fit-content;
  margin-top: 0.65rem;
}

.site-footer {
  padding-block: 1.5rem;
  border-top: 1px solid var(--border);
  background: #050505;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem 1.25rem;
}

.footer-inner p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

@media (min-width: 38rem) {
  .certificates-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
  }

  .hero-visual {
    --terminal-width: 16rem;
  }

  .portrait-wrap {
    --portrait-size: 16rem;
  }

  .skills-grid,
  .projects-grid,
  .gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    overflow: visible;
    padding: 0;
  }

  .skills-grid > .skill-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .projects-grid > li,
  .gallery-grid > li {
    min-width: 0;
  }

  .experience-header {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

}

@media (min-width: 50rem) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) 17rem;
    gap: clamp(2.5rem, 6vw, 5rem);
    align-items: start;
  }

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

  .hero-visual {
    --terminal-width: 17rem;
    justify-items: end;
  }

  .portrait-wrap {
    --portrait-size: 17rem;
    margin: 0 0 0 auto;
  }

  .section-heading-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
    text-align: left;
  }

  .section-heading-row > p {
    max-width: 30rem;
    margin-bottom: 0.45rem;
  }

  .contact-grid {
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 0.8fr);
    align-items: center;
  }

}

@media (min-width: 50rem) and (min-height: 35rem) {
  .dialog-layout {
    grid-template-columns: minmax(0, 1.2fr) minmax(16rem, 0.8fr);
    min-height: min(27rem, 78vh);
    min-height: min(27rem, 78dvh);
  }

  .dialog-image-wrap {
    max-height: none;
    aspect-ratio: auto;
  }

  .dialog-image-wrap img {
    max-height: 78vh;
    max-height: 78dvh;
  }

  .dialog-copy {
    align-self: center;
  }
}

@media (min-width: 64rem) {
  .skills-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .projects-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .skills-grid > .skill-card:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 78rem) {
  .gallery-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 75rem) {
  .site-header {
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }

  .menu-toggle {
    display: none;
  }

  .site-nav,
  .site-nav[data-open="true"] {
    position: static;
    width: auto;
    min-height: 0;
    height: auto;
    max-height: none;
    display: block;
    overflow: visible;
    margin-left: auto;
    padding: 0;
    background: transparent;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    transition: none;
  }

  .nav-list {
    width: auto;
    display: flex;
    align-items: center;
    gap: clamp(0.2rem, 1vw, 0.75rem);
    margin: 0;
  }

  .nav-list > li > a,
  .nav-other-toggle {
    min-height: 2.75rem;
    padding: 0.45rem;
    font-size: 0.78rem;
  }

  .nav-other {
    position: relative;
    display: block;
  }

  .nav-submenu {
    position: absolute;
    top: calc(100% - 0.1rem);
    right: 0;
    z-index: 20;
    width: 13rem;
    max-height: none;
    display: grid;
    gap: 0.15rem;
    overflow: visible;
    padding: 0.45rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(5, 5, 5, 0.98);
    box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.48);
    pointer-events: none;
    transform: translateY(-0.4rem);
  }

  .nav-other[data-other-open="true"] .nav-submenu {
    max-height: none;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-submenu a {
    min-height: 2.6rem;
    justify-content: flex-start;
    padding: 0.55rem 0.7rem;
    border-radius: 0.35rem;
    color: #c9c9c9;
    font-size: 0.78rem;
    font-weight: 650;
  }

  .nav-submenu a:hover,
  .nav-submenu a:focus-visible {
    background: #151515;
    color: var(--accent-hover);
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr) 18rem;
  }

  .hero-visual {
    --terminal-width: 18rem;
  }

  .portrait-wrap {
    --portrait-size: 18rem;
  }
}

@media (min-width: 90rem) {
  :root {
    --container: 78rem;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr) 19rem;
  }

  .hero-visual {
    --terminal-width: 19rem;
  }

  .portrait-wrap {
    --portrait-size: 19rem;
  }
}

@media (max-width: 30rem) {
  .hero {
    padding-block: 1.25rem 2rem;
  }

  .button-group .button,
  .contact-actions .button {
    width: 100%;
    max-width: 100%;
    text-align: center;
  }

  .social-list {
    gap: 0.55rem;
  }

  .social-link {
    padding-inline: 0.7rem;
  }

  .event-filter {
    align-items: stretch;
  }

  .event-filter-label {
    flex: 1 0 100%;
    text-align: center;
  }

  .event-filter-options {
    width: 100%;
  }

  .event-filter-button {
    min-width: 0;
    padding-inline: 0.65rem;
  }

  .contact-link strong {
    font-size: clamp(0.82rem, 4vw, 1rem);
  }

  .site-footer {
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
  }
}

@media (max-width: 22rem) {
  .container {
    width: calc(100% - 1rem);
  }

  .section {
    padding-block: clamp(2.5rem, 12vw, 3.25rem);
  }

  .header-inner {
    min-height: calc(3.9rem + env(safe-area-inset-top));
  }

  h1 {
    font-size: 2.25rem;
  }

  h2 {
    font-size: 1.65rem;
  }

  .hero-visual {
    --terminal-width: min(12.5rem, 76vw);
  }

  .portrait-wrap {
    --portrait-size: min(12.5rem, 76vw);
  }

  .academic-pathway {
    padding-inline: 0.5rem;
  }

  .education-identity {
    flex-wrap: wrap;
  }

  .education-logo {
    max-width: 100%;
  }

  .academic-grid {
    overflow: visible;
    padding-inline: 0.25rem;
  }

  .year-card,
  .year-card.is-active {
    transform: none;
  }

  .year-card-header {
    flex-wrap: wrap;
    align-items: start;
    gap: 0.5rem;
    padding-inline: 0.75rem;
  }

  .year-meta {
    text-align: left;
  }

  .skill-card,
  .experience-card,
  .project-body,
  .certificate-body {
    padding: 0.85rem;
  }

  .timeline-item {
    padding-left: 1.25rem;
  }

  .experience-identity {
    flex-wrap: wrap;
  }

  .experience-logo {
    max-width: 100%;
  }
}

@media (max-width: 74.999rem) and (max-height: 35rem) and (orientation: landscape) {
  .site-nav {
    padding-top: calc(4.5rem + env(safe-area-inset-top));
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.2rem 1rem;
  }

  .nav-list > li > a,
  .nav-other-toggle {
    min-height: 2.75rem;
    font-size: 1rem;
  }

  .nav-other {
    grid-column: 1 / -1;
  }

  .nav-submenu {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nav-submenu a {
    padding-inline: 0.35rem;
    font-size: 0.82rem;
    white-space: normal;
  }

  .dialog-layout {
    min-height: 0;
  }

  .dialog-image-wrap,
  .dialog-image-wrap img {
    max-height: 38vh;
    max-height: 38dvh;
  }

  .dialog-image-wrap {
    aspect-ratio: 16 / 7;
  }

  .dialog-copy {
    padding-block: 0.85rem;
  }
}

@media (min-width: 36rem) and (max-width: 49.999rem) and (max-height: 35rem) and (orientation: landscape) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(10rem, 38vh);
    gap: 1.5rem;
    align-items: center;
  }

  .hero-visual {
    --terminal-width: min(11.5rem, 42vh);
    justify-items: end;
  }

  .portrait-wrap {
    --portrait-size: min(11.5rem, 42vh);
    margin: 0 0 0 auto;
  }
}

/* Progressive scroll motion: content stays visible unless JavaScript enables it. */
[data-reveal],
[data-draw] {
  --reveal-delay: 0ms;
}

.motion-ready [data-reveal] {
  opacity: 0;
  translate: 0 var(--reveal-distance);
  transition:
    opacity 650ms var(--motion-ease),
    translate 850ms var(--motion-ease);
  transition-delay: 0ms;
}

.motion-ready [data-reveal="fade"] {
  translate: none;
}

.motion-ready [data-reveal="line"] {
  opacity: 1;
  translate: none;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 900ms var(--motion-ease);
}

.motion-ready [data-reveal]:not(.is-inview) {
  will-change: opacity, translate;
}

.motion-ready [data-reveal="line"]:not(.is-inview) {
  will-change: clip-path;
}

.motion-ready [data-reveal].is-inview {
  opacity: 1;
  translate: none;
  transition-delay: var(--reveal-delay);
}

.motion-ready [data-reveal="line"].is-inview {
  clip-path: inset(0);
}

.motion-ready [data-draw] :is(path, rect, circle) {
  stroke-dasharray: var(--draw-length, 1);
  stroke-dashoffset: var(--draw-length, 1);
  transition: stroke-dashoffset 900ms var(--motion-ease);
  transition-delay: 0ms;
}

.motion-ready [data-draw].is-inview :is(path, rect, circle) {
  stroke-dashoffset: 0;
  transition-delay: calc(var(--reveal-delay) + var(--draw-delay, 120ms));
}

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

  .motion-ready [data-reveal],
  .motion-ready [data-draw] :is(path, rect, circle) {
    opacity: 1 !important;
    translate: none !important;
    clip-path: none !important;
    stroke-dashoffset: 0 !important;
    transition: none !important;
  }

  .hero-terminal-cursor {
    display: none;
  }

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

@media print {
  [data-reveal],
  [data-draw] :is(path, rect, circle) {
    opacity: 1 !important;
    translate: none !important;
    clip-path: none !important;
    stroke-dashoffset: 0 !important;
    transition: none !important;
  }

  .site-header,
  .skip-link,
  .button-group,
  .social-list,
  .event-filter,
  .gallery-dialog {
    display: none !important;
  }

  :root {
    --bg: #fff;
    --surface: #fff;
    --surface-raised: #fff;
    --text: #222;
    --text-muted: #444;
    --heading: #000;
    --accent: #000;
    --border: #bbb;
  }

  .hero,
  .section {
    padding-block: 1.25rem;
  }

  .projects-grid,
  .gallery-grid {
    display: grid;
    overflow: visible;
  }

  .card {
    break-inside: avoid;
  }
}
