/* ==========================================================================
   Plumber — Code Hygiene & Slop Inspector Design System
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Warm Ivory Palette (Light Mode Default) */
  --bg: #F4F3EF;
  --dot: #D6D4CD;
  --fg: #111111;
  --muted: #858585;
  --faint: #A8A7A2;
  --border: #C9C8C3;
  --border-light: #E0DFDA;
  --surface: #FFFFFF;
  --surface-alt: #F8F7F3;
  --titlebar: #E8E7E2;
  --titlebar-border: #D3D2CC;
  /* Accent & Highlight Colors */
  --accent-red: #C83B3B;
  --accent-blue: #2E5AAC;
  --accent-green: #2B7A4B;
  --accent-orange: #C06014;
  --surface-plain: #F4F3EF;

  /* Tactile Shadows */
  --shadow-window: 0 10px 30px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04), 0 0 0 1px var(--border);
  --shadow-card: 0 3px 10px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-btn: 0 1px 2px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --shadow-btn-pressed: inset 0 1px 3px rgba(0, 0, 0, 0.15);
  --shadow-input: inset 0 1px 3px rgba(0, 0, 0, 0.07), 0 1px 0 rgba(255, 255, 255, 0.8);

  /* Fonts (Inter Modern Neo-Grotesque) */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, "Courier New", monospace;
}

[data-theme="dark"] {
  /* Dark Desktop Theme */
  --bg: #1A1A1C;
  --dot: #2D2D31;
  --fg: #EDEDED;
  --muted: #9E9E9E;
  --faint: #606064;
  --border: #3A3A3E;
  --border-light: #2C2C30;
  --surface: #222226;
  --surface-alt: #1E1E22;
  --titlebar: #2B2B30;
  --titlebar-border: #38383D;

  --accent-red: #EF5350;
  --accent-blue: #42A5F5;
  --accent-green: #66BB6A;
  --accent-orange: #FFA726;

  --shadow-window: 0 12px 36px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--border);
  --shadow-card: 0 3px 10px rgba(0, 0, 0, 0.25);
  --shadow-btn: 0 1px 2px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --shadow-btn-pressed: inset 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-input: inset 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.05);
  --surface-plain: #1A1A1C;
}

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

html {
  zoom: 1.25;
}

@media (max-width: 680px) {
  html {
    zoom: 1;
  }
}

html, body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

[data-theme="dark"] body {
  background-color: #070b14;
  background-image: url("/night_sky_bg_v2.jpg");
  background-image:
    image-set(
      url("/night_sky_bg_v2.webp") type("image/webp"),
      url("/night_sky_bg_v2.jpg") type("image/jpeg")
    );
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

@media (max-width: 768px) {
  [data-theme="dark"] body {
    background-attachment: scroll;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(244, 243, 239, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .site-nav {
  background-color: rgba(11, 18, 32, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Mobile Navigation Toggle Button */
.mobile-nav-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 36px;
  height: 34px;
  box-shadow: var(--shadow-btn);
  transition: all 0.15s ease;
}

.mobile-nav-toggle:hover {
  background: var(--surface-alt);
  border-color: var(--fg);
}

.hamburger-bar {
  display: block;
  width: 18px;
  height: 2px;
  background-color: var(--fg);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Transform hamburger to X when open */
.mobile-nav-toggle[aria-expanded="true"] .hamburger-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.mobile-nav-toggle[aria-expanded="true"] .hamburger-bar:nth-child(2) {
  opacity: 0;
}
.mobile-nav-toggle[aria-expanded="true"] .hamburger-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
  color: var(--muted);
}

.nav-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--muted);
  transition: color 0.15s ease;
  cursor: pointer;
}

.nav-link:hover {
  color: var(--fg);
}

/* Utility Button */
.btn-utility {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-mono);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg);
  box-shadow: var(--shadow-btn);
  cursor: pointer;
  transition: all 0.1s ease;
}

.btn-utility:hover {
  background: var(--surface-alt);
  border-color: var(--faint);
}

.btn-utility:active {
  box-shadow: var(--shadow-btn-pressed);
  transform: translateY(1px);
}

/* ==========================================================================
   Hero Stage
   ========================================================================== */

/* ==========================================================================
   Hero Stage (Main Page - Dotted Canvas, Full Viewport)
   ========================================================================== */

.hero-stage {
  position: relative;
  min-height: calc(100vh - 48px);
  min-height: calc(100dvh - 48px);
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.2px);
  background-size: 20px 20px;
  padding: 30px 0 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;
}

[data-theme="dark"] .hero-stage {
  background-color: #070b14;
  background-image: url("/night_sky_bg_v2.jpg");
  background-image:
    image-set(
      url("/night_sky_bg_v2.webp") type("image/webp"),
      url("/night_sky_bg_v2.jpg") type("image/jpeg")
    );
  background-size: cover;
  background-position: center top;
}

.hero-center {
  position: relative;
  z-index: 10;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
  transform: translateY(-32px);
}

.hero-title {
  font-family: var(--font-sans);
  font-size: clamp(38px, 6.2vw, 64px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.05;
  color: var(--fg);
  margin-bottom: 26px;
  text-transform: lowercase;
}

[data-theme="dark"] .hero-title {
  color: #ffffff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7), 0 1px 3px rgba(0, 0, 0, 0.5);
}

.hero-desc {
  display: none;
}

/* Desktop Repo Input Box */
.repo-form-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9999px;
  box-shadow: var(--shadow-input);
  padding: 4px 5px 4px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

[data-theme="dark"] .repo-form-box {
  background: rgba(22, 22, 28, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), var(--shadow-input);
}

.repo-form-box:focus-within {
  border-color: #2b59c3;
  box-shadow: 0 0 0 3px rgba(43, 89, 195, 0.15), var(--shadow-input);
}

.github-svg {
  width: 18px;
  height: 18px;
  fill: var(--muted);
  flex-shrink: 0;
}

.repo-input-field {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 6px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--fg);
  outline: none;
}

[data-theme="dark"] .repo-input-field {
  color: #ffffff;
}

.repo-input-field::placeholder {
  color: var(--faint);
  font-family: var(--font-sans);
}

/* ==========================================================================
   Aqua & Pearl Glossy Capsule Buttons (Reference: Pill Aesthetic)
   ========================================================================== */

/* Aqua Glossy Blue Button (Inspect Repo) */
.btn-inspect {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 9999px;
  padding: 8px 24px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: var(--font-sans);
  color: #000000;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
  border: 1px solid #1c4fb8;
  background: linear-gradient(
    180deg,
    #7bbcfb 0%,
    #4ea4fd 48%,
    #1b80f8 50%,
    #469bfd 75%,
    #82c6fe 100%
  );
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.18),
    inset 0 1px 0.5px rgba(255, 255, 255, 0.95),
    inset 0 -1px 1px rgba(255, 255, 255, 0.55);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: filter 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn-inspect::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 3px;
  right: 3px;
  height: 48%;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.96) 0%,
    rgba(255, 255, 255, 0.45) 80%,
    rgba(255, 255, 255, 0.08) 100%
  );
  border-radius: 9999px 9999px 40% 40% / 9999px 9999px 25% 25%;
  pointer-events: none;
  z-index: 1;
}

.btn-inspect > * {
  position: relative;
  z-index: 2;
}

.btn-inspect-icon {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex-shrink: 0;
}

.btn-inspect:hover {
  filter: brightness(1.06);
  box-shadow:
    0 2px 7px rgba(28, 79, 184, 0.38),
    inset 0 1px 0.5px rgba(255, 255, 255, 1),
    inset 0 -1px 1px rgba(255, 255, 255, 0.65);
}

.btn-inspect:active {
  transform: translateY(1px);
  background: linear-gradient(
    180deg,
    #5aa4fc 0%,
    #2985f5 48%,
    #1472e0 50%,
    #3086f0 75%,
    #5aa6fc 100%
  );
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.28),
    0 1px 1px rgba(0, 0, 0, 0.1);
}

.btn-inspect:disabled {
  filter: grayscale(0.2) opacity(0.75);
  cursor: wait;
}

/* Pearl Glossy Pill Chips (Matching Screenshot Pair) */
.samples-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}

[data-theme="dark"] .samples-row span {
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.sample-chip {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(
    180deg,
    #ffffff 0%,
    #efefef 48%,
    #dedede 50%,
    #eaeaea 75%,
    #f8f8f8 100%
  );
  border: 1px solid #9c9c9f;
  border-radius: 9999px;
  padding: 4px 13px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: #000000;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.1),
    inset 0 1px 0.5px rgba(255, 255, 255, 0.95),
    inset 0 -1px 1px rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.12s ease;
}

.sample-chip::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 2px;
  right: 2px;
  height: 48%;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 255, 255, 0.5) 85%,
    rgba(255, 255, 255, 0.1) 100%
  );
  border-radius: 9999px 9999px 40% 40% / 9999px 9999px 25% 25%;
  pointer-events: none;
  z-index: 1;
}

.sample-chip > * {
  position: relative;
  z-index: 2;
}

.sample-chip:hover {
  filter: brightness(1.03);
  border-color: #6c6c70;
  box-shadow:
    0 2px 5px rgba(0, 0, 0, 0.15),
    inset 0 1px 0.5px #ffffff,
    inset 0 -1px 1px #ffffff;
}

.sample-chip:active {
  transform: translateY(1px);
  background: linear-gradient(
    180deg,
    #dfdfdf 0%,
    #cccccc 48%,
    #bebebe 50%,
    #cecece 75%,
    #dfdfdf 100%
  );
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Dark Theme Adjustments for Capsule Buttons */
[data-theme="dark"] .sample-chip {
  background: linear-gradient(
    180deg,
    #38383c 0%,
    #2b2b2f 48%,
    #202024 50%,
    #28282c 75%,
    #333337 100%
  );
  border-color: #505056;
  color: #ededed;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.35),
    inset 0 1px 0.5px rgba(255, 255, 255, 0.2),
    inset 0 -1px 1px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .sample-chip::before {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.22) 0%,
    rgba(255, 255, 255, 0.08) 85%,
    rgba(255, 255, 255, 0) 100%
  );
}

[data-theme="dark"] .btn-inspect {
  border-color: #1a429a;
  box-shadow:
    0 2px 8px rgba(27, 128, 248, 0.3),
    inset 0 1px 0.5px rgba(255, 255, 255, 0.95),
    inset 0 -1px 1px rgba(255, 255, 255, 0.55);
}

/* Status Ticker */
.status-ticker-area {
  margin-top: 20px;
  min-height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Status & Error Feedback Components */
.status-pill,
.retro-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: var(--shadow-card);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg);
  max-width: 100%;
}

.spinner,
.retro-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid var(--border);
  border-top-color: var(--fg);
  border-radius: 50%;
  animation: spinner-spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spinner-spin {
  to { transform: rotate(360deg); }
}
@keyframes retro-spin {
  to { transform: rotate(360deg); }
}

.error-pill,
.retro-error-pill {
  padding: 8px 14px;
  background: rgba(200, 59, 59, 0.08);
  border: 1px solid var(--accent-red);
  border-radius: 4px;
  color: var(--accent-red);
  font-size: 12px;
  font-family: var(--font-mono);
  max-width: 100%;
}

/* ==========================================================================
   Pure Square Background GIFs (No layout/chrome behind)
   ========================================================================== */

/* Media Picture Wrapper (Zero Layout Box) */
picture.media-frame {
  display: contents;
}

.bg-square-gif {
  width: 74px;
  height: 74px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-btn);
  background: var(--surface);
  display: block;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  will-change: transform;
  pointer-events: auto;
  user-select: none;
}

.bg-square-gif:hover {
  transform: scale(1.1) !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--fg);
  z-index: 25 !important;
}

/* Inline & Modal GIFs - Pure Square Only (No layout behind) */
.inline-gif {
  width: 28px;
  height: 28px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-btn);
  vertical-align: middle;
}

.modal-gif {
  width: 64px;
  height: 64px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  margin-bottom: 14px;
}

.ticker-gif {
  width: 24px;
  height: 24px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
  margin-right: 8px;
  vertical-align: middle;
}

/* Background Positioning on Desktop (Organically Scattered Across Hero Blank Spaces) */
@media (min-width: 960px) {
  .bg-gifs-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
  }

  .bg-square-gif {
    position: absolute;
    width: 76px;
    height: 76px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
  }

  /* 1. Top-Left Blank Space (Far corner) */
  .bg-gif-1 {
    top: 9%;
    left: 4.5%;
    transform: rotate(-6deg);
  }

  /* 2. Upper-Mid-Left Blank Space (High in the open sky above/flanking title) */
  .bg-gif-5 {
    top: 13%;
    left: 20%;
    transform: rotate(4.5deg);
  }

  /* 3. Mid-Far-Left Blank Space (Outer flank) */
  .bg-gif-3 {
    top: 48%;
    left: 4%;
    transform: rotate(-3deg);
  }

  /* 4. Lower-Left Blank Space (Well above bottom fold) */
  .bg-gif-7 {
    top: 70%;
    left: 14%;
    transform: rotate(5deg);
  }

  /* 5. Top-Right Blank Space (Far corner) */
  .bg-gif-2 {
    top: 9%;
    right: 4.5%;
    transform: rotate(5.5deg);
  }

  /* 6. Upper-Mid-Right Blank Space (High in the open sky above/flanking title) */
  .bg-gif-6 {
    top: 13%;
    right: 20%;
    transform: rotate(-4.5deg);
  }

  /* 7. Mid-Far-Right Blank Space (Outer flank) */
  .bg-gif-4 {
    top: 48%;
    right: 4%;
    transform: rotate(3deg);
  }

  /* 8. Lower-Right Blank Space (Well above bottom fold) */
  .bg-gif-8 {
    top: 70%;
    right: 14%;
    transform: rotate(-5deg);
  }
}

/* Tablet / Medium Screens: Place below the hero center in a clean row */
@media (min-width: 769px) and (max-width: 959px) {
  .hero-center {
    transform: none;
  }

  .bg-gifs-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    max-width: 440px;
  }

  .bg-square-gif {
    position: relative;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 64px;
    height: 64px;
    transform: none !important;
  }

  .bg-gif-7, .bg-gif-8 {
    display: none;
  }
}

/* Mobile Screens: Completely remove all GIFs when on mobile */
@media (max-width: 768px) {
  .bg-gifs-container,
  .bg-square-gif,
  .section-ambient-stickers,
  .ambient-sticker-tl,
  .ambient-sticker-tr,
  .ambient-sticker-bl,
  .ambient-sticker-br,
  .ambient-sticker-left,
  .ambient-sticker-right,
  .inline-gif,
  .modal-gif,
  .ticker-gif,
  img[src$=".gif"],
  img[src*="/gifs/"] {
    display: none !important;
  }
}

/* Content Section (One Page One Part - Zero Divider Lines) */
.content-section {
  position: relative;
  min-height: calc(100vh - 48px);
  min-height: calc(100dvh - 48px);
  padding: 70px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  border-top: none;
  content-visibility: auto;
  contain-intrinsic-size: 1px 650px;
}

/* Dotted Grid Canvas for Retro Developer Feel */
.dotted-canvas {
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.2px);
  background-size: 20px 20px;
}

[data-theme="dark"] .dotted-canvas {
  background: transparent;
}

@media (min-width: 1180px) {
  .section-ambient-stickers {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: visible;
  }

  .ambient-sticker-tl {
    position: absolute;
    top: 50px;
    left: max(16px, calc((100% - 980px) / 2 - 92px));
    transform: rotate(-4deg);
    pointer-events: auto;
  }

  .ambient-sticker-tr {
    position: absolute;
    top: 70px;
    right: max(16px, calc((100% - 980px) / 2 - 92px));
    transform: rotate(4deg);
    pointer-events: auto;
  }

  .ambient-sticker-bl {
    position: absolute;
    bottom: 80px;
    left: max(16px, calc((100% - 980px) / 2 - 92px));
    transform: rotate(3deg);
    pointer-events: auto;
  }

  .ambient-sticker-br {
    position: absolute;
    bottom: 60px;
    right: max(16px, calc((100% - 980px) / 2 - 92px));
    transform: rotate(-3.5deg);
    pointer-events: auto;
  }

  .ambient-sticker-left {
    position: absolute;
    top: 48px;
    left: max(16px, calc((100% - 980px) / 2 - 94px));
    transform: rotate(-3deg);
    pointer-events: auto;
  }

  .ambient-sticker-right {
    position: absolute;
    top: 68px;
    right: max(16px, calc((100% - 980px) / 2 - 94px));
    transform: rotate(3deg);
    pointer-events: auto;
  }
}

@media (max-width: 1179px) {
  .section-ambient-stickers {
    display: none;
  }
}

/* ==========================================================================
   Sky Zone (Pages 2 & 3: Atmospheric Sky with Clouds & Smooth Fades)
   ========================================================================== */

.sky-zone {
  position: relative;
  background-color: #2b77d9;
  background-image:
    image-set(
      url("/sky_bg.webp") type("image/webp"),
      url("/sky_bg.jpg") type("image/jpeg")
    );
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  overflow: hidden;
}

/* Framer-Style Top Fade Transition (Hero Dotted Canvas -> Sky) */
.sky-zone::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 140px;
  background: linear-gradient(to bottom, var(--bg) 0%, rgba(244, 243, 239, 0) 100%);
  pointer-events: none;
  z-index: 5;
}

/* Framer-Style Bottom Fade Transition (Sky -> Plain Last Section) */
.sky-zone::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 160px;
  background: linear-gradient(to bottom, rgba(244, 243, 239, 0) 0%, var(--surface-plain, #F4F3EF) 100%);
  pointer-events: none;
  z-index: 5;
}

[data-theme="dark"] .sky-zone::before {
  display: none;
}

[data-theme="dark"] .sky-zone::after {
  display: none;
}

[data-theme="dark"] .sky-zone {
  background-color: #070b14 !important;
  background-image: url("/night_sky_bg_v2.jpg") !important;
  background-image:
    image-set(
      url("/night_sky_bg_v2.webp") type("image/webp"),
      url("/night_sky_bg_v2.jpg") type("image/jpeg")
    ) !important;
  background-size: cover !important;
  background-position: center top !important;
  filter: none !important;
}

/* Sky Zone Typography (Luminous White Like Heyclicky Pricing) */
.sky-zone .section-header h2 {
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 30, 80, 0.5), 0 1px 3px rgba(0, 0, 0, 0.4);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.sky-zone .section-header p {
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 4px rgba(0, 20, 60, 0.35);
  font-size: 14.5px;
}

/* Sky Zone macOS-style Floating Cards (Matching Uploaded Reference Screenshot) */
.sky-zone .card,
.sky-zone .retro-card,
.sky-zone .category-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 18px 40px rgba(0, 20, 60, 0.22), 0 2px 6px rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  color: #111111;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sky-zone .card:hover,
.sky-zone .retro-card:hover,
.sky-zone .category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 50px rgba(0, 20, 60, 0.3), 0 4px 12px rgba(0, 0, 0, 0.12);
}

.sky-zone .card-head,
.sky-zone .retro-card-head {
  background: linear-gradient(180deg, #f7f7f7 0%, #ececec 50%, #e1e1e1 100%);
  border-bottom: 1px solid #d4d4d4;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sky-zone .category-card-head {
  background: linear-gradient(180deg, #f7f7f7 0%, #ececec 50%, #e1e1e1 100%);
  border-bottom: 1px solid #d4d4d4;
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.card-title-group h3 {
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: #222222;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sky-zone .pref-pane {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 24px 54px rgba(0, 25, 70, 0.24), 0 2px 10px rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  overflow: hidden;
}

/* Authentic 3D Gel Window Control Dots */
.window-dots-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.window-dot-mini {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.window-dot-mini.close {
  background: radial-gradient(circle at 35% 30%, #ff837d 0%, #ff5f56 50%, #e0443e 100%);
  border: 1px solid #cf3c37;
}

.window-dot-mini.min {
  background: radial-gradient(circle at 35% 30%, #ffdf6d 0%, #ffbd2e 50%, #dea123 100%);
  border: 1px solid #cfa01f;
}

.window-dot-mini.max {
  background: radial-gradient(circle at 35% 30%, #6be375 0%, #27c93f 50%, #1eae33 100%);
  border: 1px solid #1a962b;
}

/* Window Close "X" Glyph (Matching Reference Upload) */
.window-close-x {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1;
  color: #8c8c8c;
  cursor: default;
  user-select: none;
  transition: color 0.15s ease;
  padding: 0 2px;
}

.window-close-x:hover {
  color: #333333;
}

/* Dark Mode Overrides for Category Cards */
[data-theme="dark"] .category-card {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .category-card-head {
  background: var(--surface-alt);
  border-bottom-color: var(--border-light);
}

[data-theme="dark"] .category-card-desc {
  color: var(--fg);
}

[data-theme="dark"] .category-card-list li {
  color: var(--muted);
}

/* ==========================================================================
   Plain Zone (Last Page: Solid Plain Surface, No Dots, No Sky, Full Viewport)
   ========================================================================== */

.plain-zone {
  position: relative;
  background-color: var(--surface-plain, #F4F3EF);
  min-height: calc(100vh - 48px);
  min-height: calc(100dvh - 48px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}

[data-theme="dark"] .plain-zone {
  background-color: rgba(11, 18, 32, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .plain-zone .section-header h2 {
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .plain-zone .section-header p {
  color: rgba(255, 255, 255, 0.85);
}

.plain-zone .content-section {
  min-height: auto;
  flex: 1;
  padding: 70px 0 20px;
}

.plain-zone .site-footer {
  margin-top: 0;
  border-top: none;
  padding: 24px 0 32px;
}

/* ==========================================================================
   Section Blocks & Technical Inspection Cards
   ========================================================================== */

.section-header {
  text-align: center;
  margin-bottom: 36px;
}

.section-header h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.035em;
  margin-bottom: 6px;
  text-transform: lowercase;
}

.section-header p {
  color: var(--muted);
  font-size: 14px;
}

/* Inspection Categories Grid & Cards (Matching Screenshot) */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 900px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

.category-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 0 0 1px var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.category-card-head {
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border-light);
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.category-card-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--fg);
  margin: 0;
  letter-spacing: -0.01em;
}

.category-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}

.category-tag.tag-critical {
  color: var(--accent-red);
  border-color: rgba(200, 59, 59, 0.35);
  background: rgba(200, 59, 59, 0.06);
}

.category-tag.tag-high {
  color: var(--accent-orange);
  border-color: rgba(192, 96, 20, 0.35);
  background: rgba(192, 96, 20, 0.06);
}

.category-tag.tag-medium {
  color: var(--accent-yellow, #A06800);
  border-color: rgba(160, 104, 0, 0.35);
  background: rgba(160, 104, 0, 0.06);
}

.category-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.category-card-desc {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--fg);
  margin-bottom: 12px;
}

.category-card-list {
  padding-left: 18px;
  margin: 0;
  list-style-type: disc;
}

.category-card-list li {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 4px;
}

.category-card-list code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface-alt);
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid var(--border-light);
  color: var(--fg);
}

/* ==========================================================================
   Integration Preferences Pane (Tabs)
   ========================================================================== */

.pref-pane {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow-window);
  overflow: hidden;
  max-width: 820px;
  margin: 0 auto;
}

.pref-tabbar {
  display: flex;
  background: var(--titlebar);
  border-bottom: 1px solid var(--titlebar-border);
  overflow-x: auto;
}

.pref-tab {
  padding: 10px 18px;
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.pref-tab:hover {
  color: var(--fg);
}

.pref-tab[aria-selected="true"] {
  color: var(--fg);
  background: var(--surface);
  border-bottom-color: var(--fg);
  font-weight: 600;
}

.pref-content {
  padding: 24px;
}

.pref-desc {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}

.code-block {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  overflow-x: auto;
  box-shadow: var(--shadow-input);
}

.code-block pre {
  margin: 0;
  color: var(--fg);
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
}

/* ==========================================================================
   Badge Utility Section
   ========================================================================== */

.badge-card {
  max-width: 600px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow-card);
  padding: 20px;
}

.badge-live-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  margin-top: 60px;
  border-top: 1px solid var(--border);
  padding: 24px 0;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
}

[data-theme="dark"] .site-footer {
  border-top-color: rgba(255, 255, 255, 0.08);
  background-color: rgba(11, 18, 32, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a:hover {
  color: var(--fg);
}

/* ==========================================================================
   Modal Dialogs (About & Changelog)
   ========================================================================== */

.modal-backdrop,
.retro-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.modal-backdrop.open,
.retro-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.dialog,
.retro-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25), 0 0 0 1px var(--border);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
  transform: scale(0.96);
  transition: transform 0.15s ease;
}

.modal-backdrop.open .dialog,
.retro-modal-backdrop.open .retro-dialog {
  transform: scale(1);
}

.dialog-head {
  height: 28px;
  background: var(--titlebar);
  border-bottom: 1px solid var(--titlebar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.dialog-close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
}

.dialog-close-btn:hover {
  color: var(--fg);
}

.dialog-body {
  padding: 20px;
}

.dialog-body h4 {
  font-size: 16px;
  margin-bottom: 8px;
}

.dialog-body p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 14px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--fg);
  color: var(--bg);
  padding: 8px 14px;
  border-radius: 4px;
  font-size: 12px;
  font-family: var(--font-mono);
  box-shadow: var(--shadow-window);
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 1050;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Responsive Navigation & Mobile Layout Optimization
   ========================================================================== */

@keyframes nav-dropdown-slide {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 680px) {
  .mobile-nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 48px;
    left: 0;
    right: 0;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16);
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 8px;
    z-index: 100;
  }

  .nav-links.mobile-open {
    display: flex;
    animation: nav-dropdown-slide 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  .nav-link {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    min-height: 44px;
    font-size: 14px;
    color: var(--fg);
    border-radius: 4px;
    background: transparent;
    transition: background 0.12s ease;
    text-align: left;
  }

  .nav-link:hover,
  .nav-link:focus-visible {
    background: var(--surface-alt);
  }

  #themeToggleBtn {
    width: 100%;
    justify-content: center;
    padding: 12px 14px;
    min-height: 44px;
    margin-top: 4px;
    font-size: 13px;
  }

  /* Hero Section Mobile Polish */
  .hero-stage {
    min-height: auto;
    padding: 36px 0 48px;
  }

  .hero-title {
    font-size: clamp(28px, 8vw, 42px);
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -0.04em;
  }

  /* Content Sections */
  .content-section {
    padding: 40px 0;
  }

  .section-header {
    margin-bottom: 24px;
  }

  .section-header h2 {
    font-size: 20px;
  }

  /* Integration Tabs */
  .pref-pane {
    border-radius: 6px;
  }

  .pref-tab {
    padding: 9px 13px;
    font-size: 11.5px;
  }

  .pref-content {
    padding: 16px 14px;
  }

  .code-block {
    padding: 12px;
    font-size: 11.5px;
  }

  /* Badge live row */
  .badge-live-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  /* Footer */
  .site-footer {
    margin-top: 40px;
    padding: 24px 0;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 14px;
  }

  .footer-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
  }
}

@media (max-width: 480px) {
  .nav-wrapper {
    height: 44px;
  }

  .nav-links {
    top: 44px;
  }

  .repo-form-box {
    flex-direction: column;
    padding: 8px;
    gap: 8px;
    border-radius: 20px;
  }

  .github-svg {
    display: none;
  }

  .repo-input-field {
    width: 100%;
    text-align: center;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--border-light);
    border-radius: 9999px;
    box-sizing: border-box;
  }

  .btn-inspect {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    min-height: 44px;
  }

  .samples-row {
    flex-direction: column;
    gap: 6px;
  }

  .sample-chip {
    padding: 7px 16px;
    width: 100%;
    max-width: 260px;
    text-align: center;
    justify-content: center;
  }

  .dialog,
  .retro-dialog {
    max-width: calc(100vw - 24px);
    margin: 12px auto;
  }

  .dialog-body {
    padding: 16px 14px;
  }
}

/* ==========================================================================
   Accessibility: Reduced Motion Preference (Save CPU & Prevent Discomfort)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .spinner,
  .retro-spinner {
    animation: none !important;
    border-top-color: var(--accent-blue) !important;
  }

  .bg-square-gif:hover {
    transform: none !important;
  }
}
