:root {
  --paper: #efe4c8;
  --paper-deep: #e7d8b5;
  --ink: #1f1d18;
  --muted: #766c58;
  --accent: #efb62d;
  --accent-2: #d99d19;
  --line: #26231c;
  --card-dark: #24231f;
  --card-copy: #fff7e4;
  --shadow: #17150f;
  --max: 660px;
  --serif: Georgia, 'Times New Roman', Times, serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  background: linear-gradient(180deg, #f1e7cc 0%, var(--paper) 48%, #eadbb9 100%);
  overflow-x: hidden;
}

/* Paper grain only; no white glow/fog layer. */
.noise {
  position: fixed;
  inset: 0;
  z-index: 25;
  pointer-events: none;
  opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.page-shell {
  position: relative;
  z-index: 3;
  width: min(var(--max), calc(100% - 30px));
  margin: 0 auto;
  padding: 34px 0 32px;
}

.hero { text-align: center; margin-bottom: 28px; }

.mascot-shell {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  width: min(205px, 68vw);
  margin: 0 auto 17px;
  position: relative;
  perspective: 850px;
  isolation: isolate;
}
.mascot-float { position: relative; z-index: 2; animation: begFloat 5.4s ease-in-out infinite; }
.mascot-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 10px;
  transform-style: preserve-3d;
  transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  transition: transform 180ms cubic-bezier(.2,.75,.2,1), box-shadow .18s ease;
  box-shadow: 0 11px 24px rgba(47,39,24,.17);
  user-select: none;
  will-change: transform;
  background: #f4ecd9;
}
.mascot-card:hover { box-shadow: 0 14px 28px rgba(47,39,24,.22); }
.mascot-image { width: 100%; height: 100%; display: block; object-fit: cover; pointer-events: none; }
.mascot-fx { position: absolute; inset: 0; pointer-events: none; }
.mascot-blink {
  position: absolute;
  top: 45.2%;
  width: 10.7%;
  height: 6.2%;
  border-radius: 50%;
  background: #24231f;
  transform: scaleY(.02);
  opacity: 0;
}
.mascot-blink::after {
  content: '';
  position: absolute;
  left: 9%; right: 9%; top: 52%;
  height: 2px;
  border-radius: 999px;
  background: #e9dfc4;
}
.mascot-blink--left { left: 32.4%; }
.mascot-blink--right { left: 47.6%; }
.mascot-shell.is-blinking .mascot-blink { animation: begBlink 170ms ease-in-out 2 alternate; }
.mascot-shadow {
  position: absolute;
  z-index: 1;
  left: 24%; right: 24%; bottom: 13px;
  height: 12px;
  border-radius: 50%;
  background: rgba(48,40,27,.22);
  filter: blur(8px);
  animation: begShadow 5.4s ease-in-out infinite;
}
.mascot-id {
  position: relative;
  z-index: 4;
  display: inline-flex;
  margin-top: 6px;
  padding: 5px 8px;
  border: 1px solid rgba(32,31,26,.24);
  border-radius: 999px;
  background: rgba(239,228,200,.88);
  color: var(--muted);
  font: 800 7px/1 var(--mono);
  letter-spacing: .12em;
}

@keyframes begFloat {
  0%,100% { transform: translateY(0) rotate(-.18deg); }
  50% { transform: translateY(-4px) rotate(.12deg); }
}
@keyframes begShadow {
  0%,100% { transform: scaleX(.86); opacity: .5; }
  50% { transform: scaleX(.77); opacity: .32; }
}
@keyframes begBlink {
  0% { transform: scaleY(.02); opacity: 0; }
  35%,100% { transform: scaleY(1); opacity: 1; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font: 800 11px/1 var(--mono);
  letter-spacing: .18em;
}
.eyebrow-line { width: 30px; height: 5px; background: var(--accent); }

h1 {
  margin: 0;
  font: 800 clamp(50px, 6.1vw, 72px)/.93 var(--serif);
  letter-spacing: -.05em;
  text-shadow: 2px 2px 0 rgba(239,182,45,.20);
}

.hero-code {
  margin: 15px auto 0;
  max-width: 600px;
  font: 700 clamp(12px, 1.7vw, 15px)/1.45 var(--mono);
  color: #39352d;
}
.hero-meta {
  margin-top: 14px;
  color: var(--muted);
  font: 800 8px/1 var(--mono);
  letter-spacing: .16em;
}

.project-list { display: grid; gap: 9px; }
.project-card {
  --card-bg: var(--card-dark);
  min-height: 82px;
  display: grid;
  grid-template-columns: 52px 1fr 24px;
  align-items: center;
  gap: 13px;
  padding: 13px 16px;
  border: 2px solid var(--line);
  border-radius: 9px;
  background: var(--card-bg);
  color: var(--card-copy);
  text-decoration: none;
  box-shadow: 6px 6px 0 var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
  position: relative;
  overflow: hidden;
}
.project-card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 0 68%, rgba(255,255,255,.03) 68% 71%, transparent 71%);
}
.project-card:hover,
.project-card:focus-visible {
  transform: translate(-2px,-2px);
  box-shadow: 8px 8px 0 var(--shadow);
  outline: none;
}
.project-card[data-featured="true"] { --card-bg: var(--accent); color: #171611; }
.project-icon {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #302f29;
  border: 1.5px solid rgba(239,181,47,.38);
  color: var(--accent);
  font: 900 17px/1 var(--mono);
}
.project-icon span { transform: rotate(-3deg); }
.project-card[data-featured="true"] .project-icon {
  background: rgba(255,255,255,.16);
  color: #171611;
  border-color: rgba(23,22,17,.25);
}
.project-topline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.project-copy h2 { margin: 0; font: 800 clamp(17px, 2.3vw, 21px)/1.05 var(--sans); letter-spacing: -.03em; }
.project-copy > p { margin: 4px 0 5px; font-size: 12.5px; line-height: 1.25; color: #d8d0bc; font-weight: 600; }
.project-meta { color: #948e7d; font: 700 7.5px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 17px;
  border: 1px solid rgba(239,181,47,.42);
  border-radius: 999px;
  padding: 2px 6px;
  color: var(--accent);
  background: rgba(239,181,47,.06);
  font: 800 7px/1 var(--mono);
  letter-spacing: .08em;
}
.status-chip::before {
  content: '';
  width: 4px; height: 4px;
  margin-right: 4px;
  border-radius: 50%;
  background: currentColor;
}
.project-card[data-featured="true"] .project-copy > p,
.project-card[data-featured="true"] .project-meta { color: rgba(23,22,17,.70); }
.project-card[data-featured="true"] .status-chip { color: #171611; border-color: rgba(23,22,17,.28); background: rgba(255,255,255,.24); }
.project-arrow { justify-self: end; color: var(--accent); font: 900 22px/1 var(--sans); }
.project-card[data-featured="true"] .project-arrow { color: #171611; }

.footer {
  margin: 28px 0 4px;
  padding: 17px 2px 0;
  border-top: 1px dashed rgba(32,31,26,.24);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  color: var(--muted);
}
.footer-brand {
  width: 29px; height: 29px;
  border-radius: 50%;
  display: grid; place-items: center;
  border: 2px solid var(--ink);
  background: var(--accent);
  color: #171611;
  text-decoration: none;
  font: 900 8px/1 var(--mono);
}
.footer p,.footer-domain { margin: 0; font: 800 8px/1.4 var(--mono); letter-spacing: .11em; }
.footer-domain { text-align: right; }

/* Selected illustrated workshop: only the left/right art is used as the desktop backdrop.
   The center stays real HTML so links, text and responsiveness remain clean. */
@media (min-width: 1100px) {
  body::before,
  body::after {
    content: '';
    position: fixed;
    top: 0;
    bottom: 0;
    z-index: 0;
    width: clamp(430px, calc((100vw - var(--max)) / 2 + 105px), 690px);
    pointer-events: none;
    background-repeat: no-repeat;
    background-position: center top;
    background-size: cover;
    opacity: 1;
  }
  body::before {
    left: 0;
    background-image: url('./assets/lab-selected-left.webp');
    -webkit-mask-image: linear-gradient(90deg,#000 0 85%,rgba(0,0,0,.9) 89%,transparent 100%);
    mask-image: linear-gradient(90deg,#000 0 85%,rgba(0,0,0,.9) 89%,transparent 100%);
  }
  body::after {
    right: 0;
    background-image: url('./assets/lab-selected-right.webp');
    -webkit-mask-image: linear-gradient(270deg,#000 0 85%,rgba(0,0,0,.9) 89%,transparent 100%);
    mask-image: linear-gradient(270deg,#000 0 85%,rgba(0,0,0,.9) 89%,transparent 100%);
  }
}

@media (max-width: 1099px) {
  body::before, body::after { display: none !important; }
}

@media (max-width: 650px) {
  .page-shell { width: min(100% - 24px, var(--max)); padding-top: 30px; }
  .mascot-shell { width: min(300px, 86vw); margin-bottom: 20px; }
  .mascot-card { border-radius: 14px; box-shadow: 0 15px 34px rgba(40,34,22,.15); }
  .mascot-shadow { bottom: 21px; }
  .hero { margin-bottom: 31px; }
  .hero-code { max-width: 94%; }
  .project-list { gap: 14px; }
  .project-card { grid-template-columns: 62px 1fr 25px; min-height: 112px; gap: 13px; padding: 18px 16px; border-radius: 13px; box-shadow: 6px 7px 0 var(--shadow); }
  .project-card:hover { transform: none; box-shadow: 6px 7px 0 var(--shadow); }
  .project-icon { width: 58px; height: 58px; border-radius: 11px; font-size: 19px; }
  .project-copy h2 { font-size: 20px; }
  .project-copy > p { font-size: 13.5px; margin: 5px 0 7px; }
  .project-meta { font-size: 8.5px; }
  .status-chip { display: none; }
  .project-arrow { font-size: 24px; }
  .footer { grid-template-columns: auto 1fr; }
  .footer-domain { display: none; }
}

@media (hover: none), (pointer: coarse) {
  .mascot-card { transform: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
  .mascot-blink { display: none; }
}
