/* Yashvardhan Padhi personal workbench (yash.voyagerforge.dev)
   Daylight Ledger dark tokens matching Karyo and Hive sites:
   pure black ground, shared-hairline 14px ledger frame, Space Grotesk + JetBrains Mono, 12px floor. */

@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/space-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #000000;
  --surface-low: #050608;
  --muted: #0d0d0d;
  --card: #161616;
  --secondary: #1f1f1f;
  --ink: #ffffff;
  --soft: #d9d9d9;
  --body-ink: #c4c6d2;
  --muted-fg: #a8a8a8;
  --border: #2e2e2e;
  --border-subtle: #1f2428;
  --input-border: #434750;
  --primary: #93b4ff;
  --primary-hover: #bed0ff;
  --primary-soft: #182448;
  --success: #74d49b;
  --success-soft: #10301e;
  --attention: #f2c15a;
  --attention-soft: #3b2b0b;
  --teal: #64c7b8;
  --teal-soft: #183e38;
  --error: #ff8a7a;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --wrap-max: 72rem;
  --gutter: clamp(1rem, 3vw, 2rem);
  --sans: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  min-width: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image:
    linear-gradient(to right, rgba(31, 36, 40, 0.36) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(31, 36, 40, 0.36) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

::selection {
  background: var(--primary-soft);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

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

.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;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 50;
  padding: 0.5rem 0.85rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius-sm);
  font: 600 13px var(--mono);
  text-decoration: none;
}

.skip:focus {
  top: 0.75rem;
}

/* =====================================================================
   1) Sticky Top Utility Strip
   ===================================================================== */
header.top {
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.top-inner {
  width: 100%;
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding: 0.55rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 54px;
}

.brand-mark {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0.25rem 0;
  margin: 0;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--soft);
  font: 500 12px/1.3 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s ease;
}

.brand-mark:hover {
  color: var(--primary);
}

.brand-mobile {
  display: none;
  text-transform: none;
  letter-spacing: 0.04em;
}

.reticle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--primary);
}

.reticle::before,
.reticle::after {
  content: "";
  position: absolute;
  background: currentColor;
}

.reticle::before {
  width: 14px;
  height: 1.25px;
}

.reticle::after {
  width: 1.25px;
  height: 14px;
}

.header-stage {
  flex: 1 1 auto;
  min-width: 140px;
  height: 44px;
  overflow: hidden;
  pointer-events: none;
}

.cameo-slot-header {
  height: 44px;
}

.top-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.header-icons {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--body-ink);
  text-decoration: none;
  transition: color 0.15s ease;
}

.icon-link:hover {
  color: var(--primary);
}

.cv-pill {
  appearance: none;
  border: 0;
  margin-left: 0.25rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font: 700 12px/1.25 var(--mono);
  letter-spacing: 0.03em;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.cv-pill:hover {
  background: #e5e5e5;
}

.mobile-top-stage {
  display: none;
}

/* =====================================================================
   2) Main Architectural Blueprint Ledger Frame (Desktop Refined A)
   ===================================================================== */
.main {
  flex: 1;
  width: 100%;
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding: 2.25rem var(--gutter) 2.75rem;
}

.ledger {
  position: relative;
  background-color: var(--bg);
  background-image: radial-gradient(ellipse at 50% 0%, rgba(147, 180, 255, 0.24) 0%, transparent 48%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Hero & Motto 8/4 Split */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
}

.hero-copy {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.mobile-ticks {
  display: none;
}

h1 {
  margin: 0;
  font-size: 3rem;
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 700;
  color: var(--ink);
}

.intro {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.64;
  color: var(--body-ink);
  max-width: 42rem;
}

.chips {
  list-style: none;
  margin: 0.15rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chips li {
  padding: 0.3rem 0.65rem;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: 500 12px/1.3 var(--mono);
  letter-spacing: 0.04em;
  color: var(--soft);
}

/* Balanced Motto Panel */
.motto-cell {
  background: var(--muted);
  border-left: 1px solid var(--border-subtle);
  border-top: 2px dashed var(--teal);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.motto-body {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.motto-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font: 600 12px/1.2 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
}

.motto-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  flex: none;
}

.motto-plus {
  display: none;
}

.motto-text {
  margin: 0;
  padding-left: 1rem;
  border-left: 2px solid var(--teal);
  font-size: 1.0625rem;
  line-height: 1.62;
  font-weight: 500;
  color: var(--ink);
}

.tick {
  font: 500 12px/1 var(--mono);
  color: var(--primary);
  user-select: none;
}

/* =====================================================================
   3) Section Bars & Built 2-Column Grid
   ===================================================================== */
.section-block {
  border-top: 1px solid var(--border-subtle);
}

.section-bar {
  padding: 0.75rem 1.5rem;
  background: var(--surface-low);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.section-bar h2 {
  margin: 0;
  font: 500 12px/1.3 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--body-ink);
}

.built-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-card {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  transition: background-color 0.15s ease;
}

.project-card:first-child {
  border-right: 1px solid var(--border-subtle);
}

.project-card:hover {
  background: #050709;
}

.project-top {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.project-title-row {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
}

.proj-num {
  font: 500 12px/1.3 var(--mono);
  letter-spacing: 0.05em;
  color: var(--primary);
}

.project-card h3 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-weight: 600;
  color: var(--ink);
}

.tag {
  display: inline-block;
  flex: none;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-sm);
  font: 600 12px/1.25 var(--mono);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.tag-blue {
  background: var(--primary-soft);
  color: var(--primary);
}

.tag-green {
  background: var(--success-soft);
  color: var(--success);
}

.tag-amber {
  background: var(--attention-soft);
  color: var(--attention);
}

.project-desc {
  margin: 0;
  font-size: 1rem;
  line-height: 1.58;
  color: var(--body-ink);
}

.project-foot {
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.35rem;
}

.project-actions-split {
  justify-content: space-between;
}

.link-primary,
.link-secondary {
  font: 500 12px/1.4 var(--mono);
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 0.15s ease;
}

.link-primary {
  color: var(--primary);
}

.link-primary:hover {
  color: var(--primary-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-secondary {
  color: var(--body-ink);
}

.link-secondary:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.meta-note {
  font: 400 12px/1.4 var(--mono);
  letter-spacing: 0.03em;
  color: var(--muted-fg);
}

/* Zero-JS Native <details> Under the Hood */
.hood summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font: 500 12px/1.4 var(--mono);
  letter-spacing: 0.04em;
  color: var(--body-ink);
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
}

.hood summary::-webkit-details-marker {
  display: none;
}

.hood summary:hover {
  color: var(--ink);
}

.hood-sign::before {
  content: "+";
  color: var(--primary);
}

.hood[open] .hood-sign::before {
  content: "-";
}

.hood p {
  margin: 0.75rem 0 0;
  padding: 0.75rem 0.9rem;
  background: var(--surface-low);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: 400 12px/1.6 var(--mono);
  color: var(--body-ink);
}

/* =====================================================================
   4) Writing Band (Homelab Stories)
   ===================================================================== */
.writing-section {
  background: var(--muted);
}

.writing-card {
  padding: 2rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem 2rem;
}

.writing-copy {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 44rem;
}

.writing-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.writing-head h3 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 600;
  color: var(--ink);
}

.writing-desc {
  margin: 0;
  font-size: 1rem;
  line-height: 1.58;
  color: var(--body-ink);
}

.story-list {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.story-list li {
  position: relative;
  padding-left: 1rem;
  font: 400 13px/1.5 var(--mono);
  color: var(--soft);
}

.story-list li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--attention);
  font-weight: 700;
}

.pending-btn,
.substack-link-btn {
  display: inline-block;
  flex: none;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font: 500 12px/1.3 var(--mono);
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
}

.pending-btn {
  border: 1px dashed var(--border);
  color: var(--muted-fg);
}

.substack-link-btn {
  border: 1px solid rgba(147, 180, 255, 0.45);
  background: var(--primary-soft);
  color: var(--primary);
}

.substack-link-btn:hover {
  border-color: var(--primary);
  color: var(--ink);
}

/* =====================================================================
   5) Open Cameo Stage Strip (Desktop, zero filler labels)
   ===================================================================== */
.rail-stage {
  position: relative;
  height: 54px;
  padding: 0 1.5rem;
  background: var(--surface-low);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.cameo-slot {
  position: relative;
  width: 100%;
  flex: 1;
  height: 52px;
  overflow: hidden;
  pointer-events: none;
}

.cameo-slot.cameo-slot-header {
  height: 44px;
}

.cameo-slot.cameo-slot-header .fig-actor {
  width: 48px;
  height: 42px;
}

/* =====================================================================
   6) Profiles & Get my CV Action Strip
   ===================================================================== */
.profiles-strip {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
}

.profile-item {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--body-ink);
  transition: color 0.15s ease;
}

.profile-item:hover {
  color: var(--primary);
}

.profile-left {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.profile-name {
  font: 500 12px/1.3 var(--mono);
  color: var(--soft);
}

.profile-item:hover .profile-name {
  color: var(--primary);
}

.profile-handle {
  font: 400 12px/1.3 var(--mono);
  color: var(--muted-fg);
}

.profile-pending {
  color: var(--attention);
}

.icon-amber {
  color: var(--attention);
}

.icon-blue {
  color: var(--primary);
}

.cv-action {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.95rem;
  background: var(--surface-low);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font: 500 12px/1.3 var(--mono);
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.cv-action:hover {
  border-color: var(--primary);
}

.cv-action-accent {
  color: var(--primary);
}

/* =====================================================================
   7) Inline Get my CV Drawer
   ===================================================================== */
.cv-drawer {
  padding: 1.5rem;
  background: var(--muted);
  border-top: 1px solid rgba(147, 180, 255, 0.45);
}

.cv-drawer[hidden] {
  display: none;
}

.cv-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.cv-drawer-head h2 {
  margin: 0;
  font: 600 13px/1.3 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}

.cv-close {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.6rem;
  color: var(--body-ink);
  font: 500 12px/1.3 var(--mono);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.cv-close:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.cv-hint {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--body-ink);
  max-width: 42rem;
}

.cv-form {
  max-width: 34rem;
}

.cv-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.cv-input {
  flex: 1 1 220px;
  padding: 0.65rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font: 400 14px/1.4 var(--mono);
}

.cv-input::placeholder {
  color: var(--muted-fg);
}

.cv-input:focus {
  outline: none;
  border-color: var(--primary);
}

.cv-submit {
  appearance: none;
  border: 0;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--bg);
  font: 700 13px/1.3 var(--mono);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.cv-submit:hover {
  background: #e5e5e5;
}

.cv-submit:disabled {
  opacity: 0.6;
  cursor: wait;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.cv-turnstile {
  margin-top: 0.75rem;
}

.cv-status {
  margin: 0.75rem 0 0;
  min-height: 1.3em;
  font: 500 13px/1.45 var(--mono);
  color: var(--body-ink);
}

.cv-status.is-ok {
  color: var(--success);
}

.cv-status.is-err {
  color: var(--error);
}

/* =====================================================================
   8) Quiet Footer Bar
   ===================================================================== */
.site-footer {
  margin-top: auto;
  width: 100%;
  background: var(--bg);
  border-top: 1px solid var(--border-subtle);
}

.footer-inner {
  width: 100%;
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding: 1rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font: 500 12px/1.3 var(--mono);
  color: var(--muted-fg);
}

.pause-btn {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0.2rem 0.35rem;
  color: var(--muted-fg);
  font: 500 12px/1.3 var(--mono);
  cursor: pointer;
  transition: color 0.15s ease;
}

.pause-btn:hover {
  color: var(--ink);
}

.pause-btn:disabled {
  cursor: default;
  opacity: 0.85;
}

/* =====================================================================
   9) Round 5 Original Animated SVG Figures & Choreography
   ===================================================================== */
.fig-actor {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 56px;
  height: 48px;
  transform: translate(-50%, 60px);
  opacity: 0;
  will-change: transform, opacity;
}

.fig-actor svg {
  width: 100%;
  height: 100%;
}

.fig-actor.pop-cameo {
  animation: cameoPop 3.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.fig-actor.roll-cameo {
  left: 0;
  transform: translate(-70px, 0);
  animation: cameoRoll 4.2s cubic-bezier(0.35, 0, 0.25, 1) forwards;
}

@keyframes cameoPop {
  0% {
    transform: translate(-50%, 54px);
    opacity: 0;
  }
  14% {
    transform: translate(-50%, 0);
    opacity: 1;
  }
  84% {
    transform: translate(-50%, 0);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, 54px);
    opacity: 0;
  }
}

@keyframes cameoRoll {
  0% {
    transform: translate(-64px, 0);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  26% {
    transform: translate(var(--roll-x, 80px), 0);
    opacity: 1;
  }
  74% {
    transform: translate(var(--roll-x, 80px), 0);
    opacity: 1;
  }
  88% {
    opacity: 1;
  }
  100% {
    transform: translate(calc(var(--roll-x, 80px) + 95px), 0);
    opacity: 0;
  }
}

.fig-forklift .forks-group {
  animation: forkHoist 1.6s ease-in-out infinite;
}

.fig-forklift .beacon {
  animation: beaconFlash 0.7s steps(2) infinite;
}

@keyframes forkHoist {
  0%,
  100% {
    transform: translateY(0);
  }
  45%,
  60% {
    transform: translateY(-9px);
  }
}

@keyframes beaconFlash {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

.fig-tinker .tool-arm {
  transform-box: fill-box;
  transform-origin: 20% 70%;
  animation: screwTwist 0.85s ease-in-out infinite;
}

.fig-tinker .spark {
  transform-box: fill-box;
  transform-origin: center;
  animation: sparkPop 0.85s ease-in-out infinite;
}

.fig-tinker .antenna {
  transform-box: fill-box;
  transform-origin: bottom center;
  animation: antennaWig 1.4s ease-in-out infinite;
}

@keyframes screwTwist {
  0%,
  100% {
    transform: rotate(-16deg);
  }
  50% {
    transform: rotate(22deg);
  }
}

@keyframes sparkPop {
  0%,
  40%,
  100% {
    opacity: 0;
    transform: scale(0.4);
  }
  55%,
  75% {
    opacity: 1;
    transform: scale(1.15);
  }
}

@keyframes antennaWig {
  0%,
  100% {
    transform: rotate(-7deg);
  }
  50% {
    transform: rotate(7deg);
  }
}

.fig-rack .wave-arm {
  transform-box: fill-box;
  transform-origin: 10% 80%;
  animation: armWave 0.55s ease-in-out infinite alternate;
}

.fig-rack .rack-body {
  animation: happyHop 1.1s ease-in-out infinite;
}

@keyframes armWave {
  0% {
    transform: rotate(-28deg);
  }
  100% {
    transform: rotate(24deg);
  }
}

@keyframes happyHop {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.fig-pallet .stack-top {
  transform-box: fill-box;
  transform-origin: bottom center;
  animation: palletWobble 1.3s ease-in-out infinite;
}

@keyframes palletWobble {
  0%,
  100% {
    transform: rotate(0deg);
  }
  22% {
    transform: rotate(-9deg);
  }
  52% {
    transform: rotate(10deg);
  }
  76% {
    transform: rotate(-4deg);
  }
}

/* =====================================================================
   10) Tablet & Refined Mobile Layout (<= 960px / <= 720px)
   ===================================================================== */
@media (max-width: 960px) {
  .header-stage {
    display: none;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .motto-cell {
    border-left: 0;
    border-top: 2px dashed var(--teal);
  }

  .built-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-card:first-child {
    border-right: 0;
    border-bottom: 1px solid var(--border-subtle);
  }

  .writing-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  body {
    background-image: radial-gradient(rgba(142, 144, 156, 0.22) 1px, transparent 1px);
    background-size: 24px 24px;
  }

  .top-inner {
    padding: 0.65rem 1rem;
    min-height: 52px;
  }

  .brand-desktop,
  .header-icons {
    display: none;
  }

  .brand-mobile {
    display: inline;
    color: var(--ink);
  }

  .reticle {
    width: 14px;
    height: 14px;
    background-repeat: no-repeat;
    background-image:
      linear-gradient(var(--primary), var(--primary)),
      linear-gradient(var(--primary), var(--primary)),
      linear-gradient(var(--primary), var(--primary)),
      linear-gradient(var(--primary), var(--primary)),
      linear-gradient(var(--primary), var(--primary)),
      linear-gradient(var(--primary), var(--primary)),
      linear-gradient(var(--primary), var(--primary)),
      linear-gradient(var(--primary), var(--primary));
    background-position:
      left top, left top, right top, right top,
      left bottom, left bottom, right bottom, right bottom;
    background-size:
      4px 1.5px, 1.5px 4px, 4px 1.5px, 1.5px 4px,
      4px 1.5px, 1.5px 4px, 4px 1.5px, 1.5px 4px;
  }

  .reticle::before,
  .reticle::after {
    display: none;
  }

  .cv-pill {
    margin-left: 0;
    padding: 0.4rem 0.9rem;
  }

  .mobile-top-stage {
    display: block;
    width: 100%;
    height: 44px;
    padding: 0 1rem;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.72);
    overflow: hidden;
  }

  .cameo-slot-top {
    height: 44px;
  }

  .main {
    padding: 1.25rem 1rem 1.75rem;
  }

  .ledger {
    background-color: transparent;
    background-image: none;
    border: 0;
    border-radius: 0;
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .hero-grid {
    gap: 1.25rem;
  }

  .hero-copy {
    padding: 0;
    gap: 0.9rem;
  }

  .mobile-ticks {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font: 500 12px/1 var(--mono);
    color: var(--muted-fg);
  }

  h1 {
    font-size: 2rem;
    line-height: 1.15;
  }

  .intro {
    font-size: 1rem;
    line-height: 1.58;
  }

  .motto-cell {
    background: var(--muted);
    border: 1px solid var(--border);
    border-left: 2px solid var(--teal);
    border-radius: 12px;
    padding: 1.1rem;
  }

  .motto-dot {
    display: none;
  }

  .motto-plus {
    display: inline;
  }

  .motto-text {
    padding-left: 0;
    border-left: 0;
    font-size: 0.9375rem;
    font-weight: 400;
  }

  .section-block {
    border-top: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
  }

  .section-bar {
    padding: 0;
    background: transparent;
    border-bottom: 0;
    justify-content: flex-start;
  }

  .section-bar .tick-end {
    margin-left: auto;
    color: var(--muted-fg);
  }

  .built-grid {
    gap: 0.9rem;
  }

  .project-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.15rem;
    gap: 1rem;
  }

  .project-card:first-child {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }

  .project-card h3 {
    font-size: 1.15rem;
  }

  .project-desc {
    font-size: 0.9375rem;
  }

  .writing-section {
    background: transparent;
    padding: 0;
    border-top: 0;
    border-bottom: 0;
  }

  .tick-amber-mobile {
    color: var(--attention);
  }

  .writing-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.15rem;
    gap: 1rem;
  }

  .writing-head {
    width: 100%;
    justify-content: space-between;
  }

  .writing-desc {
    font-size: 0.9375rem;
  }

  .story-list li {
    font-size: 12px;
  }

  /* On mobile, figures use the top margin stage so there is no blank gap above footer links */
  .rail-stage {
    display: none;
  }

  .profiles-strip {
    padding: 0.25rem 0 0;
    border-top: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .profile-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    padding-top: 0.75rem;
  }

  .profile-item {
    justify-content: space-between;
    padding: 0.85rem 1rem;
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: 12px;
  }

  .profile-name {
    font-family: var(--sans);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--ink);
  }

  .cv-action {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--ink);
    border-color: var(--ink);
    border-radius: var(--radius-md);
    color: var(--bg);
    font-family: var(--sans);
    font-size: 1rem;
    font-weight: 600;
  }

  .cv-action:hover {
    background: #e5e5e5;
    border-color: #e5e5e5;
  }

  .cv-action-accent {
    color: var(--bg);
  }

  .cv-drawer {
    border: 1px solid rgba(147, 180, 255, 0.45);
    border-radius: var(--radius-lg);
    padding: 1.15rem;
  }

  .cv-submit {
    width: 100%;
  }

  .footer-inner {
    padding: 1rem;
  }
}

/* =====================================================================
   11) Reduced Motion Compliance
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .fig-actor,
  .fig-actor *,
  .cameo-slot {
    animation: none !important;
    transition: none !important;
  }

  .fig-actor {
    display: none !important;
  }
}
