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

/* ── ROOT ──────────────────────────────────────────────────────── */
/*
  Contrast ratios (WCAG AA requires 4.5:1 normal text, 3:1 large text):
  --text      #d4d4d4  on --bg  #0a0a0a : ~12.6:1  ✓
  --text      #d4d4d4  on --bg2 #111111 : ~11.0:1  ✓
  --text-dim  #909090  on --bg  #0a0a0a :  ~5.2:1  ✓
  --text-dim  #909090  on --bg2 #111111 :  ~4.8:1  ✓
  --accent    #00e5ff  on --bg  #0a0a0a :  ~8.1:1  ✓
  --text-muted #555     — decorative/borders only, not for text
*/
:root {
  --bg:         #0a0a0a;
  --bg2:        #111111;
  --border:     #1e1e1e;
  --accent:     #00e5ff;
  --text:       #d4d4d4;
  --text-dim:   #909090;
  --text-muted: #555;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  touch-action: manipulation;
}

/* Sub-pages: body fades in with opacity only — no transform on body, which would
   create a new containing block and unfix position:fixed children (canvas, nav). */
body.page-in { animation: pageFade 0.5s ease both; }
@keyframes pageFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
/* Slide-in applied to content elements, not body, so fixed canvas is unaffected. */
body.page-in nav,
body.page-in .page-wrap,
body.page-in .policy-wrap,
body.page-in footer {
  animation: pageSlide 0.5s ease both;
}
@keyframes pageSlide {
  from { transform: translateY(8px); }
  to   { transform: none; }
}

/* ── CANVAS ─────────────────────────────────────────────────────── */
/* inset:0 lets the browser size the canvas to the real viewport — more reliable
   than 100vw/100vh which can be wrong on iOS Safari (large-viewport mismatch). */
#bgCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── NAV ────────────────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; width: 100%;
  padding: 1rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 500;
}
.nav-logo {
  font-family: monospace;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-links { display: flex; gap: 2rem; list-style: none; flex-wrap: wrap; }
.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }

/* ── BUTTONS ────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.7rem 1.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 2px;
  transition: all 0.2s;
  cursor: pointer;
  text-align: center;
}
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { opacity: 0.82; }
.btn-ghost { border: 1px solid var(--border); color: var(--text-dim); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-outline {
  border: 1px solid rgba(0, 229, 255, 0.3);
  color: var(--accent);
}
.btn-outline:hover { border-color: var(--accent); background: rgba(0, 229, 255, 0.06); }
.btn-disabled {
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: default;
  pointer-events: none;
}
.btn-fixed { width: 200px; }

/* ── SHARED TEXT / SECTION ELEMENTS ────────────────────────────── */
.section-label {
  font-family: monospace;
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
h2 { font-size: 1.85rem; font-weight: 700; color: #fff; margin-bottom: 2rem; }
.divider { border: none; border-top: 1px solid var(--border); }

.tag-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tag {
  font-size: 0.66rem;
  font-family: monospace;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.6rem;
  border: 1px solid rgba(0, 229, 255, 0.35);
  color: var(--accent);
  border-radius: 2px;
}

/* ── PAGE WRAPPERS ──────────────────────────────────────────────── */
.page-wrap {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 8rem 2rem 4rem;
}

.page-header {
  display: inline-block;
  background: rgba(10, 10, 10, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 4px;
  padding: 2rem 2.5rem;
  margin-bottom: 3rem;
  border: 1px solid rgba(30, 30, 30, 0.6);
}
.page-title {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 0.85rem;
}

.section-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 6rem 2rem;
  background: rgba(10, 10, 10, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ── CONTENT BLOCKS ─────────────────────────────────────────────── */
.content-block {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1.4rem 1.6rem;
}
.block-title {
  font-size: 0.72rem;
  font-family: monospace;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.85rem;
}
.content-block p {
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.8;
}

/* ── LISTS ──────────────────────────────────────────────────────── */
.feature-list { list-style: none; display: flex; flex-direction: column; gap: 0.45rem; }
.feature-list li {
  color: var(--text-dim);
  font-size: 0.9rem;
  padding-left: 1.25rem;
  position: relative;
  line-height: 1.6;
}
.feature-list li::before { content: '›'; position: absolute; left: 0; color: var(--accent); }

.step-list { list-style: none; display: flex; flex-direction: column; gap: 0.9rem; }
.step-list li {
  display: flex;
  gap: 0.9rem;
  align-items: baseline;
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.6;
}
.step-num {
  font-family: monospace;
  font-size: 0.7rem;
  color: var(--accent);
  background: rgba(0, 229, 255, 0.07);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 2px;
  padding: 0.1rem 0.45rem;
  flex-shrink: 0;
}
.step-list strong { color: var(--text); font-weight: 600; }

/* ── SIDEBAR META ───────────────────────────────────────────────── */
.sidebar-meta {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.meta-row { display: flex; flex-direction: column; gap: 0.15rem; }
.meta-key {
  font-family: monospace;
  font-size: 0.62rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.meta-val { font-size: 0.85rem; color: var(--text); }

/* ── FOOTER ─────────────────────────────────────────────────────── */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 3rem 2rem 2.5rem;
  border-top: 1px solid var(--border);
}
footer.mt { margin-top: 4rem; }
.socials {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.socials a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.socials a svg { width: 14px; height: 14px; flex-shrink: 0; }
.socials a:hover { color: var(--accent); }
.footer-copy { font-size: 0.76rem; color: var(--text-dim); }
.footer-copy a { color: var(--text-dim); text-decoration: none; }

/* ── INTRO (index.html) ─────────────────────────────────────────── */
#main {
  position: relative;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.65s ease 0.15s;
}
#main.visible { opacity: 1; }

#intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: rgb(0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition:
    background-color 1.2s ease,
    transform 0.9s cubic-bezier(0.65, 0, 0.35, 1);
}
#intro.dim      { background-color: rgba(0, 0, 0, 0.86); }
#intro.slide-up { transform: translateY(-100%); }

.intro-content {
  text-align: center;
  padding: 0 1.5rem;
  max-width: 100%;
  width: 100%;
  transition: opacity 0.38s ease, transform 0.38s ease;
}
.intro-content.fade-out { opacity: 0; transform: scale(1.07); }

.intro-brand {
  display: block;
  font-family: monospace;
  font-size: clamp(2.6rem, 8vw, 5rem);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
  white-space: nowrap;
  min-height: 1.2em;
  text-shadow:
    0 0 18px rgba(0, 229, 255, 0.6),
    0 0 45px rgba(0, 229, 255, 0.3),
    0 0 90px rgba(0, 229, 255, 0.12);
}
.intro-cursor { display: inline-block; animation: blink 0.9s step-end infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.intro-line {
  width: 0;
  height: 2px;
  margin: 1.1rem auto;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent), 0 0 22px rgba(0, 229, 255, 0.35);
  transition: width 0.65s cubic-bezier(0.25, 0, 0, 1);
}
.intro-sub {
  font-family: monospace;
  font-size: 0.88rem;
  color: var(--text-dim);
  letter-spacing: 0.13em;
  opacity: 0;
  transition: opacity 0.55s ease;
}

/* ── HERO (index.html) ──────────────────────────────────────────── */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7rem 2rem 4rem;
  text-align: center;
  position: relative;
}
#hero::after {
  content: '';
  position: absolute;
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.055) 0%, transparent 62%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 820px;
  width: 100%;
  background: rgba(10, 10, 10, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(30, 30, 30, 0.7);
  border-radius: 4px;
  padding: 3rem 3.5rem;
}
.hero-tag {
  display: inline-block;
  font-family: monospace;
  font-size: 0.78rem;
  color: var(--accent);
  border: 1px solid rgba(0, 229, 255, 0.3);
  padding: 0.3rem 0.9rem;
  border-radius: 2px;
  margin-bottom: 1.75rem;
  letter-spacing: 0.12em;
}
h1 {
  font-size: clamp(2.8rem, 9vw, 5.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: #fff;
  margin-bottom: 1rem;
}
h1 span { color: var(--accent); }
.hero-sub {
  font-family: monospace;
  font-size: 1rem;
  color: var(--text-dim);
  margin-bottom: 2.75rem;
  letter-spacing: 0.03em;
}
.cta-row { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── ABOUT (index.html) ─────────────────────────────────────────── */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.about-text p { color: var(--text-dim); line-height: 1.85; margin-bottom: 1rem; font-size: 0.95rem; }
.info-table { display: flex; flex-direction: column; gap: 1rem; }
.info-row { display: flex; align-items: baseline; gap: 1rem; font-size: 0.9rem; }
.info-key {
  font-family: monospace;
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  min-width: 70px;
}
.info-val { color: var(--text); }
.info-val a { color: var(--accent); text-decoration: none; }
.info-val a:hover { text-decoration: underline; }

/* ── PROJECTS (index.html) ──────────────────────────────────────── */
.projects-grid { display: grid; gap: 1.25rem; }
.project-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1.5rem 1.75rem;
  transition: border-color 0.2s, transform 0.2s;
}
.project-card:hover { border-color: rgba(0, 229, 255, 0.3); transform: translateY(-2px); }
.project-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.project-name { font-size: 1rem; font-weight: 600; color: #fff; }
.project-tag {
  font-size: 0.66rem;
  font-family: monospace;
  letter-spacing: 0.08em;
  padding: 0.18rem 0.5rem;
  border: 1px solid rgba(0, 229, 255, 0.35);
  color: var(--accent);
  border-radius: 2px;
}
.project-desc { color: var(--text-dim); font-size: 0.88rem; line-height: 1.7; margin-bottom: 1rem; }
.project-link { font-size: 0.82rem; color: var(--accent); text-decoration: none; font-family: monospace; }
.project-link:hover { text-decoration: underline; }

/* ── R6RANDOM TWO-COLUMN LAYOUT ─────────────────────────────────── */
.r6-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 3.5rem;
  align-items: start;
}
.r6-visual {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
  position: sticky;
  top: 5.5rem;
}
.app-img {
  width: 200px;
  border-radius: 18px;
  box-shadow:
    0 0 40px rgba(0, 229, 255, 0.1),
    0 8px 32px rgba(0, 0, 0, 0.65);
  border: 1px solid var(--border);
  display: block;
}
.r6-info { display: flex; flex-direction: column; gap: 1.25rem; }

/* ── FABRIC × SODIUM × IRIS LAYOUT ─────────────────────────────── */
.mc-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 3.5rem;
  align-items: start;
}
.mc-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 5.5rem;
}
.mc-info { display: flex; flex-direction: column; gap: 1.25rem; }

/* ── PRIVACY POLICY ─────────────────────────────────────────────── */
.policy-wrap {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 8rem 2rem 4rem;
}
.policy-intro {
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.85;
  margin-bottom: 0.5rem;
}
.policy-body { display: flex; flex-direction: column; gap: 1.25rem; }
.policy-section h3 {
  font-family: monospace;
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.85rem;
}
.policy-section p {
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.85;
  margin-bottom: 0.6rem;
}
.policy-section p:last-child { margin-bottom: 0; }
.policy-section ul {
  list-style: none;
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.policy-section ul li {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.6;
  padding-left: 1.25rem;
  position: relative;
}
.policy-section ul li::before { content: '›'; position: absolute; left: 0; color: var(--accent); }
.policy-section a { color: var(--accent); text-decoration: none; }
.policy-section a:hover { text-decoration: underline; }
.policy-em { color: var(--text); font-weight: 600; }

/* ── ERROR PAGES ────────────────────────────────────────────────── */
.error-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}
.error-code {
  font-family: monospace;
  font-size: clamp(5rem, 18vw, 9rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  text-shadow:
    0 0 30px rgba(0, 229, 255, 0.4),
    0 0 80px rgba(0, 229, 255, 0.15);
  margin-bottom: 0.75rem;
}
.error-title {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.65rem;
}
.error-sub {
  font-family: monospace;
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-bottom: 2.5rem;
  max-width: 400px;
  line-height: 1.6;
}

/* ── WIP PAGE ───────────────────────────────────────────────────── */
.wip-wrap {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 6rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem 3rem;
  text-align: center;
}
.wip-img {
  max-width: min(260px, 50vw, 50vh);
  border-radius: 12px;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
}
.wip-label {
  font-family: monospace;
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.wip-title {
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.65rem;
}
.wip-sub {
  font-family: monospace;
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
  max-width: 360px;
  line-height: 1.6;
}

/* ── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  nav { padding: 0.85rem 1.5rem; }
  .nav-links { gap: 1.25rem; }
  .hero-inner { padding: 2.25rem 2rem; }
  .section-wrap { padding: 4rem 1.5rem; }
  .page-wrap { padding: 6.5rem 1.5rem 3rem; }
  .page-header { padding: 1.5rem 1.75rem; margin-bottom: 2.25rem; }
  h2 { font-size: 1.65rem; }
  .policy-wrap { padding: 6.5rem 1.5rem 3rem; }
}

@media (max-width: 640px) {
  .r6-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .r6-visual {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    position: static;
    gap: 1rem;
  }
  .app-img { width: 140px; }
  .btn-fixed { width: auto; min-width: 140px; }
  .mc-layout { grid-template-columns: 1fr; gap: 2rem; }
  .mc-sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
  .mc-sidebar .btn { min-width: 160px; width: auto; }
  .mc-sidebar .sidebar-meta { flex: 1; min-width: 180px; }
}

@media (max-width: 620px) {
  .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  nav { padding: 0.7rem 1rem; gap: 0.5rem; }
  .nav-logo { font-size: 1rem; }
  .nav-links { gap: 0.75rem; }
  .nav-links a { font-size: 0.72rem; letter-spacing: 0.04em; }
  #hero { padding: 5.5rem 1rem 3rem; }
  .hero-inner { padding: 1.75rem 1.25rem; }
  .hero-sub { font-size: 0.88rem; margin-bottom: 2rem; }
  .cta-row { gap: 0.75rem; }
  .btn { padding: 0.65rem 1.25rem; font-size: 0.78rem; }
  .section-wrap { padding: 3rem 1rem; }
  .page-wrap { padding: 5.5rem 1rem 2.5rem; }
  .policy-wrap { padding: 5.5rem 1rem 2.5rem; }
  .page-header { padding: 1.25rem 1.25rem; width: 100%; margin-bottom: 1.75rem; }
  h2 { font-size: 1.45rem; margin-bottom: 1.5rem; }
  .content-block { padding: 1.1rem 1.2rem; }
  .about-text p { font-size: 0.9rem; }
  footer { padding: 2.25rem 1rem 2rem; }
  .socials { gap: 1rem; }
  .socials a { font-size: 0.75rem; gap: 0.35rem; }
  .socials a svg { width: 13px; height: 13px; }
  .wip-wrap { padding: 5rem 1rem 2.5rem; }
  .error-code { font-size: clamp(4rem, 22vw, 9rem); }
}
