:root {
  --bg-primary: #0A1628;
  --bg-panel: #112233;
  --bg-card: #1B3A5C;
  --cyan: #00E5FF;
  --green: #00FF9F;
  --orange: #FF6B35;
  --red: #FF4D6D;
  --gold: #FFD700;
  --text-light: #E6F0FA;
  --text-muted: #8A9BB0;
  --border-width: 3px;
  --border-width-thin: 2px;
  --shadow-hard: 6px 6px 0px 0px rgba(0, 0, 0, 0.8);
  --font-heading: "Chakra Petch", "Space Grotesk", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "JetBrains Mono", "Roboto Mono", ui-monospace, SFMono-Regular, Consolas, "Noto Sans SC", monospace;
  --header-height: 120px;
  --transition-speed: 0.3s ease;
}
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-light);
  line-height: 1.7;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { display: block; max-width: 100%; }
a { color: var(--green); text-decoration: none; transition: color var(--transition-speed), background-color var(--transition-speed); }
a:hover { color: var(--cyan); }
ul, ol { list-style: none; }
.container {
  width: min(100% - 3rem, 1440px);
  margin-inline: auto;
}
.skip-link {
  position: absolute;
  left: 1rem;
  top: -100%;
  z-index: 2000;
  background: var(--green);
  color: var(--bg-primary);
  padding: 0.5rem 1rem;
  font-weight: bold;
  font-family: var(--font-heading);
  border-radius: 0 0 4px 4px;
  transition: top var(--transition-speed);
}
.skip-link:focus { top: 0; outline: var(--border-width) solid var(--cyan); }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
:focus-visible {
  outline: var(--border-width-thin) solid var(--cyan);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(0, 229, 255, 0.2);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 22, 40, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: var(--border-width-thin) solid var(--bg-card);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}
.top-bar {
  background: var(--bg-panel);
  border-bottom: var(--border-width-thin) solid var(--cyan);
}
.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
  gap: 1rem;
}
.top-bar-message {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-body);
  letter-spacing: 0.05em;
}
.top-bar-link {
  color: var(--orange);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  border: var(--border-width-thin) solid var(--orange);
  padding: 0.1rem 0.8rem;
  transition: background-color var(--transition-speed), color var(--transition-speed);
}
.top-bar-link:hover {
  background: var(--orange);
  color: var(--bg-primary);
}
.main-nav {
  border-bottom: var(--border-width-thin) solid var(--bg-card);
}
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.5rem;
}
.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-style: italic;
  font-size: 1.6rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  position: relative;
}
.brand-logo:hover { color: var(--green); }
.brand-mark {
  width: 1.2rem;
  height: 1.2rem;
  background: var(--green);
  box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--green), 4px 4px 0 0 rgba(0, 255, 159, 0.2);
  position: relative;
  display: inline-block;
  clip-path: polygon(0 0, 50% 0, 100% 50%, 100% 100%, 50% 100%, 0 50%);
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 20%;
  background: var(--bg-primary);
  clip-path: polygon(0 0, 50% 0, 100% 50%, 100% 100%, 50% 100%, 0 50%);
}
.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 6px;
}
.nav-toggle .nav-line {
  width: 1.8rem;
  height: var(--border-width-thin);
  background: var(--green);
  transition: transform 0.3s ease, opacity 0.3s ease;
  display: block;
}
.nav-toggle[aria-expanded="true"] .nav-line:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-line:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-line:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-links a {
  color: var(--text-light);
  font-family: var(--font-heading);
  font-weight: 400;
  font-style: italic;
  font-size: 1.05rem;
  padding: 0.5rem 0.8rem;
  text-transform: uppercase;
  position: relative;
  border: var(--border-width-thin) solid transparent;
}
.nav-links a:hover {
  color: var(--green);
  border-color: var(--cyan);
  box-shadow: 4px 4px 0 0 var(--cyan);
}
.nav-links a[aria-current="page"] {
  background: var(--green);
  color: var(--bg-primary);
  font-weight: 700;
  box-shadow: 4px 4px 0 0 var(--green);
  border-color: var(--green);
}

/* Scroll Progress */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--green), var(--cyan), var(--orange));
  z-index: 2000;
  width: 0%;
  transition: width 0.1s linear;
  box-shadow: 0 0 12px rgba(0, 255, 159, 0.8);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.6rem 1.8rem;
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border: var(--border-width-thin) solid var(--green);
  background: transparent;
  color: var(--green);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 4px 4px 0 0 transparent;
}
.btn:hover {
  background: var(--green);
  color: var(--bg-primary);
  box-shadow: 4px 4px 0 0 var(--cyan);
  transform: translate(-2px, -2px);
}
.btn-primary {
  background: var(--green);
  color: var(--bg-primary);
  box-shadow: 4px 4px 0 0 var(--cyan);
}
.btn-primary:hover { background: var(--cyan); box-shadow: 4px 4px 0 0 var(--green); }
.btn-outline {
  border-color: var(--cyan);
  color: var(--cyan);
}
.btn-outline:hover { background: var(--cyan); color: var(--bg-primary); }

/* Footer */
.site-footer {
  background: var(--bg-panel);
  border-top: var(--border-width) solid var(--bg-card);
  position: relative;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--green), var(--orange), var(--cyan));
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
  gap: 2rem;
  padding-top: 3rem;
  padding-bottom: 2rem;
}
.footer-brand { font-size: 1.3rem; margin-bottom: 1rem; }
.footer-title {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--cyan);
  letter-spacing: 0.05em;
  margin-bottom: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: var(--border-width-thin) solid var(--bg-card);
}
.footer-desc { color: var(--text-muted); font-size: 0.85rem; }
.footer-links li,
.contact-list li { margin-bottom: 0.5rem; }
.footer-links a,
.contact-list a { color: var(--text-muted); font-size: 0.9rem; }
.footer-links a:hover,
.contact-list a:hover { color: var(--green); padding-left: 0.3rem; }
.contact-list li { color: var(--text-light); font-size: 0.85rem; }
.footer-bottom {
  background: var(--bg-primary);
  border-top: var(--border-width-thin) solid var(--bg-card);
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.footer-bottom-wrap {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Back to top */
.back-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 3rem;
  height: 3rem;
  background: var(--bg-panel);
  border: var(--border-width-thin) solid var(--green);
  color: var(--green);
  font-size: 1rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition-speed);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover { background: var(--green); color: var(--bg-primary); }

/* Breadcrumb */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 1rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.breadcrumb a { color: var(--cyan); }
.breadcrumb a:hover { color: var(--green); }
.breadcrumb span { color: var(--text-light); }
.breadcrumb li:not(:last-child)::after { content: "//"; margin-left: 0.5rem; color: var(--text-muted); }

/* Section Header */
.section-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin: 3rem 0 1.5rem;
}
.section-title {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 700;
  font-size: 2.2rem;
  line-height: 1.1;
  color: var(--text-light);
  text-transform: uppercase;
  position: relative;
}
.section-title::before {
  content: attr(data-index);
  position: absolute;
  right: calc(100% - 1rem);
  color: var(--orange);
  font-size: 1rem;
  font-family: var(--font-body);
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: var(--cyan);
  z-index: 1;
}
.section-note {
  writing-mode: vertical-rl;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-left: var(--border-width-thin) solid var(--cyan);
  padding-left: 0.5rem;
  transform: rotate(180deg);
}

/* General Content & Grid */
.main-content { padding-bottom: 4rem; }
.page-hero { padding: 3rem 0; border-bottom: var(--border-width-thin) solid var(--bg-card); }
.page-hero .page-title {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 700;
  font-size: 3rem;
  color: var(--text-light);
  text-shadow: 4px 4px 0 var(--bg-card), 8px 8px 0 rgba(0, 229, 255, 0.2);
}
.page-hero .page-desc { color: var(--text-muted); max-width: 40rem; margin-top: 1rem; }
.content-area { padding-top: 2rem; }

/* Bento Grid & Cards */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}
.bento-card {
  background: var(--bg-panel);
  border: var(--border-width-thin) solid var(--bg-card);
  box-shadow: var(--shadow-hard);
  padding: 1.5rem;
  position: relative;
  transition: transform var(--transition-speed), border-color var(--transition-speed);
}
.bento-card:hover { border-color: var(--cyan); transform: translateY(-4px); }
.bento-card::before,
.bento-card::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--green);
  border-style: solid;
}
.bento-card::before { top: -2px; left: -2px; border-width: 2px 0 0 2px; }
.bento-card::after { bottom: -2px; right: -2px; border-width: 0 2px 2px 0; }
.bento-card .card-index {
  font-size: 0.8rem;
  color: var(--orange);
  display: block;
  margin-bottom: 0.5rem;
}
.bento-card .card-title {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}
.bento-card .card-text { color: var(--text-muted); font-size: 0.9rem; }

/* Utility classes for bento spanning */
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

/* Filter tags (for JS filtering) */
.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 1rem 0;
}
.filter-tag {
  background: var(--bg-panel);
  border: var(--border-width-thin) solid var(--bg-card);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  padding: 0.4rem 1.2rem;
  cursor: pointer;
  transition: all var(--transition-speed);
}
.filter-tag:hover, .filter-tag[data-filter="active"] {
  border-color: var(--green);
  color: var(--green);
  box-shadow: 2px 2px 0 0 var(--green);
}

/* Reduced Motion */
@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;
  }
  html { scroll-behavior: auto; }
}

/* Responsive */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .main-nav { position: relative; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-panel);
    flex-direction: column;
    align-items: stretch;
    border-bottom: var(--border-width-thin) solid var(--cyan);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.8);
    padding: 1rem;
    gap: 0.5rem;
  }
  .nav-links[data-open] { display: flex; }
  .nav-links a {
    display: block;
    padding: 0.8rem 1rem;
    border: var(--border-width-thin) solid transparent;
    text-align: center;
  }
  .nav-links a:hover { border-color: var(--cyan); }
  .top-bar .container { flex-direction: column; gap: 0.2rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .container { width: calc(100% - 2rem); }
  .bento-grid { grid-template-columns: 1fr; }
  .col-4, .col-5, .col-6, .col-7, .col-8, .col-12 { grid-column: span 1; }
  .page-hero .page-title { font-size: 2.2rem; }
}
@media (max-width: 480px) {
  .footer-bottom-wrap { flex-direction: column; gap: 0.3rem; text-align: center; }
  .brand-text { font-size: 1.3rem; }
  .back-to-top { width: 2.5rem; height: 2.5rem; right: 1rem; bottom: 1rem; }
}
@media (min-width: 769px) {
  .nav-links[data-open] { display: flex; }
}
