:root {
  --bg-canvas: #160f2e;
  --bg-surface: #251b43;
  --bg-surface-alt: #2f2355;
  --text-primary: #ffffff;
  --text-muted: #d0c8e8;
  --accent-primary: #e0409b;
  --accent-line: #22d3ee;
  --border-subtle: rgba(34, 211, 238, 0.28);
  --shadow-offset: 4px 4px 0 #0d0720;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

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

body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.68;
  min-height: 100vh;
  padding: clamp(0.75rem, 2vw, 1.75rem);
  overflow-wrap: anywhere;
  hyphens: auto;
}

.site-frame {
  max-width: 1240px;
  margin: 0 auto;
  border: 1px solid var(--border-subtle);
  background: var(--bg-canvas);
  box-shadow: 0 0 0 1px rgba(22, 15, 46, 0.8), 0 20px 50px rgba(8, 4, 18, 0.6);
  position: relative;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--accent-primary);
  color: #fff;
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  z-index: 1000;
  text-decoration: none;
}
.skip-link:focus-visible {
  top: 1rem;
}

/* Header */
.site-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  gap: 1rem;
}

.brand {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: #ffffff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: lowercase;
}
.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--accent-line);
  display: inline-block;
  box-shadow: 0 0 8px var(--accent-line);
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-desktop a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-family: var(--font-mono);
  transition: color 0.15s ease;
}
.nav-desktop a:hover,
.nav-desktop a[aria-current="page"] {
  color: var(--accent-line);
}

.btn-cta {
  background: var(--accent-primary);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  padding: 0.55rem 1rem;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-offset);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-cta:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #0d0720;
}
.btn-cta:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 transparent;
}

.btn-secondary {
  background: var(--bg-surface-alt);
  color: #ffffff;
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.55rem 1rem;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  box-shadow: var(--shadow-offset);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-secondary:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #0d0720;
  border-color: var(--accent-line);
}

/* Mobile 3-dot trigger */
.nav-toggle-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: #ffffff;
  padding: 0.4rem 0.65rem;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  letter-spacing: 0.1em;
}
.nav-toggle-btn:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent-line);
  outline-offset: 3px;
}

.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1.25rem;
  flex-direction: column;
  gap: 1rem;
  z-index: 50;
}
.mobile-menu.is-open {
  display: flex;
}
.mobile-menu a {
  color: var(--text-primary);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  padding: 0.4rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

/* Hero short band */
.hero-band {
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.25rem, 4vw, 3rem) 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(37, 27, 67, 0.4) 0%, rgba(22, 15, 46, 0.9) 100%);
}
.hero-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-line);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.hero-band h1 {
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.03em;
  max-width: 24ch;
  color: #ffffff;
}
.hero-band p {
  color: var(--text-muted);
  max-width: 68ch;
  margin-top: 1rem;
  font-size: 1.1rem;
}

/* Sequence layout with cyan vertical line */
.sequence-wrap {
  position: relative;
  padding: clamp(1rem, 3vw, 2.5rem);
}
.sequence-wrap::before {
  content: "";
  position: absolute;
  top: 2rem;
  bottom: 2rem;
  left: clamp(1.75rem, 3.75vw, 3.25rem);
  width: 2px;
  background: linear-gradient(180deg, var(--accent-line), rgba(34, 211, 238, 0.15));
  z-index: 1;
}

.circuit-section {
  position: relative;
  z-index: 2;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
  padding-left: clamp(2.5rem, 5vw, 4.25rem);
}
.circuit-section:last-child {
  margin-bottom: 1rem;
}

.section-badge {
  position: absolute;
  left: 0;
  top: 0;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--accent-line);
  color: var(--accent-line);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.3);
}

.circuit-section h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}
.section-intro {
  color: var(--text-muted);
  max-width: 70ch;
  margin-bottom: 1.75rem;
}

/* Standard Inner Page Layout */
.page-header {
  padding: clamp(2rem, 4vw, 3.5rem) clamp(1.25rem, 4vw, 3rem);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}
.page-header h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.page-header p {
  color: var(--text-muted);
  margin-top: 0.75rem;
  max-width: 68ch;
  font-size: 1.1rem;
}
.page-content {
  padding: clamp(1.5rem, 3.5vw, 3rem);
  max-width: 100%;
}

/* Cards & Grid */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 1.5rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.circuit-card {
  background: var(--bg-surface);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 8px 24px rgba(9, 4, 20, 0.45);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
  position: relative;
}
.circuit-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(9, 4, 20, 0.7);
}

.card-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-line);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}
.circuit-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.65rem;
  font-weight: 700;
  line-height: 1.3;
}
.circuit-card p {
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

/* Split Image Card */
.split-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-surface);
  margin-bottom: 2rem;
  box-shadow: 0 8px 24px rgba(9, 4, 20, 0.45);
}
.split-card-media {
  position: relative;
  min-height: 280px;
}
.split-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.split-card-body {
  padding: clamp(1.25rem, 3vw, 2.25rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Square photograph blocks */
.photo-box {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  margin-bottom: 1.25rem;
  background-color: #120a24;
}
.photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Timeline sequences */
.timeline-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  padding-left: 1.5rem;
  border-left: 1px dashed var(--accent-line);
  margin: 1.5rem 0;
}
.timeline-item {
  position: relative;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.85rem;
  top: 0.4rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-primary);
}
.timeline-time {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-line);
}
.timeline-item h4 {
  font-size: 1.1rem;
  margin: 0.15rem 0 0.35rem;
}
.timeline-item p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Responsive Table */
.table-scroll-wrapper {
  overflow-x: auto;
  margin: 2rem 0;
  border: 1px solid var(--border-subtle);
}
table.guide-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
  background: var(--bg-surface);
  text-align: left;
}
table.guide-table th {
  background: var(--bg-surface-alt);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.9rem 1.2rem;
  color: var(--accent-line);
  border-bottom: 1px solid var(--border-subtle);
  text-transform: uppercase;
}
table.guide-table td {
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.95rem;
  color: var(--text-muted);
}
table.guide-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
}

/* Interactive Note Tool */
.note-tool-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: clamp(1.25rem, 3vw, 2rem);
  margin-top: 2rem;
}
.form-group {
  margin-bottom: 1.25rem;
}
.form-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-line);
  margin-bottom: 0.4rem;
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  background: #150e2b;
  border: 1px solid var(--border-subtle);
  color: #ffffff;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 0.98rem;
}
.form-textarea {
  min-height: 120px;
  resize: vertical;
}
.form-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 1rem;
}
.preview-output {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: #100a22;
  border: 1px dashed var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  white-space: pre-wrap;
  color: var(--text-muted);
}

/* Inline FAQ Details */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}
details.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 1rem 1.25rem;
}
details.faq-item[open] {
  border-color: var(--accent-line);
}
summary.faq-question {
  cursor: pointer;
  font-weight: 700;
  font-size: 1.05rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
summary.faq-question::-webkit-details-marker {
  display: none;
}
summary.faq-question::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--accent-line);
}
details.faq-item[open] summary.faq-question::after {
  content: "–";
}
.faq-answer {
  margin-top: 0.85rem;
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.65;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.85rem;
}

/* Text editorial column */
.editorial-text {
  max-width: 70ch;
}
.editorial-text p {
  margin-bottom: 1.25rem;
  color: var(--text-muted);
}
.editorial-text h2 {
  font-size: 1.5rem;
  margin: 2rem 0 0.85rem;
  color: #ffffff;
}
.editorial-text h3 {
  font-size: 1.2rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--accent-line);
}
.editorial-text ul {
  margin: 1rem 0 1.5rem 1.5rem;
  color: var(--text-muted);
}
.editorial-text li {
  margin-bottom: 0.5rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: #120a26;
  padding: clamp(2rem, 4vw, 3rem) clamp(1.25rem, 3.5vw, 2.5rem);
}
.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-brand {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.5rem;
}
.footer-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  max-width: 44ch;
}
.footer-nav-col h4 {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--accent-line);
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}
.footer-nav-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.footer-nav-col a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
}
.footer-nav-col a:hover {
  color: var(--accent-line);
}
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
}
.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Media Queries */
@media (max-width: 860px) {
  .nav-desktop {
    display: none;
  }
  .nav-toggle-btn {
    display: block;
  }
  .footer-top {
    grid-template-columns: 1fr;
  }
  .split-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  body {
    padding: 0.25rem;
  }
  .site-header {
    padding: 0.75rem 1rem;
  }
  .sequence-wrap::before {
    left: 1.25rem;
  }
  .circuit-section {
    padding-left: 2rem;
  }
  .section-badge {
    width: 1.8rem;
    height: 1.8rem;
    font-size: 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
