:root {
  --scene-scale: 1;
  --ground-bottom: clamp(4.8vh, calc(6.7vh * var(--scene-scale)), 6.8vh);
  --frame-fluid: clamp(0.84, calc(var(--scene-scale) * 0.96), 1.02);
  --char-object-scale: clamp(0.7, var(--scene-scale), 1);
  --char-ground-offset: -56px;
  --shadow-foot-offset: 10px;
  --lottie-anchor: 53%;
}

.wall {
  isolation: isolate;
}

.world {
  z-index: 2;
}

.floor,
.floor-world {
  z-index: 0;
}

.baseboard {
  z-index: 1;
  bottom: clamp(10vh, calc(22vh * var(--scene-scale)), 22vh);
}

.floor,
.floor-world {
  height: clamp(10vh, calc(22vh * var(--scene-scale)), 22vh);
}

.character-wrap {
  width: calc(480px * var(--char-object-scale));
  height: calc(520px * var(--char-object-scale));
  bottom: calc(var(--ground-bottom) + var(--char-ground-offset));
  z-index: 20;
}

.character-wrap::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: var(--shadow-foot-offset);
  width: calc(56% * var(--char-object-scale));
  min-width: 170px;
  max-width: 300px;
  height: calc(9.5% * var(--char-object-scale));
  min-height: 22px;
  max-height: 44px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.24), transparent 72%);
  filter: blur(0.2px);
  pointer-events: none;
  z-index: -1;
}

.lottie svg {
  transform: translateY(var(--lottie-anchor)) scale(var(--lottie-scale)) !important;
  transform-origin: 50% 100%;
}

.char-shadow {
  opacity: 0;
  pointer-events: none;
}

.frame-shell {
  background: transparent;
  padding: 0;
  border-radius: clamp(12px, 1.2vw, 16px);
  box-shadow:
    0 18px 36px rgba(8, 10, 14, 0.32),
    0 4px 10px rgba(8, 10, 14, 0.24);
  overflow: hidden;
}

.frame-mat {
  background: transparent;
  padding: 0;
}

.frame-paper {
  background: #222731;
  color: #f2f5fa;
  padding: clamp(13px, calc(18px * var(--frame-fluid)), 22px);
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: clamp(7px, calc(10px * var(--frame-fluid)), 13px);
}

.frame-paper::before {
  display: none;
}

.frame {
  transition: transform 220ms ease, filter 220ms ease;
}

.frame:hover,
.frame:focus-visible {
  transform: translateY(-3px);
  filter: brightness(1.02);
}

.frame-kicker {
  font-size: clamp(0.58rem, calc(0.62rem * var(--frame-fluid) + 0.04vw), 0.72rem);
  letter-spacing: 0.16em;
  color: #9aa6b9;
  text-transform: uppercase;
  font-weight: 500;
}

.frame-title {
  color: #f7f9ff;
  font-size: clamp(1.04rem, calc(1.42rem * var(--frame-fluid) + 0.2vw), 1.7rem);
  line-height: 1.12;
  text-wrap: balance;
  font-weight: 500;
}

.frame-meta {
  font-size: clamp(0.62rem, calc(0.64rem * var(--frame-fluid) + 0.05vw), 0.76rem);
  line-height: 1.42;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #95a2b5;
}

.frame-lines {
  margin-top: clamp(2px, calc(4px * var(--frame-fluid)), 6px);
  padding-top: clamp(9px, calc(12px * var(--frame-fluid)), 14px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: clamp(0.76rem, calc(0.82rem * var(--frame-fluid) + 0.08vw), 0.92rem);
  line-height: clamp(1.34, calc(1.3 + (1 - var(--frame-fluid)) * 0.24), 1.5);
  gap: clamp(6px, calc(8px * var(--frame-fluid)), 10px);
  color: #d7deea;
}

.frame-lines span,
.frame-meta,
.frame-title {
  overflow-wrap: anywhere;
}

[data-id='education'] .section-content {
  gap: 9px;
}

[data-id='education'] .section-content p {
  margin: 0;
  text-transform: none;
  letter-spacing: normal;
}

[data-id='education'] .section-content p:nth-child(3n + 1) {
  margin-top: 6px;
  font-weight: 600;
  font-size: 1.03rem;
  color: #111214;
  font-family: 'Space Grotesk', system-ui, -apple-system, Segoe UI, sans-serif;
  text-transform: none;
  letter-spacing: normal;
}

[data-id='education'] .section-content p:nth-child(3n + 2) {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: rgba(17, 18, 20, 0.54);
  margin-bottom: 2px;
}

[data-id='education'] .section-content p:nth-child(3n) {
  color: rgba(17, 18, 20, 0.74);
  font-family: 'Space Grotesk', system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 0.96rem;
  font-weight: 400;
  line-height: 1.48;
  text-transform: none;
  letter-spacing: normal;
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(17, 18, 20, 0.14);
}

@media (max-width: 1180px) {
  .frame-paper {
    gap: clamp(5px, 0.85vw, 10px);
  }
}

@media (max-width: 980px) {
  .frame-title {
    font-size: clamp(1rem, 2vw, 1.4rem);
  }

  .frame-lines {
    font-size: clamp(0.75rem, 1.25vw, 0.88rem);
  }
}

@media (max-width: 900px) {
  .mobile-character,
  .mobile-char-shadow,
  .mobile-char-lottie {
    display: none !important;
  }
}
