/* Professional layout overrides — load after page inline styles */

/* ─── Native affordances ─── */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  cursor: auto;
  line-height: 1.65;
}

a:any-link,
button,
summary,
[role="button"],
label[for] {
  cursor: pointer;
}

input,
textarea,
select {
  cursor: text;
}

#cursor {
  display: none !important;
}

html {
  scrollbar-width: thin;
  scrollbar-color: var(--muted) var(--bg2);
}

::-webkit-scrollbar {
  display: block;
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg2);
}

::-webkit-scrollbar-thumb {
  background: var(--muted);
  border-radius: 4px;
}

body::before {
  opacity: calc(var(--grain-opacity) * 0.5);
}

/* ─── Focus ─── */
a:focus-visible,
button:focus-visible,
.nav-menu-btn:focus-visible,
.nav-backdrop:focus-visible,
.theme-toggle:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.work-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ─── Layout shell ─── */
.layout-container {
  max-width: var(--content-max);
  margin-inline: auto;
  width: 100%;
  padding-inline: 48px;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .layout-container {
    padding-inline: 24px;
  }
}

nav {
  padding-block: 20px;
  padding-inline: 0;
}

.nav-inner.layout-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-logo {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav-logo span {
  animation: none;
  opacity: 1;
}

.nav-links a,
.theme-toggle {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

/* Sentence-case labels from theme.js ("Bright page" / "Dark page"); keep on one line in tight nav. */
.theme-toggle {
  text-transform: none;
  white-space: nowrap;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: none;
  padding: 4px 0;
  transition: color 0.2s ease;
}

.theme-toggle:hover {
  color: var(--accent);
}

/* Narrow tablet / small laptop: keep row nav but tighter */
@media (max-width: 900px) and (min-width: 769px) {
  .nav-inner.layout-container {
    gap: 16px;
  }

  .nav-end {
    gap: 14px;
    flex-shrink: 1;
    min-width: 0;
  }

  .nav-links {
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .nav-links a,
  .theme-toggle {
    font-size: 0.65rem;
    letter-spacing: 0.04em;
  }
}

/* Mobile: menu button + slide-down panel */
.nav-backdrop {
  display: none;
}

.nav-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 10px 4px 10px 12px;
  min-height: 44px;
  min-width: 44px;
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s ease;
}

.nav-menu-btn:hover,
.nav-menu-btn:focus-visible {
  color: var(--text);
}

nav.nav-open .nav-menu-btn {
  color: var(--accent);
}

.nav-menu-label-close {
  display: none;
}

nav.nav-open .nav-menu-label-open {
  display: none;
}

nav.nav-open .nav-menu-label-close {
  display: inline;
}

@media (max-width: 768px) {
  nav {
    z-index: 1000;
  }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 998;
    margin: 0;
    padding: 0;
    border: none;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }

  html[data-theme="light"] .nav-backdrop {
    background: rgba(0, 0, 0, 0.2);
  }

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

  .nav-menu-btn {
    display: flex;
    margin-left: auto;
    z-index: 1002;
    position: relative;
  }

  .nav-logo {
    position: relative;
    z-index: 1002;
  }

  .nav-inner.layout-container {
    position: relative;
    z-index: 1002;
  }

  /* Right drawer: keeps logo + menu control in the bar */
  .nav-end {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1001;
    width: min(300px, 88vw);
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: calc(72px + env(safe-area-inset-top, 0px)) 20px 24px;
    overflow-y: auto;
    background: var(--nav-scrolled-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-left: 1px solid var(--rule);
    box-shadow: var(--shadow-soft);
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.76, 0, 0.24, 1),
      opacity 0.25s ease,
      visibility 0.25s ease;
  }

  nav.nav-open .nav-end {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
  }

  .nav-links li {
    width: 100%;
    border-bottom: 1px solid var(--rule);
  }

  .nav-links li:last-of-type {
    border-bottom: none;
  }

  .nav-links a {
    display: block;
    padding: 14px 4px;
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: none;
  }

  .nav-links a::before {
    display: none;
  }

  .nav-links a.active {
    color: var(--accent);
  }

  .theme-toggle {
    align-self: flex-start;
    margin-top: 12px;
    padding: 12px 4px;
    font-size: 0.75rem;
    text-transform: none;
    letter-spacing: 0.04em;
  }
}

body.nav-open {
  overflow: hidden;
}

/* ─── Hero ─── */
#hero {
  padding-inline: 0;
}

.hero-glyph {
  font-size: min(22vw, 280px);
  opacity: 0.9;
}

.hero-name {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(2.5rem, 7vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.hero-sub {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 500;
  font-size: clamp(1rem, 2vw, 1.35rem);
  letter-spacing: 0.02em;
  text-transform: none;
  max-width: 42ch;
}

.btn-outline,
.btn-filled {
  font-family: 'Inter', system-ui, sans-serif;
  letter-spacing: 0.08em;
  border-radius: var(--radius-sm);
}

/* ─── Sections ─── */
#work {
  padding-left: 0;
  padding-right: 0;
}

#about {
  padding-left: 0;
  padding-right: 0;
}

#contact {
  padding-left: 0;
  padding-right: 0;
}

.layout-container .section-header {
  padding-left: 0;
  padding-right: 0;
}

.section-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(1.75rem, 3.2vw, 2.35rem);
  letter-spacing: -0.02em;
  text-transform: none;
}

.section-count {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}

/* ─── Work ─── */
.work-row {
  cursor: pointer;
  border-radius: var(--radius-sm);
  margin-inline: 0;
}

.work-num,
.track-num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.work-name {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  letter-spacing: -0.02em;
}

.work-desc {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
}

.tag {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.6rem;
  border-radius: 4px;
}

.preview-card {
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
}

.preview-card-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.preview-card li {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.8125rem;
  line-height: 1.55;
}

/* ─── Skill band (replaces marquee) ─── */
.skill-band {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 20px 0;
  background: var(--bg2);
}

.skill-band-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  justify-content: center;
  align-items: center;
}

.skill-pill {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 7px 12px;
  border: 1px solid var(--tag-border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

/* ─── About / terminal ─── */
.terminal-box {
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  box-shadow: var(--shadow-soft);
}

.terminal-box::before {
  content: 'Console';
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  left: auto;
  right: 20px;
  top: 16px;
  opacity: 0.4;
}

.terminal-inner {
  font-family: inherit;
}

.cap-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
}

.cap-desc {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.75rem;
}

/* ─── Contact ─── */
.contact-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 700;
}

.contact-title em {
  font-family: 'Inter', system-ui, sans-serif;
  font-style: italic;
  font-weight: 500;
}

.email-link {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 500;
}

.social-links a {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
}

/* ─── Footer ─── */
footer {
  padding: 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-block: 28px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 900px) {
  .footer-inner {
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }
}

/* ─── Music page ─── */
#model {
  padding-left: 0;
  padding-right: 0;
}

#tracks {
  padding-left: 0;
  padding-right: 0;
}

.track-row {
  cursor: default;
  border-radius: var(--radius-sm);
}

.track-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.track-desc {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.8125rem;
}

.model-links a {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.terminal-inner p,
.terminal-inner .t-muted {
  font-family: inherit;
}

@media (prefers-reduced-motion: reduce) {
  .hero-glyph {
    transition: none !important;
  }

  .scroll-dot {
    animation: none !important;
  }
}

/* ─── Free games page ─── */
.status-strip {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

#filters {
  padding-left: 0;
  padding-right: 0;
}

#status-bar {
  padding: 0;
}

.status-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: 14px;
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#games-section {
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 120px;
}

.skel-row {
  padding-left: 48px;
  padding-right: 48px;
}

.game-row {
  cursor: pointer;
  border-radius: var(--radius-sm);
  margin-inline: 0;
  padding: 28px 48px;
}

.game-row:hover {
  margin-inline: 0;
  padding-left: 48px;
  padding-right: 48px;
}

.game-name {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  letter-spacing: -0.02em;
}

.game-platform,
.game-worth,
.game-end {
  font-family: 'Inter', system-ui, sans-serif;
}

.game-meta {
  max-width: min(360px, 42vw);
}

@media (max-width: 900px) {
  .game-row,
  .game-row:hover {
    padding: 22px 24px;
  }

  .skel-row {
    padding-left: 24px;
    padding-right: 24px;
  }

  #games-section {
    padding-bottom: 80px;
  }
}
