/* ===== ocean — gothic mono theme (v2) ===== */

:root {
  --bg:        #060606;
  --bg-alt:    #0c0c0c;
  --card:      rgba(12, 12, 12, 0.82);
  --border:    #1c1c1c;
  --border-2:  #262626;
  --accent:    #8a8a8a;
  --accent-dim:#3a3a3a;
  --accent-glow: rgba(160, 160, 160, 0.14);
  --text:      #cfcfcf;
  --text-dim:  #9a9a9a;
  --text-faint:#737373;
  --white:     #ededed;
  --mono:      'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { height: 100%; color-scheme: dark; }

:focus-visible {
  outline: 2px solid #c5c5c5;
  outline-offset: 4px;
}

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  position: relative;
}

/* ===== fondo base ===== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, #0e0e0e 0%, #050505 70%);
  pointer-events: none;
  z-index: -3;
}

/* ===== fondo con imagen ===== */
.bg {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: saturate(0.85) contrast(1.05) brightness(0.85);
  z-index: -2;
  animation: bgIn 2s ease both;
}

@keyframes bgIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6,6,10,0.45) 0%, rgba(6,6,10,0.65) 100%);
  backdrop-filter: blur(4px);
}

.noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===== ruido + scanlines (textura gotica) ===== */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.06;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(255, 255, 255, 0.4) 3px,
    transparent 4px
  );
}

/* scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #181818; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

::selection { background: var(--accent-dim); color: var(--white); }

/* ===== frame principal ===== */
.frame {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 600px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background: rgba(10, 10, 14, 0.56);
  padding: 0;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 -1px 0 rgba(0, 0, 0, 0.4) inset,
    0 20px 50px rgba(0, 0, 0, 0.6);
  animation: frameIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.frame::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(160deg, rgba(255,255,255,0.10), transparent 40%, transparent 60%, rgba(255,255,255,0.04));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

@keyframes frameIn {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== barra superior estilo terminal ===== */
.top {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}

.top .prompt { color: var(--text-dim); }

.top .cursor {
  color: var(--accent);
  animation: blink 1.1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

/* ===== contenido ===== */
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  padding: 48px 36px 40px;
  text-align: center;
}

/* ===== avatar ===== */
.avatar-wrap {
  position: relative;
  width: 116px;
  height: 116px;
  margin-bottom: 64px;
  animation: fadeUp 0.9s 0.15s ease both;
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid var(--border-2);
  object-fit: cover;
  filter: saturate(1.05) contrast(1.02);
  transition: filter 0.4s, border-color 0.4s;
}

.avatar:hover {
  filter: saturate(1.15) contrast(1.05);
  border-color: var(--accent);
}

.ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px dashed rgba(242, 242, 242, 0.24);
  animation: spin 26s linear infinite;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.avatar-wrap:hover .ring {
  border-color: rgba(242, 242, 242, 0.7);
  box-shadow: 0 0 9px rgba(242, 242, 242, 0.18);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== nombre ===== */
.name {
  position: absolute;
  left: 50%;
  right: auto;
  width: max-content;
  translate: -50% 0;
  top: calc(100% + 22px);
  text-align: center;
  white-space: nowrap;
  font-size: 2.25rem;
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--white);
  animation: fadeUp 0.9s 0.25s ease both;
}

.name::before,
.name::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  width: 100%;
  text-align: center;
  white-space: inherit;
  opacity: 0;
  pointer-events: none;
}

.name::before {
  color: rgba(80, 225, 255, 0.9);
  text-shadow: 0 0 8px rgba(80, 225, 255, 0.55);
  animation: nameGlitchBefore 2.4s steps(1, end) infinite;
}

.name::after {
  color: rgba(255, 75, 125, 0.85);
  text-shadow: 0 0 8px rgba(255, 75, 125, 0.5);
  animation: nameGlitchAfter 2.4s steps(1, end) infinite;
}

@keyframes nameGlitchBefore {
  0%, 69%, 72%, 77%, 80%, 85%, 88%, 93%, 96%, 100% {
    opacity: 0;
    clip-path: inset(0 0 100% 0);
    transform: translateX(0);
  }
  70%, 78%, 86%, 94% {
    opacity: 1;
    clip-path: inset(17% 0 76% 0);
    transform: translateX(-4px);
  }
  71%, 79%, 87%, 95% {
    opacity: 0.85;
    clip-path: inset(58% 0 36% 0);
    transform: translateX(3px);
  }
}

@keyframes nameGlitchAfter {
  0%, 73%, 76%, 81%, 84%, 89%, 92%, 97%, 100% {
    opacity: 0;
    clip-path: inset(0 0 100% 0);
    transform: translateX(0);
  }
  74%, 82%, 90%, 98% {
    opacity: 1;
    clip-path: inset(28% 0 66% 0);
    transform: translateX(4px);
  }
  75%, 83%, 91%, 99% {
    opacity: 0.8;
    clip-path: inset(68% 0 26% 0);
    transform: translateX(-3px);
  }
}

.name .at {
  color: var(--accent);
  font-weight: 300;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .name::before,
  .name::after,
  .game-panel.hit-shake { animation: none; }
}

/* ===== bio ===== */
.bio {
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--text-dim);
  max-width: 460px;
  animation: fadeUp 0.9s 0.35s ease both;
}

.bio .hl { color: var(--text); }

/* ===== status ===== */
.status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--text-faint);
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--bg-alt);
  animation: fadeUp 0.9s 0.45s ease both;
}

.status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #48d17a;
  box-shadow: 0 0 8px rgba(140, 140, 140, 0.5);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

/* ===== links (solo logo) ===== */
.links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  animation: fadeUp 0.9s 0.55s ease both;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: transparent;
  color: #f2f2f2;
  cursor: pointer;
  transition: color 0.16s ease-out, transform 0.16s ease-out, border-color 0.16s ease-out;
  position: relative;
}

.icon-btn:hover {
  color: #e2e5eb;
  border-color: var(--accent-dim);
  transform: translateY(-3px);
}

.icon-btn:active {
  transform: translateY(-1px) scale(0.97);
}

.icon-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  transition: color 0.16s ease-out;
}

.gmail-icon {
  display: block;
  width: 23px;
  height: 23px;
  object-fit: contain;
  filter: grayscale(1);
  transition: filter 0.2s ease-out;
}

.social-email:hover .gmail-icon,
.social-email:focus-visible .gmail-icon,
.contact-copy-email:hover .gmail-icon,
.contact-copy-email:focus-visible .gmail-icon {
  filter: grayscale(0);
}

.icon-btn[data-copy-value="2cean"] svg,
.contact-copy-discord svg {
  color: #f2f2f2;
  transition: color 0.2s ease-out;
}

.icon-btn[data-copy-value="2cean"]:hover svg,
.icon-btn[data-copy-value="2cean"]:focus-visible svg,
.contact-copy-discord:hover svg,
.contact-copy-discord:focus-visible svg {
  color: #5865f2;
}

.icon-btn[data-copy-value="2cean"]:hover,
.contact-copy-discord:hover {
  color: #5865f2;
}

.social-youtube:hover {
  color: #ff0033;
}

/* ===== boton projects ===== */
.btn-projects {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 30px;
  border: 1px solid var(--border-2);
  border-radius: 3px;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  text-decoration: none;
  transition: border-color 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  animation: fadeUp 0.9s 0.65s ease both;
  position: relative;
  overflow: hidden;
}

.btn-projects:hover {
  border-color: var(--accent);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.6);
}

.btn-projects svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transition: transform 0.3s ease;
}

.btn-projects:hover svg { transform: translateX(3px); }

/* ===== namemc mark ===== */
.nmc-icon {
  shape-rendering: crispEdges;
}

/* ===== footer con redireccionadores ===== */
.footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: border-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.footer-link-disabled {
  color: var(--text-faint);
  cursor: default;
}

.footer-link-disabled:hover {
  border-color: var(--border);
  color: var(--text-faint);
  transform: none;
}

.footer-link:hover {
  border-color: var(--accent-dim);
  color: var(--white);
  transform: translateY(-2px);
}

.footer-link svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  opacity: 0.7;
}

.footer-link:hover svg { opacity: 1; }

.footer-link:focus-visible,
.icon-btn:focus-visible,
.back-link:focus-visible {
  outline-offset: 4px;
}

.footer-copy {
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  text-align: center;
}

.footer-copy a {
  color: inherit;
  text-decoration: none;
}

.footer-copy a:hover,
.footer-copy a:focus-visible {
  color: var(--text-soft);
}

/* ===== toast (copy feedback) ===== */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 20px;
  border: 1px solid var(--border-2);
  border-radius: 3px;
  background: var(--card);
  color: var(--text);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 10;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== animaciones ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== PÁGINA PROYECTOS ===== */
body.projects-page {
  display: block;
  min-height: 100vh;
  padding: 56px 24px 32px;
}

body.projects-page .bg {
  filter: grayscale(0.08) saturate(1.08) contrast(1.04) brightness(0.8);
}

body.projects-page .bg::after {
  background: linear-gradient(180deg, rgba(7, 7, 8, 0.5) 0%, rgba(7, 7, 8, 0.7) 100%);
}

body.projects-page .noise { opacity: 0.025; }
body.projects-page .scanlines { opacity: 0.035; }

body.game-page .bg,
body.services-page .bg {
  filter: grayscale(0.08) saturate(1.08) contrast(1.04) brightness(0.8);
}

.projects-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  animation: fadeUp 0.8s ease both;
}

.eyebrow,
.section-kicker {
  margin-bottom: 10px;
  color: #a4a4a4;
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.page-header .title {
  font-size: clamp(1.45rem, 4vw, 2rem);
  font-weight: 500;
  color: var(--white);
  letter-spacing: -0.04em;
}

.page-header .title span { color: var(--accent); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.78rem;
  transition: color 0.2s;
}

body.projects-page .back-link { color: #b0b0b0; }

.back-link:hover { color: var(--white); }
.back-link svg { width: 16px; height: 16px; fill: currentColor; }

.projects-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 310px);
  align-items: end;
  gap: 24px;
  margin-bottom: 22px;
}

.projects-intro h2 {
  margin-bottom: 8px;
  color: var(--white);
  font-size: clamp(1.15rem, 3vw, 1.55rem);
  font-weight: 400;
  letter-spacing: -0.04em;
}

.projects-intro > div:first-child > p:last-child {
  color: #b8b8b8;
  font-size: 0.78rem;
  line-height: 1.75;
}

.concept-note p {
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.75;
}

.concept-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0 8px 12px;
  border-left: 1px solid var(--border-2);
}

.concept-note strong { color: var(--text); font-weight: 500; }

.note-mark {
  display: grid;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid var(--border-2);
  border-radius: 50%;
  color: var(--text-dim);
  font-size: 0.68rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.completed-ideas {
  margin-top: 38px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.completed-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.completed-intro h2 {
  margin-bottom: 7px;
  color: var(--white);
  font-size: clamp(1.15rem, 3vw, 1.55rem);
  font-weight: 400;
  letter-spacing: -0.04em;
}

.completed-intro > div > p:last-child {
  color: #b8b8b8;
  font-size: 0.76rem;
  line-height: 1.7;
}

.completed-count {
  flex: 0 0 auto;
  padding-bottom: 3px;
  color: #a4a4a4;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 5px;
  background: rgba(10, 10, 14, 0.52);
  color: inherit;
  transition: border-color 0.16s ease, transform 0.16s ease;
  animation: projectCardIn 0.55s ease both;
}

.project-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

@keyframes projectCardIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.project-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.project-index {
  color: var(--text-faint);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
}

.project-state {
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text-dim);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-card .project-name {
  margin: 0 0 9px;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--white);
  letter-spacing: 0.01em;
}

.project-card .desc {
  margin-bottom: 16px;
  color: var(--text-dim);
  font-size: 0.76rem;
  line-height: 1.75;
}

.project-points {
  display: grid;
  gap: 7px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.project-points li {
  position: relative;
  padding-left: 14px;
  color: var(--text-dim);
  font-size: 0.7rem;
  line-height: 1.5;
}

.project-points li::before {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--accent);
  content: "›";
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: auto;
}

.project-tags span {
  padding: 2px 0;
  color: var(--text-dim);
  font-size: 0.61rem;
  letter-spacing: 0.04em;
}

.project-tags span + span::before {
  margin: 0 8px;
  color: var(--text-faint);
  content: "/";
}

.projects-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: #929292;
  font-size: 0.65rem;
}

/* ===== responsive ===== */
@media (max-width: 520px) {
  .content { padding: 36px 22px 30px; gap: 22px; }
  .avatar-wrap { width: 96px; height: 96px; }
  .links { gap: 10px; }
  body { padding: 20px 14px; }
  .footer { padding: 14px 12px; }
  .footer-links { gap: 8px; }
  .footer-link { min-width: 76px; padding: 8px 12px; }
  body.projects-page { padding: 32px 16px 24px; }
  .page-header { align-items: flex-start; flex-direction: column; gap: 14px; }
  .projects-intro,
  .projects-grid { grid-template-columns: 1fr; }
  .projects-intro { gap: 16px; }
  .projects-footer { align-items: flex-start; flex-direction: column; }
  .completed-ideas { margin-top: 28px; padding-top: 20px; }
  .completed-intro { align-items: flex-start; flex-direction: column; gap: 8px; }
}

@media (min-width: 521px) and (max-width: 760px) {
  body.projects-page { padding: 36px 20px 28px; }
  .projects-intro { grid-template-columns: minmax(0, 1fr) minmax(180px, 260px); gap: 18px; }
  .page-header { gap: 16px; }
}

/* ===== página arcade ===== */
body.game-page {
  display: block;
  min-height: 100vh;
  padding: 18px 24px 12px;
}

.game-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1280px;
  --game-panel-padding: clamp(12px, 1.8vw, 22px);
  --game-board-width: max(280px, calc((100svh - 250px) * 12 / 7));
  margin: 0 auto;
}

body.game-page .page-header {
  margin-bottom: 12px;
  padding-bottom: 10px;
}

.arcade-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  align-items: start;
  gap: clamp(16px, 2vw, 28px);
}

.game-menu {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 14px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(10, 10, 14, 0.58);
}

.game-menu-heading {
  padding: 2px 5px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 0.65rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.game-menu-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 54px;
  padding: 7px 6px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.game-menu-item:hover,
.game-menu-item[aria-pressed="true"] {
  border-color: var(--border-2);
  background: rgba(255, 255, 255, 0.055);
  color: var(--white);
}

.game-menu-item[aria-pressed="true"] .game-menu-number { color: var(--white); }

.game-menu-number {
  color: var(--text-faint);
  font-size: 0.64rem;
  letter-spacing: 0.05em;
}

.game-menu-item strong,
.game-menu-item small { display: block; }

.game-menu-item strong {
  overflow: hidden;
  font-size: 0.69rem;
  font-weight: 500;
  letter-spacing: 0.025em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.game-menu-item small {
  margin-top: 4px;
  color: var(--text-faint);
  font-size: 0.56rem;
  letter-spacing: 0.015em;
}

.arcade-stage { min-width: 0; }

.game-panel {
  position: relative;
  width: min(100%, calc(var(--game-board-width) + var(--game-panel-padding) + var(--game-panel-padding) + 2px));
  max-width: 100%;
  margin-inline: auto;
  padding: var(--game-panel-padding);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(10, 10, 14, 0.58);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
}

.game-panel.hit-shake {
  animation: gameHitShake 260ms ease-out;
}

@keyframes gameHitShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5px, 2px); }
  45% { transform: translate(4px, -2px); }
  70% { transform: translate(-2px, 1px); }
}

.game-hud {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  color: #c4c4c4;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-hud strong {
  color: var(--white);
  font-weight: 500;
}

.game-pause {
  display: none;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-2);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
  font: inherit;
  letter-spacing: inherit;
  text-transform: uppercase;
}

.game-pause:disabled {
  color: var(--text-faint);
  opacity: 0.55;
}

.game-screen {
  display: block;
  width: min(100%, var(--game-board-width));
  height: auto;
  aspect-ratio: 12 / 7;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(3, 4, 6, 0.86);
  cursor: crosshair;
  touch-action: none;
}

.game-mobile-hint { display: none; }

.game-touch-controls { display: none; }

.game-touch-controls button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-2);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
  font: inherit;
  font-size: 0.68rem;
  text-transform: uppercase;
  touch-action: manipulation;
}

body[data-active-game="aim"] .game-touch-controls,
body[data-active-game="starfall"] .game-touch-controls { display: none; }

.game-screen:active { cursor: crosshair; }

.game-screen:focus-visible {
  outline-offset: 3px;
}

.game-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.game-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  width: min(100%, calc(var(--game-board-width) + var(--game-panel-padding) + var(--game-panel-padding) + 2px));
  max-width: 100%;
  margin-inline: auto;
  padding: 10px 2px 0;
  border-top: 1px solid var(--border);
}

@media (max-width: 900px) {
  .arcade-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .game-menu {
    grid-template-columns: repeat(7, minmax(120px, 1fr));
    gap: 6px;
    overflow-x: auto;
    padding: 8px;
  }
  .game-menu-heading {
    grid-column: 1 / -1;
    padding-bottom: 5px;
  }
  .game-menu-item { min-height: 46px; }
  .game-menu-item small { display: none; }
}

@media (max-width: 520px) {
  body.game-page { padding: 14px 14px 10px; }
  .game-hud { font-size: 0.64rem; }
  .game-menu { grid-template-columns: repeat(7, minmax(112px, 1fr)); margin-inline: -2px; }
  .game-menu-item { grid-template-columns: 22px minmax(0, 1fr); gap: 5px; padding-inline: 4px; }
  .game-menu-item strong { font-size: 0.62rem; }
}

@media (max-height: 720px) {
  body.game-page { padding-top: 10px; padding-bottom: 8px; }
  body.game-page .page-header { margin-bottom: 8px; padding-bottom: 7px; }
  .game-shell {
    --game-panel-padding: 10px;
    --game-board-width: max(220px, calc((100svh - 190px) * 12 / 7));
  }
  .game-footer { margin-top: 7px; }
}

@media (pointer: coarse), (any-pointer: coarse) {
  body.game-page {
    min-height: 100svh;
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }

  .game-shell {
    --game-panel-padding: clamp(8px, 2vw, 14px);
    --game-board-width: min(calc(100vw - 20px - env(safe-area-inset-left) - env(safe-area-inset-right)), max(220px, calc((100svh - 145px) * 12 / 7)));
  }

  .game-hud {
    align-items: center;
    gap: 8px;
    font-size: clamp(0.58rem, 2.5vw, 0.72rem);
  }

  .game-pause {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
  }

  .game-mobile-hint {
    display: block;
    margin-top: 8px;
    color: var(--text-dim);
    font-size: clamp(0.58rem, 2.6vw, 0.68rem);
    line-height: 1.5;
    text-align: center;
  }

  .game-touch-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
    margin-top: 8px;
  }

  .game-footer { margin-top: 8px; }
}

body.touch-device.game-page {
  min-height: 100svh;
  padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
}

body.touch-device .game-shell {
  --game-panel-padding: clamp(8px, 2vw, 14px);
  --game-board-width: min(calc(100vw - 20px - env(safe-area-inset-left) - env(safe-area-inset-right)), max(220px, calc((100svh - 145px) * 12 / 7)));
}

body.touch-device .game-hud {
  align-items: center;
  gap: 8px;
  font-size: clamp(0.58rem, 2.5vw, 0.72rem);
}

body.touch-device .game-pause {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}

body.touch-device .game-mobile-hint {
  display: block;
  margin-top: 8px;
  color: var(--text-dim);
  font-size: clamp(0.58rem, 2.6vw, 0.68rem);
  line-height: 1.5;
  text-align: center;
}

body.touch-device .game-touch-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: 8px;
}

body.touch-device .game-footer { margin-top: 8px; }

body.touch-device[data-active-game="aim"] .game-touch-controls,
body.touch-device[data-active-game="starfall"] .game-touch-controls { display: none; }

@media (max-height: 500px) and (pointer: coarse), (max-height: 500px) and (any-pointer: coarse) {
  body.game-page { padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  .game-shell {
    --game-panel-padding: 8px;
    --game-board-width: min(calc(100vw - 20px - env(safe-area-inset-left) - env(safe-area-inset-right)), max(220px, calc((100svh - 190px) * 12 / 7)));
  }
  body.game-page .page-header { margin-bottom: 6px; padding-bottom: 6px; }
  .game-hud { margin-bottom: 6px; }
  .game-pause { min-height: 34px; }
  .game-mobile-hint { display: none; }
  .game-touch-controls { display: none; }
  .game-footer { margin-top: 5px; padding-top: 6px; }
}

@media (max-height: 500px) {
  body.touch-device.game-page { padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  body.touch-device .game-shell {
    --game-panel-padding: 6px;
    --game-board-width: min(calc(100vw - 20px - env(safe-area-inset-left) - env(safe-area-inset-right)), max(180px, calc((100svh - 215px) * 12 / 7)));
  }
  body.game-page .page-header .eyebrow { display: none; }
  body.touch-device.game-page .page-header { margin-bottom: 4px; padding-bottom: 4px; }
  body.touch-device.game-page .page-header .title { font-size: 1.35rem; }
  body.touch-device.game-page .back-link { font-size: 0.68rem; }
  body.touch-device .game-menu { gap: 4px; padding: 4px; }
  body.touch-device .game-menu-heading { display: none; }
  body.touch-device .game-menu-item { min-height: 34px; }
  body.touch-device .game-hud { margin-bottom: 6px; }
  body.touch-device .game-pause { min-height: 34px; }
  body.touch-device .game-mobile-hint { display: none; }
  body.touch-device .game-touch-controls { display: none; }
  body.touch-device .game-footer { margin-top: 5px; padding-top: 6px; }
}

/* ===== services page ===== */
body.services-page {
  display: block;
  min-height: 100vh;
  padding: 48px 24px 32px;
}

.services-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
}

.services-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  align-items: end;
  gap: 28px;
  margin-bottom: 22px;
}

.services-intro h2,
.services-contact h2 {
  margin-bottom: 8px;
  color: var(--white);
  font-size: clamp(1.2rem, 3vw, 1.65rem);
  font-weight: 400;
  letter-spacing: -0.04em;
}

.services-intro > div > p:last-child,
.services-contact > div > p:last-child {
  color: #b8b8b8;
  font-size: 0.78rem;
  line-height: 1.75;
}

.services-note {
  padding: 8px 0 8px 14px;
  border-left: 1px solid var(--border-2);
  color: #b8b8b8;
  font-size: 0.72rem;
  line-height: 1.7;
}

.services-note strong {
  color: var(--text);
  font-weight: 500;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.service-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 5px;
  background: rgba(10, 10, 14, 0.54);
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.service-card:hover {
  border-color: rgba(255, 255, 255, 0.13);
  transform: translateY(-1px);
}

.service-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.service-index {
  color: #999;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
}

.service-mark {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #9da2ac;
}

.service-mark svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.service-mark svg circle {
  fill: currentColor;
  stroke: none;
}

.service-card h2 {
  margin-bottom: 10px;
  color: var(--white);
  font-size: 1rem;
  font-weight: 500;
}

.service-card > p {
  min-height: 5.4em;
  margin-bottom: 16px;
  color: #b0b0b0;
  font-size: 0.73rem;
  line-height: 1.75;
}

.service-card ul {
  display: grid;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.service-card li {
  position: relative;
  padding-left: 14px;
  color: #b0b0b0;
  font-size: 0.68rem;
  line-height: 1.5;
}

.service-card li::before {
  position: absolute;
  left: 0;
  color: #aaa;
  content: "›";
}

.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: auto;
  color: #a4a4a4;
  font-size: 0.6rem;
  letter-spacing: 0.04em;
}

.service-tags span + span::before {
  margin: 0 7px;
  color: var(--text-faint);
  content: "/";
}

.services-contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 16px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 5px;
  background: rgba(10, 10, 14, 0.54);
}

.services-contact .section-kicker {
  margin-bottom: 7px;
}

.services-contact h2 {
  margin-bottom: 5px;
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
}

.services-contact > div > p:last-child {
  font-size: 0.7rem;
}

.contact-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.contact-copy {
  display: inline-flex;
  flex: 0 0 46px;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border-2);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.025);
  color: #bdbdbd;
  font-family: var(--mono);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.contact-copy:hover {
  border-color: #777;
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
}

.contact-copy-discord { margin-right: 6px; }

.contact-copy svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.services-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: #929292;
  font-size: 0.65rem;
}

@media (max-width: 760px) {
  body.services-page { padding: 32px 18px 24px; }
  .services-intro { grid-template-columns: 1fr; gap: 14px; }
  .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-card:last-child { grid-column: 1 / -1; }
  .service-card > p { min-height: 0; }
}

@media (max-width: 520px) {
  body.services-page { padding: 28px 16px 22px; }
  body.services-page .page-header { align-items: flex-end; flex-direction: row; gap: 10px; }
  .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .service-card { padding: 13px; }
  .service-card-top { margin-bottom: 10px; }
  .service-mark { flex-basis: 24px; width: 24px; height: 24px; }
  .service-mark svg { width: 17px; height: 17px; }
  .service-card h2 { min-height: 2.4em; margin-bottom: 6px; font-size: 0.82rem; }
  .service-card > p { margin-bottom: 9px; font-size: 0.66rem; line-height: 1.5; }
  .service-card ul { gap: 5px; margin-bottom: 10px; }
  .service-card li { font-size: 0.62rem; }
  .service-tags { font-size: 0.54rem; }
  .service-tags span + span::before { margin-inline: 4px; }
  .service-card:last-child { grid-column: 1 / -1; }
  .service-card:last-child > p { min-height: 0; }
  .services-intro { gap: 8px; margin-bottom: 12px; }
  .services-intro .section-kicker { margin-bottom: 6px; }
  .services-intro h2 { margin-bottom: 5px; font-size: 1.08rem; }
  .services-intro > div > p:last-child { font-size: 0.68rem; line-height: 1.5; }
  .services-note { padding-block: 4px; font-size: 0.63rem; line-height: 1.45; }
  .services-contact { align-items: center; gap: 10px; margin-top: 10px; padding: 12px; }
  .services-contact .section-kicker { margin-bottom: 4px; }
  .services-contact h2 { margin-bottom: 4px; font-size: 0.96rem; }
  .services-contact > div > p:last-child { font-size: 0.62rem; line-height: 1.45; }
  .contact-actions { align-self: flex-end; }
  .contact-copy { flex: 0 0 46px; width: 46px; min-height: 46px; padding: 0; }
  .services-footer { margin-top: 12px; padding-top: 9px; }
}

@media (min-width: 521px) and (max-height: 900px) {
  body.services-page { padding-top: 20px; padding-bottom: 16px; }
  body.services-page .page-header { margin-bottom: 16px; padding-bottom: 12px; }
  .services-intro { gap: 18px; margin-bottom: 14px; }
  .services-intro h2 { margin-bottom: 5px; }
  .service-card { padding: 15px; }
  .service-card-top { margin-bottom: 12px; }
  .service-card > p { min-height: 0; margin-bottom: 10px; }
  .service-card ul { gap: 5px; margin-bottom: 12px; }
  .services-contact { margin-top: 12px; padding: 13px 16px; }
  .services-footer { margin-top: 14px; padding-top: 10px; }
}

@media (max-height: 700px) {
  body.services-page { padding-top: 10px; padding-bottom: 10px; }
  body.services-page .page-header { margin-bottom: 10px; padding-bottom: 8px; }
  .services-intro { margin-bottom: 10px; }
  .services-intro .section-kicker { margin-bottom: 5px; }
  .services-note { padding-block: 4px; }
  .service-card { padding: 12px; }
  .service-card-top { margin-bottom: 8px; }
  .service-card ul { margin-bottom: 8px; }
  .services-contact { margin-top: 9px; padding-block: 10px; }
  .services-footer { margin-top: 10px; padding-top: 8px; }
}
