/* Inter (variable, latin subset) — self-hosted */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('assets/fonts/inter-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ═══════════════════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════════════════ */
:root {
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 32px;
  --nav-h: 84px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="light"] {
  --accent: #6D5DD3;
  --accent-soft: rgba(109, 93, 211, 0.10);
  --bg: #FAFAF8;
  --fg: #111111;
  --fg-muted: #666666;
  --fg-subtle: rgba(0, 0, 0, 0.56);
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.15);
  --surface: rgba(255, 255, 255, 0.75);
  --surface-2: rgba(255, 255, 255, 1);
  --nav-bg: rgba(250, 250, 248, 0.65);
  --nav-bg-scrolled: rgba(255, 255, 255, 0.85);
  --card-bg: rgba(255, 255, 255, 0.75);
  --card-border: rgba(0, 0, 0, 0.08);

  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 16px 32px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 32px 64px rgba(0, 0, 0, 0.08);

  --noise-opacity: 0.03;
  --vignette-color: rgba(230, 225, 220, 0.3);

  --hero-light-gradient: radial-gradient(ellipse at center, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.4) 40%, transparent 70%);
  --hero-text-glow-gradient: radial-gradient(circle, rgba(255, 255, 255, 1) 0%, transparent 60%);
  --hero-card-glow-gradient: radial-gradient(circle, rgba(255, 255, 255, 1) 0%, transparent 60%);

  --btn-primary-bg: #111111;
  --btn-primary-fg: #FFFFFF;
  --btn-primary-hover: #333333;
  --btn-secondary-bg: transparent;
  --btn-secondary-fg: #111111;
  --btn-secondary-border: rgba(0, 0, 0, 0.15);
  --btn-secondary-hover-bg: rgba(0, 0, 0, 0.04);
  --btn-secondary-hover-border: rgba(0, 0, 0, 0.25);

  --photo-card-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.5) 100%);
  --photo-card-shadow: inset 0 1px 0 rgba(255, 255, 255, 1), 0 24px 48px rgba(0, 0, 0, 0.06);
  --photo-card-shadow-hover: inset 0 1px 0 rgba(255, 255, 255, 1), 0 32px 64px rgba(0, 0, 0, 0.12);
  --avatar-circle-bg: rgba(0, 0, 0, 0.03);
  --avatar-circle-hover: rgba(0, 0, 0, 0.06);
  --badge-bg: rgba(255, 255, 255, 0.85);
  --badge-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);

  --divider: rgba(0, 0, 0, 0.06);
  --skill-chip-bg: rgba(0, 0, 0, 0.02);
  --skill-chip-hover: rgba(0, 0, 0, 0.05);
  --timeline-dot: rgba(0, 0, 0, 0.15);
  --timeline-dot-hover: #111111;
  --card-light-glow: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] {
  --accent: #A99CF5;
  --accent-soft: rgba(169, 156, 245, 0.12);
  --bg: #090909;
  --fg: #FFFFFF;
  --fg-muted: #B0B0B0;
  --fg-subtle: rgba(255, 255, 255, 0.7);
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --surface: rgba(255, 255, 255, 0.02);
  --surface-2: rgba(255, 255, 255, 0.04);
  --nav-bg: rgba(9, 9, 9, 0.5);
  --nav-bg-scrolled: rgba(9, 9, 9, 0.7);
  --card-bg: rgba(255, 255, 255, 0.02);
  --card-border: rgba(255, 255, 255, 0.05);

  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 16px 32px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 32px 64px rgba(0, 0, 0, 0.4);

  --noise-opacity: 0.35;
  --vignette-color: rgba(0, 0, 0, 0.5);

  --hero-light-gradient: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.02) 40%, transparent 70%);
  --hero-text-glow-gradient: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 60%);
  --hero-card-glow-gradient: radial-gradient(circle, rgba(255, 255, 255, 0.04) 0%, transparent 60%);

  --btn-primary-bg: #FFFFFF;
  --btn-primary-fg: #090909;
  --btn-primary-hover: #F0F0F0;
  --btn-secondary-bg: transparent;
  --btn-secondary-fg: #FFFFFF;
  --btn-secondary-border: rgba(255, 255, 255, 0.2);
  --btn-secondary-hover-bg: rgba(255, 255, 255, 0.08);
  --btn-secondary-hover-border: rgba(255, 255, 255, 0.3);

  --photo-card-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
  --photo-card-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 24px 48px rgba(0, 0, 0, 0.4);
  --photo-card-shadow-hover: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 32px 64px rgba(0, 0, 0, 0.5);
  --avatar-circle-bg: rgba(255, 255, 255, 0.02);
  --avatar-circle-hover: rgba(255, 255, 255, 0.04);
  --badge-bg: rgba(9, 9, 9, 0.6);
  --badge-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);

  --divider: rgba(255, 255, 255, 0.04);
  --skill-chip-bg: rgba(255, 255, 255, 0.02);
  --skill-chip-hover: rgba(255, 255, 255, 0.05);
  --timeline-dot: rgba(255, 255, 255, 0.15);
  --timeline-dot-hover: #FFFFFF;
  --card-light-glow: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .skill-chip .skill-logo.mono {
  filter: invert(1);
}
html[data-theme="dark"] .skill-chip .skill-logo[src*="nextjs-light.svg"] {
  filter: invert(1);
}

/* ═══════════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background-color: var(--bg);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg);
  color: var(--fg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}

/* Noise Overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background-image: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)" opacity="0.06"/%3E%3C/svg%3E');
  opacity: var(--noise-opacity);
  transition: opacity 0.5s var(--ease);
}

/* Vignette */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 30%, var(--vignette-color) 150%);
  transition: background 0.5s var(--ease);
}

a {
  color: inherit;
  text-decoration: none;
}

/* ═══════════════════════════════════════════════════
   NAVBAR — floating pill
═══════════════════════════════════════════════════ */
#navbar {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  width: max-content;
  max-width: min(1040px, calc(100vw - 48px));
  height: 56px;
  border-radius: 9999px;
  background: var(--nav-bg);
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  transition:
    top 0.5s var(--ease),
    height 0.5s var(--ease),
    box-shadow 0.5s var(--ease),
    background 0.5s var(--ease),
    border-color 0.5s var(--ease);
}

#navbar.scrolled {
  top: 16px;
  height: 50px;
  box-shadow: var(--shadow-md);
  background: var(--nav-bg-scrolled);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 0;
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
}

.nav-link {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--fg-muted);
  padding: 7px 14px;
  border-radius: 9999px;
  white-space: nowrap;
  transition: color 0.4s var(--ease), background 0.4s var(--ease);
}

.nav-link:hover {
  color: var(--fg);
  background: var(--surface);
}

.nav-link.active {
  color: var(--fg);
  background: var(--surface-2);
}

#nav-jp {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  height: 100%;
  cursor: pointer;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  transition: opacity 0.4s var(--ease), border-color 0.4s var(--ease);
  flex-shrink: 0;
  overflow: visible;
}

#nav-jp:hover {
  opacity: 0.8;
}

#nav-jp img {
  height: 64px;
  width: auto;
  object-fit: contain;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.15));
  transition: transform 0.5s var(--ease), filter 0.5s var(--ease);
}

#nav-jp:hover img {
  transform: scale(1.05) translateY(-2px);
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.2));
}

.theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: color 0.4s var(--ease), background 0.4s var(--ease), transform 0.4s var(--ease);
}

.theme-toggle:hover {
  color: var(--fg);
  background: var(--surface-2);
  transform: scale(1.05);
}

.resume-btn {
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 9999px;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: transform 0.4s var(--ease), background 0.4s var(--ease), box-shadow 0.4s var(--ease);
  box-shadow: var(--shadow-sm);
}

.resume-btn:hover {
  transform: translateY(-2px);
  background: var(--btn-primary-hover);
  box-shadow: var(--shadow-md);
}

.resume-btn svg {
  flex-shrink: 0;
}

@media (min-width: 921px) {
  #nav-container {
    position: fixed;
    top: 24px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    z-index: 200;
    pointer-events: none;
    transition: top 0.5s var(--ease);
  }
  #nav-container.scrolled {
    top: 16px;
  }
  #nav-container > * {
    pointer-events: auto;
  }
  #navbar {
    position: static !important;
    transform: none !important;
  }
  #nav-utils-desktop {
    position: absolute;
    right: 32px;
    top: 0;
  }
}

#nav-utils-desktop {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  padding: 0 12px;
  background: var(--nav-bg);
  border: 1px solid var(--border);
  border-radius: 9999px;
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
  transition: height 0.5s var(--ease), box-shadow 0.5s var(--ease), background 0.5s var(--ease), border-color 0.5s var(--ease);
}

#nav-utils-desktop.scrolled {
  height: 50px;
  box-shadow: var(--shadow-md);
  background: var(--nav-bg-scrolled);
}

.nav-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
}

/* ═══════════════════════════════════════════════════
   HERO SECTION (#home)
═══════════════════════════════════════════════════ */
#home {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: var(--nav-h);
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

/* Soft Diffused Light (Cinematic Spotlight) */
.hero-light {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120vw;
  height: 60vh;
  background: var(--hero-light-gradient);
  transform: translate(-50%, -50%) rotate(-10deg);
  z-index: -2;
  pointer-events: none;
  filter: blur(60px);
  transition: background 0.5s var(--ease);
}

/* Huge radial gradient behind hero text */
.hero-text-glow {
  position: absolute;
  top: 50%;
  left: 30%;
  width: 800px;
  height: 800px;
  background: var(--hero-text-glow-gradient);
  transform: translate(-50%, -50%);
  z-index: -1;
  pointer-events: none;
  filter: blur(40px);
  transition: background 0.5s var(--ease);
}

/* Another soft radial gradient behind the profile card */
.hero-card-glow {
  position: absolute;
  top: 50%;
  right: 15%;
  width: 900px;
  height: 900px;
  background: var(--hero-card-glow-gradient);
  transform: translate(50%, -50%);
  z-index: -1;
  pointer-events: none;
  filter: blur(50px);
  transition: background 0.5s var(--ease);
}

#hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 64px;
  width: 100%;
  max-width: 1200px;
  padding: 0 40px;
  margin-top: -20px;
}

/* ─── LEFT: greeting + name + bio ─── */
#hero-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  min-width: 0;
}

#greeting {
  font-size: 24px;
  font-weight: 300;
  color: var(--fg-muted);
  letter-spacing: 0.5px;
  opacity: 0;
  transform: translateY(-15px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}

#greeting.visible {
  opacity: 1;
  transform: translateY(0);
}

#logo-row {
  display: flex;
  align-items: center;
  margin-left: -6px;
}

.cell {
  position: relative;
  width: 66px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cell.space-cell {
  width: 36px;
}

.cell .logo-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  position: absolute;
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  opacity: 0;
  transform: translateY(20px) scale(0.8);
}

.cell .letter {
  font-size: 84px;
  font-weight: 900;
  color: var(--fg);
  letter-spacing: -3px;
  position: absolute;
  opacity: 0;
  transform: scale(1.2);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), color 0.5s var(--ease);
  user-select: none;
  line-height: 1;
}

.cell.loop-speed .logo-img {
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.cell.loop-speed .letter {
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease), color 0.5s var(--ease);
}

.cell.show-logo .logo-img {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.cell.show-logo .letter {
  opacity: 0;
  transform: scale(1.2);
}

.cell.morphing .logo-img {
  opacity: 0;
  transform: scale(1.5) rotate(5deg);
}

.cell.morphing .letter {
  opacity: 0;
  transform: scale(0.5);
}

.cell.show-letter .logo-img {
  opacity: 0;
  transform: scale(0);
}

.cell.show-letter .letter {
  opacity: 1;
  transform: scale(1);
}

.cell.show-letter.hovered .logo-img {
  opacity: 1;
  transform: scale(1.05);
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.08));
}

.cell.show-letter.hovered .letter {
  opacity: 0;
  transform: scale(0.5);
}

.cell.show-letter {
  cursor: crosshair;
}

.cell .ripple {
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--surface-2);
  transform: scale(0);
  opacity: 1;
  pointer-events: none;
}

.cell .ripple.go {
  animation: ripple-out 0.6s var(--ease) forwards;
}

@keyframes ripple-out {
  to {
    transform: scale(3.5);
    opacity: 0;
  }
}

#subtitle {
  max-width: 580px;
  text-wrap: pretty;
  margin: 0;
  font-size: 18px;
  font-weight: 400;
  color: var(--fg-muted);
  letter-spacing: 0.2px;
  line-height: 1.6;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  text-align: left;
}

#subtitle.visible {
  opacity: 1;
  transform: none;
}

#tags {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-start;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}

#tags.visible {
  opacity: 1;
  transform: translateY(0);
}

.tag {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.5px;
  padding: 8px 18px;
  border-radius: 100px;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  background: var(--surface);
  transition: background 0.5s var(--ease), border-color 0.5s var(--ease), color 0.5s var(--ease);
}

.tag:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--fg);
}

/* ─── RIGHT: Profile card ─── */
#hero-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

#hero-right.visible {
  opacity: 1;
  transform: none;
}

#photo-card {
  position: relative;
  width: 340px;
  border-radius: 32px;
  overflow: hidden;
  background: var(--photo-card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--photo-card-shadow);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease), border-color 0.6s var(--ease), background 0.6s var(--ease);
}

#photo-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--photo-card-shadow-hover);
  border-color: var(--border-strong);
}

/* Light Hover Effect */
#photo-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at top right, var(--card-light-glow) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.6s var(--ease);
  pointer-events: none;
}
#photo-card:hover::after {
  opacity: 1;
}

#photo-avatar {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 40px;
}

.avatar-img {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--avatar-circle-bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.5s var(--ease), border-color 0.5s var(--ease), transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
  flex-shrink: 0;
}

#photo-card:hover .avatar-img {
  background: var(--avatar-circle-hover);
  border-color: var(--border-strong);
  transform: scale(1.05);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.avatar-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.2px;
  text-align: center;
}

.avatar-role {
  font-size: 14px;
  font-weight: 400;
  color: var(--fg-muted);
  text-align: center;
  letter-spacing: 0.2px;
  margin-top: 6px;
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-subtle);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.label-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.photo-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  background: var(--badge-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 14px 6px 10px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2px;
  color: var(--fg);
  white-space: nowrap;
  box-shadow: var(--badge-shadow);
  transition: background 0.5s var(--ease), border-color 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
}

/* CTA buttons */
#cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

#cta-row.visible {
  opacity: 1;
  transform: none;
}

.cta-btn {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.2px;
  padding: 12px 28px;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), background 0.5s var(--ease), border-color 0.5s var(--ease), color 0.5s var(--ease);
}

.cta-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  box-shadow: var(--shadow-sm);
}

.cta-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: var(--btn-primary-hover);
}

.cta-secondary {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-fg);
  border: 1px solid var(--btn-secondary-border);
}

.cta-secondary:hover {
  transform: translateY(-2px);
  background: var(--btn-secondary-hover-bg);
  border-color: var(--btn-secondary-hover-border);
}

/* Scroll hint */
#scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transition: opacity 1.2s var(--ease);
  z-index: 10;
}

#scroll-hint.visible {
  opacity: 1;
}

#scroll-hint span {
  font-size: 10px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--fg-subtle);
}

#scroll-hint .arrow {
  width: 12px;
  height: 12px;
  border-right: 1.5px solid var(--fg-subtle);
  border-bottom: 1.5px solid var(--fg-subtle);
  transform: rotate(45deg);
  animation: bounce 2s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

@keyframes bounce {

  0%,
  100% {
    transform: rotate(45deg) translateY(0);
  }

  50% {
    transform: rotate(45deg) translateY(6px);
  }
}

/* ═══════════════════════════════════════════════════
   SHARED SECTION STYLES
═══════════════════════════════════════════════════ */
.section-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 112px 40px;
}

.section-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 20px;
}

.section-title {
  font-size: clamp(38px, 5vw, 64px);
  font-weight: 700;
  letter-spacing: -2px;
  color: var(--fg);
  line-height: 1.1;
  margin-bottom: 32px;
}

.section-body {
  font-size: 18px;
  font-weight: 400;
  color: var(--fg-subtle);
  line-height: 1.8;
  max-width: 640px;
}

/* Divider */
.section-divider {
  border: none;
  border-top: 1px solid var(--divider);
  margin: 0;
  transition: border-color 0.5s var(--ease);
}

/* ═══════════════════════════════════════════════════
   ABOUT SECTION
═══════════════════════════════════════════════════ */
.about-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
}
.about-left, .about-right {
  display: flex;
  flex-direction: column;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 60px;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 24px;
  transition: border-color 0.5s var(--ease), transform 0.5s var(--ease), background 0.5s var(--ease);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at top right, var(--card-light-glow) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.6s var(--ease);
  pointer-events: none;
}

.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
  background: var(--surface-2);
}
.card:hover::after {
  opacity: 1;
}

.card-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  box-shadow: 0 0 20px rgba(126, 87, 194, 0.15);
  backdrop-filter: blur(10px);
}

.card-icon {
  font-size: 24px;
  display: block;
  filter: hue-rotate(240deg) drop-shadow(0 0 8px rgba(126, 87, 194, 0.5));
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 12px;
  letter-spacing: -0.2px;
}

.card-text {
  font-size: 13.5px;
  color: var(--fg-muted);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════
   SKILLS SECTION
═══════════════════════════════════════════════════ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
  margin-top: 0;
}

.skill-chip {
  background: var(--skill-chip-bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 16px 24px;
  font-size: 14px;
  font-weight: 400;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.5s var(--ease), border-color 0.5s var(--ease), transform 0.5s var(--ease);
  cursor: pointer;
}

.skill-chip:hover {
  background: var(--skill-chip-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.skill-chip .skill-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
  transition: filter 0.4s var(--ease);
}

/* ═══════════════════════════════════════════════════
   PROJECTS SECTION
═══════════════════════════════════════════════════ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 60px;
}

@media (max-width: 768px) {
  .project-grid {
    grid-template-columns: 1fr;
  }
}

.project-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.5s var(--ease), transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}



.project-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  background: var(--surface-2);
}

.project-image {
  width: 100%;
  height: 260px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
  position: relative;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.project-card:hover .project-image img {
  transform: scale(1.03);
}

.project-content {
  padding: 8px 8px 16px 8px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.3px;
  margin-bottom: 8px;
}

.project-desc {
  font-size: 15px;
  color: var(--fg-muted);
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
}

.project-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.project-tag {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 100px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.project-tag:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--fg);
}

.project-links {
  display: flex;
  gap: 12px;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--fg);
  transition: all 0.3s var(--ease);
  text-decoration: none;
}

.project-link:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.project-link svg {
  width: 16px;
  height: 16px;
}

/* ═══════════════════════════════════════════════════
   CERTIFICATIONS SECTION
═══════════════════════════════════════════════════ */
.timeline {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: 28px;
}

.timeline-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 27.5px;
  width: 1px;
  background: var(--border-strong);
  z-index: 0;
}

.timeline-item {
  display: flex;
  position: relative;
  align-items: flex-start;
  margin-bottom: 40px;
  z-index: 1;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-icon-badge {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  margin-left: -28px;
  margin-right: 32px;
  box-shadow: 0 0 20px rgba(126, 87, 194, 0.15);
  backdrop-filter: blur(10px);
  filter: hue-rotate(240deg) drop-shadow(0 0 8px rgba(126, 87, 194, 0.5));
}

.timeline-content.card {
  align-items: flex-start;
  text-align: left;
  padding: 24px 32px;
  margin: 0;
  width: 100%;
}

.timeline-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 8px;
}

.timeline-org {
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.5;
}

.timeline-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--accent);
  margin-top: 12px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9d8df1;
  box-shadow: 0 0 8px #9d8df1;
}

/* ═══════════════════════════════════════════════════
   CERTIFICATIONS SECTION
═══════════════════════════════════════════════════ */
.cert-header-new {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 48px;
}

@media (max-width: 900px) {
  .cert-header-new {
    flex-direction: column;
    align-items: flex-start;
  }
  .cert-header-right {
    display: none;
  }
}

.cert-header-left .section-title {
  font-size: 48px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -1.5px;
  margin-bottom: 16px;
}
.cert-header-left .section-title span {
  color: var(--accent);
}
.cert-header-left .section-body {
  font-size: 16px;
  color: var(--fg-muted);
  line-height: 1.6;
}
.cert-header-right img {
  max-width: 400px;
  width: auto;
}

.cert-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 12px;
}

.cert-category-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 600;
  color: var(--fg);
}

.category-icon {
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--accent-soft);
  border-radius: 8px;
}

.view-all-btn {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-muted);
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--surface);
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
  text-decoration: none;
}
.view-all-btn:hover {
  background: var(--surface-2);
  color: var(--fg);
}

.cert-grid-new {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.cert-grid-new.two-cols {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 1100px) {
  .cert-grid-new {
    grid-template-columns: repeat(2, 1fr);
  }
  .cert-grid-new.two-cols {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  .cert-grid-new, .cert-grid-new.two-cols {
    grid-template-columns: 1fr;
  }
}

.cert-card-new {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  gap: 16px;
  cursor: pointer;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease);
  align-items: center;
}


.cert-card-new:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.cert-preview-new {
  position: relative;
  width: 120px;
  height: 85px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
}
.cert-preview-new.large {
  width: 160px;
  height: 110px;
}

.cert-embed-new {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
  pointer-events: none;
}

.cert-details-new {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.cert-title-new {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.3;
  margin: 0;
}
.cert-subtitle-new {
  font-size: 13px;
  color: var(--accent);
  margin: 0;
}
.cert-date-new {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--fg-muted);
  margin-top: 4px;
}

.cert-badge-new {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 100px;
  margin-top: 6px;
  width: max-content;
}
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.badge-dot.purple { background: #9d8df1; box-shadow: 0 0 6px #9d8df1; }
.badge-dot.green { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.badge-dot.orange { background: #f97316; box-shadow: 0 0 6px #f97316; }
.badge-dot.red { background: #ef4444; box-shadow: 0 0 6px #ef4444; }

/* Certificate Modal */
#cert-modal {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  align-items: center;
  justify-content: center;
  padding: 40px;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
#cert-modal[hidden] {
  display: none;
}
#cert-modal.active {
  opacity: 1;
}
#cert-modal-img {
  max-width: min(1000px, 100%);
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border: none;
  border-radius: 12px;
  background: white;
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.5);
  transform: translateY(20px);
  transition: transform 0.4s var(--ease);
}
#cert-modal.active #cert-modal-img {
  transform: translateY(0);
}
.modal-close-btn {
  position: absolute;
  top: 24px;
  right: 32px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--fg);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
  z-index: 100000;
}
.modal-close-btn:hover {
  background: var(--surface);
  transform: scale(1.05);
}

/* ═══════════════════════════════════════════════════
   CONTACT & RESUME SECTION
═══════════════════════════════════════════════════ */
.contact-container {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

@media (min-width: 900px) {
  .contact-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .contact-left {
    width: 45%;
  }
  .contact-right {
    width: 50%;
  }
}

.contact-left .section-label {
  margin-bottom: 24px;
}
.contact-left .section-title {
  font-size: 56px;
  line-height: 1.1;
  margin-bottom: 24px;
  font-weight: 700;
  letter-spacing: -1.5px;
}
.contact-left .section-title span {
  color: var(--accent);
}
.contact-left .contact-divider {
  width: 40px;
  height: 2px;
  background: var(--accent);
  margin: 24px 0;
}
.contact-left p {
  font-size: 16px;
  color: var(--fg-muted);
  line-height: 1.6;
}

.contact-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
  text-decoration: none;
  color: var(--fg);
}

.contact-card:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.contact-card-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.contact-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-card-title {
  font-size: 16px;
  font-weight: 600;
}

.contact-card-sub {
  font-size: 14px;
  color: var(--fg-muted);
}

.contact-card-arrow {
  color: var(--fg-muted);
  transition: transform 0.3s var(--ease), color 0.3s var(--ease);
}

.contact-card:hover .contact-card-arrow {
  transform: translateX(4px);
  color: var(--fg);
}

/* ═══════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════ */
footer {
  border-top: 1px solid var(--divider);
  padding: 40px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  transition: border-color 0.5s var(--ease);
}

.footer-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-muted);
  letter-spacing: -0.2px;
}

.footer-copy {
  font-size: 13.5px;
  color: var(--fg-subtle);
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════ */
/* Hamburger Menu & Mobile Overlay */
#hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: var(--fg);
  cursor: pointer;
  padding: 8px;
  margin-left: 12px;
}
#mobile-menu {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  width: calc(100vw - 32px);
  max-width: 400px;
  background: var(--nav-bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
  z-index: 199;
}
#mobile-menu.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.mobile-link {
  text-align: center;
  padding: 12px;
  border-radius: 12px;
  font-size: 16px;
  color: var(--fg-muted);
  font-weight: 500;
  transition: color 0.4s var(--ease), background 0.4s var(--ease);
  text-decoration: none;
}
.mobile-link:hover {
  color: var(--fg);
  background: var(--surface);
}

@media (max-width: 1100px) {
  .about-layout {
    grid-template-columns: 1fr;
    gap: 60px;
  }
  .about-right {
    margin-top: 0;
  }
}

@media (max-width: 920px) {
  #home {
    height: auto;
    min-height: 100vh;
    padding-bottom: 80px;
  }

  #hero-content {
    flex-direction: column;
    align-items: center;
    padding-top: 40px;
    margin-top: -10px;
    gap: 40px;
  }

  #hero-left {
    align-items: center;
    text-align: center;
  }

  #cta-row {
    justify-content: center;
  }

  #subtitle {
    text-align: center;
  }

  #tags {
    justify-content: center;
  }

  #hero-right {
    width: 100%;
    max-width: 280px;
  }
  #photo-card {
    width: 100%;
  }
  #photo-avatar {
    padding: 16px;
    gap: 16px;
  }
  #scroll-hint {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    margin-top: 60px;
  }

  .nav-left-group,
  .nav-right-group {
    display: none;
  }

  #navbar {
    max-width: calc(100vw - 32px);
  }
  .nav-inner {
    width: 100%;
    justify-content: space-between;
  }
  .desktop-only { display: none !important; }
  #nav-utils-mobile {
    display: flex !important;
    padding-left: 0;
    margin-left: auto;
    align-items: center;
    gap: 12px;
  }
  .nav-divider {
    display: block;
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
  }
  #nav-jp {
    border-right: none;
    border-left: none;
    padding-left: 8px;
    padding-right: 0;
    margin-right: auto;
  }
  #hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-left: 12px;
    padding: 0;
    color: var(--fg);
  }
  .resume-btn {
    padding: 6px 14px;
  }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .project-grid { grid-template-columns: 1fr; }
  .cert-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

@media (max-width: 640px) {
  .cell {
    width: clamp(32px, 10vw, 64px);
    height: clamp(32px, 10vw, 64px);
  }

  .cell .letter {
    font-size: clamp(32px, 10vw, 60px);
  }

  .cell.space-cell {
    width: 16px;
  }

  .cell .logo-img {
    width: clamp(24px, 8vw, 48px);
    height: clamp(24px, 8vw, 48px);
  }

  .section-wrap {
    padding: 72px 20px;
  }

  footer {
    padding: 32px 20px;
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  #nav-utils {
    right: 16px;
    top: 16px;
  }
  #nav-utils.scrolled {
    top: 12px;
  }
  .section-title {
    font-size: clamp(32px, 8vw, 48px);
    margin-bottom: 24px;
  }
  #greeting {
    font-size: 20px;
  }
  #subtitle {
    font-size: 15px;
  }
  .photo-badge {
    font-size: 12px;
    padding: 6px 16px 6px 12px;
    bottom: 16px;
  }
  .avatar-img {
    width: 150px;
    height: 150px;
  }
  .card-grid, .project-grid, .cert-grid {
    grid-template-columns: 1fr;
  }
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .skill-chip {
    padding: 12px 14px;
    font-size: 13px;
    gap: 8px;
  }
  .timeline-item {
    margin-bottom: 24px;
  }
  .timeline-icon-badge {
    width: 48px;
    height: 48px;
    font-size: 20px;
    margin-left: -24px;
    margin-right: 20px;
  }
  .timeline-content.card {
    padding: 20px 24px;
  }
  .timeline-line {
    left: 23.5px;
  }
  .cert-embed {
    height: 200px;
  }
  .cert-category-title {
    font-size: 17px;
    margin-top: 32px;
  }
  #cert-modal {
    padding: 20px;
  }
  #cert-modal-img {
    max-height: 80vh;
  }
  .modal-close-btn {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
}

@media (max-width: 380px) {
  .resume-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
  #theme-toggle {
    width: 28px;
    height: 28px;
  }
  #nav-utils-desktop {
    gap: 4px;
    padding: 0 8px;
    height: 48px;
  }
  #navbar {
    top: 16px;
  }
  #mobile-menu {
    top: 80px;
  }
}


/* ═══════════════════════════════════════════════════
   ADDITIONS — polish pass
═══════════════════════════════════════════════════ */

/* Accessibility helpers */
.visually-hidden {
  position: absolute !important;
  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: 12px; left: 12px;
  z-index: 100001;
  padding: 10px 16px;
  border-radius: 100px;
  background: var(--fg);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  transform: translateY(-200%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}
section[id] { scroll-margin-top: 96px; }
h3, h4 { margin: 0; }

/* Hero photo card — badge + one-line meta, no repeated name */
#photo-avatar { padding: 32px; gap: 20px; }
.photo-meta { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.photo-meta .avatar-role { margin: 0; }
.photo-meta .photo-badge { margin: 0; }

/* Section spacing tweaks */
.section-title { margin-bottom: 20px; }
.section-body { margin: 0 0 8px; }
.timeline-desc { margin-top: 14px; }

/* Experience */
.exp-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 40px;
}
.exp-card.card {
  text-align: left;
  align-items: stretch;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.exp-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.exp-role {
  font-size: 17px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.2px;
}
.exp-org {
  font-size: 14px;
  color: var(--fg-muted);
  margin-top: 4px;
}
.exp-date {
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 100px;
  white-space: nowrap;
}
.exp-points {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--fg-muted);
}
.exp-link {
  align-self: flex-start;
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 100px;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.exp-link:hover { background: var(--surface-2); border-color: var(--fg-subtle); }

/* Skills grouped by area */
.skill-group-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 32px 0 14px;
}
.skill-group-title:first-of-type { margin-top: 0; }

/* Project type label */
.project-kind {
  display: inline-block;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

/* Resume: two-column, cropped preview (no phone number exposed) */
.resume-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.resume-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.resume-preview-card {
  position: relative;
  display: block;
  width: 100%;
  max-width: 520px;
  justify-self: end;
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background: #fff;
  cursor: zoom-in;
  box-shadow: var(--shadow-md);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.resume-preview-card img {
  width: 100%;
  height: auto;
  display: block;
}
.resume-fade {
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 85%);
  pointer-events: none;
}
.resume-preview-card .view-resume-text {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 100px;
  white-space: nowrap;
}
.resume-preview-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

/* Contact: email card with copy button */
.contact-card-email { padding: 12px 16px 12px 24px; }
.contact-card-email .contact-card-left { color: inherit; text-decoration: none; flex: 1; padding: 8px 0; }
.copy-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 100px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--fg);
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.copy-btn:hover { background: var(--fg); color: var(--bg); }
.copy-btn.copied { background: #16a34a; border-color: #16a34a; color: #fff; }

/* Footer */
a.footer-copy { color: var(--fg-muted); text-decoration: none; }
a.footer-copy:hover { color: var(--fg); text-decoration: underline; }

@media (max-width: 1100px) {
  .cell { width: 60px; }
  .cell .letter { font-size: 72px; }
}

@media (max-width: 920px) {
  #hero-content { gap: 40px; }
  #subtitle { text-align: center; font-size: 16px; }
  .resume-layout { grid-template-columns: 1fr; gap: 40px; }
  .resume-preview-card { justify-self: center; }
}

@media (max-width: 768px) {
  .exp-grid { grid-template-columns: 1fr; }
  .exp-head { flex-direction: column; gap: 10px; }
}

@media (max-width: 640px) {
  .cell {
    width: clamp(30px, 9.5vw, 60px);
    height: clamp(30px, 9.5vw, 60px);
  }
  .cell .letter { font-size: clamp(30px, 10vw, 56px); }
  .exp-card.card { padding: 22px; }
  .contact-card-sub { word-break: break-all; }
}

/* Respect users who ask for less motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 920px) {
  #home { flex-direction: column; }
}
.cert-details-new { min-width: 0; }
.cert-badge-new { max-width: 100%; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
#nav-utils-mobile { display: none; }

/* 404 page */
.nf-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.nf { width: 100%; max-width: 720px; padding: 48px 24px; }
.nf .section-title span { color: var(--accent); }
.nf-term {
  margin: 8px 0 32px;
  padding: 20px 24px;
  border-radius: 14px;
  background: #0d0d0f;
  color: #d4d4d8;
  font: 14px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--border-strong);
}
.nf-prompt { color: #22c55e; }
.nf-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Narrow glyph: tighten the "I" cell so the name reads as one word */
.cell[data-letter="I"] { width: 46px; }
@media (max-width: 1100px) { .cell[data-letter="I"] { width: 42px; } }
@media (max-width: 640px) { .cell[data-letter="I"] { width: clamp(20px, 6.5vw, 42px); } }
.cell[data-letter="I"] .logo-img { width: 44px; height: 44px; }
@media (max-width: 640px) { .cell[data-letter="I"] .logo-img { width: clamp(18px, 6vw, 36px); height: clamp(18px, 6vw, 36px); } }
