/* ===========================
   CSS Custom Properties
   =========================== */
:root {
  /* Light Theme — Blue Toned */
  --bg-primary: #f5f9ff;
  --bg-secondary: #edf5ff;
  --bg-tertiary: #dbeafe;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-glow: rgba(37, 99, 235, 0.20);
  --card-bg: #ffffff;
  --card-border: #dbeafe;
  --card-shadow: 0 4px 24px rgba(37, 99, 235, 0.08);
  --card-shadow-hover: 0 12px 40px rgba(37, 99, 235, 0.15);
  --navbar-bg: rgba(245, 249, 255, 0.92);
  --navbar-blur: blur(12px);
  --badge-bg: #dbeafe;
  --badge-text: #1d4ed8;
  --border: #dbeafe;
  --input-bg: #f0f7ff;
  --hero-gradient: linear-gradient(135deg, #f0f7ff 0%, #e0efff 50%, #f5f9ff 100%);
  --hero-glow: radial-gradient(circle, rgba(37, 99, 235, 0.12) 0%, transparent 70%);
  --section-alt-bg: #edf5ff;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 0.875rem;
  --space-lg: 1.25rem;
  --space-xl: 1.75rem;
  --space-2xl: 2.5rem;
  --space-3xl: 3.25rem;
  --space-4xl: 5rem;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Layout */
  --max-width: 1100px;
  --navbar-height: 64px;
}

/* Dark Theme — Deep Blue Atmosphere */
[data-theme="dark"] {
  --bg-primary: #050b18;
  --bg-secondary: #081225;
  --bg-tertiary: #0d1a35;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-glow: rgba(59, 130, 246, 0.30);
  --card-bg: rgba(10, 24, 48, 0.65);
  --card-border: rgba(96, 165, 250, 0.18);
  --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --card-shadow-hover: 0 12px 40px rgba(59, 130, 246, 0.18);
  --navbar-bg: rgba(5, 11, 24, 0.92);
  --badge-bg: rgba(59, 130, 246, 0.15);
  --badge-text: #60a5fa;
  --border: rgba(96, 165, 250, 0.18);
  --input-bg: #0d1a35;
  --hero-gradient: linear-gradient(135deg, #050b18 0%, #0a1530 40%, #061020 100%);
  --hero-glow: radial-gradient(circle, rgba(59, 130, 246, 0.18) 0%, transparent 70%);
  --section-alt-bg: #070e1f;
}

/* ===========================
   Reset & Base
   =========================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--navbar-height);
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: background-color var(--transition-base), color var(--transition-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[data-theme="dark"] body {
  background:
    radial-gradient(ellipse 80% 50% at 20% 15%, rgba(37, 99, 235, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 80% 25%, rgba(56, 189, 248, 0.07) 0%, transparent 50%),
    radial-gradient(ellipse 50% 50% at 50% 80%, rgba(37, 99, 235, 0.05) 0%, transparent 50%),
    #050b18;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

img {
  max-width: 100%;
  display: block;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

ul {
  list-style: none;
}

strong {
  color: var(--accent);
  font-weight: 600;
}

/* ===========================
   Container & Layout
   =========================== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.section {
  padding: var(--space-4xl) 0;
  position: relative;
}

.section:nth-child(even) {
  background-color: var(--section-alt-bg);
}

/* About section ambient glow in dark mode */
[data-theme="dark"] .about::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 700px;
  max-width: 100vw;
  height: 100%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse 100% 60% at 50% 30%, rgba(59, 130, 246, 0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

[data-theme="dark"] .section > .container {
  position: relative;
  z-index: 1;
}

.section-title {
  font-size: clamp(1.75rem, 1.5rem + 1.25vw, 2.5rem);
  font-weight: 800;
  text-align: center;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.02em;
}

/* Mono slash before section titles: echoes the hero's "/muchamad-fabian"
   voice, tying every section to the same typographic identity (R-31). */
.title-slash {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 700;
  margin-right: 0.15em;
}

/* Hand-drawn wavy stroke under section titles — anubi-style scribble
   accent that gives the headings a crafted, "studio di forme" feel. */
.title-wave {
  display: block;
  width: 120px;
  height: 12px;
  margin: var(--space-xs) auto 0;
  overflow: visible;
}

.title-wave path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: var(--space-3xl);
  font-size: clamp(0.95rem, 0.9rem + 0.25vw, 1.1rem);
}

/* ===========================
   Navbar
   =========================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  background: var(--navbar-bg);
  backdrop-filter: var(--navbar-blur);
  -webkit-backdrop-filter: var(--navbar-blur);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: background-color var(--transition-base), border-color var(--transition-base);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
  height: 100%;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
  font-family: var(--font-mono);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.nav-link {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
}

.nav-link.active {
  color: var(--accent);
  background-color: var(--badge-bg);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

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

.theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.nav-hamburger:hover {
  background-color: var(--bg-tertiary);
}

.nav-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.nav-hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-hamburger.active span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===========================
   Hero (Minimalist & Clean)
   =========================== */
.hero {
  min-height: calc(100vh - var(--navbar-height));
  display: flex;
  align-items: center;
  background: var(--hero-gradient);
  position: relative;
  overflow: hidden;
  padding-top: calc(var(--navbar-height) + var(--space-2xl));
  padding-bottom: var(--space-4xl);
}

[data-theme="dark"] .hero {
  background:
    radial-gradient(ellipse 65% 55% at 20% 25%, rgba(59, 130, 246, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 45% 40% at 75% 40%, rgba(56, 189, 248, 0.08) 0%, transparent 50%),
    linear-gradient(135deg, #050b18 0%, #081328 50%, #050b18 100%);
}

.hero-minimal-container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

/* Mascot Styles & Animations (nilbuild/page-mascot) */
.hero-mascot-wrapper {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: var(--space-md);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
  border: none;
  background: transparent;
  padding: 0;
}

.mascot-sprite-stage {
  position: relative;
  width: 140px;
  height: 140px;
  display: block;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.08));
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
}

[data-theme="dark"] .mascot-sprite-stage {
  filter: drop-shadow(0 8px 24px rgba(59, 130, 246, 0.12));
}

.hero-mascot-wrapper:hover .mascot-sprite-stage {
  transform: translateY(-3px) scale(1.03);
}

.mascot-squash-box {
  width: 100%;
  height: 100%;
  position: relative;
  transform-origin: 50% 92%;
}

.mascot-layer {
  position: absolute;
  inset: 0;
  background-size: 300% 300%;
  background-repeat: no-repeat;
  image-rendering: auto;
  pointer-events: none;
  transition: opacity 0.04s ease;
}

.mascot-directions {
  background-image: url('../assets/mascot/knight-paper-directions.png');
  background-position: 50% 50%; /* center */
  opacity: 1;
}

.mascot-reactions {
  background-image: url('../assets/mascot/knight-paper-reactions.png');
  background-position: 0% 0%; /* blink */
  opacity: 0;
}

/* Fix layer stacking / ghosting: when reacting, directions layer is completely hidden */
.hero-mascot-wrapper.is-reacting .mascot-directions {
  opacity: 0;
}

.hero-mascot-wrapper.is-reacting .mascot-reactions {
  opacity: 1;
}

/* Mascot Speech Bubble */
.mascot-speech-bubble {
  position: absolute;
  top: -12px;
  left: 95px;
  background: var(--card-bg);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-sans);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px) scale(0.9);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  white-space: nowrap;
  z-index: 10;
}

.mascot-speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 14px;
  width: 8px;
  height: 8px;
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transform: rotate(45deg);
}

.hero-mascot-wrapper:hover .mascot-speech-bubble,
.mascot-speech-bubble.active {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Minimalist Slash Heading */
.hero-minimal-content {
  max-width: 720px;
}

.hero-title-slash {
  font-size: clamp(2.4rem, 2rem + 2.8vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: baseline;
}

.slash-prefix {
  color: var(--accent);
  margin-right: 2px;
  font-weight: 700;
  opacity: 0.95;
}

[data-theme="light"] .hero-title-slash {
  color: #090d16;
}

.hero-description-minimal {
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.2rem);
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: var(--space-2xl);
  max-width: 640px;
}

/* Pill CTA Buttons */
.hero-pill-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.45rem;
  border-radius: var(--radius-full);
  font-size: 0.92rem;
  font-weight: 600;
  font-family: var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

/* Primary Pill: Sleek Obsidian in Light Mode, Clean White in Dark Mode */
.btn-pill-primary {
  background-color: #0f172a;
  color: #ffffff;
  border: 1px solid #0f172a;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.16);
}

.btn-pill-primary:hover {
  background-color: #1e293b;
  border-color: #1e293b;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.25);
  color: #ffffff;
}

[data-theme="dark"] .btn-pill-primary {
  background-color: #f8fafc;
  color: #0f172a;
  border: 1px solid #ffffff;
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .btn-pill-primary:hover {
  background-color: #ffffff;
  color: #020617;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.2);
}

/* Secondary Pill: Clean Bordered Card */
.btn-pill-secondary {
  background-color: var(--card-bg);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.btn-pill-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

/* GitHub Pill */
.btn-pill-github {
  background-color: var(--card-bg);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.btn-pill-github:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.pill-icon-github {
  transition: transform 0.2s ease;
}

.btn-pill-github:hover .pill-icon-github {
  transform: scale(1.12) rotate(-5deg);
}

/* Micro-caption */
.hero-micro-caption {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

@media (max-width: 640px) {
  .hero-pill-actions {
    gap: var(--space-sm);
  }

  .btn-pill {
    padding: 0.65rem 1.15rem;
    font-size: 0.86rem;
  }
}

/* ===========================
   About — anubi editorial collage
   =========================== */

/* Free-form canvas: big type + doodles + floating tiles. No grid, no cards.
   Everything is absolutely placed so each element can be tuned individually. */
.about-canvas {
  position: relative;
  min-height: 660px;
  margin-top: var(--space-lg);
}

/* Editorial headline, stacked in anubi's "Direzione e / Produzione Creativa"
   rhythm. Uppercase-free, huge, extra-bold, tight tracking. */
.about-headline {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  margin: 0;
  font-size: clamp(3rem, 3rem + 4.6vw, 6.6rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.045em;
  text-transform: lowercase;
  color: var(--text-primary);
  max-width: 620px;
  pointer-events: none;
}

.hl-line {
  display: block;
}

.hl-line-2 {
  position: relative;
  display: inline-block;
  margin-top: 0.08em;
}

/* Hand-drawn wave under "UI/UX" — the anubi scribble accent. */
.hl-underline {
  position: absolute;
  left: 0;
  bottom: -0.1em;
  width: 100%;
  height: 0.16em;
  overflow: visible;
}

.hl-underline path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 7;
  stroke-linecap: round;
}

/* Copy block sits in the empty space bottom-left. */
.about-copy {
  position: absolute;
  left: 0;
  bottom: 40px;
  max-width: 440px;
  z-index: 2;
}

.about-copy p {
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.68;
  margin-bottom: var(--space-md);
}

.about-copy strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* Mono stamp pills — the old tags rebuilt as labels with weak borders. */
.about-stamp-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.stamp-pill {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.9rem;
  background: var(--card-bg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: scale var(--transition-fast), rotate var(--transition-fast), border-color var(--transition-fast);
}

.stamp-pill:hover {
  scale: 1.06;
  rotate: -1deg;
  border-color: var(--accent);
}

/* Floating portrait tile — polaroid block with organic blob outline + an
   orbiting accent dot, slightly tilted like a photo taped on the canvas. */
.about-photo-collage {
  position: absolute;
  top: 6px;
  right: 3%;
  width: 300px;
  z-index: 1;
  rotate: -4deg;
  transition: rotate var(--transition-slow), scale var(--transition-slow), box-shadow var(--transition-slow);
}

.about-photo-collage:hover {
  rotate: -2deg;
  scale: 1.03;
}

.about-photo-collage:hover .about-photo-frame {
  box-shadow: 0 24px 52px rgba(15, 23, 42, 0.16);
}

/* The blob orbit + orbiting dot (shared with the Skills "core"). */
.about-orbit {
  position: absolute;
  inset: -8% -5%;
  z-index: 0;
  pointer-events: none;
}

.about-blob {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  transform: rotate(-7deg);
}

.about-blob path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
}

.about-orbit-wrapper {
  position: absolute;
  inset: 0;
  animation: aboutOrbitSpin 20s linear infinite;
}

.about-orbit-moon {
  position: absolute;
  top: -10px;
  left: 50%;
  width: 15px;
  height: 15px;
  margin-left: -7.5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
}

@keyframes aboutOrbitSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Square polaroid frame around the portrait. */
.about-photo-frame {
  position: relative;
  z-index: 1;
  padding: var(--space-md);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.10), 0 4px 12px rgba(15, 23, 42, 0.06);
}

.about-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

/* Small second tile — another piece of art floating on the canvas. */
.about-tile {
  position: absolute;
  z-index: 0;
  width: 150px;
  padding: 8px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.10);
  transition: scale var(--transition-slow), rotate var(--transition-slow);
}

.about-tile img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
}

.about-tile-card {
  bottom: 150px;
  left: 42%;
  rotate: 6deg;
}

.about-tile-card:hover {
  rotate: 4deg;
  scale: 1.05;
}

/* Hand-drawn doodles — sharp SVG strokes in the reference palette.
   Color per element; positions are scoped per canvas below. */
.doodle {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  overflow: visible;
}

.doodle path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.doodle-blue path {
  stroke: #2563eb;
  stroke-width: 3.5;
}

.doodle-yellow path {
  stroke: #eab308;
  stroke-width: 3.5;
}

.doodle-orange-scribble path {
  stroke: #f97316;
  stroke-width: 2.5;
}

.doodle-purple-star {
  color: #a855f7;
}

.doodle-purple-star path {
  fill: currentColor;
}

[data-theme="dark"] .doodle-blue path { stroke: #60a5fa; }
[data-theme="dark"] .doodle-yellow path { stroke: #facc15; }
[data-theme="dark"] .doodle-orange-scribble path { stroke: #fb923c; }
[data-theme="dark"] .doodle-purple-star { color: #c084fc; }

/* Blue loop doodle (the big Anubi curl) */
.doodle-blue-loop path {
  stroke: #2563eb;
  stroke-width: 4;
  stroke-linecap: round;
}
[data-theme="dark"] .doodle-blue-loop path { stroke: #60a5fa; }

/* ===========================
   Anubi Section Layout
   (Full-bleed, no max-width card container)
   =========================== */
.anubi-section {
  padding: 0;
  background: none;
  overflow: visible;
}

/* Remove even-section alt background for anubi sections */
.anubi-section:nth-child(even) {
  background-color: transparent;
}

.anubi-section-inner {
  position: relative;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-4xl) var(--space-xl);
}

/* Fixed navbar clearance — the top editorial words ("ui/ux.", "let's talk.")
   must not slide under the fixed navbar. Keep the anubi spacing character;
   only give the top of these canvases extra breathing room on larger screens. */
@media (min-width: 768px) {
  .anubi-section.design .anubi-section-inner,
  .anubi-section.contact .anubi-section-inner {
    padding-top: calc(var(--space-4xl) + var(--navbar-height));
  }
}

/* Anubi editorial section number label — top-left corner */
.anubi-section-label {
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: var(--space-2xl);
  user-select: none;
}

.anubi-label-index {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.6;
  letter-spacing: 0.05em;
}

.anubi-label-text {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

/* Anubi scroll hint — bottom-right of canvas */
.anubi-scroll-hint {
  position: absolute;
  bottom: 24px;
  right: var(--space-xl);
  display: flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.5;
  pointer-events: none;
}

/* About canvas doodle placements */
.about-canvas .doodle-blue-loop {
  top: 260px;
  right: 0%;
  width: 240px;
  opacity: 0.85;
}

.about-canvas .doodle-purple-star {
  top: -16px;
  right: 24%;
  width: 60px;
}

.about-canvas .doodle-star-b {
  bottom: 100px;
  left: 44%;
  width: 42px;
  opacity: 0.7;
}

.about-canvas .doodle-yellow {
  top: 60px;
  left: 42%;
  width: 160px;
}

.about-canvas .doodle-orange-scribble {
  bottom: 60px;
  right: 7%;
  width: 160px;
}

/* Skills canvas doodle placements */
.skills-canvas .doodle-star-sk {
  top: 43%;
  left: 54%;
  width: 38px;
  opacity: 0.65;
}

.skills-canvas .doodle-blue-sk {
  top: 58%;
  right: 1%;
  width: 180px;
  opacity: 0.85;
}

.skills-canvas .doodle-orange-sk {
  top: 87%;
  right: 4%;
  width: 140px;
}

.skills-canvas .doodle-yellow-sk {
  top: 28%;
  left: 52%;
  width: 140px;
}

/* Gentle idle float for doodles (per-element amplitude/duration below). */
.fl {
  animation: floatIdle var(--float-dur, 6s) ease-in-out infinite;
}

.fl-a { --float-dur: 7s;  --float-dist: -6px; animation-delay: 0s; }
.fl-b { --float-dur: 9s;  --float-dist: -9px; animation-delay: 1.2s; }
.fl-c { --float-dur: 6s;  --float-dist: -4px; animation-delay: 0.6s; }

@keyframes floatIdle {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 var(--float-dist, -6px); }
}

/* ===========================
   Skills — anubi "studio di forme"
   =========================== */

/* Freely-arranged canvas: outlined category words + scattered tech stamps.
   No grid, no cards — elements are absolutely placed "di forma" and can be
   retuned by editing the coordinates below. */
.skills-canvas {
  position: relative;
  min-height: 900px;
  margin-top: var(--space-lg);
}

/* Outlined anchor words ("frontend.", "mobile.", ...). The accent dot breaks
   the outline so each word keeps one filled color accent. */
.sk-word {
  position: absolute;
  margin: 0;
  font-size: clamp(2.6rem, 2rem + 4.5vw, 5.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  text-transform: lowercase;
  color: transparent;
  -webkit-text-stroke: 2px var(--text-primary);
  pointer-events: none;
}

.sk-dot {
  color: var(--accent);
  -webkit-text-stroke: 0 solid transparent;
}

[data-theme="dark"] .sk-word {
  -webkit-text-stroke-color: #cbd5e1;
}

/* Fallback if outlined text isn't supported: fill the words normally. */
@supports not (-webkit-text-stroke: 1px black) {
  .sk-word {
    color: var(--text-primary);
  }

  .sk-dot {
    color: var(--accent);
  }
}

.sk-frontend { top: 0; left: 2%; }
.sk-mobile   { top: 7%; right: 3%; }
.sk-design   { top: 45%; left: 7%; }
.sk-data     { top: 53%; right: 14%; }
.sk-tools    { top: 81%; left: 16%; }

/* Clusters: each group is an invisible anchor box; stamps float inside it. */
.stamp-group {
  position: absolute;
  pointer-events: none;
}

.sg-frontend { top: 8%; left: 3%; width: 640px; height: 240px; }
.sg-mobile   { top: 11%; right: 8%; width: 220px; height: 130px; }
.sg-design   { top: 54%; left: 9%; width: 320px; height: 140px; }
.sg-data     { top: 62%; right: 14%; width: 340px; height: 130px; }
.sg-tools    { top: 89%; left: 8%; width: 380px; height: 120px; }

/* Sticker-looking tech stamps (pill with icon + mono label). */
.tech-stamp {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px 7px 8px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  font-family: var(--font-mono);
  font-size: 0.71rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: scale var(--transition-fast), box-shadow var(--transition-fast);
}

.tech-stamp img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}

.tech-stamp b {
  font-weight: 600;
}

.tech-stamp:hover {
  scale: 1.12;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.14);
}

/* Per-stamp tilt + placement — edit coordinates here, not in the HTML. */
.sg-frontend .stamp-html      { top: 0; left: 60px; rotate: -4deg; }
.sg-frontend .stamp-react     { top: 8px; left: 340px; rotate: 3deg; }
.sg-frontend .stamp-js        { top: 104px; left: 280px; rotate: 5deg; }
.sg-frontend .stamp-css       { top: 150px; left: 60px; rotate: -3deg; }
.sg-frontend .stamp-tailwind  { top: 182px; left: 400px; rotate: -2deg; }
.sg-frontend .stamp-bootstrap { top: 160px; left: 220px; rotate: 4deg; }

.sg-mobile .stamp-flutter     { top: 70px; left: 20px; rotate: -3deg; }

.sg-design .stamp-figma       { top: 8px; left: 10px; rotate: -4deg; }
.sg-design .stamp-canva       { top: 84px; left: 150px; rotate: 5deg; }

.sg-data .stamp-mysql         { top: 6px; left: 6px; rotate: 3deg; }
.sg-data .stamp-sqlite        { top: 66px; left: 170px; rotate: -4deg; }

.sg-tools .stamp-docker       { top: 14px; left: 10px; rotate: -3deg; }
.sg-tools .stamp-java         { top: 22px; left: 230px; rotate: 4deg; }

/* Doodle placements inside the Skills canvas. */
.skills-canvas .doodle-purple-star:not(.doodle-star-sk) { top: 1%; right: 20%; width: 58px; }

.badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--badge-bg);
  color: var(--badge-text);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

/* ===========================
   Projects
   =========================== */
.project-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
}

.filter-btn {
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-xl);
}

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--accent);
}

.project-card.hidden {
  display: none;
}

.project-image {
  height: 200px;
  overflow: hidden;
}

.project-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.project-info {
  padding: var(--space-lg);
}

.project-meta {
  margin-bottom: var(--space-sm);
}

.project-category {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.project-name {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.project-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: var(--space-md);
  line-height: 1.6;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.project-links {
  display: flex;
  gap: var(--space-md);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.project-link:hover {
  color: var(--accent);
}

/* ===========================
   Design Showcase
   =========================== */
.design-showcase {
  display: flex;
  justify-content: center;
}

.design-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  padding: var(--space-4xl) var(--space-xl);
  background: var(--card-bg);
  border: 2px dashed var(--card-border);
  border-radius: var(--radius-xl);
  text-align: center;
  max-width: 600px;
  width: 100%;
  color: var(--text-muted);
}

.design-placeholder h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.design-placeholder p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ===========================
   Education
   =========================== */
.education-card {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  box-shadow: var(--card-shadow);
  max-width: 700px;
  margin: 0 auto;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.education-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--accent);
}

.education-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  background: var(--badge-bg);
  border-radius: var(--radius-lg);
  color: var(--accent);
  flex-shrink: 0;
}

.education-info h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.education-program {
  color: var(--accent);
  font-weight: 500;
  margin-bottom: var(--space-xs);
}

.education-period {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===========================
   Contact
   =========================== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  max-width: 800px;
  margin: 0 auto;
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-2xl) var(--space-lg);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--card-shadow);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.contact-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--accent);
}

.contact-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--badge-bg);
  border-radius: var(--radius-md);
  color: var(--accent);
}

.contact-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.contact-value {
  color: var(--text-muted);
  font-size: 0.85rem;
  word-break: break-all;
}

/* ===========================
   Footer
   =========================== */
.footer {
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
  position: relative;
}

[data-theme="dark"] .footer {
  background:
    radial-gradient(ellipse 60% 100% at 50% 100%, rgba(37, 99, 235, 0.06) 0%, transparent 60%),
    #050b18;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  text-align: center;
}

.footer-name {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-socials {
  display: flex;
  gap: var(--space-md);
}

.footer-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.footer-socials a:hover {
  color: var(--accent);
  background: var(--badge-bg);
}

/* ===========================
   Scroll Reveal
   =========================== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Visually hidden — accessible text-only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ===========================
   Focus States (Accessibility)
   =========================== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===========================
   Reduced Motion
   =========================== */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }

  .hero-card {
    animation: none;
  }

  /* Stop all decorative motion for reduced-motion users. */
  .about-orbit-wrapper {
    animation: none;
  }

  .fl {
    animation: none;
  }
}

/* ===========================
   Responsive — Tablet
   =========================== */
@media (max-width: 991px) {
  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-2xl);
  }

  .hero-description {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-cta {
    justify-content: center;
  }

  .hero-card {
    width: 230px;
    height: 460px;
  }

  /* About collage — rescope for a narrower canvas. */
  .about-headline {
    font-size: clamp(2.6rem, 2.4rem + 3.8vw, 4.6rem);
    max-width: 480px;
  }

  .about-photo-collage {
    width: 250px;
    right: 1%;
  }

  .about-tile-card {
    bottom: 130px;
    left: 38%;
  }

  /* Skills collage — pull clusters inward so nothing crowds the edges. */
  .skills-canvas {
    min-height: 920px;
  }

  .sg-frontend {
    left: 2%;
    width: 560px;
  }

  .sg-data {
    left: auto;
    right: 14%;
  }

  .sk-tools {
    left: 22%;
  }

  .sk-data {
    right: 14%;
  }

  .contact-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===========================
   Responsive — Mobile
   =========================== */
@media (max-width: 767px) {
  :root {
    --navbar-height: 56px;
  }

  .container {
    padding: 0 var(--space-md);
  }

  .section {
    padding: var(--space-2xl) 0;
  }

  /* Larger touch targets for the fixed navbar controls */
  .theme-toggle,
  .nav-hamburger {
    width: 44px;
    height: 44px;
  }

  /* Remove the tap-flash highlight on touch screens */
  body,
  a,
  button,
  .btn,
  .filter-btn,
  .nav-link,
  .contact-card {
    -webkit-tap-highlight-color: transparent;
  }

  /* Mobile Nav — dropdown that slides in below the navbar.
     max-height + overflow-y keep it inside the viewport on short screens. */
  .nav-menu {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    max-height: calc(100vh - var(--navbar-height) - var(--space-md));
    overflow-y: auto;
    background: var(--navbar-bg);
    backdrop-filter: var(--navbar-blur);
    -webkit-backdrop-filter: var(--navbar-blur);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: var(--space-sm);
    gap: var(--space-xs);
    transform: translateY(-108%);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--transition-base), opacity var(--transition-base);
  }

  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .nav-link {
    width: 100%;
    text-align: center;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm) var(--space-md);
    font-size: 1rem;
  }

  .nav-link:active {
    background-color: var(--bg-tertiary);
    color: var(--accent);
  }

  .nav-hamburger {
    display: flex;
  }

  /* Hero */
  .hero {
    min-height: auto;
    padding: calc(var(--navbar-height) + var(--space-xl)) 0 var(--space-xl);
  }

  /* Show the hero photo on mobile too, centered below the text, sized to
     fit small screens without overwhelming the viewport. */
  .hero-visual {
    display: flex;
    justify-content: center;
    margin-top: var(--space-xl);
  }

  .hero-card {
    width: 150px;
    height: 300px;
  }

  /* Fluid, mobile-friendly hero typography */
  .hero-greeting {
    font-size: clamp(0.9rem, 3vw, 1rem);
  }

  .hero-name {
    font-size: clamp(1.85rem, 8.5vw, 2.7rem);
    letter-spacing: -0.02em;
  }

  .hero-headline {
    font-size: clamp(1.1rem, 4.6vw, 1.5rem);
  }

  .hero-description {
    font-size: clamp(0.95rem, 3.6vw, 1.05rem);
    max-width: 34ch;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
  }

  .btn {
    width: 100%;
    max-width: 300px;
    min-height: 48px;
    justify-content: center;
    padding: 0.9rem 1.5rem;
  }

  .btn:active {
    transform: translateY(0) scale(0.98);
  }

  /* About & Skills collage — reflow for phones: the kinetic canvas becomes
     a stacked composition, the portrait stays the focal point, stamps wrap,
     doodles and the second tile are dropped. */

  .anubi-section-inner {
    padding: var(--space-2xl) var(--space-md);
  }

  .anubi-section-label {
    margin-bottom: var(--space-lg);
  }

  .anubi-scroll-hint {
    display: none;
  }

  .about-canvas {
    min-height: 0;
    margin-top: var(--space-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-xl);
  }

  .about-canvas .doodle,
  .skills-canvas .doodle {
    display: none;
  }

  .about-headline {
    position: static;
    order: 1;
    text-align: center;
    font-size: clamp(2.7rem, 11vw, 4rem);
  }

  .about-photo-collage {
    position: static;
    order: 2;
    width: min(300px, 76vw);
    rotate: -3deg;
  }

  .about-copy {
    position: static;
    order: 3;
    max-width: 540px;
  }

  .about-stamp-row {
    justify-content: center;
  }

  .about-tile-card {
    display: none;
  }

  /* Skills: words and stamp clusters stack and wrap — no grid. */
  .skills-canvas {
    min-height: 0;
    margin-top: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-2xl);
  }

  .sk-word {
    position: static;
    text-align: center;
  }

  .stamp-group {
    position: static;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    width: auto !important;
    height: auto !important;
  }

  .tech-stamp {
    position: static;
  }

  /* Skills: hide the freestanding outlines (they stack before every stamp
     cluster on phones) and give each cluster its own small heading instead. */
  .skills-canvas > .sk-word {
    display: none;
  }

  .stamp-group::before {
    content: '';
    font-family: var(--font-mono);
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    text-transform: lowercase;
    color: transparent;
    -webkit-text-stroke: 1.5px var(--text-primary);
    width: 100%;
    text-align: center;
    margin-bottom: 4px;
  }

  .sg-frontend::before { content: 'frontend.'; }
  .sg-mobile::before { content: 'mobile.'; }
  .sg-design::before { content: 'design.'; }
  .sg-data::before { content: 'data.'; }
  .sg-tools::before { content: 'tools.'; }

  /* Projects */
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .filter-btn {
    min-height: 44px;
    padding: 0.6rem 1.25rem;
  }

  .filter-btn:active {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
  }

  .project-info {
    padding: var(--space-lg);
  }

  .project-links {
    flex-wrap: wrap;
    gap: var(--space-md);
  }

  .project-link {
    min-height: 44px;
    padding: 0.5rem 0;
  }

  .project-link:active {
    color: var(--accent);
  }

  /* Contact */
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .contact-card {
    padding: var(--space-xl) var(--space-lg);
  }

  .contact-card:active {
    transform: translateY(0) scale(0.98);
  }

  /* Education */
  .education-card {
    flex-direction: column;
    text-align: center;
    padding: var(--space-xl);
  }

  /* Footer — comfortable touch targets & breathing room */
  .footer {
    padding: var(--space-2xl) 0 var(--space-xl);
  }

  .footer-socials {
    gap: var(--space-md);
  }

  .footer-socials a {
    width: 44px;
    height: 44px;
  }
}

/* ===========================
   Responsive — Small Mobile
   =========================== */
@media (max-width: 480px) {
  .hero-name {
    font-size: clamp(1.7rem, 9vw, 2.2rem);
  }

  .section-title {
    font-size: clamp(1.45rem, 6vw, 1.6rem);
  }

  .hero-description {
    max-width: 30ch;
  }

  /* Collage fine-tuning for very small screens. */
  .about-headline {
    font-size: clamp(2.3rem, 10.5vw, 3.2rem);
  }

  .about-copy p {
    font-size: 0.9rem;
  }

  .tech-stamp {
    gap: 6px;
    padding: 6px 11px 6px 7px;
    font-size: 0.66rem;
  }

  .tech-stamp img {
    width: 20px;
    height: 20px;
  }
}

/* ==========================================================================
   04 · Projects — anubi "quaderno" canvas
   ========================================================================== */
.projects-canvas {
  position: relative;
  min-height: 760px;
  margin-top: var(--space-lg);
}

.sk-works {
  top: 0;
  left: 3%;
}

.projects-canvas .project-filters {
  position: absolute;
  top: 27%;
  left: 4%;
  justify-content: flex-start;
  margin: 0;
  z-index: 3;
}

/* Filter pills → mono "stamp" vocabulary */
.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: lowercase;
  letter-spacing: 0.06em;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  color: var(--text-secondary);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
  transition: color var(--transition-slow), background var(--transition-slow),
    border-color var(--transition-slow), scale var(--transition-slow);
}

.filter-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  scale: 1.04;
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

/* Polaroid project tiles */
.project-tile {
  position: absolute;
  width: 260px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
  padding: var(--space-sm) var(--space-sm) var(--space-md);
  transition: rotate var(--transition-slow), scale var(--transition-slow),
    box-shadow var(--transition-slow);
}

.project-tile:hover {
  scale: 1.05;
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.16);
}

.project-tile.hidden {
  display: none;
}

.pj-web {
  top: 6%;
  right: 7%;
  rotate: -3deg;
}

.pj-mobile {
  top: 31%;
  right: 32%;
  rotate: 4deg;
}

.pj-desktop {
  top: 42%;
  left: 4%;
  rotate: -4deg;
}

.project-tile-frame {
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px dashed var(--card-border);
}

.project-tile-preview {
  aspect-ratio: 4 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: lowercase;
  letter-spacing: 0.1em;
}

.project-tile-info {
  padding: var(--space-md) var(--space-sm) 0;
  text-align: left;
}

.project-tile-cat {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: lowercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.project-tile-info h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 4px 0;
  color: var(--text-primary);
}

.project-tile-info p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: var(--space-sm);
}

.project-tile-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Projects doodles */
.projects-canvas .doodle-purple-star {
  top: -10px;
  right: 22%;
  width: 56px;
}

.projects-canvas .doodle-blue-pj {
  top: 18%;
  right: 2%;
  width: 170px;
  opacity: 0.85;
}

.projects-canvas .doodle-orange-pj {
  bottom: 8%;
  right: 12%;
  width: 120px;
}

/* ==========================================================================
   05 · Design — anubi "moodboard" canvas
   ========================================================================== */
.design-canvas {
  position: relative;
  min-height: 780px;
  margin-top: var(--space-lg);
}

.ds-uiux {
  top: 0;
  left: 3%;
}

.ds-interface {
  top: 40%;
  right: 2%;
}

.ds-prototype {
  top: 84%;
  left: 6%;
}

.design-tile {
  position: absolute;
  width: 240px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: var(--space-sm);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
  transition: rotate var(--transition-slow), scale var(--transition-slow),
    box-shadow var(--transition-slow);
}

.design-tile:hover {
  scale: 1.05;
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.16);
}

.design-tile-frame {
  aspect-ratio: 4 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  background: var(--bg-secondary);
  border: 1px dashed var(--card-border);
  border-radius: 8px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: lowercase;
  letter-spacing: 0.1em;
}

.design-tile figcaption {
  display: flex;
  gap: 6px;
  padding: var(--space-sm) 0 0;
  justify-content: center;
}

.dt-1 {
  top: 6%;
  right: 6%;
  rotate: -4deg;
}

.dt-2 {
  top: 36%;
  left: 15%;
  rotate: 5deg;
}

.dt-3 {
  top: 54%;
  right: 30%;
  rotate: -3deg;
}

.design-canvas .doodle-purple-star {
  top: 38%;
  left: 6%;
  width: 54px;
}

.design-canvas .doodle-blue-ds {
  bottom: 3%;
  right: 8%;
  width: 150px;
  opacity: 0.85;
}

.design-canvas .doodle-yellow-ds {
  top: 2%;
  right: 30%;
  width: 90px;
}

/* ==========================================================================
   06 · Education — anubi "diary" tile
   ========================================================================== */
.education-canvas {
  position: relative;
  min-height: 540px;
  margin-top: var(--space-lg);
}

.edu-word {
  top: 0;
  left: 3%;
}

.edu-tile {
  position: absolute;
  top: 22%;
  right: 12%;
  width: 360px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  rotate: -2deg;
  transition: rotate var(--transition-slow), scale var(--transition-slow),
    box-shadow var(--transition-slow);
}

.edu-tile:hover {
  rotate: 0deg;
  scale: 1.02;
  box-shadow: 0 24px 52px rgba(15, 23, 42, 0.16);
}

.edu-tile-body {
  padding: var(--space-2xl) var(--space-xl);
}

.edu-cap {
  color: var(--accent);
  margin-bottom: var(--space-md);
}

.edu-institution {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.edu-accent {
  color: var(--accent);
}

.edu-program {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
}

.edu-period {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.education-canvas .doodle-purple-star {
  top: -12px;
  right: 26%;
  width: 50px;
}

.education-canvas .doodle-orange-ed {
  bottom: 12%;
  left: 18%;
  width: 120px;
}

.education-canvas .doodle-yellow-ed {
  top: 16%;
  left: 44%;
  width: 90px;
}

/* ==========================================================================
   07 · Contact — anubi "big hello" stamp pills
   ========================================================================== */
.contact-canvas {
  position: relative;
  min-height: 780px;
  margin-top: var(--space-lg);
}

.ct-word {
  top: 0;
  left: 3%;
}

.contact-pill {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  color: var(--text-primary);
  transition: scale var(--transition-slow), border-color var(--transition-slow),
    box-shadow var(--transition-slow);
}

.contact-pill:hover {
  scale: 1.04;
  border-color: var(--accent);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.14);
}

.contact-pill svg {
  color: var(--accent);
  flex-shrink: 0;
}

.cp-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: lowercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.cp-email {
  top: 14%;
  left: 4%;
  rotate: -2deg;
}

.cp-github {
  top: 28%;
  left: 20%;
  rotate: 1.5deg;
}

.cp-linkedin {
  top: 42%;
  left: 7%;
  rotate: -1.5deg;
}

.cp-instagram {
  top: 54%;
  left: 15%;
  rotate: 2deg;
}

.cp-threads {
  top: 68%;
  left: 5%;
  rotate: -1deg;
}

.contact-canvas .doodle-blue-ct {
  top: 8%;
  right: 6%;
  width: 160px;
  opacity: 0.85;
}

.contact-canvas .doodle-purple-star {
  top: 52%;
  left: 36%;
  width: 54px;
}

.contact-canvas .doodle-yellow-ct {
  bottom: 18%;
  right: 10%;
  width: 90px;
}

.contact-canvas .request-card {
  position: absolute;
  top: 22%;
  right: 5%;
  width: 300px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: 14px;
  rotate: 1.5deg;
  transition: rotate var(--transition-slow);
}

.contact-canvas .request-card:hover {
  rotate: 0deg;
}

.request-card-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  color: var(--text-muted);
}

.request-card label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.request-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: lowercase;
  color: var(--text-secondary);
}

.request-card input,
.request-card textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px dashed var(--card-border);
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
  transition: border-color var(--transition-slow);
}

.request-card input::placeholder,
.request-card textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.75;
}

.request-card input:focus,
.request-card textarea:focus {
  border-color: var(--accent);
  border-style: solid;
}

.request-card textarea {
  resize: vertical;
  min-height: 72px;
}

.request-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  padding: 10px 14px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--accent);
  border: 1px solid var(--accent);
  cursor: pointer;
  transition: scale var(--transition-slow), filter var(--transition-slow);
}

.request-btn:hover {
  scale: 1.03;
  filter: brightness(1.08);
}

/* ==========================================================================
   Cursor trail — anubi "pen trace" canvas
   ========================================================================== */
#cursor-trail {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: multiply;
}

[data-theme='dark'] #cursor-trail {
  mix-blend-mode: screen;
}

/* ==========================================================================
   Responsive: anubi canvases (04–07)
   ========================================================================== */
@media (max-width: 991px) {
  .project-tile {
    width: 230px;
  }

  .design-tile {
    width: 220px;
  }

  .pj-mobile {
    right: 30%;
  }

  .pj-desktop {
    left: 3%;
  }

  .edu-tile {
    right: 8%;
    width: 330px;
  }
}

@media (max-width: 767px) {
  .projects-canvas,
  .design-canvas,
  .education-canvas,
  .contact-canvas {
    min-height: 0;
    margin-top: var(--space-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-xl);
  }

  .projects-canvas .doodle,
  .design-canvas .doodle,
  .education-canvas .doodle,
  .contact-canvas .doodle {
    display: none;
  }

  .projects-canvas .project-filters {
    position: static;
    justify-content: center;
    margin-bottom: var(--space-lg);
  }

  .project-tile,
  .design-tile,
  .edu-tile,
  .contact-pill {
    position: static;
    rotate: none;
  }

  .project-tile {
    width: min(320px, 86vw);
  }

  .design-tile {
    width: min(300px, 84vw);
  }

  .edu-tile {
    width: min(360px, 88vw);
  }

  .contact-pill {
    justify-content: center;
    padding: 12px 18px;
  }

  .contact-canvas .request-card {
    position: static;
    rotate: none;
    width: min(360px, 90vw);
  }

  .project-tile-info,
  .project-tile-tech {
    text-align: left;
  }

  .project-tile-tech {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .cp-value {
    font-size: 0.82rem;
  }

  .project-tile-info h3 {
    font-size: 0.95rem;
  }
}
