/* ==========================================================================
   OFICINA HARDWARE LAB · ARTES DO SUL (CYBER-GROWTH DESIGN SYSTEM)
   ========================================================================== */

:root {
  --bg-primary: #080c0a;
  --bg-surface: #101714;
  --bg-surface-elevated: #16221d;
  --bg-card: rgba(18, 26, 22, 0.75);
  --bg-glass: rgba(14, 21, 18, 0.65);
  
  --ink-primary: #f0f6f2;
  --ink-secondary: #a3b8ad;
  --ink-muted: #6b8075;
  --line: rgba(255, 255, 255, 0.09);
  --line-focus: rgba(255, 107, 53, 0.4);

  --accent-orange: #ff6b35; /* Growth & Hardware Action */
  --accent-orange-soft: rgba(255, 107, 53, 0.15);
  --accent-cyan: #00d9ff;   /* Logic & MCU Telemetry */
  --accent-cyan-soft: rgba(0, 217, 255, 0.12);
  --accent-green: #10b981;  /* Verified & Online */
  --accent-green-soft: rgba(16, 185, 129, 0.15);
  --accent-purple: #a855f7; /* UART & Communication */
  --accent-purple-soft: rgba(168, 85, 247, 0.15);
  --accent-gold: #f59e0b;   /* Analog & Special */

  --font-display: "Bricolage Grotesque", "Chakra Petch", -apple-system, sans-serif;
  --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", Consolas, monospace;

  --glass-blur: blur(14px);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 9999px;

  --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.45);
  --shadow-glow-orange: 0 0 25px rgba(255, 107, 53, 0.25);
  --shadow-glow-cyan: 0 0 25px rgba(0, 217, 255, 0.22);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  background-color: var(--bg-primary);
  color: var(--ink-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Background Subtle Grid Effect */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    linear-gradient(to right, rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

a {
  color: var(--accent-orange);
  text-decoration: none;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

a:hover {
  color: #ff8c5f;
  text-shadow: 0 0 8px rgba(255, 107, 53, 0.4);
}

code, pre {
  font-family: var(--font-mono);
}

.shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px 80px;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   TOPBAR & HEADER
   ========================================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 12, 10, 0.85);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--line);
  margin: 0 -20px 24px;
  padding: 12px 24px;
  transition: all 0.3s ease;
}

.topbar.scrolled {
  background: rgba(8, 12, 10, 0.95);
  border-bottom-color: rgba(255, 107, 53, 0.25);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink-primary);
}

.brand-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-orange), #b53805);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  box-shadow: var(--shadow-glow-orange);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--ink-primary);
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tracker-mini {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--line);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--ink-secondary);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.btn-topbar {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-topbar:hover {
  color: var(--ink-primary);
  background: var(--bg-surface-elevated);
  border-color: var(--accent-orange);
}

.btn-topbar.btn-accent {
  background: var(--accent-orange-soft);
  color: var(--accent-orange);
  border-color: rgba(255, 107, 53, 0.3);
}

/* ==========================================================================
   HERO MASTERPIECE SECTION
   ========================================================================== */

.hero-cinematic {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-surface);
  margin-bottom: 36px;
  box-shadow: var(--shadow-card);
}

.hero-bg-wrapper {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.38;
  filter: saturate(1.2) brightness(0.85);
}

.hero-gradient-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, rgba(8, 12, 10, 0.94) 0%, rgba(16, 23, 20, 0.82) 55%, rgba(8, 12, 10, 0.95) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 44px 36px;
  display: grid;
  gap: 20px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.badge-glow {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--accent-orange-soft);
  color: var(--accent-orange);
  border: 1px solid rgba(255, 107, 53, 0.35);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  box-shadow: 0 0 12px rgba(255, 107, 53, 0.2);
}

.badge-pulse {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  background: var(--accent-cyan-soft);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 217, 255, 0.3);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

.hero-content h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.hero-content h1 span {
  color: var(--accent-orange);
  background: linear-gradient(135deg, #ff8c5f 0%, #ff6b35 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lead {
  font-size: 1.08rem;
  color: var(--ink-secondary);
  max-width: 78ch;
  line-height: 1.6;
}

/* ==========================================================================
   LAB TRACKER CARD (LOCALSTORAGE PERSISTENCE)
   ========================================================================== */

.lab-tracker-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  margin-top: 10px;
  display: grid;
  gap: 14px;
}

.tracker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.tracker-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink-primary);
}

.tracker-sync-status {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-green);
}

.tracker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.tracker-stat {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease;
}

.tracker-stat:hover {
  border-color: rgba(255, 107, 53, 0.3);
}

.stat-num {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin-top: 4px;
}

.stat-action {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0;
}

.btn-tracker-filter {
  width: 100%;
  height: 100%;
  min-height: 44px;
  background: var(--accent-orange);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: grid;
  place-items: center;
}

.btn-tracker-filter:hover {
  background: #ff7d4e;
  box-shadow: var(--shadow-glow-orange);
}

/* ==========================================================================
   FILTER DASHBOARD & TOOLBAR
   ========================================================================== */

.filter-dashboard {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 28px;
  display: grid;
  gap: 18px;
}

.filter-group {
  display: grid;
  gap: 10px;
}

.group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.group-title {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.group-hint {
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.chips-track {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  background: var(--bg-surface-elevated);
  color: var(--ink-secondary);
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.chip:hover {
  color: var(--ink-primary);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

.chip[aria-pressed="true"] {
  background: var(--accent-orange);
  color: #ffffff;
  border-color: var(--accent-orange);
  box-shadow: 0 0 12px rgba(255, 107, 53, 0.35);
  font-weight: 600;
}

.chip small {
  font-family: var(--font-mono);
  font-size: 0.75em;
  opacity: 0.8;
  background: rgba(0, 0, 0, 0.25);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}

.toolbar-search-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.search-box {
  flex: 1 1 280px;
  position: relative;
}

.search-input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--line);
  color: var(--ink-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 3px var(--accent-orange-soft);
}

.search-input::placeholder {
  color: var(--ink-muted);
}

.results-meta {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-secondary);
}

/* ==========================================================================
   PROJECT CARDS GRID
   ========================================================================== */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.project-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-orange), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 107, 53, 0.4);
  box-shadow: var(--shadow-card), 0 0 20px rgba(255, 107, 53, 0.15);
}

.project-card:hover::before {
  opacity: 1;
}

.project-card.featured {
  border-color: rgba(0, 217, 255, 0.28);
}

.project-card.featured::before {
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  opacity: 0.8;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-category-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  background: var(--accent-cyan-soft);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 217, 255, 0.25);
}

.card-status-pill {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.card-status-pill.in_lab {
  background: var(--accent-green-soft);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.card-status-pill.ready {
  background: var(--accent-purple-soft);
  color: var(--accent-purple);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.card-status-pill.expansion {
  background: var(--accent-orange-soft);
  color: var(--accent-orange);
  border: 1px solid rgba(255, 107, 53, 0.3);
}

.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.22rem;
  line-height: 1.25;
  color: #fff;
  margin-top: 6px;
}

.card-mcu-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-secondary);
  background: var(--bg-surface-elevated);
  padding: 3px 8px;
  border-radius: 4px;
  margin-top: 4px;
}

.card-summary {
  font-size: 0.92rem;
  color: var(--ink-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-pin-preview {
  background: var(--bg-primary);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}

.pin-preview-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--ink-muted);
  letter-spacing: 0.05em;
  display: flex;
  justify-content: space-between;
}

.pin-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.pin-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: var(--bg-surface-elevated);
  padding: 2px 6px;
  border-radius: 3px;
  border-left: 2px solid var(--accent-orange);
  color: var(--ink-primary);
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.btn-card-action {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
}

.btn-card-action.primary {
  background: var(--accent-orange);
  color: #fff;
}

.btn-card-action.primary:hover {
  background: #ff7d4e;
  box-shadow: var(--shadow-glow-orange);
}

.btn-card-action.secondary {
  background: var(--bg-surface-elevated);
  color: var(--ink-secondary);
  border-color: var(--line);
}

.btn-card-action.secondary:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-card-toggle-lab {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.btn-card-toggle-lab.active {
  background: var(--accent-green-soft);
  color: var(--accent-green);
  border-color: rgba(16, 185, 129, 0.35);
}

/* ==========================================================================
   PINOUT EXPLORER SECTION & VISUALIZER
   ========================================================================== */

.pinout-section {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  margin-bottom: 48px;
  display: grid;
  gap: 24px;
}

.section-head {
  display: grid;
  gap: 8px;
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-orange);
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
}

.section-head p {
  color: var(--ink-secondary);
  max-width: 68ch;
}

.pinout-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.tab-btn {
  background: transparent;
  border: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--ink-primary);
  background: var(--bg-surface-elevated);
}

.tab-btn.active {
  color: var(--accent-orange);
  background: var(--accent-orange-soft);
}

.pinout-display-board {
  background: #0b120f;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  overflow-x: auto;
}

/* 40-Pin Interactive Raspberry Pi Header Visualizer */
.rpi-header-table {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  border-collapse: collapse;
}

.rpi-header-table tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.rpi-header-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.rpi-header-table td {
  padding: 6px 10px;
  text-align: center;
}

.rpi-header-table td.name-left {
  text-align: right;
  color: var(--ink-secondary);
}

.rpi-header-table td.name-right {
  text-align: left;
  color: var(--ink-secondary);
}

.pin-socket {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: inline-grid;
  place-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  background: #1a2722;
  border: 1px solid #2f443c;
  cursor: default;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pin-socket:hover {
  transform: scale(1.25);
  z-index: 2;
}

.pin-socket.pwr { background: #b91c1c; border-color: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.4); }
.pin-socket.gnd { background: #18181b; border-color: #52525b; }
.pin-socket.i2c { background: #c2410c; border-color: #f97316; box-shadow: 0 0 6px rgba(249, 115, 22, 0.4); }
.pin-socket.uart { background: #1d4ed8; border-color: #3b82f6; box-shadow: 0 0 6px rgba(59, 130, 246, 0.4); }
.pin-socket.spi { background: #0f766e; border-color: #14b8a6; box-shadow: 0 0 6px rgba(20, 184, 166, 0.4); }
.pin-socket.w1 { background: #047857; border-color: #10b981; box-shadow: 0 0 6px rgba(16, 185, 129, 0.4); }
.pin-socket.gpio { background: #374151; border-color: #6b7280; }

.pinout-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-secondary);
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* ==========================================================================
   BATTERY & POWER RUNTIME CALCULATOR
   ========================================================================== */

.calc-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  display: grid;
  gap: 16px;
  margin-bottom: 48px;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.calc-input-box {
  display: grid;
  gap: 6px;
}

.calc-input-box label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-secondary);
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
}

.calc-input-box input[type="range"] {
  width: 100%;
  accent-color: var(--accent-orange);
}

.calc-result-box {
  background: var(--bg-primary);
  border: 1px solid rgba(255, 107, 53, 0.3);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: grid;
  place-items: center;
  text-align: center;
}

.calc-val {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-orange);
  line-height: 1;
}

.calc-desc {
  font-size: 0.85rem;
  color: var(--ink-secondary);
  margin-top: 4px;
}

/* ==========================================================================
   MODAL / DETAILS DRAWER (STEP-BY-STEP & SCHEMATIC)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4, 7, 6, 0.85);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

.modal-window {
  background: var(--bg-surface);
  border: 1px solid rgba(255, 107, 53, 0.35);
  border-radius: var(--radius-lg);
  max-width: 880px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.8);
  display: grid;
  gap: 20px;
  padding: 32px;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.modal-backdrop.open .modal-window {
  transform: translateY(0);
}

.btn-close-modal {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--line);
  color: var(--ink-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

.btn-close-modal:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
}

.modal-header {
  display: grid;
  gap: 8px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  padding-right: 40px;
}

.modal-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.modal-section-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-orange);
  margin-top: 8px;
}

/* Wiring Table in Modal */
.wiring-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  margin-top: 6px;
}

.wiring-table th {
  text-align: left;
  padding: 8px 12px;
  background: var(--bg-surface-elevated);
  color: var(--ink-muted);
  border-bottom: 1px solid var(--line);
}

.wiring-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-primary);
}

.step-list {
  display: grid;
  gap: 12px;
  padding-left: 0;
  list-style: none;
}

.step-item {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.92rem;
  line-height: 1.5;
}

/* Code Snippet Box with Copy Button */
.code-box {
  background: #090e0c;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #111a16;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-muted);
}

.btn-copy-code {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-secondary);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy-code:hover {
  background: var(--accent-orange);
  color: #fff;
  border-color: var(--accent-orange);
}

.code-box pre {
  padding: 14px;
  overflow-x: auto;
  font-size: 0.82rem;
  color: #d6e2dc;
  line-height: 1.5;
}

/* ==========================================================================
   FOOTER (ARTES DO SUL BRANDING)
   ========================================================================== */

.footer-branded {
  margin-top: 60px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.footer-author a {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent-orange);
}

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

.footer-nav a {
  color: var(--ink-secondary);
}

.footer-nav a:hover {
  color: var(--ink-primary);
}

/* ==========================================================================
   FLOATING GO-TO-TOP BUTTON
   ========================================================================== */

.go-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  border: 1px solid rgba(255, 107, 53, 0.4);
  color: var(--accent-orange);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all 0.25s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.go-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.go-to-top:hover {
  background: var(--accent-orange);
  color: #fff;
  box-shadow: var(--shadow-glow-orange);
}

/* ==========================================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================================== */

@media (max-width: 768px) {
  .hero-content {
    padding: 28px 20px;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .modal-window {
    padding: 20px;
  }
  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }
}
