/* ==========================================================================
   filipbradaric.com — Embedded Systems / Matte-Black PCB & ENIG Gold Aesthetic
   Palette: Matte-Black Solder Mask, ENIG Golden Pads/Traces & Crisp Silkscreen
   ========================================================================== */

:root {
  /* Matte-Black PCB Substrate & Surfaces (Zero green tint) */
  --pcb-substrate: #08080A;
  --pcb-soldermask: #0E0E11;
  --surface-module: rgba(18, 18, 22, 0.86);
  --surface-module-hover: rgba(25, 24, 29, 0.96);
  --surface-icon: rgba(255, 255, 255, 0.035);

  /* ENIG Gold (Pads, Traces, Vias) & Status LED */
  --enig-gold: #D4A853;
  --enig-gold-bright: #EBC374;
  --enig-gold-dim: rgba(212, 168, 83, 0.32);
  --led-green: #10B981;

  /* Silkscreen & Laser-Etched Text (Neutral Charcoal/White) */
  --silkscreen-primary: #F2F2F4;
  --silkscreen-secondary: #9A9AA3;
  --silkscreen-muted: #5C5C66;

  /* Borders & Trace Lines */
  --border-trace: rgba(212, 168, 83, 0.2);
  --border-silkscreen: rgba(255, 255, 255, 0.085);
  --border-hover: rgba(212, 168, 83, 0.5);
  --border-focus: rgba(212, 168, 83, 0.75);

  /* Fonts */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Transitions */
  --ease-out-expo: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  font-size: 16px;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  color-scheme: dark;
}

body {
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  background-color: var(--pcb-substrate);
  color: var(--silkscreen-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

::selection {
  background: rgba(212, 168, 83, 0.28);
  color: #ffffff;
}

/* ==========================================================================
   Matte-Black PCB Substrate Canvas, Golden Grid & 45-Degree Golden Traces
   ========================================================================== */
.pcb-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.pcb-grid {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(212, 168, 83, 0.14) 1px, transparent 1px),
    linear-gradient(to right, rgba(212, 168, 83, 0.028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(212, 168, 83, 0.028) 1px, transparent 1px);
  background-size: 24px 24px, 96px 96px, 96px 96px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, #000 30%, transparent 88%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, #000 30%, transparent 88%);
}

.pcb-traces {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--enig-gold);
}

.trace-pulse {
  stroke-dasharray: 8 100;
  stroke-dashoffset: 108;
  opacity: 0.7;
  filter: drop-shadow(0 0 4px rgba(235, 195, 116, 0.75));
  animation: traceSignal 6s linear infinite;
}

.trace-pulse--1 { animation-delay: 0.0s; animation-duration: 5.8s; }
.trace-pulse--2 { animation-delay: 0.4s; animation-duration: 5.8s; }
.trace-pulse--3 { animation-delay: 0.8s; animation-duration: 5.8s; }
.trace-pulse--4 { animation-delay: 2.1s; animation-duration: 6.4s; }
.trace-pulse--5 { animation-delay: 2.5s; animation-duration: 6.4s; }
.trace-pulse--6 { animation-delay: 1.2s; animation-duration: 6.0s; }
.trace-pulse--7 { animation-delay: 1.6s; animation-duration: 6.0s; }
.trace-pulse--8 { animation-delay: 3.4s; animation-duration: 6.6s; }
.trace-pulse--9 { animation-delay: 3.8s; animation-duration: 6.6s; }

@keyframes traceSignal {
  0% {
    stroke-dashoffset: 108;
    opacity: 0;
  }
  8% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.8;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 0;
  }
}

.ambient-glow--primary {
  position: absolute;
  width: 620px;
  height: 620px;
  top: -220px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 50%;
  filter: blur(125px);
  background: radial-gradient(
    circle,
    rgba(212, 168, 83, 0.11) 0%,
    rgba(212, 168, 83, 0.03) 48%,
    transparent 70%
  );
}

.ambient-noise {
  position: absolute;
  inset: 0;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Main Container (PCB Carrier Board) & Interconnect Bus SVG
   ========================================================================== */
.hub-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 568px;
  padding: 0.45rem 2.85rem;
  display: flex;
  flex-direction: column;
  gap: clamp(0.6rem, 2.1dvh, 1.75rem);
  transform-origin: center center;
}

.board-bus-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  overflow: visible;
  opacity: 0;
  animation: busReveal 650ms var(--ease-out-expo) 120ms forwards;
}

@keyframes busReveal {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Base Copper Traces on the Carrier Board (Passive / Unlit when Idle) */
.bus-trace {
  fill: none;
  stroke: var(--enig-gold);
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.34;
  transition:
    opacity 200ms var(--ease-out-expo),
    stroke 200ms var(--ease-out-expo),
    stroke-width 200ms var(--ease-out-expo),
    filter 200ms var(--ease-out-expo);
}

.bus-trace--probe-inner {
  stroke-width: 1.2;
  stroke-dasharray: 2.5 2.5;
  opacity: 0.34;
}

.bus-trace--la-active,
.bus-trace--card-active {
  opacity: 0;
}

/* Animated Signal Pulses on SCLK, MOSI & CS (Off in Idle, Active Only on Selection / Copy) */
.bus-pulse {
  fill: none;
  stroke: var(--enig-gold-bright);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 7 93;
  stroke-dashoffset: 100;
  opacity: 0;
  filter: drop-shadow(0 0 4px rgba(235, 195, 116, 0.75));
  animation: busSignalFlow 2.2s linear infinite;
  animation-play-state: paused;
  transition: opacity 180ms var(--ease-out-expo);
}

.bus-pulse--la-mosi,
.bus-pulse--card-mosi {
  animation-delay: -0.8s;
  animation-duration: 1.85s;
}

.bus-pulse--la-miso,
.bus-pulse--card-miso {
  animation-delay: -0.4s;
  animation-duration: 2.0s;
  animation-direction: reverse;
}

.bus-pulse--cs {
  stroke-dasharray: 9 91;
  animation-duration: 1.8s;
}

@keyframes busSignalFlow {
  0% {
    stroke-dashoffset: 100;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

/* Heartbeat GPIO Trace (Static copper trace to D1 LED) */
.bus-trace--hb,
.bus-trace--hb-gnd {
  opacity: 0.34;
}

/* Active Highlighting for SCLK, MOSI, MISO, and Selected CS Line */
.board-bus-svg[data-bus-active="true"] .bus-trace--la-active,
.board-bus-svg[data-bus-active="true"] .bus-trace--probe-inner,
.board-bus-svg .bus-trace.is-active {
  stroke: var(--enig-gold-bright);
  opacity: 0.95;
  stroke-width: 1.75;
  filter: drop-shadow(0 0 6px rgba(235, 195, 116, 0.65));
}

.board-bus-svg[data-bus-active="true"] .bus-pulse--la-sclk,
.board-bus-svg[data-bus-active="true"] .bus-pulse--la-mosi,
.board-bus-svg[data-bus-active="true"] .bus-pulse--la-miso,
.board-bus-svg .bus-pulse.is-active {
  opacity: 0.95;
  animation-play-state: running;
}

/* SMD Terminal Pads & Through-Hole Vias on Bus */
.bus-pad {
  fill: var(--enig-gold);
  opacity: 0.82;
  transition:
    fill 200ms var(--ease-out-expo),
    opacity 200ms var(--ease-out-expo),
    filter 200ms var(--ease-out-expo);
}

.bus-pad.is-active,
.board-bus-svg[data-bus-active="true"] .bus-pad--la {
  fill: var(--enig-gold-bright);
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(235, 195, 116, 0.8));
}

.bus-via {
  fill: var(--pcb-substrate);
  stroke: var(--enig-gold);
  stroke-width: 1.35;
  opacity: 0.85;
  transition:
    stroke 200ms var(--ease-out-expo),
    opacity 200ms var(--ease-out-expo),
    filter 200ms var(--ease-out-expo);
}

.bus-via.is-active,
.board-bus-svg[data-bus-active="true"] .bus-via--la {
  stroke: var(--enig-gold-bright);
  opacity: 1;
  filter: drop-shadow(0 0 5px rgba(235, 195, 116, 0.75));
}

.bus-via-hole {
  fill: #050507;
}

/* Silkscreen Net Labels on PCB */
.bus-label {
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  fill: var(--silkscreen-muted);
  opacity: 0.78;
  user-select: none;
  transition: fill 200ms var(--ease-out-expo), opacity 200ms var(--ease-out-expo);
}

.bus-label.is-active,
.board-bus-svg[data-bus-active="true"] .bus-label--spi {
  fill: var(--enig-gold-bright);
  opacity: 1;
}

/* ==========================================================================
   Profile Identity Header & QFP Microcontroller Socket (U1)
   ========================================================================== */
.profile-header {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.ic-socket-wrapper {
  position: relative;
  width: clamp(92px, 10.2dvh, 108px);
  height: clamp(92px, 10.2dvh, 108px);
  margin: 0.35rem 0 clamp(0.45rem, 1.55dvh, 1.25rem);
  display: flex;
  align-items: center;
  justify-content: center;
}

.silkscreen-ref {
  position: absolute;
  top: -20px;
  left: -6px;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--silkscreen-muted);
  user-select: none;
}

/* QFP Gull-Wing ENIG Gold IC Pins */
.ic-pins {
  position: absolute;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 2;
}

.ic-pins span {
  display: block;
  background: var(--enig-gold);
  border-radius: 1px;
  opacity: 0.78;
  transition:
    opacity 250ms var(--ease-out-expo),
    background-color 250ms var(--ease-out-expo),
    box-shadow 250ms var(--ease-out-expo);
}

.ic-socket-wrapper:has(.avatar-surface:hover) .ic-pins span,
.ic-pins span.is-active {
  opacity: 1;
  background: var(--enig-gold-bright);
  box-shadow: 0 0 8px rgba(235, 195, 116, 0.85);
}

.ic-pins--top,
.ic-pins--bottom {
  left: 14px;
  right: 14px;
  height: 7px;
}

.ic-pins--top {
  top: -7px;
}

.ic-pins--bottom {
  bottom: -7px;
}

.ic-pins--top span,
.ic-pins--bottom span {
  width: var(--mcu-pin-thickness, 5px);
  height: 100%;
}

.ic-pins--left,
.ic-pins--right {
  top: 14px;
  bottom: 14px;
  width: 7px;
  flex-direction: column;
}

.ic-pins--left {
  left: -7px;
}

.ic-pins--right {
  right: -7px;
}

.ic-pins--left span,
.ic-pins--right span {
  height: var(--mcu-pin-thickness, 5px);
  width: 100%;
}

/* Matte-Black Epoxy IC Package Body */
.avatar-surface {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  background: #121215;
  border: 1.5px solid rgba(212, 168, 83, 0.45);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow:
    0 0 28px rgba(0, 0, 0, 0.75),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: border-color 250ms var(--ease-out-expo);
}

.ic-socket-wrapper:has(.avatar-surface:hover) .avatar-surface {
  border-color: var(--enig-gold-bright);
}

/* IC Pin-1 Orientation Dot */
.pin1-notch {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(12, 12, 15, 0.9);
  border: 1.5px solid var(--enig-gold);
  z-index: 3;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.avatar-image {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  object-fit: cover;
  object-position: center 18%;
  display: block;
  transition: transform 400ms var(--ease-out-expo);
}

.ic-socket-wrapper:has(.avatar-surface:hover) .avatar-image {
  transform: scale(1.03);
}

/* SMD Package Heartbeat LED (Moved to MCU Side & Connected to Pin 6) */
.online-indicator {
  position: absolute;
  bottom: 10px;
  right: -40px;
  z-index: 3;
  width: 13px;
  height: 13px;
  border-radius: 2.5px;
  background: var(--enig-gold-bright);
  border: 2px solid #16161B;
  box-shadow: 0 0 10px rgba(212, 168, 83, 0.85);
  animation: mcuHeartbeat 1s infinite;
}

/* Gold SMD Anode & Cathode End-Caps on the Heartbeat LED */
.online-indicator::before,
.online-indicator::after {
  content: '';
  position: absolute;
  top: 1.5px;
  bottom: 1.5px;
  width: 3px;
  background: var(--enig-gold);
  border-radius: 1px;
}

.online-indicator::before {
  left: -4px;
}

.online-indicator::after {
  right: -4px;
}

.led-silkscreen {
  position: absolute;
  top: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--silkscreen-muted);
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

@keyframes mcuHeartbeat {
  0%, 49% {
    background-color: #EBC374;
    box-shadow: 0 0 12px rgba(212, 168, 83, 0.95), 0 0 4px #FFF3D1 inset;
  }
  50%, 100% {
    background-color: #2A2214;
    box-shadow: 0 0 0 rgba(212, 168, 83, 0);
  }
}

/* Role Chip Badge */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0.65rem;
  margin-bottom: clamp(0.25rem, 0.9dvh, 0.7rem);
  border-radius: 4px;
  background: rgba(212, 168, 83, 0.085);
  border: 1px solid rgba(212, 168, 83, 0.32);
  color: var(--enig-gold-bright);
  font-family: var(--font-mono);
  font-size: 0.71rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.role-chip-icon {
  width: 14px;
  height: 14px;
  color: var(--enig-gold);
  flex-shrink: 0;
}

/* ==========================================================================
   Main Name Heading with Trailing Copy Icon
   ========================================================================== */
.profile-name-heading {
  margin-bottom: clamp(0.2rem, 0.8dvh, 0.6rem);
  display: flex;
  justify-content: center;
}

.name-copy-trigger {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  padding: 0.2rem 0.55rem;
  margin: -0.2rem -0.55rem;
  border-radius: 6px;
  font-family: inherit;
  color: var(--silkscreen-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  position: relative;
  transition:
    background-color 200ms var(--ease-out-expo),
    border-color 200ms var(--ease-out-expo),
    transform 160ms var(--ease-out-expo);
}

.name-copy-trigger:hover {
  background: rgba(212, 168, 83, 0.06);
  border-color: rgba(212, 168, 83, 0.22);
}

.name-copy-trigger:active {
  transform: scale(0.985);
}

.name-copy-trigger:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 4px;
}

.profile-name-text {
  font-size: clamp(1.55rem, min(4.2vw, 3.2dvh), 2.1rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.12;
  color: var(--silkscreen-primary);
}

.croatian-char {
  color: var(--enig-gold-bright);
  text-shadow: 0 0 16px rgba(212, 168, 83, 0.35);
}

.name-copy-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-silkscreen);
  color: var(--silkscreen-secondary);
  flex-shrink: 0;
  transition:
    color 200ms var(--ease-out-expo),
    background-color 200ms var(--ease-out-expo),
    border-color 200ms var(--ease-out-expo),
    transform 200ms var(--ease-out-expo);
}

.name-copy-trigger:hover .name-copy-icon {
  color: var(--enig-gold-bright);
  background: rgba(212, 168, 83, 0.12);
  border-color: rgba(212, 168, 83, 0.4);
  transform: translateY(-1px);
}

.name-copy-icon .icon-copy,
.name-copy-icon .icon-check {
  width: 14px;
  height: 14px;
}

.name-copy-icon .icon-check {
  --fa-display: none;
  display: none;
  color: var(--enig-gold-bright);
}

.name-copy-trigger.is-copied .name-copy-icon {
  background: rgba(212, 168, 83, 0.18);
  border-color: rgba(212, 168, 83, 0.55);
  color: var(--enig-gold-bright);
}

.name-copy-trigger.is-copied .icon-copy {
  --fa-display: none;
  display: none;
}

.name-copy-trigger.is-copied .icon-check {
  --fa-display: inline-block;
  display: inline-block;
}

/* Floating "Copied!" Pill */
.copied-toast {
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  background: rgba(15, 15, 18, 0.96);
  border: 1px solid rgba(212, 168, 83, 0.5);
  color: var(--enig-gold-bright);
  font-family: var(--font-mono);
  font-size: 0.675rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 180ms var(--ease-out-expo),
    transform 180ms var(--ease-out-expo);
}

.name-copy-trigger.is-copied .copied-toast {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ==========================================================================
   Firmware Comment Bio & Location/Time Metadata
   ========================================================================== */
.profile-bio {
  max-width: 100%;
  padding-inline: 0.25rem;
  font-family: var(--font-mono);
  font-size: clamp(0.58rem, 2.2vw, 0.82rem);
  color: var(--silkscreen-secondary);
  white-space: normal;
  text-wrap: balance;
  overflow-wrap: break-word;
  line-height: 1.45;
  margin-bottom: clamp(0.4rem, 1.3dvh, 1rem);
}

.comment-delim {
  color: var(--enig-gold);
  opacity: 0.7;
  font-weight: 500;
  margin: 0 0.15rem;
}

.profile-meta {
  max-width: 100%;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.28rem 0.75rem;
  border-radius: 4px;
  background: rgba(18, 18, 22, 0.82);
  border: 1px solid var(--border-silkscreen);
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--silkscreen-secondary);
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.meta-pill--time {
  font-variant-numeric: tabular-nums;
  color: var(--enig-gold-bright);
}

.meta-icon {
  width: 13px;
  height: 13px;
  color: var(--enig-gold);
  opacity: 0.8;
  flex-shrink: 0;
}

.meta-divider {
  color: var(--silkscreen-muted);
  font-size: 0.7rem;
}

/* ==========================================================================
   Logic Analyzer Communication Strip (SCLK + MOSI Digital Timing)
   ========================================================================== */
.logic-analyzer {
  background: rgba(14, 14, 17, 0.9);
  border: 1px solid var(--border-silkscreen);
  border-radius: 6px;
  padding: 0.4rem 0.7rem 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.03);
}

.logic-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
}

.logic-probe-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--silkscreen-muted);
  font-weight: 600;
}

.probe-dot {
  width: 6px;
  height: 6px;
  border-radius: 1px;
  display: inline-block;
  background: rgba(212, 168, 83, 0.24);
  transition: background-color 180ms var(--ease-out-expo), box-shadow 180ms var(--ease-out-expo);
}

.probe-dot--clk {
  background: rgba(212, 168, 83, 0.24);
}

.probe-dot--mosi,
.probe-dot--miso {
  margin-left: 0.35rem;
  background: rgba(212, 168, 83, 0.24);
}

body[data-bus-active="true"] .probe-dot--clk {
  background: rgba(212, 168, 83, 0.78);
  box-shadow: 0 0 5px rgba(212, 168, 83, 0.5);
}

body[data-bus-active="true"] .probe-dot--mosi {
  background: var(--enig-gold-bright);
  box-shadow: 0 0 6px rgba(235, 195, 116, 0.75);
}

body[data-bus-active="true"] .probe-dot--miso {
  background: #D9A74A;
  box-shadow: 0 0 6px rgba(217, 167, 74, 0.7);
}

.logic-decoder {
  color: var(--silkscreen-muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 180ms var(--ease-out-expo);
}

body[data-bus-active="true"] .logic-decoder {
  color: var(--enig-gold-bright);
}

.logic-screen {
  width: 100%;
  height: clamp(48px, 5.6dvh, 60px);
  border-radius: 4px;
  background: rgba(8, 8, 10, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.045);
  overflow: hidden;
  position: relative;
  cursor: crosshair;
  transition: border-color 180ms var(--ease-out-expo);
}

.logic-screen.is-held {
  border-color: rgba(212, 168, 83, 0.55);
}

#logicCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ==========================================================================
   Social Links Section (Memory-Mapped Peripheral Bus)
   ========================================================================== */
.links-section {
  display: flex;
  flex-direction: column;
  gap: clamp(0.4rem, 1.3dvh, 0.9rem);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0 0.15rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
}

.section-reg {
  color: var(--enig-gold-bright);
  font-weight: 600;
  padding: 0.1rem 0.38rem;
  border-radius: 3px;
  background: rgba(212, 168, 83, 0.1);
  border: 1px solid rgba(212, 168, 83, 0.28);
}

.section-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--silkscreen-secondary);
  font-weight: 600;
  white-space: nowrap;
}

.section-line {
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    rgba(212, 168, 83, 0.22) 0px,
    rgba(212, 168, 83, 0.22) 4px,
    transparent 4px,
    transparent 8px
  );
}

.section-bus {
  color: var(--silkscreen-muted);
}

.links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: clamp(0.35rem, 1.1dvh, 0.8rem);
}

/* Hardware Peripheral Card */
.social-card {
  --mouse-x: 50%;
  --mouse-y: 50%;

  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: clamp(46px, 6.6dvh, 66px);
  padding: clamp(0.4rem, 1.05dvh, 0.8rem) 0.95rem clamp(0.4rem, 1.05dvh, 0.8rem) 0.8rem;
  border-radius: 6px;
  background: var(--surface-module);
  border: 1px solid var(--border-silkscreen);
  color: var(--silkscreen-primary);
  text-decoration: none;
  overflow: hidden;
  box-shadow:
    0 6px 20px -6px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.035);
  transition:
    transform 200ms var(--ease-out-expo),
    background-color 200ms var(--ease-out-expo),
    border-color 200ms var(--ease-out-expo),
    box-shadow 200ms var(--ease-out-expo);
}

/* Legacy single left pad hidden in favor of dual SCLK/MOSI + right CS SMD pads */
.pin-pad {
  display: none;
}

/* Hex Register Address Offset */
.reg-addr {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--silkscreen-muted);
  letter-spacing: 0.02em;
  user-select: none;
  flex-shrink: 0;
  transition: color 200ms var(--ease-out-expo);
}

.social-card:hover .reg-addr,
.social-card.is-post-active .reg-addr {
  color: var(--enig-gold-bright);
}

/* Pointer-Tracked Golden Radial Glow Overlay */
.card-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    280px circle at var(--mouse-x) var(--mouse-y),
    rgba(212, 168, 83, 0.11),
    transparent 70%
  );
  transition: opacity 260ms var(--ease-out-expo);
}

.social-card:hover,
.social-card.is-post-active {
  background: var(--surface-module-hover);
  border-color: rgba(212, 168, 83, 0.48);
  box-shadow:
    0 10px 26px -8px rgba(0, 0, 0, 0.8),
    0 0 22px -8px rgba(212, 168, 83, 0.22);
}

.social-card:hover .card-glow {
  opacity: 1;
}

.social-card:active {
  transform: scale(0.996);
}

.social-card:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* Left Platform Icon Box (IC Die / Module Frame) */
.card-icon {
  position: relative;
  z-index: 1;
  width: 35px;
  height: 35px;
  border-radius: 6px;
  background: var(--surface-icon);
  border: 1px solid rgba(255, 255, 255, 0.075);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--silkscreen-secondary);
  flex-shrink: 0;
  transition:
    color 200ms var(--ease-out-expo),
    background-color 200ms var(--ease-out-expo),
    border-color 200ms var(--ease-out-expo);
}

.card-icon svg,
.card-icon i {
  width: 19px;
  height: 19px;
  font-size: 19px;
}

.social-card:hover .card-icon,
.social-card.is-post-active .card-icon {
  color: var(--enig-gold-bright);
  background: rgba(212, 168, 83, 0.12);
  border-color: rgba(212, 168, 83, 0.4);
}

/* Center Title & Handle */
.card-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--silkscreen-primary);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.card-title-subtle {
  font-weight: 400;
  color: var(--silkscreen-muted);
  font-size: 0.85em;
}

.card-handle {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--silkscreen-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 200ms var(--ease-out-expo);
}

.social-card:hover .card-handle {
  color: #D4D4DC;
}

/* Right Action Indicators & Bus Pad/LED */
.card-trailing {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

/* SMD Bus Activity Indicator */
.io-led {
  width: 6px;
  height: 6px;
  border-radius: 1.5px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 180ms var(--ease-out-expo);
}

.social-card:hover .io-led,
.social-card.is-post-active .io-led {
  background: var(--enig-gold-bright);
  border-color: #F6DC9F;
  box-shadow: 0 0 8px rgba(212, 168, 83, 0.85);
}

.shortcut-key {
  font-family: var(--font-mono);
  font-size: 0.675rem;
  line-height: 1;
  padding: 0.24rem 0.42rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--silkscreen-muted);
  transition:
    color 200ms var(--ease-out-expo),
    border-color 200ms var(--ease-out-expo),
    background-color 200ms var(--ease-out-expo);
}

.social-card:hover .shortcut-key {
  color: var(--enig-gold-bright);
  border-color: rgba(212, 168, 83, 0.4);
  background: rgba(212, 168, 83, 0.1);
}

.card-arrow {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--silkscreen-muted);
  transition:
    color 200ms var(--ease-out-expo),
    transform 200ms var(--ease-out-expo);
}

.card-arrow svg,
.card-arrow i {
  width: 13px;
  height: 13px;
  font-size: 13px;
}

.social-card:hover .card-arrow {
  color: var(--enig-gold-bright);
  transform: translate(2.5px, -2.5px);
}

/* ==========================================================================
   Silkscreen Footer
   ========================================================================== */
.hub-footer {
  margin-top: 0;
  padding-top: clamp(0.35rem, 1.1dvh, 0.85rem);
  border-top: 1px dashed rgba(212, 168, 83, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  text-align: center;
  font-family: var(--font-mono);
}

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

.footer-heart {
  color: var(--enig-gold-bright);
  margin: 0 0.1rem;
  transition: color 180ms var(--ease-out-expo);
}

.footer-hint {
  font-size: 0.675rem;
  color: var(--silkscreen-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  transition: color 180ms var(--ease-out-expo);
}

.footer-hint:hover {
  color: var(--silkscreen-secondary);
}

.footer-hint kbd {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  padding: 0.08rem 0.32rem;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--silkscreen-secondary);
  transition:
    color 180ms var(--ease-out-expo),
    border-color 180ms var(--ease-out-expo),
    background-color 180ms var(--ease-out-expo);
}

.footer-hint:hover kbd {
  color: var(--enig-gold-bright);
  border-color: rgba(212, 168, 83, 0.38);
  background: rgba(212, 168, 83, 0.08);
}

/* ==========================================================================
   Silkscreen System Register & Keyboard Shortcut Manual Modal (? Key)
   ========================================================================== */
.shortcut-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(6, 6, 8, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease-out-expo);
}

.shortcut-modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.shortcut-modal {
  width: 100%;
  max-width: 440px;
  border-radius: 8px;
  background: #101014;
  border: 1px solid rgba(212, 168, 83, 0.45);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.85),
    0 0 28px rgba(212, 168, 83, 0.14);
  font-family: var(--font-mono);
  overflow: hidden;
  transform: translateY(8px) scale(0.98);
  transition: transform 220ms var(--ease-out-expo);
}

.shortcut-modal-backdrop.is-open .shortcut-modal {
  transform: translateY(0) scale(1);
}

.shortcut-modal-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.9rem;
  background: rgba(212, 168, 83, 0.07);
  border-bottom: 1px solid rgba(212, 168, 83, 0.22);
}

.shortcut-modal-reg {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--enig-gold-bright);
  padding: 0.12rem 0.4rem;
  border-radius: 3px;
  background: rgba(212, 168, 83, 0.14);
  border: 1px solid rgba(212, 168, 83, 0.35);
}

.shortcut-modal-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--silkscreen-primary);
  flex: 1;
}

.shortcut-modal-close {
  appearance: none;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

.shortcut-modal-close kbd {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  padding: 0.14rem 0.4rem;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--silkscreen-secondary);
  transition: all 160ms var(--ease-out-expo);
}

.shortcut-modal-close:hover kbd {
  color: var(--enig-gold-bright);
  border-color: rgba(212, 168, 83, 0.45);
}

.shortcut-modal-body {
  padding: 0.65rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.shortcut-row {
  display: grid;
  grid-template-columns: 58px 98px 1fr;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.45rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.7rem;
}

.shortcut-row--fault {
  border-color: rgba(255, 82, 82, 0.22);
  background: rgba(255, 82, 82, 0.04);
}

.shortcut-keys kbd {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.12rem 0.36rem;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(212, 168, 83, 0.32);
  color: var(--enig-gold-bright);
}

.shortcut-row--fault .shortcut-keys kbd {
  border-color: rgba(255, 107, 107, 0.45);
  color: #FF6B6B;
}

.shortcut-cmd {
  font-weight: 600;
  color: var(--silkscreen-primary);
  font-size: 0.68rem;
}

.shortcut-row--fault .shortcut-cmd {
  color: #FF6B6B;
}

.shortcut-desc {
  color: var(--silkscreen-secondary);
  font-size: 0.675rem;
}

.shortcut-modal-footer {
  padding: 0.5rem 0.9rem;
  border-top: 1px dashed rgba(212, 168, 83, 0.18);
  font-size: 0.625rem;
  color: var(--silkscreen-muted);
  text-align: center;
}

/* ==========================================================================
   Easter Egg: Bare-Metal SIGSEGV / HardFault_Handler Panic State
   ========================================================================== */
@keyframes segfaultBlink {
  0%, 49% {
    opacity: 1;
  }
  50%, 100% {
    opacity: 0.2;
  }
}

@keyframes hardwareFaultJitter {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-2px, 1px); }
  40% { transform: translate(2px, -1px); }
  60% { transform: translate(-1.5px, -1px); }
  80% { transform: translate(1.5px, 1px); }
}

body[data-segfault="true"] {
  --enig-gold: #FF4D4D;
  --enig-gold-bright: #FF6B6B;
  --enig-gold-dim: rgba(255, 77, 77, 0.35);
  --border-trace: rgba(255, 77, 77, 0.25);
  --border-hover: rgba(255, 77, 77, 0.55);
  --border-focus: rgba(255, 77, 77, 0.8);
}

body[data-segfault="true"] .pcb-grid {
  background-image:
    radial-gradient(rgba(255, 77, 77, 0.18) 1px, transparent 1px),
    linear-gradient(to right, rgba(255, 77, 77, 0.038) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 77, 77, 0.038) 1px, transparent 1px);
}

body[data-segfault="true"] .pcb-signal-pulses {
  stroke: #FF6B6B;
}

body[data-segfault="true"] .trace-pulse {
  filter: drop-shadow(0 0 5px rgba(255, 82, 82, 0.85));
}

body[data-segfault="true"] .pcb-traces g:nth-of-type(3) {
  stroke: #FF5252;
}

body[data-segfault="true"] .ambient-glow--primary {
  background: radial-gradient(
    circle,
    rgba(255, 64, 64, 0.16) 0%,
    rgba(255, 64, 64, 0.045) 48%,
    transparent 70%
  );
}

body[data-segfault="true"] .ic-socket-wrapper,
body[data-segfault="true"] .logic-header,
body[data-segfault="true"] .logic-screen {
  animation: hardwareFaultJitter 220ms linear 1;
}

body[data-segfault="true"] .logic-analyzer {
  border-color: rgba(255, 77, 77, 0.62);
  box-shadow:
    0 0 16px rgba(255, 64, 64, 0.18),
    inset 0 0 12px rgba(255, 64, 64, 0.08);
}

body[data-segfault="true"] .logic-decoder {
  color: #FF6B6B;
  font-weight: 600;
}

body[data-segfault="true"] .probe-dot--clk,
body[data-segfault="true"] .probe-dot--mosi,
body[data-segfault="true"] .probe-dot--miso {
  background: #FF5252;
  box-shadow: 0 0 6px rgba(255, 82, 82, 0.85);
}

body[data-segfault="true"] .avatar-surface {
  border-color: #FF5252;
  box-shadow:
    0 0 18px rgba(255, 77, 77, 0.45),
    0 10px 28px -8px rgba(0, 0, 0, 0.9);
}

body[data-segfault="true"] .online-indicator {
  background: #FF4D4D !important;
  box-shadow: 0 0 12px rgba(255, 77, 77, 0.95) !important;
  animation: segfaultBlink 160ms steps(2, start) infinite;
}

body[data-segfault="true"] .ic-pins span,
body[data-segfault="true"] .ic-pins span.ic-pin--connected {
  background: #FF5252;
  opacity: 0.95;
  box-shadow: 0 0 6px rgba(255, 77, 77, 0.75);
}

body[data-segfault="true"] .croatian-char {
  color: #FF6B6B;
  text-shadow: 0 0 16px rgba(255, 77, 77, 0.55);
}

body[data-segfault="true"] .role-badge {
  background: rgba(255, 77, 77, 0.12);
  border-color: rgba(255, 77, 77, 0.45);
  color: #FF6B6B;
}

body[data-segfault="true"] .section-reg {
  background: rgba(255, 77, 77, 0.12);
  border-color: rgba(255, 77, 77, 0.4);
  color: #FF6B6B;
}

body[data-segfault="true"] .section-line {
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 77, 77, 0.35) 0px,
    rgba(255, 77, 77, 0.35) 4px,
    transparent 4px,
    transparent 8px
  );
}

body[data-segfault="true"] .card-glow {
  background: radial-gradient(
    280px circle at var(--mouse-x) var(--mouse-y),
    rgba(255, 77, 77, 0.14),
    transparent 70%
  );
}

body[data-segfault="true"] .social-card:hover {
  border-color: rgba(255, 77, 77, 0.55);
  box-shadow:
    0 10px 26px -8px rgba(0, 0, 0, 0.8),
    0 0 22px -8px rgba(255, 77, 77, 0.28);
}

body[data-segfault="true"] .social-card:hover .card-icon,
body[data-segfault="true"] .social-card:hover .shortcut-key {
  color: #FF6B6B;
  background: rgba(255, 77, 77, 0.14);
  border-color: rgba(255, 77, 77, 0.45);
}

body[data-segfault="true"] .io-led,
body[data-segfault="true"] .social-card:hover .io-led {
  background: #FF4D4D;
  border-color: #FF8585;
  box-shadow: 0 0 8px rgba(255, 77, 77, 0.85);
}

body[data-segfault="true"] .hub-footer {
  border-top-color: rgba(255, 77, 77, 0.28);
}

body[data-segfault="true"] .footer-heart {
  color: #FF4D4D;
  filter: drop-shadow(0 0 6px rgba(255, 77, 77, 0.65));
}

body[data-segfault="true"] .footer-hint:hover kbd {
  color: #FF6B6B;
  border-color: rgba(255, 77, 77, 0.45);
  background: rgba(255, 77, 77, 0.14);
}

body[data-segfault="true"] .name-copy-trigger:hover {
  background: rgba(255, 77, 77, 0.08);
  border-color: rgba(255, 77, 77, 0.28);
}

body[data-segfault="true"] .name-copy-trigger:hover .name-copy-icon {
  color: #FF6B6B;
  background: rgba(255, 77, 77, 0.14);
  border-color: rgba(255, 77, 77, 0.45);
}

body[data-segfault="true"] .board-bus-svg .bus-trace {
  stroke: #FF5252;
  opacity: 0.88;
  stroke-width: 1.65;
  filter: drop-shadow(0 0 5px rgba(255, 82, 82, 0.65));
}

body[data-segfault="true"] .board-bus-svg .bus-pulse {
  stroke: #FF7A7A;
  filter: drop-shadow(0 0 5px rgba(255, 82, 82, 0.85));
}

body[data-segfault="true"] .board-bus-svg .bus-pad {
  fill: #FF5252;
  opacity: 1;
  filter: drop-shadow(0 0 5px rgba(255, 82, 82, 0.8));
}

body[data-segfault="true"] .board-bus-svg .bus-via {
  stroke: #FF5252;
  opacity: 1;
  filter: drop-shadow(0 0 5px rgba(255, 82, 82, 0.75));
}

body[data-segfault="true"] .board-bus-svg .bus-label {
  fill: #FF6B6B;
  opacity: 1;
}

/* ==========================================================================
   Entrance Animations & Responsive Adjustments
   ========================================================================== */
@keyframes revealUp {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal-item {
  opacity: 0;
  animation: revealUp 550ms var(--ease-out-expo) forwards;
  animation-delay: var(--delay, 0ms);
}

/* Hide keyboard shortcut hints on touch devices */
@media (hover: none), (pointer: coarse), (max-width: 560px) {
  .shortcut-key,
  .footer-hint,
  .mcu-hide-mobile,
  .reg-addr {
    display: none;
  }

  .hub-container {
    padding: clamp(0.5rem, 1.5dvh, 1rem) 2.5rem clamp(0.5rem, 1.5dvh, 1rem) 2.15rem;
    gap: clamp(0.55rem, 1.3dvh, 0.95rem);
  }

  .social-card {
    padding: clamp(0.38rem, 0.75dvh, 0.55rem) 0.85rem;
    min-height: clamp(44px, 5.8dvh, 52px);
  }

  .copied-toast {
    left: 50%;
    top: calc(100% + 6px);
    transform: translateX(-50%) translateY(-4px);
  }

  .name-copy-trigger.is-copied .copied-toast {
    transform: translateX(-50%) translateY(0);
  }

  /* Avoid expensive SVG drop-shadow filter repaints on high-DPR mobile GPUs */
  .board-bus-svg[data-bus-active="true"] .bus-trace--la-active,
  .board-bus-svg[data-bus-active="true"] .bus-trace--probe-inner,
  .board-bus-svg .bus-trace.is-active,
  .bus-pad.is-active,
  .board-bus-svg[data-bus-active="true"] .bus-pad--la,
  .bus-via.is-active,
  .board-bus-svg[data-bus-active="true"] .bus-via--la,
  .bus-pulse {
    filter: none;
  }
}

/* Crisp, fast transitions during sequential POST bus sweep so steps never overlap */
body[data-post-sweep="true"] .social-card,
body[data-post-sweep="true"] .card-icon,
body[data-post-sweep="true"] .reg-addr,
body[data-post-sweep="true"] .io-led,
body[data-post-sweep="true"] .bus-trace,
body[data-post-sweep="true"] .bus-pad,
body[data-post-sweep="true"] .bus-via,
body[data-post-sweep="true"] .ic-pins span {
  transition-duration: 75ms;
}

/* Respect Reduced Motion Preferences */
@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;
  }

  .reveal-item,
  .board-bus-svg {
    opacity: 1;
    transform: none;
  }
}
