* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --font-sans: "Geist Sans", "Geist", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
  --sidebar-width: clamp(280px, 28vw, 360px);
  --page-pad: clamp(16px, 2.5vw, 32px);
  --gap: clamp(8px, 0.8vw, 12px);
  --layout-gap: clamp(20px, 3vw, 40px);
  --content-pad: clamp(12px, 1.5vh, 20px);
  --content-pad-x: clamp(12px, 2vw, 24px);
  --sidebar-top: clamp(20px, 3vh, 36px);
  --intro-pad: clamp(26px, 3.2vh, 34px);
  --nav-name-indent: 6px;
}

html,
body {
  height: 100%;
  min-height: 100%;
  font-family: var(--font-sans);
}

body {
  overflow: hidden;
}

.wrap {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  width: 100%;
  max-width: 100vw;
  padding: var(--page-pad);
  border-radius: 0;
  font-family: var(--font-sans);
  transition: background 0.2s;
  overflow: hidden;
}

.wrap.dark {
  background: #111110;
  --text: #f0eee8;
  --muted: #888780;
  --subtle: #444441;
  --surface: #1a1a18;
  --surface2: #222220;
  --border: #2e2e2c;
  --orange: #e8601c;
  --orange-light: #f2845a;
  --orange-dim: #3d1f0d;
  --blue: #1a6ebf;
  --blue-light: #5b9fd8;
  --blue-dim: #0a2540;
  --green: #2a7d52;
  --green-light: #5bb88a;
  --green-dim: #0d2e1c;
}

.wrap.light {
  background: #f5f3ee;
  --text: #1a1a18;
  --muted: #888780;
  --subtle: #b4b2a9;
  --surface: #ffffff;
  --surface2: #eeece8;
  --border: #d3d1c7;
  --orange: #e8601c;
  --orange-light: #c04a10;
  --orange-dim: #fde8dc;
  --blue: #1a6ebf;
  --blue-light: #0c447c;
  --blue-dim: #dceaf7;
  --green: #2a7d52;
  --green-light: #1e5c3d;
  --green-dim: #dcefe4;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: var(--gap);
  flex-shrink: 0;
}

.nav-name {
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  line-height: 1.2;
  letter-spacing: -0.01em;
  padding-left: var(--nav-name-indent);
}

.nav-name .nav-accent--blue {
  color: var(--blue-light);
}

.nav-name .nav-accent--orange {
  color: var(--orange);
}

.nav-name .nav-accent--green {
  color: var(--green-light);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
}

.nav-links a {
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav-links a[data-nav="home"].active {
  color: var(--text);
}

.nav-links a[data-nav="tech"].active {
  color: var(--blue-light);
}

.nav-links a[data-nav="design"].active {
  color: var(--orange);
}

.nav-links a[data-nav="other"].active {
  color: var(--green-light);
}

.nav-links a[data-nav="cv"].active,
.nav-links a.cv-link.active {
  color: var(--orange);
}

.nav-links a[data-nav="home"]:hover {
  color: var(--text);
}

.nav-links a[data-nav="tech"]:hover {
  color: var(--blue-light);
}

.nav-links a[data-nav="design"]:hover {
  color: var(--orange);
}

.nav-links a[data-nav="other"]:hover {
  color: var(--green-light);
}

.nav-links a[data-nav="cv"]:hover,
.nav-links a.cv-link:hover {
  color: var(--orange);
}

.toggle {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  border: 0.5px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-knob {
  position: absolute;
  top: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text);
  transition: left 0.2s;
}

.wrap.dark .toggle-knob {
  left: 3px;
}

.wrap.light .toggle-knob {
  left: 21px;
}

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  column-gap: var(--layout-gap);
  row-gap: var(--gap);
  flex: 1;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  min-width: 0;
  min-height: 0;
  max-width: var(--sidebar-width);
  max-height: 100%;
  padding-top: var(--sidebar-top);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  align-self: stretch;
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  flex-shrink: 0;
  margin-top: auto;
}

@media (max-width: 720px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .sidebar {
    max-width: none;
    align-self: stretch;
  }
}

.btn-cell {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.12s, filter 0.12s;
  user-select: none;
  text-decoration: none;
  color: inherit;
  display: block;
}

.btn-cell > * {
  position: relative;
  z-index: 1;
}

.btn-shader-host {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.5s ease-out;
  pointer-events: none;
  overflow: hidden;
}

.btn-shader-host canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.action-cell.is-shader-active .btn-shader-host {
  opacity: 1;
}

.intro-cell.is-shader-active .btn-shader-host--intro {
  opacity: 0.64;
}

.intro-cell.is-shader-active .intro-title,
.intro-cell.is-shader-active .intro-body,
.intro-cell.is-shader-active .intro-name,
.intro-cell.is-shader-active .intro-accent,
.intro-cell.is-shader-active .label,
.intro-cell.is-shader-active .book-title,
.intro-cell.is-shader-active .book-author,
.intro-cell.is-shader-active .tools-note,
.intro-cell.is-shader-active .social-links span {
  text-shadow: 0 1px 10px rgba(17, 17, 16, 0.85), 0 0 18px rgba(17, 17, 16, 0.45);
}

.wrap.light .intro-cell.is-shader-active .intro-title,
.wrap.light .intro-cell.is-shader-active .intro-body,
.wrap.light .intro-cell.is-shader-active .intro-name,
.wrap.light .intro-cell.is-shader-active .intro-accent,
.wrap.light .intro-cell.is-shader-active .label,
.wrap.light .intro-cell.is-shader-active .book-title,
.wrap.light .intro-cell.is-shader-active .book-author,
.wrap.light .intro-cell.is-shader-active .tools-note,
.wrap.light .intro-cell.is-shader-active .social-links span {
  text-shadow: 0 1px 8px rgba(255, 255, 255, 0.9), 0 0 14px rgba(255, 255, 255, 0.6);
}

.btn-cell:active {
  transform: scale(0.96);
  filter: brightness(0.88);
}

.intro-cell {
  background: var(--surface);
  border: none;
  padding: var(--intro-pad);
  flex: 1 1 auto;
  min-height: clamp(320px, 46vh, 520px);
  overflow: visible;
}

.intro-copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.intro-copy-footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: -4px;
}

.label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.action-cell {
  padding: clamp(16px, 1.2vw, 20px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: clamp(92px, 12vh, 116px);
}

.tech-cell {
  background: var(--blue);
}

.design-cell {
  background: var(--orange);
}

.other-cell {
  background: var(--green);
}

.action-cell p {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
}

.action-cell p:last-child {
  text-transform: none;
  letter-spacing: normal;
  color: rgba(255, 255, 255, 0.5);
}

.main-area {
  background: transparent;
  border: none;
  border-radius: 0;
  min-height: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.page-viewport {
  width: 100%;
  min-height: 100%;
  position: relative;
}

.page-panel {
  width: 100%;
  min-height: 100%;
  padding: var(--content-pad) var(--content-pad-x);
  will-change: transform, opacity;
}

.page-content {
  padding: 0;
}

.page-panel.slide-in {
  animation: slideInFromRight 0.42s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.page-panel.slide-out {
  animation: slideOutToLeft 0.28s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideInFromRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutToLeft {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(-18%);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-panel.slide-in,
  .page-panel.slide-out {
    animation: none;
  }
}

.page-content--home {
  display: flex;
  align-items: center;
  min-height: 100%;
  padding: clamp(20px, 6vh, 64px) 0;
}

.home-now {
  max-width: 44ch;
}

.home-now-title {
  font-size: 14px;
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0.05em;
  color: var(--text);
  text-transform: lowercase;
  margin-bottom: 18px;
}

.home-now-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.home-now-list li {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  text-transform: lowercase;
}

.page-content h2 {
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.3;
}

.page-content .page-lead {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 24px;
  max-width: 52ch;
}

.page-content ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.page-content li a,
.page-content li span {
  font-size: 14px;
  color: var(--blue-light);
  text-decoration: none;
}

.page-content li a:hover {
  text-decoration: underline;
}

.intro-name {
  font-weight: 500;
  color: #ffffff;
}

.intro-body {
  font-size: 14px;
  color: #ffffff;
  line-height: 1.7;
  margin-bottom: 0;
}

.wrap.light .intro-name {
  color: var(--text);
}

.wrap.light .intro-body {
  color: var(--text);
}

.intro-body:last-child {
  margin-bottom: 0;
}

.intro-accent {
  font-weight: 500;
}

.intro-accent--tech {
  color: var(--blue-light);
}

.intro-accent--design {
  color: var(--orange);
}

.divider {
  height: 0.5px;
  background: var(--border);
  margin-bottom: 12px;
}

.intro-copy .divider-sm {
  width: 50%;
  height: 0.5px;
  margin: 0;
}

.intro-copy .social-links span {
  color: var(--blue-light);
}

.book-title {
  font-size: 12px;
  font-style: italic;
  color: var(--text);
  margin-bottom: 2px;
}

.book-author {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.book-author:last-of-type {
  margin-bottom: 12px;
}

.tools-note {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.social-links {
  display: flex;
  gap: 14px;
}

.social-links span {
  font-size: 12px;
  color: var(--blue-light);
}
