:root {
  --ink: #fff7fb;
  --ink-2: #eef8ff;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --line: #ded6e8;
  --text: #21172f;
  --muted: #6d6178;
  --peach: #ffc1d6;
  --coral: #ff78ad;
  --violet: #b99cff;
  --blue: #8fd8ff;
  --mint: #93efd2;
  --berry: #c24e87;
  --sky-ink: #3477a2;
  --shadow: 0 24px 70px rgba(152, 113, 178, 0.18);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --phone-cutout-buffer: 0px;
  --header-safe-top: max(var(--safe-top), var(--phone-cutout-buffer));
  --header-offset: calc(14px + var(--header-safe-top));
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(120px + var(--header-safe-top));
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #fff7fb 0%, #f4fbff 58%, #fff8ef 100%);
  letter-spacing: 0;
  overflow-x: hidden;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

img,
svg,
canvas {
  max-width: 100%;
}

main,
section,
article,
p,
h1,
h2,
h3,
li,
dd,
a {
  overflow-wrap: anywhere;
}

input,
textarea {
  font-size: 1rem;
}

a,
button {
  touch-action: manipulation;
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  padding: 24px;
  padding:
    calc(24px + var(--header-safe-top))
    calc(24px + var(--safe-right))
    calc(24px + var(--safe-bottom))
    calc(24px + var(--safe-left));
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(255, 193, 214, 0.82), transparent 38%),
    linear-gradient(225deg, rgba(143, 216, 255, 0.76), transparent 44%),
    linear-gradient(180deg, #fffaff 0%, #eef8ff 100%);
  transition: opacity 420ms ease, visibility 420ms ease;
}

.loader.is-hidden {
  visibility: hidden;
  opacity: 0;
}

.loader__mark {
  position: relative;
  width: 74px;
  height: 74px;
  border: 1px solid rgba(91, 70, 122, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 193, 214, 0.72), rgba(143, 216, 255, 0.72), rgba(185, 156, 255, 0.54));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.loader__mark span {
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--peach);
  border-right-color: var(--violet);
  animation: spin 900ms linear infinite;
}

.loader__mark span + span {
  inset: 25px;
  border-top-color: var(--mint);
  border-right-color: var(--coral);
  animation-direction: reverse;
}

.loader p {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.loader__bar {
  width: min(260px, 76vw);
  height: 5px;
  padding: 1px;
  border-radius: 999px;
  background: rgba(91, 70, 122, 0.11);
  overflow: hidden;
}

.loader__bar span {
  display: block;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--peach), var(--coral), var(--violet));
  animation: loadbar 900ms ease-in-out infinite;
}

.site-shell {
  width: min(1180px, calc(100% - 32px - var(--safe-left) - var(--safe-right)));
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  margin: 0 auto;
  padding-top: var(--header-offset);
  padding-bottom: calc(36px + var(--safe-bottom));
  opacity: 1;
  transform: none;
}

body.is-ready .site-shell {
  opacity: 1;
  transform: none;
}

.site-header {
  position: sticky;
  top: var(--header-offset);
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin: 0 0 22px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 40px rgba(152, 113, 178, 0.18);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.brand__sig {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: #21172f;
  font-size: 0.86rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--peach), var(--blue) 52%, var(--violet));
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 0.95rem;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.75rem;
}

.tabs {
  display: flex;
  justify-self: center;
  max-width: 100%;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  min-width: 74px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: #ffffff;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease;
}

.tab:hover,
.tab:focus-visible {
  color: var(--text);
  background: #fff7fb;
  outline: none;
}

.tab.is-active {
  color: #21172f;
  background: linear-gradient(135deg, #ffd7e6, #d8f1ff 52%, #e5d9ff);
}

.header-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  min-width: max-content;
}

.header-actions a,
.header-actions button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.header-actions a:hover,
.header-actions a:focus-visible,
.header-actions button:hover,
.header-actions button:focus-visible {
  border-color: rgba(255, 120, 173, 0.4);
  background: #ffd7e6;
  outline: none;
  transform: translateY(-2px);
}

.header-actions svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.game-launch img {
  display: block;
  width: 27px;
  height: 27px;
  border-radius: 5px;
  image-rendering: pixelated;
  object-fit: cover;
}

.maze-launch svg {
  display: block;
  width: 27px;
  height: 27px;
  border-radius: 5px;
}

.maze-icon-bg {
  fill: #21172f;
}

.maze-icon-wall {
  fill: #3477a2;
}

.maze-icon-player {
  fill: #ffcf52;
}

.maze-icon-dot {
  fill: #ffd7e6;
}

.tab-panel {
  animation: panelIn 360ms ease both;
}

.tab-panel:focus {
  outline: none;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 34px;
  align-items: center;
  min-height: 560px;
  padding: 18px 0 56px;
}

.hero-copy h1,
.page-intro h1 {
  max-width: 820px;
  margin: 0;
  font-size: 4.7rem;
  line-height: 0.96;
  font-weight: 800;
}

.hero-copy h1,
.page-intro h1 {
  max-width: 760px;
  font-size: 3.15rem;
  color: var(--text);
}

.hero-copy__lead,
.page-intro p {
  max-width: 700px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--berry);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 30px 0;
}

.btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.btn:hover,
.btn:focus-visible {
  border-color: rgba(255, 120, 173, 0.5);
  outline: none;
  transform: translateY(-2px);
}

.btn:disabled {
  cursor: progress;
  opacity: 0.72;
  transform: none;
}

.btn--primary {
  border-color: transparent;
  color: #21172f;
  background: linear-gradient(135deg, #ffd7e6, #d8f1ff 54%, #e5d9ff);
}

.btn--ghost {
  background: #ffffff;
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0;
}

.signal-grid div {
  min-height: 124px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.signal-grid dt {
  margin: 0 0 8px;
  color: var(--sky-ink);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.signal-grid dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.profile-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.profile-photo-frame {
  aspect-ratio: 1 / 1;
  margin: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.profile-photo-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
}

.profile-card__body {
  display: grid;
  gap: 10px;
  padding: 8px 22px 22px;
}

.profile-card__body h2,
.profile-card__body p {
  margin: 0;
}

.profile-card__body h2 {
  font-size: 2rem;
  line-height: 1;
}

.profile-card__body p {
  color: var(--muted);
  line-height: 1.55;
}

.profile-kicker {
  color: var(--berry) !important;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.profile-links a {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: #ffffff;
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.section-band {
  padding: 70px 0;
  border-top: 1px solid var(--line);
}

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

.section-heading h2,
.section-band--split h2 {
  max-width: 680px;
  margin: 0;
  font-size: 2.3rem;
  line-height: 1.08;
}

.project-wheel {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
}

.project-wheel__controls {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  pointer-events: none;
}

.project-wheel__button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(73, 43, 88, 0.14);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.project-wheel__button:hover,
.project-wheel__button:focus-visible {
  border-color: #ff78ad;
  background: #ffd7e6;
  outline: none;
  transform: translateY(-2px);
}

.project-wheel__button svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.project-wheel__counter {
  position: absolute;
  top: 12px;
  right: 18px;
  min-width: 68px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--sky-ink);
  background: #ffffff;
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
  pointer-events: none;
}

.project-wheel__viewport {
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: #ffb6d1 #ffffff;
}

.project-wheel__viewport::-webkit-scrollbar {
  height: 10px;
}

.project-wheel__viewport::-webkit-scrollbar-track {
  background: #ffffff;
}

.project-wheel__viewport::-webkit-scrollbar-thumb {
  border: 3px solid #ffffff;
  border-radius: 999px;
  background: #ffb6d1;
}

.project-wheel__viewport:focus-visible {
  outline: 3px solid #8fd8ff;
  outline-offset: 4px;
}

.project-wheel__track {
  display: flex;
}

.project-card {
  position: relative;
  display: grid;
  flex: 0 0 100%;
  min-width: 100%;
  min-height: 380px;
  align-content: start;
  gap: 12px;
  padding: 24px 72px;
  background:
    linear-gradient(135deg, #fff7fb 0%, #ffffff 42%, #eef8ff 100%);
  overflow: hidden;
  scroll-snap-align: center;
}

.project-card--place-1 {
  background:
    radial-gradient(circle at 88% 14%, rgba(255, 219, 105, 0.34), transparent 28%),
    linear-gradient(135deg, #eaf7ff 0%, #ffffff 46%, #fff1bf 100%);
}

.project-card--place-2 {
  background:
    radial-gradient(circle at 88% 14%, rgba(217, 80, 98, 0.2), transparent 32%),
    linear-gradient(135deg, #fff0f2 0%, #ffffff 43%, #eff1f5 100%);
  box-shadow:
    inset 0 0 0 4px rgba(217, 80, 98, 0.72),
    inset 14px 0 0 #d95062,
    inset -14px 0 0 #d95062,
    inset 18px 0 0 #eff1f5,
    inset -18px 0 0 #eff1f5;
}

.project-card--place-2::before {
  position: absolute;
  top: 86px;
  right: -172px;
  z-index: 1;
  width: 472px;
  height: 44px;
  background: #d95062;
  box-shadow:
    0 10px 24px rgba(148, 40, 58, 0.2),
    0 0 0 7px #d95062;
  content: "";
  pointer-events: none;
  transform: rotate(35deg);
}

.project-card--place-2::after {
  position: absolute;
  top: 64px;
  right: 16px;
  z-index: 2;
  width: 236px;
  color: #ffffff;
  content: "2ND PLACE";
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.075em;
  line-height: 1;
  pointer-events: none;
  text-align: center;
  text-shadow:
    0 1px 2px rgba(148, 40, 58, 0.42),
    0 0 10px rgba(255, 255, 255, 0.18);
  transform: rotate(35deg);
}

.project-card--place-2 > * {
  position: relative;
  z-index: 3;
}

.project-card--place-3 {
  background:
    radial-gradient(circle at 88% 14%, rgba(217, 166, 109, 0.2), transparent 30%),
    linear-gradient(135deg, #ffffff 0%, #fff9ee 48%, #f2dfc9 100%);
}

.project-card__tag {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid #b9ddf2;
  border-radius: 999px;
  color: var(--sky-ink);
  background: #eef8ff;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.project-card__tag--place-1 {
  border-color: #3477a2;
  color: #1f5f92;
  background: linear-gradient(135deg, #eaf7ff 0%, #ffffff 50%, #fff1bf 100%);
}

.project-card__tag--place-2 {
  border-color: #d95062;
  color: #94283a;
  background: linear-gradient(135deg, #fff0f2 0%, #ffffff 48%, #eff1f5 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.project-card__tag--place-3 {
  border-color: #d2c3a8;
  color: #76512d;
  background: linear-gradient(135deg, #ffffff 0%, #fff9ee 48%, #d9a66d 100%);
}

.project-card h3 {
  max-width: 760px;
  margin: 0;
  color: var(--text);
  font-size: clamp(1.65rem, 4vw, 2.8rem);
  line-height: 1;
}

.project-card p,
.project-card li {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.48;
}

.project-card p {
  margin: 0;
}

.project-card ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
}

.project-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.project-card__links a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #ffffff;
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.project-card__links a:hover,
.project-card__links a:focus-visible {
  border-color: #ff78ad;
  background: #fff7fb;
  outline: none;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.case-grid--wide .case-card {
  min-height: 440px;
}

.case-card,
.blog-card,
.resume-panel,
.contact-card,
.contact-aside,
.principles article,
.about-grid article,
.tech-stack article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.case-card {
  min-height: 390px;
  padding: 22px;
}

.case-card__tag,
.blog-card__meta,
.principles span,
.timeline span {
  color: var(--sky-ink);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.case-card h3,
.blog-card h2,
.resume-panel h2,
.contact-aside h2,
.principles h3,
.about-grid h3,
.tech-stack h3 {
  margin: 14px 0 10px;
}

.case-card h3 {
  font-size: 1.45rem;
}

.case-card h3 a {
  color: inherit;
  text-decoration: none;
}

.case-card h3 a:hover,
.case-card h3 a:focus-visible {
  color: var(--sky-ink);
  text-decoration: underline;
}

.case-card p,
.case-card li,
.blog-card p,
.resume-panel p,
.principles p,
.contact-aside a,
.about-grid p {
  color: var(--muted);
  line-height: 1.62;
}

.case-card ul {
  display: grid;
  gap: 8px;
  margin: 20px 0 0;
  padding-left: 20px;
}

.case-card__languages {
  margin-top: 18px;
}

.section-band--split {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 32px;
  align-items: start;
}

.about-grid {
  display: grid;
  gap: 12px;
}

.about-grid article {
  padding: 20px;
}

.about-grid h3 {
  font-size: 1.22rem;
}

.about-grid p {
  margin-bottom: 0;
}

.principles {
  display: grid;
  gap: 12px;
}

.principles article {
  padding: 20px;
}

.principles h3 {
  font-size: 1.22rem;
}

.principles p {
  margin-bottom: 0;
}

.page-intro {
  min-height: 240px;
  padding: 28px 0 30px;
}

.blog-list {
  display: grid;
  gap: 16px;
  padding-bottom: 80px;
}

.blog-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  align-items: start;
  padding: 22px;
}

.blog-card__meta {
  margin: 4px 0 0;
}

.blog-card h2 {
  margin-top: 0;
  font-size: 1.5rem;
}

.blog-card h2 a {
  color: inherit;
  text-decoration: none;
}

.blog-card h2 a:hover,
.blog-card h2 a:focus-visible {
  color: var(--sky-ink);
  text-decoration: underline;
}

.blog-card h3 {
  margin: 24px 0 8px;
  color: var(--berry);
  font-size: 1rem;
  text-transform: uppercase;
}

.blog-card ul {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding-left: 20px;
}

.blog-card li {
  color: var(--muted);
  line-height: 1.62;
}

.blog-card code {
  color: var(--text);
  font-size: 0.92em;
  font-weight: 700;
}

.blog-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.blog-card__links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.82);
}

.blog-card__links a:hover,
.blog-card__links a:focus-visible {
  background: rgba(255, 255, 255, 0.92);
  outline: none;
}

.blog-card p:last-child {
  margin-bottom: 0;
}

.tech-stack {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.tech-stack article {
  padding: 20px;
}

.tech-stack h3 {
  color: var(--berry);
  font-size: 1rem;
  text-transform: uppercase;
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.badge-list span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 3px 9px;
  border: 1px solid rgba(91, 70, 122, 0.14);
  border-radius: 6px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.76);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.2;
}

.resume-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 16px;
  padding-bottom: 80px;
}

.resume-panel {
  padding: 22px;
}

.resume-panel:nth-child(3) {
  grid-column: 1 / -1;
}

.resume-panel:nth-child(4) {
  grid-column: 1 / -1;
}

.resume-panel h2 {
  color: var(--berry);
  font-size: 1rem;
  text-transform: uppercase;
}

.resume-item h3,
.timeline h3 {
  margin: 0 0 8px;
}

.resume-item + .resume-item {
  margin-top: 18px;
}

.resume-item a {
  color: var(--sky-ink);
  font-weight: 800;
  text-decoration: none;
}

.resume-item a:hover,
.resume-item a:focus-visible {
  text-decoration: underline;
}

.resume-note {
  margin-top: 18px;
}

.skill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-cloud span {
  padding: 9px 11px;
  border: 1px solid rgba(91, 70, 122, 0.14);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.9rem;
}

.timeline {
  display: grid;
  gap: 16px;
}

.timeline article {
  padding-left: 18px;
  border-left: 2px solid rgba(255, 120, 173, 0.5);
}

.resume-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.resume-actions--top {
  margin: 0 0 18px;
}

.resume-actions .btn {
  width: fit-content;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  padding-bottom: 80px;
}

.contact-card {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 22px;
}

.contact-card h2 {
  margin: 0;
  color: var(--berry);
  font-size: 1rem;
  text-transform: uppercase;
}

.contact-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.62;
}

.contact-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.contact-card__actions .btn {
  width: auto;
}

.contact-aside {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 22px;
}

.contact-aside h2 {
  margin-top: 0;
  color: var(--berry);
  font-size: 1rem;
  text-transform: uppercase;
}

.contact-aside a {
  overflow-wrap: anywhere;
}

.contact-aside a {
  text-decoration: none;
}

.contact-aside a span {
  display: block;
  margin-bottom: 2px;
  color: var(--sky-ink);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.contact-aside a:hover,
.contact-aside a:focus-visible {
  color: var(--text);
  outline: none;
}

.game-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding:
    calc(18px + var(--header-safe-top))
    calc(18px + var(--safe-right))
    calc(18px + var(--safe-bottom))
    calc(18px + var(--safe-left));
  background: rgba(33, 23, 47, 0.34);
  backdrop-filter: blur(14px);
}

.game-modal[hidden] {
  display: none;
}

.game-window {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100vh - 36px - var(--header-safe-top) - var(--safe-bottom));
  max-height: calc(100dvh - 36px - var(--header-safe-top) - var(--safe-bottom));
  overflow: hidden auto;
  border: 1px solid rgba(91, 70, 122, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 193, 214, 0.56), transparent 36%),
    linear-gradient(225deg, rgba(143, 216, 255, 0.58), transparent 45%),
    rgba(255, 255, 255, 0.92);
  box-shadow: 0 30px 100px rgba(33, 23, 47, 0.32);
}

.game-window--maze {
  width: min(520px, 100%);
}

.game-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
}

.game-window--maze .game-header {
  grid-template-columns: 1fr auto auto auto;
}

.game-header h2,
.game-header p {
  margin: 0;
}

.game-header h2 {
  font-size: 1.2rem;
}

.game-scoreboard {
  display: grid;
  min-width: 74px;
  padding: 8px 10px;
  border: 1px solid rgba(91, 70, 122, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  text-align: center;
}

.game-scoreboard span {
  color: var(--berry);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.game-scoreboard strong {
  font-size: 1.25rem;
}

.game-icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(91, 70, 122, 0.14);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
}

.game-icon-button:hover,
.game-icon-button:focus-visible {
  border-color: rgba(255, 120, 173, 0.42);
  outline: none;
}

.game-icon-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.game-canvas {
  display: block;
  width: calc(100% - 28px);
  max-width: 390px;
  aspect-ratio: 42 / 62;
  margin: 0 auto;
  border: 1px solid rgba(91, 70, 122, 0.16);
  border-radius: 8px;
  background: #d8f1ff;
  touch-action: manipulation;
}

.maze-canvas {
  display: block;
  width: calc(100% - 28px);
  max-width: 420px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border: 1px solid rgba(91, 70, 122, 0.16);
  border-radius: 8px;
  background: #090711;
  touch-action: none;
}

.game-controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 14px;
}

.game-controls .btn {
  width: 100%;
}

.maze-pad {
  display: grid;
  grid-template-columns: repeat(3, 48px);
  grid-template-areas:
    ". up ."
    "left down right";
  justify-content: center;
  gap: 8px;
  padding: 0 14px 14px;
}

.maze-pad button {
  display: grid;
  width: 48px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(91, 70, 122, 0.14);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.82);
  font-weight: 800;
  cursor: pointer;
}

.maze-pad button:hover,
.maze-pad button:focus-visible {
  border-color: rgba(255, 120, 173, 0.42);
  outline: none;
}

.maze-pad [data-maze-dir="up"] {
  grid-area: up;
}

.maze-pad [data-maze-dir="left"] {
  grid-area: left;
}

.maze-pad [data-maze-dir="down"] {
  grid-area: down;
}

.maze-pad [data-maze-dir="right"] {
  grid-area: right;
}

.birthday-card {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 16px;
  border: 1px solid rgba(91, 70, 122, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.birthday-card span {
  color: var(--berry);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.birthday-card strong {
  font-size: 1.3rem;
}

.birthday-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
  line-height: 1.6;
}

.site-footer a {
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--berry);
  outline: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes loadbar {
  0% {
    transform: translateX(-110%);
  }

  100% {
    transform: translateX(240%);
  }
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (max-width: 980px) {
  :root {
    --phone-cutout-buffer: 18px;
    --header-offset: calc(10px + var(--header-safe-top));
  }

  .site-header {
    grid-template-columns: 1fr auto;
  }

  .tabs {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    overflow-x: auto;
  }

  .tab {
    flex: 1 0 86px;
  }

  .hero-section {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: 10px;
  }

  .hero-copy h1,
  .page-intro h1 {
    font-size: 3.4rem;
  }

  .hero-copy h1,
  .page-intro h1 {
    font-size: 2.95rem;
  }

  .case-grid,
  .section-band--split,
  .resume-layout,
  .contact-layout,
  .tech-stack {
    grid-template-columns: 1fr;
  }

  .signal-grid {
    grid-template-columns: 1fr;
  }

  .project-wheel {
    max-width: 860px;
  }

  .project-card {
    min-height: 400px;
  }
}

@media (max-width: 640px) {
  :root {
    --phone-cutout-buffer: 34px;
    --header-offset: calc(8px + var(--header-safe-top));
  }

  .site-shell {
    width: min(1180px, calc(100% - 22px - var(--safe-left) - var(--safe-right)));
    padding-bottom: calc(28px + var(--safe-bottom));
  }

  .site-header {
    margin-bottom: 16px;
    gap: 10px;
    padding: 8px;
  }

  .brand span:last-child {
    display: none;
  }

  .header-actions {
    gap: 6px;
  }

  .header-actions a {
    width: 44px;
    height: 44px;
  }

  .header-actions button {
    width: 44px;
    height: 44px;
  }

  .hero-copy h1,
  .page-intro h1 {
    font-size: 2.45rem;
    line-height: 1.02;
  }

  .hero-copy h1,
  .page-intro h1 {
    font-size: 2.05rem;
  }

  .hero-copy__lead,
  .page-intro p {
    font-size: 1rem;
  }

  .hero-section {
    gap: 24px;
    padding-bottom: 34px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .section-heading {
    display: block;
  }

  .section-heading h2,
  .section-band--split h2 {
    font-size: 1.8rem;
  }

  .project-wheel__button {
    width: 38px;
    height: 38px;
  }

  .project-card {
    min-height: 0;
    padding: 22px 58px 24px;
  }

  .project-card--place-2::before,
  .project-card--place-2::after {
    display: none;
  }

  .case-card {
    min-height: 0;
  }

  .case-grid--wide .case-card {
    min-height: 0;
  }

  .blog-card {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .game-window {
    max-height: calc(100vh - 24px - var(--header-safe-top) - var(--safe-bottom));
    max-height: calc(100dvh - 24px - var(--header-safe-top) - var(--safe-bottom));
  }

  .game-header,
  .game-controls {
    grid-template-columns: 1fr;
  }

  .game-icon-button {
    position: absolute;
    top: 28px;
    right: 28px;
  }

  .page-intro {
    min-height: 190px;
    padding-top: 22px;
  }

  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

}

@media (max-width: 480px) {
  :root {
    --phone-cutout-buffer: 38px;
  }

  .site-shell {
    width: min(1180px, calc(100% - 18px - var(--safe-left) - var(--safe-right)));
  }

  .site-header {
    gap: 8px;
    padding: 7px;
  }

  .header-actions {
    gap: 4px;
  }

  .header-actions a,
  .header-actions button {
    width: 38px;
    height: 38px;
  }

  .header-actions svg {
    width: 18px;
    height: 18px;
  }

  .game-launch img,
  .maze-launch svg {
    width: 24px;
    height: 24px;
  }

  .tabs {
    gap: 3px;
    padding: 3px;
  }

  .tab {
    flex: 1 0 72px;
    padding: 0 8px;
    font-size: 0.92rem;
  }

  .hero-copy h1,
  .page-intro h1 {
    font-size: 2.22rem;
  }

  .hero-copy h1,
  .page-intro h1 {
    font-size: 1.95rem;
  }

  .section-band {
    padding: 48px 0;
  }

  .page-intro {
    min-height: 0;
    padding: 18px 0 26px;
  }

  .signal-grid div,
  .case-card {
    min-height: 0;
  }

  .case-card,
  .project-card,
  .resume-panel,
  .contact-card,
  .contact-aside,
  .principles article,
  .about-grid article,
  .tech-stack article,
  .blog-card {
    padding: 18px;
  }

  .project-wheel__controls {
    padding: 0 6px;
  }

  .project-wheel__counter {
    top: 8px;
    right: 12px;
    min-width: 62px;
    padding: 5px 9px;
    font-size: 0.78rem;
  }

  .project-card {
    padding: 18px 50px 22px;
  }

  .project-card h3 {
    font-size: 1.8rem;
  }

  .profile-card__body {
    padding: 6px 18px 18px;
  }

  .profile-links a,
  .blog-card__links a,
  .resume-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .badge-list span {
    min-height: 22px;
    max-width: 100%;
  }

  .skill-cloud span {
    max-width: 100%;
  }

  .game-modal {
    padding:
      calc(10px + var(--header-safe-top))
      calc(10px + var(--safe-right))
      calc(10px + var(--safe-bottom))
      calc(10px + var(--safe-left));
  }

  .game-canvas {
    width: calc(100% - 18px);
  }

  .maze-canvas {
    width: calc(100% - 18px);
  }
}

@media (max-width: 390px) {
  .hero-copy h1,
  .page-intro h1 {
    font-size: 2.15rem;
  }

  .hero-copy h1,
  .page-intro h1 {
    font-size: 1.88rem;
  }

  .tab {
    flex-basis: 68px;
    padding: 0 7px;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .site-header {
    position: relative;
    top: auto;
  }

  .hero-section {
    min-height: 0;
    padding: 24px 0 38px;
  }

  .game-window {
    display: grid;
    width: min(760px, 100%);
    grid-template-columns: auto minmax(180px, 1fr);
    grid-template-areas:
      "canvas header"
      "canvas controls"
      "canvas pad";
    align-items: start;
  }

  .game-header {
    grid-area: header;
  }

  .game-canvas {
    grid-area: canvas;
    width: auto;
    height: min(360px, calc(100dvh - 48px - var(--header-safe-top) - var(--safe-bottom)));
    margin: 14px;
  }

  .maze-canvas {
    grid-area: canvas;
    width: auto;
    height: min(360px, calc(100dvh - 48px - var(--header-safe-top) - var(--safe-bottom)));
    margin: 14px;
  }

  .game-controls {
    grid-area: controls;
    grid-template-columns: 1fr;
  }

  .maze-pad {
    grid-area: pad;
  }

  .game-icon-button {
    position: static;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
