@import "core.css";

/* ============================================================
   TANOSHII BLUEPRINT — Base Design System
   Core Tokens, Layout, and Global Components
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Orbitron:wght@500;600;700&display=swap');

/* --- Reset & Base --- */
[x-cloak] { display: none !important; }

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

* {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--bp-font-body);
  font-weight: 400;
  color: var(--bp-text-secondary);
  background: var(--bp-bg);
  line-height: 1.6;
  overflow-x: hidden;
}

/* --- Blueprint Grid Background --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(var(--bp-line-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--bp-line-subtle) 1px, transparent 1px);
  background-size: 40px 40px, 40px 40px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  opacity: 0.6;
}

body > .bp-grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center, 
    transparent 40%, 
    rgba(6, 12, 24, 0.5) 100%
  );
}

/* Scan line overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 212, 255, 0.008) 2px,
    rgba(0, 212, 255, 0.008) 4px
  );
}

/* --- Container --- */
.bp-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

@media (max-width: 768px) {
  .bp-container {
    padding: 0 16px;
  }
}

/* --- Accessibility --- */
.bp-skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 12px 24px;
  background: var(--bp-cyan);
  color: var(--bp-bg);
  font-family: var(--bp-font-body);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--bp-radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: top 0.2s ease;
}

.bp-skip-link:focus {
  top: 16px;
  outline: 2px solid var(--bp-text-primary);
  outline-offset: 2px;
}

:focus-visible {
  outline: 2px solid var(--bp-cyan);
  outline-offset: 2px;
  border-radius: var(--bp-radius-sm);
}

/* --- Navigation --- */
.bp-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(5, 10, 15, 0.92);
  backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid var(--bp-line-subtle);
  height: 64px;
}

.bp-nav__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.bp-nav__brand {
  font-family: var(--bp-font-mono);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--bp-text-primary);
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
}

.bp-nav__brand ruby rb {
  font-family: var(--bp-font-body);
  font-size: 1rem;
  color: var(--bp-cyan);
}

.bp-nav__brand ruby rt {
  font-size: 0.55em;
  color: var(--bp-text-tertiary);
  font-family: var(--bp-font-mono);
  letter-spacing: 0.15em;
}

.bp-nav__links {
  display: flex;
  gap: 4px;
  align-items: center;
}

.bp-nav__links a {
  font-family: var(--bp-font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--bp-text-tertiary);
  text-decoration: none;
  padding: 8px 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: var(--bp-transition);
  min-height: 36px;
  display: flex;
  align-items: center;
  border: 1px solid transparent;
}

.bp-nav__links a:hover {
  color: var(--bp-cyan);
  background: rgba(0, 212, 255, 0.04);
  border-color: rgba(0, 212, 255, 0.15);
}

.bp-nav__links a::before {
  content: '/';
  opacity: 0.3;
  margin-right: 4px;
}

.bp-nav__links a.bp-nav__cta {
  color: var(--bp-bg);
  background: var(--bp-cyan);
  font-weight: 600;
  padding: 8px 20px;
  border: 1px solid var(--bp-cyan);
  margin-left: 8px;
}

.bp-nav__links a.bp-nav__cta:hover {
  background: transparent;
  color: var(--bp-cyan);
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.15);
}

.bp-nav__links a.bp-nav__cta::before { display: none; }

.bp-nav__theme-toggle {
  background: transparent;
  border: 1px solid var(--bp-line-subtle);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  transition: var(--bp-transition);
}

.bp-nav__theme-toggle:hover {
  border-color: var(--bp-cyan);
  background: var(--bp-cyan-dim);
}

.bp-nav__avatar {
  width: 32px;
  height: 32px;
  border: 1px solid var(--bp-cyan);
  cursor: pointer;
}

.bp-nav__toggle {
  display: none;
  background: none;
  border: 1px solid var(--bp-line-subtle);
  color: var(--bp-cyan);
  font-size: 1.2rem;
  padding: 6px 10px;
  cursor: pointer;
  min-height: 36px;
  min-width: 36px;
}

@media (max-width: 900px) {
  .bp-nav__toggle { display: flex; align-items: center; justify-content: center; }
  .bp-nav__links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(5, 10, 15, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 12px 32px;
    border-bottom: 1px solid var(--bp-line-subtle);
  }
  .bp-nav__links--open { display: flex; }
  .bp-nav__links a { width: 100%; justify-content: flex-start; padding: 14px 16px; }
}

/* --- Buttons --- */
.bp-btn {
  font-family: var(--bp-font-body);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding: 14px 28px;
  border: 1px solid var(--bp-line);
  border-radius: var(--bp-radius-md);
  color: var(--bp-text-primary);
  background: transparent;
  cursor: pointer;
  transition: var(--bp-transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
}

.bp-btn:hover {
  border-color: var(--bp-cyan);
  background: var(--bp-cyan-dim);
  box-shadow: 0 0 20px var(--bp-cyan-glow);
}

.bp-btn--primary {
  background: var(--bp-cyan);
  color: var(--bp-bg);
  border-color: var(--bp-cyan);
}

.bp-btn--primary:hover {
  background: var(--bp-text-primary);
  color: var(--bp-bg);
}

/* --- Sections --- */
.bp-section {
  position: relative;
  z-index: 1;
  padding: 80px 0;
  border-top: 1px solid var(--bp-line-subtle);
}

.bp-section__header {
  margin-bottom: 48px;
}

.bp-section__label {
  font-family: var(--bp-font-mono);
  font-size: 0.7rem;
  color: var(--bp-cyan);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bp-section__label::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 1px;
  background: var(--bp-cyan);
}

/* --- Footer --- */
.bp-footer {
  width: 100%;
  background: #050A0F;
  border-top: 1px solid var(--bp-line-subtle);
  padding-top: 80px;
  position: relative;
  z-index: 1;
}

.bp-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

.bp-footer__top {
  display: flex;
  gap: 0;
}

/* LEFT COL — Brand */
.bp-footer__brand {
  width: 40%;
  padding-right: 48px;
  border-right: 1px solid var(--bp-line-subtle);
}

.bp-footer__logo {
  font-family: var(--bp-font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--bp-text-primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  display: block;
  margin-bottom: 16px;
  transition: var(--bp-transition);
}

.bp-footer__logo:hover {
  color: var(--bp-cyan);
}

.bp-footer__logo-kanji {
  font-family: var(--bp-font-body);
  font-weight: 400;
  font-size: 0.9rem;
  display: block;
  color: var(--bp-text-tertiary);
  margin-top: 2px;
  letter-spacing: 0.05em;
}

.bp-footer__desc {
  font-family: var(--bp-font-body);
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--bp-text-secondary);
  margin: 16px 0 24px 0;
  max-width: 360px;
}

.bp-footer__status {
  font-family: var(--bp-font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--bp-cyan);
  display: inline-block;
  padding: 4px 0;
  border-top: 1px solid var(--bp-line-subtle);
  padding-top: 10px;
  margin-top: auto;
}

.bp-footer__status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--bp-cyan);
  margin-right: 8px;
  animation: bp-pulse-status 2s ease-in-out infinite;
  vertical-align: middle;
}

/* RIGHT COL — Links Grid */
.bp-footer__links {
  width: 60%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.bp-footer__col {
  padding: 0 24px;
  border-left: 1px solid var(--bp-line-subtle);
}

.bp-footer__col:first-child {
  padding-left: 32px;
}

.bp-footer__cat {
  font-family: var(--bp-font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--bp-cyan);
  margin-bottom: 20px;
  display: block;
}

.bp-footer__cat::before {
  content: '[ ';
  opacity: 0.5;
}

.bp-footer__cat::after {
  content: ' ]';
  opacity: 0.5;
}

.bp-footer__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bp-footer__list a {
  font-family: var(--bp-font-body);
  font-size: 0.875rem;
  color: var(--bp-text-secondary);
  text-decoration: none;
  display: inline-block;
  transition: transform 0.25s var(--bp-transition), color 0.25s ease;
}

.bp-footer__list a:hover {
  color: var(--bp-cyan);
  transform: translateX(4px);
}

/* BOTTOM ROW */
.bp-footer__bottom {
  border-top: 1px solid var(--bp-bg);
  padding: 20px 0;
  margin-top: 60px;
  text-align: center;
}

.bp-footer__copy {
  font-family: var(--bp-font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bp-text-muted);
  margin: 0;
}

@media (max-width: 1024px) {
  .bp-footer__top {
    flex-direction: column;
    gap: 40px;
  }

  .bp-footer__brand {
    width: 100%;
    padding-right: 0;
    border-right: none;
    border-bottom: 1px solid var(--bp-line-subtle);
    padding-bottom: 32px;
  }

  .bp-footer__links {
    width: 100%;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .bp-footer__col {
    border-left: none;
    padding: 0;
  }

  .bp-footer__col:first-child {
    padding-left: 0;
  }
}

@media (max-width: 480px) {
  .bp-footer__links {
    grid-template-columns: 1fr;
  }

  .bp-footer__bottom {
    margin-top: 40px;
    padding: 16px 0;
  }

  .bp-footer {
    padding-top: 48px;
  }
}

.bp-totop {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  background: rgba(6, 12, 24, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid var(--bp-line);
  border-radius: 50%;
  color: var(--bp-text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bp-totop--visible {
  opacity: 1;
  visibility: visible;
}

.bp-totop:hover {
  border-color: var(--bp-cyan);
  background: var(--bp-cyan-dim);
  box-shadow: 0 0 16px var(--bp-cyan-glow);
}

/* --- Decorative Nodes --- */
.bp-node {
  position: fixed;
  width: 6px;
  height: 6px;
  background: var(--bp-cyan);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  box-shadow: 0 0 10px var(--bp-cyan-glow);
  opacity: 0.4;
  animation: bp-node-pulse 4s ease-in-out infinite;
}

@keyframes bp-node-pulse {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.5); opacity: 0.6; }
}
