@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: dark;

  /* Apple Pro Dark Palette */
  --bg-primary: #000000;
  --bg-subtle: #0a0a0a;
  --surface-card: #141415;
  --surface-elevated: #1c1c1e;
  --surface-hover: #242427;
  --surface-glass: rgba(20, 20, 22, 0.72);
  --surface-glass-solid: #141416;

  /* Specular Borders & Focus */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  --focus-ring: rgba(245, 245, 247, 0.7);

  /* Typography Colors */
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-muted: #86868b;

  /* Interactive CTA */
  --cta-primary-bg: #f5f5f7;
  --cta-primary-hover: #ffffff;
  --cta-primary-text: #000000;

  /* Typography Stack */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', system-ui, sans-serif;

  /* Widescreen Geometry */
  --nav-height: 68px;
  --canvas-max: 1600px;
  --canvas-pad: clamp(1.5rem, 4vw, 4rem);
  --sidebar-width: 320px;
  --radius-3xl: 1.75rem;
  --radius-2xl: 1.25rem;
  --radius-xl: 0.9375rem;
  --radius-pill: 9999px;
}

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

html {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 100%;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 32px);
}

@media (pointer: fine) {
  html {
    overscroll-behavior: none;
  }
}

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

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow-x: clip;
}

body.modal-open {
  overflow: hidden;
}

/* Screen-reader & Skip Link Accessibility */
.sr-only {
  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.875rem;
  left: 1.25rem;
  z-index: 100;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-pill);
  background-color: var(--cta-primary-bg);
  color: var(--cta-primary-text);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-220%);
  transition: transform 180ms ease-out;
}

.skip-link:focus-visible {
  transform: translateY(0);
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

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

/* ==========================================================================
   Widescreen Glassmorphic Fixed Top Navbar
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: var(--nav-height);
  background-color: var(--surface-glass);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
}

.site-header-inner {
  width: 100%;
  max-width: var(--canvas-max);
  height: 100%;
  margin: 0 auto;
  padding-left: max(var(--canvas-pad), env(safe-area-inset-left));
  padding-right: max(var(--canvas-pad), env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
  padding: 0.5rem 0.25rem;
  will-change: transform;
}

.brand-link::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff, #86868b);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}

.nav-menu-wrapper {
  display: flex;
  align-items: center;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-links {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.125rem;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.012em;
  will-change: transform;
  transition: color 180ms ease-out, background-color 180ms ease-out;
}

.header-links:hover,
.header-links[aria-current="page"] {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.08);
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.625rem;
  height: 2.625rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background-color: var(--surface-elevated);
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
  transition: background-color 180ms ease-out, border-color 180ms ease-out;
}

.mobile-menu-btn:hover {
  background-color: var(--surface-hover);
  border-color: var(--border-hover);
}

@media (max-width: 1023px) {
  .mobile-menu-btn {
    display: inline-flex;
  }

  .nav-menu-wrapper {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background-color: rgba(16, 16, 18, 0.94);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    backdrop-filter: blur(28px) saturate(180%);
    border-bottom: 1px solid var(--border-subtle);
    padding: 1.25rem max(var(--canvas-pad), env(safe-area-inset-right)) 1.75rem max(var(--canvas-pad), env(safe-area-inset-left));
    overscroll-behavior: contain;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
  }

  .nav-menu-wrapper.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .site-nav {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.625rem;
  }

  .header-links {
    width: 100%;
    justify-content: flex-start;
    padding: 0.9375rem 1.125rem;
    border-radius: var(--radius-xl);
    font-size: 1rem;
    background-color: var(--surface-card);
    border: 1px solid var(--border-subtle);
  }
}

/* ==========================================================================
   Widescreen Canvas & Atmospheric Lighting
   ========================================================================== */
.page-main {
  position: relative;
  flex: 1;
  width: 100%;
  padding-top: var(--nav-height);
}

.section-shell {
  position: relative;
  width: 100%;
  max-width: var(--canvas-max);
  margin: 0 auto;
  padding-block: clamp(5rem, 10vh, 8.5rem);
  padding-left: max(var(--canvas-pad), env(safe-area-inset-left));
  padding-right: max(var(--canvas-pad), env(safe-area-inset-right));
}

.ambient-section-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(60% 50% at 18% 25%, rgba(120, 145, 255, 0.06), transparent 70%),
    radial-gradient(55% 45% at 82% 72%, rgba(255, 255, 255, 0.045), transparent 70%);
}

section[id],
div[id] {
  scroll-margin-top: calc(var(--nav-height) + 32px);
}

/* ==========================================================================
   Monumental Typography Hierarchy
   ========================================================================== */
.display-title {
  margin: 0;
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.04em;
  text-wrap: balance;
  background: linear-gradient(180deg, #ffffff 0%, #f5f5f7 58%, #8e8e95 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: var(--text-primary);
  -webkit-text-fill-color: transparent;
}

.section-title {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(2.25rem, 4.2vw, 3.75rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.card-title {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  font-weight: 650;
  line-height: 1.18;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.body-lead {
  margin: 0;
  color: var(--text-secondary);
  font-size: clamp(1.075rem, 1.35vw, 1.3rem);
  font-weight: 400;
  line-height: 1.62;
  letter-spacing: -0.012em;
  text-wrap: pretty;
}

/* ==========================================================================
   Monumental Asymmetric Widescreen Hero (min-height: 90vh)
   ========================================================================== */
.hero-section {
  position: relative;
  min-height: 90vh;
  width: 100%;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--bg-primary);
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.hero-grid-mesh {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 42%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 42%, #000 20%, transparent 78%);
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}

.hero-orb-primary {
  top: -12%;
  right: 4%;
  width: clamp(360px, 42vw, 720px);
  height: clamp(360px, 42vw, 720px);
  background: radial-gradient(circle, rgba(110, 142, 255, 0.16) 0%, rgba(255, 255, 255, 0.06) 45%, transparent 72%);
}

.hero-orb-secondary {
  bottom: -18%;
  left: -6%;
  width: clamp(320px, 38vw, 640px);
  height: clamp(320px, 38vw, 640px);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.085) 0%, rgba(90, 115, 220, 0.05) 50%, transparent 75%);
}

.hero-widescreen-grid {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--canvas-max);
  margin: 0 auto;
  padding-block: clamp(3.5rem, 7vh, 6rem);
  padding-left: max(var(--canvas-pad), env(safe-area-inset-left));
  padding-right: max(var(--canvas-pad), env(safe-area-inset-right));
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 4.5rem);
  align-items: center;
}

.hero-copy-col {
  grid-column: span 7;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: clamp(1.5rem, 2.5vh, 2.25rem);
  min-width: 0;
  will-change: transform, opacity;
}

.hero-bio {
  max-width: 44rem;
}

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

.hero-visual-col {
  grid-column: span 5;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
  will-change: transform;
}

.hero-portrait-stage {
  position: relative;
  width: 100%;
  max-width: 470px;
}

.hero-portrait-halo {
  position: absolute;
  inset: -12%;
  border-radius: 2.5rem;
  background: radial-gradient(circle at 50% 45%, rgba(135, 165, 255, 0.2), rgba(255, 255, 255, 0.06) 45%, transparent 72%);
  filter: blur(42px);
  pointer-events: none;
  z-index: 0;
}

.hero-portrait-card {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 4 / 4.25;
  padding: 0.875rem;
  border-radius: calc(var(--radius-3xl) + 0.25rem);
  background: linear-gradient(160deg, rgba(34, 34, 38, 0.9) 0%, rgba(20, 20, 22, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transform-style: preserve-3d;
}

.hero-portrait-inner {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-3xl);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-subtle);
}

.hero-avatar {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

@media (max-width: 1023px) {
  .hero-section {
    min-height: auto;
  }

  .hero-widescreen-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .hero-copy-col {
    grid-column: span 1;
    order: 2;
  }

  .hero-visual-col {
    grid-column: span 1;
    order: 1;
    justify-content: flex-start;
  }

  .hero-portrait-stage {
    max-width: 340px;
  }
}

/* ==========================================================================
   Magnetic Apple Buttons & Pills
   ========================================================================== */
.apple-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 0.9375rem 1.75rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 0.96875rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  will-change: transform;
  transition: background-color 180ms ease-out, border-color 180ms ease-out, color 180ms ease-out, box-shadow 180ms ease-out;
}

.apple-btn-primary {
  background-color: var(--cta-primary-bg);
  color: var(--cta-primary-text);
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 30px rgba(255, 255, 255, 0.12);
}

.apple-btn-primary:hover {
  background-color: var(--cta-primary-hover);
  box-shadow: 0 12px 36px rgba(255, 255, 255, 0.2);
}

.apple-btn-secondary {
  background-color: var(--surface-elevated);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.1);
}

.apple-btn-secondary:hover {
  background-color: var(--surface-hover);
  border-color: var(--border-hover);
}

.apple-btn-sm {
  padding: 0.625rem 1.1875rem;
  font-size: 0.875rem;
  font-weight: 500;
}

/* ==========================================================================
   3D Perspective Tilt + Dynamic Cursor Spotlight Bento Cards
   ========================================================================== */
.bento-card {
  --mouse-x: 50%;
  --mouse-y: 50%;
  --spotlight-opacity: 0;

  position: relative;
  min-width: 0;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255, 255, 255, 0.03), transparent 60%),
    var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-3xl);
  will-change: transform;
  transition: background-color 220ms ease-out, border-color 220ms ease-out, box-shadow 220ms ease-out;
}

/* Surface Radial Glow following cursor */
.bento-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    640px circle at var(--mouse-x) var(--mouse-y),
    rgba(255, 255, 255, 0.085),
    rgba(130, 160, 255, 0.035) 35%,
    transparent 70%
  );
  opacity: var(--spotlight-opacity, 0);
  transition: opacity 260ms ease-out;
  pointer-events: none;
  z-index: 1;
}

/* Specular Rim Border Illumination following cursor */
.bento-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(
    420px circle at var(--mouse-x) var(--mouse-y),
    rgba(255, 255, 255, 0.5),
    rgba(160, 185, 255, 0.2) 38%,
    transparent 72%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: var(--spotlight-opacity, 0);
  transition: opacity 260ms ease-out;
  pointer-events: none;
  z-index: 2;
}

.bento-card > * {
  position: relative;
  z-index: 3;
}

.bento-card-elevated {
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255, 255, 255, 0.045), transparent 65%),
    var(--surface-elevated);
}

.bento-interactive {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.bento-interactive:hover,
.bento-interactive:focus-visible,
.cert-bento-card:hover,
.edu-card:hover {
  background-color: #19191c;
  border-color: var(--border-hover);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.65);
}

/* ==========================================================================
   Widescreen 12-Column Projects Bento Mosaic (8/4, 5/7, 12 Split)
   ========================================================================== */
.section-header {
  position: relative;
  z-index: 1;
  width: fit-content;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  margin-bottom: clamp(2.75rem, 5vh, 4.25rem);
}

.projects-bento-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(1.25rem, 1.8vw, 1.75rem);
  width: 100%;
}

.project-bento-item {
  min-width: 0;
  display: flex;
}

.project-span-8 {
  grid-column: span 8;
}

.project-span-7 {
  grid-column: span 7;
}

.project-span-5 {
  grid-column: span 5;
}

.project-span-4 {
  grid-column: span 4;
}

.project-span-12 {
  grid-column: span 12;
}

.project-bento-link {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: clamp(1.5rem, 2.2vw, 2.25rem);
  gap: 1.5rem;
}

.project-media-wrap {
  position: relative;
  width: 100%;
  height: clamp(250px, 24vw, 360px);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.project-span-8 .project-media-wrap,
.project-span-7 .project-media-wrap {
  height: clamp(270px, 26vw, 390px);
}

.project-span-4 .project-media-wrap {
  height: clamp(270px, 26vw, 390px);
}

.project-span-5 .project-media-wrap {
  height: clamp(270px, 26vw, 390px);
}

/* Flagship 12-Col Panorama Split Card */
.project-span-12 .project-bento-link {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: clamp(1.75rem, 3vw, 3rem);
  align-items: center;
}

.project-span-12 .project-media-wrap {
  height: clamp(290px, 28vw, 420px);
}

.project-span-12 .card-title {
  font-size: clamp(1.6rem, 2.5vw, 2.35rem);
}

.project-media-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.09);
  will-change: transform;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.project-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  flex: 1;
  min-width: 0;
}

.project-card-desc {
  margin: 0;
  color: var(--text-secondary);
  font-size: clamp(0.96875rem, 1.1vw, 1.0625rem);
  line-height: 1.62;
  text-wrap: pretty;
}

.project-card-cta {
  margin-top: auto;
  padding-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.project-card-cta i {
  transition: transform 220ms ease-out;
}

.project-bento-link:hover .project-card-cta i {
  transform: translateX(6px);
}

@media (max-width: 1120px) {
  .project-span-8,
  .project-span-7 {
    grid-column: span 7;
  }

  .project-span-4,
  .project-span-5 {
    grid-column: span 5;
  }
}

@media (max-width: 900px) {
  .projects-bento-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-span-8,
  .project-span-7,
  .project-span-5,
  .project-span-4 {
    grid-column: span 1;
  }

  .project-bento-item:first-child,
  .project-span-12 {
    grid-column: span 2;
  }

  .project-span-12 .project-bento-link {
    grid-template-columns: 1fr;
  }

  .project-media-wrap,
  .project-span-8 .project-media-wrap,
  .project-span-7 .project-media-wrap,
  .project-span-5 .project-media-wrap,
  .project-span-4 .project-media-wrap,
  .project-span-12 .project-media-wrap {
    height: 260px;
  }
}

@media (max-width: 639px) {
  .projects-bento-grid {
    grid-template-columns: 1fr;
  }

  .project-bento-item,
  .project-bento-item:first-child,
  .project-span-8,
  .project-span-7,
  .project-span-5,
  .project-span-4,
  .project-span-12 {
    grid-column: span 1;
  }

  .project-media-wrap,
  .project-span-12 .project-media-wrap {
    height: 220px;
  }
}

/* ==========================================================================
   Widescreen Contact Bento Showcase
   ========================================================================== */
.contact-bento {
  padding: clamp(3rem, 6vw, 5.25rem) clamp(2rem, 5vw, 4.5rem);
  display: grid;
  grid-template-columns: 7fr 5fr;
  align-items: center;
  gap: clamp(2rem, 4vw, 4rem);
  background:
    radial-gradient(75% 90% at 15% 0%, rgba(120, 150, 255, 0.09), transparent 68%),
    radial-gradient(65% 80% at 90% 100%, rgba(255, 255, 255, 0.05), transparent 70%),
    var(--surface-card);
}

.contact-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 1.125rem;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

@media (max-width: 960px) {
  .contact-bento {
    grid-template-columns: 1fr;
  }

  .contact-actions {
    justify-content: flex-start;
  }
}

/* ==========================================================================
   Widescreen Minimal Apple Footer (1600px)
   ========================================================================== */
.site-footer {
  margin-top: auto;
  width: 100%;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-primary);
}

.site-footer-inner {
  width: 100%;
  max-width: var(--canvas-max);
  margin: 0 auto;
  padding: 2.5rem max(var(--canvas-pad), env(safe-area-inset-right)) 3rem max(var(--canvas-pad), env(safe-area-inset-left));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.footer-brand-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
}

.footer-brand-link {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.footer-socials {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.footer-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-pill);
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  text-decoration: none;
  will-change: transform;
  transition: color 180ms ease-out, background-color 180ms ease-out, border-color 180ms ease-out;
}

.footer-social-link:hover {
  color: var(--text-primary);
  background-color: var(--surface-hover);
  border-color: var(--border-hover);
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.84375rem;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Widescreen Sidebar Layout (about.html & project-detail.html: 320px + 1fr)
   ========================================================================== */
.sidebar-layout {
  position: relative;
  width: 100%;
  max-width: var(--canvas-max);
  margin: 0 auto;
  padding: clamp(2.75rem, 5vh, 4.5rem) max(var(--canvas-pad), env(safe-area-inset-right)) clamp(5rem, 9vh, 7.5rem) max(var(--canvas-pad), env(safe-area-inset-left));
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: clamp(2rem, 3.5vw, 4rem);
  align-items: start;
}

.toc-panel {
  position: sticky;
  top: calc(var(--nav-height) + 32px);
  padding: 1.5rem;
  border-radius: var(--radius-3xl);
  background-color: var(--surface-glass);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.toc-heading {
  margin: 0 0 1rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.78125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.toc-list a {
  display: block;
  padding: 0.625rem 0.875rem;
  border-radius: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.90625rem;
  font-weight: 500;
  line-height: 1.4;
  transition: color 180ms ease-out, background-color 180ms ease-out;
}

.toc-list a:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.06);
}

.toc-list a.active {
  color: var(--text-primary);
  background-color: var(--surface-elevated);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.content-column {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(3.5rem, 6vh, 5rem);
}

@media (max-width: 1080px) {
  .sidebar-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .toc-panel {
    position: static;
  }
}

/* ==========================================================================
   About Page 12-Column Asymmetric Bento Modules
   ========================================================================== */
.about-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.about-section-title {
  margin: 0;
  align-self: flex-start;
  color: var(--text-primary);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  text-wrap: balance;
}

.bento-pad-lg {
  padding: clamp(2rem, 3.5vw, 3rem);
}

.about-bento-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.375rem;
}

.bento-span-12 {
  grid-column: span 12;
  min-width: 0;
  display: flex;
}

.bento-span-8 {
  grid-column: span 8;
  min-width: 0;
  display: flex;
}

.bento-span-7 {
  grid-column: span 7;
  min-width: 0;
  display: flex;
}

.bento-span-5 {
  grid-column: span 5;
  min-width: 0;
  display: flex;
}

.bento-span-4 {
  grid-column: span 4;
  min-width: 0;
  display: flex;
}

@media (max-width: 820px) {
  .bento-span-8,
  .bento-span-7,
  .bento-span-5,
  .bento-span-4,
  .bento-span-12 {
    grid-column: span 12;
  }
}

.cert-bento-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.9375rem;
  padding: clamp(1.625rem, 2.4vw, 2.25rem);
  border-radius: var(--radius-3xl);
}

.cert-bento-card.is-spotlight {
  background:
    radial-gradient(85% 110% at 10% 0%, rgba(120, 150, 255, 0.1), transparent 65%),
    var(--surface-elevated);
  padding: clamp(2rem, 3.2vw, 2.75rem);
}

.cert-title {
  color: var(--text-primary);
  font-size: clamp(1.125rem, 1.45vw, 1.35rem);
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.cert-bento-card.is-spotlight .cert-title {
  font-size: clamp(1.375rem, 2vw, 1.75rem);
}

.cert-issuer {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 500;
}

.cert-date {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.cert-id {
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.cert-actions {
  margin-top: 0.375rem;
}

.cert-skills {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.3125rem;
}

.cert-skills-label {
  color: var(--text-muted);
  font-size: 0.78125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cert-skills-list {
  color: var(--text-secondary);
  font-size: 0.90625rem;
  line-height: 1.55;
}

.edu-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: clamp(1.875rem, 2.8vw, 2.5rem);
  border-radius: var(--radius-3xl);
}

.edu-institution {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.edu-degree {
  color: var(--text-primary);
  font-size: clamp(1.25rem, 1.7vw, 1.55rem);
  font-weight: 650;
  letter-spacing: -0.022em;
  line-height: 1.25;
}

.edu-date {
  color: var(--text-muted);
  font-size: 0.90625rem;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.25rem;
}

.edu-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1.03125rem;
  line-height: 1.65;
}

.edu-card strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ==========================================================================
   Widescreen Project Detail Editorial Report
   ========================================================================== */
.detail-article-shell {
  width: 100%;
  padding: clamp(2rem, 4vw, 3.75rem);
  border-radius: var(--radius-3xl);
  background:
    radial-gradient(90% 45% at 50% 0%, rgba(120, 150, 255, 0.06), transparent 65%),
    var(--surface-card);
  border: 1px solid var(--border-subtle);
  min-width: 0;
}

.project-report h1 {
  margin: 0 0 2rem 0;
  color: var(--text-primary);
  font-size: clamp(2rem, 3.8vw, 3.25rem);
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.project-report .engineering-report h1 {
  margin-top: 3rem;
  font-size: clamp(1.65rem, 2.8vw, 2.35rem);
}

.project-report .engineering-report h1:first-child {
  margin-top: 0.5rem;
}

.project-report h2 {
  margin: 3.25rem 0 1.25rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 650;
  line-height: 1.18;
  letter-spacing: -0.025em;
  text-wrap: balance;
  scroll-margin-top: calc(var(--nav-height) + 32px);
}

.project-report h3 {
  margin: 2.25rem 0 0.875rem 0;
  color: var(--text-primary);
  font-size: clamp(1.25rem, 1.8vw, 1.45rem);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.018em;
}

.project-report h4 {
  margin: 1.75rem 0 0.625rem 0;
  color: var(--text-primary);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.35;
}

.project-report p,
.project-report li {
  color: var(--text-secondary);
  font-size: 1.0625rem;
  line-height: 1.78;
  text-wrap: pretty;
  overflow-wrap: break-word;
}

.project-report p {
  margin: 0 0 1.375rem 0;
  max-width: 78ch;
}

.project-report ul,
.project-report ol {
  margin: 0 0 1.625rem 0;
  padding-left: 1.5rem;
  max-width: 78ch;
}

.project-report li {
  margin-bottom: 0.5rem;
}

.project-report strong {
  color: var(--text-primary);
  font-weight: 600;
}

.project-report hr {
  border: 0;
  border-top: 1px solid var(--border-subtle) !important;
  margin: 3.5rem 0 !important;
}

.project-report figure {
  margin: 2.5rem 0 !important;
  padding: clamp(1rem, 2vw, 1.75rem);
  border-radius: var(--radius-2xl);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  text-align: center;
}

.project-report figure img {
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  height: auto;
}

.project-report figcaption {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  font-style: normal;
}

@media (max-width: 767px) {
  .project-report div[style*="display: flex"] {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .project-report div[style*="display: flex"] figure {
    max-width: 100% !important;
    width: 100% !important;
  }

  .project-report figure img[style*="inline-block"] {
    display: block !important;
    max-width: 100% !important;
    margin: 0.5rem auto !important;
  }
}

/* ==========================================================================
   3D Motion Initial State & Accessibility Overrides
   ========================================================================== */
html.motion-ready .motion-init {
  opacity: 0;
  transform: perspective(1500px) translate3d(0, 44px, -36px) scale(0.95) rotateX(6deg);
  transform-origin: center center;
  will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
  .project-media-img {
    transform: none !important;
    transition: none !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header,
  .toc-panel,
  .nav-menu-wrapper {
    background-color: var(--surface-glass-solid);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --border-subtle: rgba(255, 255, 255, 0.24);
    --border-hover: rgba(255, 255, 255, 0.48);
    --text-secondary: #d1d1d6;
    --text-muted: #aeaeb2;
  }
}
