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

:root {
  color-scheme: dark;
  --bg: #111310;
  --panel: #1b1e19;
  --text: #f5f4ed;
  --muted: #aeb3a6;
  --line: #363c31;
  --accent: #ff8051;
  --accent-fill: #b83b1b;
  --accent-ink: #ffffff;
  --soft: #252b21;
  --keyboard-glow: #70835c25;
  --radius: 28px;
  --content-width: 1280px;
  --glass-fill: #ffffff10;
  --glass-highlight: #ffffff28;
  --glass-border: #ffffff40;
  --glass-shadow: #00000030;
}

html[data-theme='light'] {
  color-scheme: light;
  --bg: #f5f3ec;
  --panel: #eae9e1;
  --text: #23291f;
  --muted: #5d6555;
  --line: #cbd0c2;
  --accent: #ad391b;
  --accent-fill: #b83b1b;
  --soft: #e0e4d7;
  --keyboard-glow: #6a855f22;
  --glass-fill: #ffffff55;
  --glass-highlight: #ffffffb3;
  --glass-border: #ffffffcc;
  --glass-shadow: #26302020;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 32px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color 220ms ease, color 220ms ease;
}

h1,
h2,
p {
  margin: 0;
}

h1,
h2,
.logo {
  font-family: 'Manrope', Arial, sans-serif;
}

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

button {
  color: inherit;
  font: inherit;
  cursor: pointer;
}

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

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 5px;
}

[hidden] {
  display: none !important;
}

em {
  color: var(--muted);
  font-style: normal;
}

/* ==========================================================
   02. Shared buttons, labels, and section layout
   ========================================================== */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  min-height: 48px;
  padding: 7px 7px 7px 21px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: linear-gradient(160deg, var(--glass-highlight), transparent 55%), var(--glass-fill);
  color: var(--text);
  box-shadow: inset 0 1px 0 #ffffff70, inset 0 -1px 0 #ffffff12, 0 5px 16px var(--glass-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  font-size: 12px;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.button:hover {
  transform: translateY(-3px);
  border-color: #ffffff90;
  box-shadow: inset 0 1px 0 #ffffffa6, inset 0 -1px 0 #ffffff20, 0 10px 24px var(--glass-shadow);
}

.button:active {
  transform: translateY(1px);
}

.arrow {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #ffffff30;
  background: linear-gradient(145deg, #ffffff30, #ffffff08);
  box-shadow: inset 0 1px 0 #ffffff60;
  color: inherit;
  font-size: 21px;
  font-weight: 500;
}

.icon-button {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 11px;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--glass-highlight), transparent 65%), var(--glass-fill);
  box-shadow: inset 0 1px 0 #ffffff60, 0 4px 12px var(--glass-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.icon-button:hover {
  border-color: #ffffff90;
  box-shadow: inset 0 1px 0 #ffffffa6, 0 7px 18px var(--glass-shadow);
  transform: translateY(-2px);
}

.icon-button svg {
  width: 21px;
  height: 21px;
}

.accent-button {
  background: linear-gradient(160deg, #ffffff30, transparent 55%), color-mix(in srgb, var(--accent-fill) 72%, transparent);
  color: #ffffff;
}

.accent-button .arrow {
  background: linear-gradient(145deg, #ffffff40, #ffffff10);
  color: inherit;
}

.section {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 104px 4%;
}

.section h2 {
  font-size: clamp(38px, 4.4vw, 63px);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -2.8px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.8px;
  line-height: 1.6;
}

.eyebrow > span {
  color: var(--muted);
  font-size: 9px;
}

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: middle;
}

.skip-link {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 30;
  padding: 12px 18px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
}

.skip-link:focus {
  top: 12px;
}

/* ==========================================================
   03. Header, navigation, and theme switcher
   ========================================================== */
.header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 40px;
  max-width: 1440px;
  min-height: 96px;
  margin: auto;
  padding: 0 5%;
}

.logo {
  flex-shrink: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -1.2px;
}

.logo span {
  font-weight: 500;
}

.logo i {
  color: var(--accent);
  font-style: normal;
}

nav {
  display: flex;
  gap: 30px;
  margin-left: auto;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  font-size: 13px;
  transition: color 160ms ease;
}

.nav-link::after {
  position: absolute;
  right: 0;
  bottom: 4px;
  left: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  content: '';
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.theme-toggle {
  border-color: var(--glass-border);
}

.moon,
.menu-toggle {
  display: none;
}

[data-theme='light'] .sun {
  display: none;
}

[data-theme='light'] .moon {
  display: block;
}

/* ==========================================================
   04. Hero and portrait
   ========================================================== */
.hero {
  position: relative;
  isolation: isolate;
  max-width: 1376px;
  margin: 0 24px;
  padding: 30px 4% 0;
  overflow: hidden;
  border: 1px solid #ffffff12;
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse at 80% 0%, #ff9b4e99, transparent 60%),
    linear-gradient(120deg, #b83d21 8%, #ba3422 56%, #85262b 100%);
  color: #fff8ed;
}

.hero::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(90deg, #ffffff12 1px, transparent 1px),
    linear-gradient(#ffffff12 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.28;
  content: '';
  pointer-events: none;
}

.hero a:focus-visible {
  outline-color: #ffffff;
}

.hero-topline {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid #ffffff30;
  font-size: 9px;
  letter-spacing: 1.5px;
  line-height: 1.7;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.85fr);
  align-items: center;
  gap: 32px;
  min-height: 570px;
  padding: 38px 0;
}

.hero-copy {
  position: relative;
  z-index: 3;
  min-width: 0;
}

.hero-intro {
  margin-bottom: 18px;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.5px;
}

.hero h1 {
  font-size: clamp(48px, 5.65vw, 81px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -4px;
}

.hero h1 > span {
  white-space: nowrap;
}

.name-period {
  color: #ffe9a9;
}

.hero-role {
  margin-top: 23px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
}

.hero-description {
  max-width: 440px;
  margin-top: 14px;
  color: #fff0e3;
  font-size: 14px;
  line-height: 1.85;
}

.hero-description strong {
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 29px;
}

.hero-button {
  background: linear-gradient(160deg, #ffffff38, transparent 60%), #28100c38;
  color: #fff8ed;
}

.hero-button .arrow {
  background: linear-gradient(145deg, #ffffff38, #ffffff0c);
  color: inherit;
}

.outline-button {
  gap: 20px;
  padding: 10px 19px;
  border-color: #ffffff80;
  background: linear-gradient(160deg, #ffffff20, transparent 60%), #28100c38;
  color: #fff8ed;
}

.outline-button > span {
  font-size: 21px;
  font-weight: 400;
}

.hero-scroll {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin-top: 22px;
  font-size: 8px;
  letter-spacing: 1.8px;
}

.hero-scroll > span {
  font-size: 20px;
  transition: transform 180ms ease;
}

.hero-scroll:hover > span {
  transform: translateY(4px);
}

.portrait-area {
  position: relative;
  width: 100%;
  max-width: 390px;
  margin: 0 12px 0 auto;
}

.portrait-wrap {
  position: relative;
  aspect-ratio: 0.83;
  overflow: hidden;
  border: 1px solid #ffffff35;
  border-radius: 180px 180px 28px 28px;
  background: #24251f;
  box-shadow: 0 20px 55px #4b15184d;
  transform: rotate(3deg);
}

.portrait {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  opacity: 0;
  transition: opacity 240ms ease;
}

.portrait.loaded {
  opacity: 1;
}

.portrait-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: radial-gradient(ellipse at 50% 35%, #48503d, #24251f 75%);
  color: #f5f4ed;
}

.portrait-placeholder > span {
  font-family: 'Manrope', Arial, sans-serif;
  font-size: clamp(60px, 10vw, 130px);
  font-weight: 800;
  letter-spacing: -8px;
}

.portrait-placeholder p {
  font-size: 12px;
  letter-spacing: 1px;
}

.portrait-orbit {
  position: absolute;
  inset: 10% -25px 7%;
  border: 1px solid #ffffff35;
  border-radius: 50%;
  transform: rotate(-20deg);
  pointer-events: none;
}

.portrait-tag {
  position: absolute;
  bottom: 75px;
  left: -20px;
  z-index: 2;
  padding: 15px 18px;
  border: 1px solid #ffffff70;
  border-radius: 8px;
  background: #f6eee0ed;
  box-shadow: 0 6px 22px #00000020;
  color: #333f2c;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1px;
  transform: rotate(-5deg);
  backdrop-filter: blur(10px);
}

.portrait-tag .status-dot {
  background: #456c35;
}

.portrait-caption {
  display: flex;
  justify-content: space-between;
  margin: 24px 0 0;
  font-size: 8px;
  letter-spacing: 1.3px;
}

.portrait-caption > span:last-child {
  font-size: 16px;
}

.hero-bottom {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 24px 0;
  border-top: 1px solid #ffffff30;
  font-size: 8px;
  letter-spacing: 1.2px;
  line-height: 1.7;
}

.hero-bottom > span:last-child {
  text-align: right;
}

.interest-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 34px 4%;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 1.5px;
}

/* ==========================================================
   05. About
   ========================================================== */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 80px;
}

.about-signature {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 34px;
  color: var(--muted);
  font-size: 12px;
}

.about-signature span {
  color: var(--accent);
  font-size: 22px;
}

.about-content {
  padding-top: 43px;
}

.lead {
  margin-bottom: 20px;
  font-size: 24px;
  line-height: 1.5;
  letter-spacing: -0.6px;
}

.about-content > p:not(.lead) {
  max-width: 510px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}

.about-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  margin: 28px 0;
  padding-top: 25px;
  border-top: 1px solid var(--line);
}

.about-details span,
.skill-categories span,
.contact-label {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 1.3px;
  line-height: 1.6;
}

.about-details p {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.8;
}

.about-details small {
  color: var(--muted);
  font-size: 10px;
}

/* ==========================================================
   06. Skills: stage, platform, and 3D keycaps
   ========================================================== */
.skills {
  padding-top: 80px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}

.section-heading > p {
  padding-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.keyboard-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 510px;
  margin-top: 24px;
  background: radial-gradient(ellipse at 50% 65%, var(--keyboard-glow), transparent 65%);
  perspective: 1100px;
}

.stage-note {
  position: absolute;
  top: 60px;
  left: 0;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 1.6px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.keyboard {
  --key-size: 112px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, var(--key-size));
  gap: 17px;
  padding: 26px 26px 35px;
  border: 1px solid #59614e;
  border-radius: 24px;
  background: linear-gradient(135deg, #3b4237, #20271e);
  box-shadow:
    -5px 7px 0 #20271d,
    -9px 15px 0 #131a11,
    -11px 19px 0 #0a1109,
    0 45px 42px #00000050;
  transform: rotateX(31deg) rotateZ(-17deg);
  transform-style: preserve-3d;
}

.keyboard::before {
  position: absolute;
  inset: 10px;
  border: 1px solid #75826a35;
  border-radius: 15px;
  content: '';
  pointer-events: none;
}

.keyboard::after {
  position: absolute;
  right: 27px;
  bottom: 10px;
  width: 44px;
  height: 3px;
  border-radius: 3px;
  background: #bdcc9c;
  box-shadow: 0 0 12px #c4ee6c90;
  content: '';
  pointer-events: none;
}

.key {
  --key: #c97621;
  --edge: #895014;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  height: 96px;
  padding: 8px 3px;
  border: 1px solid #ffffff40;
  border-radius: 15px;
  background: linear-gradient(145deg, #ffffff45, #ffffff08 45%, #ffffff18), color-mix(in srgb, var(--key) 88%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  box-shadow:
    -1px 3px 0 var(--edge),
    -3px 7px 0 var(--edge),
    -5px 12px 0 var(--edge),
    -6px 15px 8px #00000099,
    inset 2px 2px 1px #ffffff45,
    inset -2px -2px 2px #00000020;
  color: #ffffff;
  transform: translateY(-6px);
  transition:
    transform 170ms ease,
    box-shadow 170ms ease,
    filter 170ms ease;
  touch-action: manipulation;
}

.key::before {
  position: absolute;
  inset: 5px 5px auto;
  height: 40%;
  border-top: 1px solid #ffffff35;
  border-radius: 10px;
  background: linear-gradient(#ffffff0c, transparent);
  content: '';
  pointer-events: none;
}

.key > span:last-child {
  position: relative;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.key-logo {
  position: relative;
  display: block;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px #00000025);
  pointer-events: none;
  user-select: none;
}

/* Hover lifts; click and native keyboard activation press downward. */
@media (hover: hover) and (pointer: fine) {
  .key:hover {
    box-shadow:
      -2px 5px 0 var(--edge),
      -4px 11px 0 var(--edge),
      -6px 17px 0 var(--edge),
      -8px 22px 12px #00000080,
      inset 2px 2px 2px #ffffff55;
    filter: brightness(1.02);
    transform: translate(1px, -12px);
  }
}

.key:active,
.key.pressed {
  box-shadow:
    -1px 2px 0 var(--edge),
    -2px 4px 0 var(--edge),
    -2px 6px 4px #00000090,
    inset 1px 1px 3px #ffffff40;
  filter: brightness(1.02);
  transform: translate(-2px, 3px);
}

.key[aria-pressed='true'] {
  outline: 2px solid #f8ffe7;
  outline-offset: 4px;
}

.key:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 5px;
  filter: brightness(1.02);
}

/* Technology colors: the label color is chosen for contrast. */
.yellow {
  --key: #edba43;
  --edge: #a07020;
  color: #32230b;
}

.orange {
  --key: #b83e22;
  --edge: #7d2818;
}

.blue {
  --key: #2266a6;
  --edge: #153f72;
}

.teal {
  --key: #147468;
  --edge: #0d4a43;
}

.coral {
  --key: #b73d42;
  --edge: #7c282d;
}

.purple {
  --key: #6654aa;
  --edge: #41346f;
}

.violet {
  --key: #784d9b;
  --edge: #4c3068;
}

.cyan {
  --key: #1a7186;
  --edge: #104957;
}

.mint {
  --key: #356b4f;
  --edge: #294f3c;
}

.gold {
  --key: #e8b43c;
  --edge: #977221;
  color: #30230a;
}

.green {
  --key: #2c7048;
  --edge: #1b4b2f;
}

.royal {
  --key: #2d60a3;
  --edge: #1a3d71;
}

.keyboard-caption {
  position: absolute;
  bottom: 10px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 2px;
}

.skill-readout {
  display: flex;
  align-items: center;
  gap: 17px;
  max-width: 660px;
  min-height: 84px;
  margin: 25px auto 45px;
  padding: 18px 23px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  transition: background-color 220ms ease, border-color 220ms ease;
}

.readout-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 16px #ff80514d;
}

.skill-readout strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.skill-readout p > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.readout-icon {
  flex-shrink: 0;
  margin-left: auto;
  color: var(--muted);
  font-size: 25px;
}

.skill-categories {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 25px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.skill-categories p {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.8;
}

/* ==========================================================
   07. Contact and unconfigured contact states
   ========================================================== */
.contact {
  margin-bottom: 42px;
  padding: 54px 5% 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transition: background-color 220ms ease, border-color 220ms ease;
}

.contact-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.contact h2 {
  font-size: clamp(44px, 6.4vw, 88px);
  line-height: 1.14;
  letter-spacing: -4px;
}

.contact h2 em {
  color: var(--accent);
}

.contact-period {
  display: inline-block;
  margin-left: 40px;
  color: var(--accent);
  font-size: 1em;
  font-weight: 400;
}

.contact-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin-top: 38px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.contact-bottom > p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.85;
}

.email-area {
  min-width: 0;
}

.email-group {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 8px;
}

.email-group > a,
#email-placeholder {
  min-width: 0;
  font-size: clamp(17px, 2vw, 24px);
  line-height: 1.4;
  letter-spacing: -0.5px;
  overflow-wrap: anywhere;
}

#email-placeholder {
  color: var(--muted);
}

.email-group > a:hover {
  color: var(--accent);
}

.socials {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 32px;
  padding-top: 20px;
}

.socials > span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 1.3px;
}

.profile-link,
.profile-placeholder {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: linear-gradient(160deg, var(--glass-highlight), transparent 55%), var(--glass-fill);
  box-shadow: inset 0 1px 0 #ffffff60, 0 4px 12px var(--glass-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  color: var(--text);
  font-size: 12px;
}

.profile-link:hover,
.profile-placeholder:hover {
  color: var(--accent);
}

.profile-placeholder small {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  font-size: 9px;
}

.profile-link > span,
.profile-placeholder > span {
  color: var(--accent);
  font-size: 17px;
}

.copy-status {
  min-height: 20px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

/* ==========================================================
   08. Footer and back-to-top control
   ========================================================== */
footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 4% 32px;
}

footer p,
footer > a:last-child {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

footer > a:last-child {
  display: flex;
  align-items: center;
  min-height: 44px;
}

.back-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 8;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #ffffff30;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--glass-highlight), transparent 65%), var(--glass-fill);
  box-shadow: inset 0 1px 0 #ffffff60, 0 5px 18px var(--glass-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  color: var(--text);
  font-size: 20px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms;
}

.back-top.visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* ==========================================================
   09. Entrance and section animations
   ========================================================== */
.hero-copy {
  animation: enter-up 700ms ease both;
}

.portrait-area {
  animation: enter-up 850ms 100ms ease both;
}

.reveal {
  opacity: 1;
}

.js-motion .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.js-motion .reveal.in-view {
  opacity: 1;
  transform: none;
}

@keyframes enter-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================
   10. Wide monitors
   ========================================================== */
@media (min-width: 1424px) {
  .hero {
    margin-right: auto;
    margin-left: auto;
  }
}

/* ==========================================================
   11. Tablets and small laptops
   ========================================================== */
@media (max-width: 1050px) {
  .header {
    gap: 24px;
    padding-right: 4%;
    padding-left: 4%;
  }

  nav {
    gap: 22px;
  }

  .header-actions {
    gap: 10px;
  }

  .hero {
    margin: 0 16px;
  }

  .hero-layout {
    gap: 26px;
    min-height: 520px;
  }

  .hero h1 {
    font-size: clamp(44px, 5.8vw, 61px);
    letter-spacing: -3px;
  }

  .hero-description {
    font-size: 13px;
  }

  .portrait-area {
    max-width: 330px;
  }

  .hero-bottom {
    font-size: 7px;
    letter-spacing: 0.7px;
  }

  .section {
    padding: 80px 5%;
  }

  .about {
    gap: 36px;
  }

  .lead {
    font-size: 21px;
  }

  .about-content {
    padding-top: 36px;
  }

  .contact {
    margin: 0 20px 35px;
  }

  .contact-period {
    margin-left: 20px;
  }
}

/* ==========================================================
   12. Mobile navigation and stacked layouts
   ========================================================== */
@media (max-width: 760px) {
  .header {
    min-height: 80px;
    padding: 0 22px;
  }

  .logo {
    font-size: 21px;
  }

  .header-actions {
    gap: 6px;
    margin-left: auto;
  }

  .header-contact {
    display: none;
  }

  .menu-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-color: var(--glass-border);
  }

  .menu-toggle span {
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: var(--text);
    transition: transform 180ms ease;
  }

  .menu-toggle[aria-expanded='true'] span:first-child {
    transform: translateY(4px) rotate(45deg);
  }

  .menu-toggle[aria-expanded='true'] span:last-child {
    transform: translateY(-4px) rotate(-45deg);
  }

  nav {
    position: absolute;
    top: 72px;
    right: 16px;
    left: 16px;
    z-index: 12;
    flex-direction: column;
    gap: 4px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: 0 12px 40px #00000035;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms;
    pointer-events: none;
  }

  nav.open {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
  }

  .nav-link {
    padding: 10px 14px;
    border-radius: 7px;
  }

  .nav-link::after {
    top: 17px;
    right: auto;
    bottom: auto;
    left: 0;
    width: 3px;
    height: 10px;
  }

  /* Keep navigation links available if JavaScript is disabled. */
  body:not(.js-ready) .header {
    flex-wrap: wrap;
    padding-top: 16px;
    padding-bottom: 16px;
  }

  body:not(.js-ready) nav {
    position: static;
    order: 3;
    width: 100%;
    margin-left: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
  }

  body:not(.js-ready) .menu-toggle {
    display: none;
  }

  .hero {
    margin: 0 12px;
    padding: 24px 28px 0;
    border-radius: 23px;
  }

  .hero-topline {
    padding-bottom: 18px;
    font-size: 8px;
    letter-spacing: 1px;
  }

  .hero-edition {
    display: none;
  }

  .hero-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding: 32px 0 35px;
  }

  .hero-intro {
    margin-bottom: 14px;
    font-size: 18px;
  }

  .hero h1 {
    font-size: clamp(34px, 8.8vw, 65px);
    letter-spacing: -2px;
  }

  .hero-role {
    margin-top: 20px;
    font-size: 12px;
  }

  .hero-description {
    max-width: 490px;
    font-size: 13px;
  }

  .hero-actions {
    gap: 10px;
    margin-top: 24px;
  }

  .hero-scroll {
    display: none;
  }

  .portrait-area {
    width: 74%;
    max-width: 310px;
    margin: 0 auto;
  }

  .portrait-wrap {
    aspect-ratio: 0.9;
  }

  .portrait-tag {
    bottom: 60px;
    left: -15px;
    padding: 12px 15px;
    font-size: 7px;
    letter-spacing: 0.6px;
  }

  .portrait-caption {
    margin-top: 19px;
    font-size: 7px;
  }

  .hero-bottom {
    grid-template-columns: 1fr 1fr;
    gap: 12px 15px;
    padding: 22px 0;
    font-size: 7px;
  }

  .hero-bottom > span:last-child {
    text-align: left;
  }

  .interest-strip {
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    padding: 26px 24px;
    font-size: 8px;
    letter-spacing: 1px;
  }

  .section {
    padding: 65px 24px;
  }

  .section h2 {
    font-size: 43px;
    letter-spacing: -2px;
  }

  .eyebrow {
    margin-bottom: 23px;
    font-size: 9px;
  }

  .about {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .about-signature {
    margin-top: 22px;
    font-size: 11px;
  }

  .about-content {
    padding-top: 0;
  }

  .lead {
    font-size: 21px;
  }

  .about-content > p:not(.lead) {
    max-width: none;
    font-size: 13px;
  }

  .about-details {
    gap: 18px;
  }

  .section-heading {
    display: block;
  }

  .section-heading > p {
    margin-top: 22px;
    font-size: 12px;
  }

  .keyboard-stage {
    min-height: 415px;
    margin-top: 12px;
  }

  .keyboard {
    --key-size: 85px;
    gap: 13px;
    padding: 22px 22px 30px;
    transform: rotateX(28deg) rotateZ(-13deg);
  }

  .key {
    height: 81px;
    border-radius: 12px;
  }

  .key-logo {
    width: 32px;
    height: 32px;
  }

  .key > span:last-child {
    font-size: 10px;
  }

  .stage-note {
    display: none;
  }

  .keyboard-caption {
    bottom: 0;
    font-size: 8px;
    letter-spacing: 1.4px;
  }

  .skill-readout {
    gap: 12px;
    margin-top: 22px;
    margin-bottom: 32px;
    padding: 17px;
  }

  .skill-readout strong {
    font-size: 12px;
  }

  .skill-readout p > span {
    font-size: 11px;
  }

  .skill-categories {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .skill-categories p {
    margin-top: 7px;
  }

  .contact {
    margin: 0 12px 30px;
    padding: 34px 24px 22px;
    border-radius: 23px;
  }

  .contact h2 {
    font-size: clamp(32px, 7.7vw, 53px);
    letter-spacing: -1.8px;
  }

  .contact-period {
    margin-left: 10px;
  }

  .contact-bottom {
    display: block;
    margin-top: 25px;
    padding-bottom: 24px;
  }

  .contact-bottom > p {
    font-size: 12px;
  }

  .email-area {
    margin-top: 24px;
  }

  .socials {
    gap: 12px 25px;
  }

  .socials > span {
    width: 100%;
  }

  footer {
    padding: 0 24px 28px;
  }

  footer p {
    width: 100%;
    font-size: 9px;
  }

  .back-top {
    right: 12px;
    bottom: 12px;
  }
}

/* ==========================================================
   13. Small phones: a readable 3-column keyboard
   ========================================================== */
@media (max-width: 560px) {
  .keyboard-stage {
    min-height: 450px;
    margin-right: -10px;
    margin-left: -10px;
  }

  .keyboard {
    --key-size: clamp(62px, 17vw, 80px);
    grid-template-columns: repeat(3, var(--key-size));
    gap: 13px 11px;
    padding: 20px 18px 30px;
    border-radius: 19px;
    transform: rotateX(24deg) rotateZ(-10deg);
  }

  .key {
    height: 76px;
    gap: 6px;
  }

  .key > span:last-child {
    font-size: 10px;
  }

  .key-logo {
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 370px) {
  .header {
    gap: 10px;
    padding: 0 16px;
  }

  .logo {
    font-size: 19px;
  }

  .hero {
    padding-right: 20px;
    padding-left: 20px;
  }

  .hero h1 {
    font-size: 34px;
    letter-spacing: -1.5px;
  }

  .hero-actions .button {
    gap: 15px;
    padding-left: 15px;
    font-size: 11px;
  }

  .hero-role {
    font-size: 11px;
  }

  .portrait-area {
    width: 78%;
  }

  .portrait-tag {
    left: -20px;
    padding: 11px;
    font-size: 6px;
  }

  .portrait-caption {
    font-size: 6px;
  }

  .section h2 {
    font-size: 36px;
  }

  .about-details {
    grid-template-columns: minmax(0, 1fr);
  }

  .keyboard-stage {
    min-height: 425px;
  }

  .keyboard {
    --key-size: 62px;
    gap: 12px 10px;
    padding: 18px 15px 28px;
    transform: rotateX(22deg) rotateZ(-7deg);
  }

  .key {
    height: 70px;
  }

  .key-logo {
    width: 28px;
    height: 28px;
  }

  .keyboard-caption {
    font-size: 7px;
    letter-spacing: 1px;
  }

  .skill-readout {
    padding: 14px;
  }

  .readout-icon {
    display: none;
  }

  .contact h2 {
    font-size: 32px;
  }

  .socials {
    gap: 12px 20px;
  }

  .profile-placeholder {
    gap: 8px;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .js-motion .reveal {
    opacity: 1;
    transform: none;
  }
}
