:root {
  color-scheme: dark;
  --bg: #07111f;
  --surface: #0f172a;
  --surface-2: #111c31;
  --text: #f8fafc;
  --muted: #cbd5e1;
  --accent: #38bdf8;
  --accent-2: #22d3ee;
  --accent-3: #f59e0b;
  --border: rgba(255, 255, 255, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, var(--bg) 0%, #0b1120 100%);
  color: var(--text);
  line-height: 1.6;
  cursor: none;
  position: relative;
  isolation: isolate;
}

header,
main,
.hero,
.section,
.hero-card,
.intro-panel,
.card,
.sketch-canvas {
  position: relative;
  z-index: 1;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

a:hover {
  color: var(--accent-2);
}

.container {
  width: min(1150px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero {
  padding: 1rem 0 4rem;
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.22), transparent 30%),
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.16), transparent 32%);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0 2rem;
  gap: 1rem;
}

.brand {
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 1.05rem;
}

.nav-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.95rem;
}

.sprite-toggle {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-radius: 999px;
  padding: 0.48rem 0.8rem;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.sprite-toggle:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.45);
}

body.sprite-disabled .cat-sprite {
  opacity: 0;
  visibility: hidden;
}

.translate-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(8, 15, 30, 0.95);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.translate-wrap span {
  color: #fef3c7;
  font-size: 0.95rem;
}

.translate-wrap select {
  border: 0;
  background: transparent;
  color: #f8fafc;
  font: inherit;
  outline: none;
  font-weight: 600;
}

.translate-wrap select option {
  color: #0f172a;
  background: #f8fafc;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
  padding: 2rem 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.79rem;
  color: var(--accent-2);
  font-weight: 700;
  margin-bottom: 0.8rem;
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin-bottom: 1rem;
}

.lead {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 700px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.3rem;
}

.btn {
  padding: 0.8rem 1.1rem;
  border-radius: 999px;
  display: inline-block;
  font-weight: 700;
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04111d;
}

.btn.secondary {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
}

.btn.tertiary {
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.14);
  color: #e0f2fe;
}

.hero-card,
.card,
.timeline-card,
.research-card,
.tool-card,
.intro-panel {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 16px 40px rgba(2, 6, 23, 0.2);
}

.hero-card {
  padding: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
}

.hero-panel-content {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.hero-panel-badge {
  display: inline-block;
  width: fit-content;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  color: #bae6fd;
  font-weight: 700;
  font-size: 0.85rem;
}

.hero-panel-content h3 {
  margin-bottom: 0;
}

.hero-panel-content p {
  margin: 0;
  color: var(--muted);
}

.intro-panel {
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.2rem;
}

.intro-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.section {
  padding: 4rem 0;
}

.section-heading {
  margin-bottom: 1.5rem;
}

.section-heading h2 {
  font-size: clamp(1.5rem, 2.5vw, 2.1rem);
  margin-bottom: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  padding: 1.25rem;
}

.card h3,
.card h4 {
  margin-bottom: 0.45rem;
}

.card p,
.card li,
.timeline-card p,
.research-card p,
.tool-card ol,
.tool-card li,
.tool-note {
  color: var(--muted);
}

.resource-group {
  margin-top: 0.9rem;
}

.resource-group ul,
.resource-list {
  padding-left: 1rem;
  margin: 0.25rem 0 0;
}

.resource-group a,
.resource-list a {
  color: var(--accent-2);
}

.mini-note {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: #93c5fd;
}

.support-panel {
  margin-top: 1rem;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(245, 158, 11, 0.12));
}

.icon {
  font-size: 1.6rem;
  margin-bottom: 0.7rem;
}

.accent-blue {
  border-color: rgba(56, 189, 248, 0.35);
}

.accent-green {
  border-color: rgba(52, 211, 153, 0.35);
}

.accent-yellow {
  border-color: rgba(245, 158, 11, 0.35);
}

.timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.timeline-card {
  padding: 1.2rem;
}

.week {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  color: var(--accent-2);
  font-weight: 700;
  font-size: 0.85rem;
}

.ideas-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.showcase-grid,
.printing-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.project-image,
.resource-image.small {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 20px;
  margin-bottom: 1rem;
}

.idea-image {
  width: 100%;
  height: 130px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 0.6rem 0;
  margin-bottom: 0.8rem;
}

.showcase-card ul,
.sketch-tips ul {
  padding-left: 1.1rem;
  margin-top: 0.75rem;
}

.sketch-panel {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 1.5rem;
  align-items: flex-start;
}

.sketch-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sketch-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.sketch-canvas {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  min-height: 460px;
  padding: 1rem;
}

#draw-area {
  width: 100%;
  height: 100%;
  min-height: 420px;
}

#draw-area canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 18px;
}

.custom-cursor {
  position: fixed;
  pointer-events: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: rgba(56, 189, 248, 0.9);
  box-shadow: 0 0 0 6px rgba(56, 189, 248, 0.15);
  transition: transform 0.14s ease, background 0.2s ease, box-shadow 0.2s ease;
  z-index: 9999;
}

body[data-section="showcase"] .custom-cursor {
  border-radius: 12px;
  width: 22px;
  height: 22px;
}

.visually-hidden-defs {
  position: absolute;
  width: 0;
  height: 0;
}

/* cat sprite */
.cat-sprite {
  position: fixed;
  left: 84vw;
  top: 34vh;
  width: 92px;
  height: 92px;
  transform: translate(-50%, -50%);
  z-index: 0;
  transition: transform 160ms linear, left 140ms ease-out, top 140ms ease-out;
  will-change: transform, left, top;
  pointer-events: none;
  filter: url(#cat-tint) drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
  opacity: 0.95;
}

.cat-walk {
  animation: cat-bob 600ms infinite linear;
}

@keyframes cat-bob {
  0% { transform: translate(-50%, -50%) translateY(0); }
  50% { transform: translate(-50%, -50%) translateY(-6px); }
  100% { transform: translate(-50%, -50%) translateY(0); }
}

body[data-section="printing"] .custom-cursor {
  border-radius: 6px;
  width: 20px;
  height: 20px;
}

body[data-section="sketch"] .custom-cursor {
  border-radius: 50%;
  width: 24px;
  height: 24px;
}

/* additional section-specific cursor styles */
body[data-section="goal"] .custom-cursor {
  background: rgba(99, 102, 241, 0.95);
  box-shadow: 0 0 0 8px rgba(99, 102, 241, 0.12);
  border-radius: 10px;
  width: 20px;
  height: 20px;
}

body[data-section="journey"] .custom-cursor {
  background: rgba(236, 72, 153, 0.95);
  box-shadow: 0 0 0 8px rgba(236, 72, 153, 0.12);
  border-radius: 4px;
  width: 22px;
  height: 22px;
}

body[data-section="ideas"] .custom-cursor {
  background: rgba(34, 197, 94, 0.95);
  box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.12);
  border-radius: 50%;
  width: 26px;
  height: 26px;
}

body[data-section="design"] .custom-cursor {
  background: rgba(245, 158, 11, 0.95);
  box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.12);
  border-radius: 14px;
  width: 20px;
  height: 20px;
}

body[data-section="research"] .custom-cursor {
  background: rgba(56, 189, 248, 0.95);
  box-shadow: 0 0 0 8px rgba(56, 189, 248, 0.12);
  border-radius: 50%;
  width: 18px;
  height: 18px;
}

body[data-section="tools"] .custom-cursor {
  background: rgba(168, 85, 247, 0.95);
  box-shadow: 0 0 0 8px rgba(168, 85, 247, 0.12);
  border-radius: 6px;
  width: 20px;
  height: 20px;
}

#particle-canvas {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9998;
}

.sketch-hud {
  margin-top: 0.8rem;
  color: var(--muted);
  display: flex;
  gap: 1.1rem;
  align-items: center;
}

.sketch-hud .score {
  background: rgba(255,255,255,0.03);
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  font-weight: 700;
}

button:hover,
a:hover {
  transform: translateY(-1px);
}

.showcase-grid,
.printing-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.showcase-card .project-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 20px;
  margin-bottom: 1rem;
}

.showcase-card h3,
.showcase-card p,
.showcase-card ul {
  margin: 0;
}

.showcase-card ul {
  padding-left: 1.1rem;
  margin-top: 0.75rem;
}

.printing-grid article {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.printing-grid .resource-list {
  margin-top: 0;
}

.research-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
}

.research-card {
  padding: 1.25rem;
}

.research-card.highlight {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(245, 158, 11, 0.12));
}

.tool-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.tool-card {
  padding: 1.25rem;
}

.code-block {
  background: #020617;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.9rem;
  margin-top: 1rem;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.copy-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  background: rgba(56, 189, 248, 0.16);
  color: var(--text);
  cursor: pointer;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  color: #e2e8f0;
}

.footer {
  padding: 2rem 0 3rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 860px) {
  .hero-grid,
  .card-grid,
  .timeline,
  .ideas-grid,
  .research-layout,
  .tool-section {
    grid-template-columns: 1fr;
  }
}
