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

:root {
  --bg:           #0c0a08;
  --text:         #d8cdb8;
  --text-bright:  #f0e6d3;
  --text-warm:    #e8dccb;
  --accent:       #ffb45a;
  --muted:        rgba(216, 205, 184, 0.55);
  --border:       rgba(216, 205, 184, 0.08);
  --border-faint: rgba(216, 205, 184, 0.12);
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;
  --font-serif:   'Newsreader', 'Cormorant Garamond', serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(216, 205, 184, 0.12); }
::-webkit-scrollbar-thumb:hover { background: rgba(216, 205, 184, 0.22); }

/* ── Selection ── */
::selection { background: var(--accent); color: var(--bg); }

/* ── Ambient canvas ── */
#ambient-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ── Scan lines ── */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 3px,
    rgba(255, 255, 255, 0.012) 3px,
    rgba(255, 255, 255, 0.012) 4px
  );
}

/* ── Corner brackets ── */
.corner {
  position: fixed;
  color: var(--accent);
  opacity: 0.55;
  font-size: 16px;
  line-height: 1;
  font-family: var(--font-mono);
  z-index: 4;
  pointer-events: none;
  user-select: none;
}
.corner--tl { top: 18px; left: 18px; }
.corner--tr { top: 18px; right: 18px; }
.corner--bl { bottom: 18px; left: 18px; }
.corner--br { bottom: 18px; right: 18px; }

/* ── Page wrapper ── */
.page {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Header ── */
.site-header {
  position: relative;
  z-index: 3;
  padding: 22px 56px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 12px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.y-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 180, 90, 0.53);
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 0;
  font-weight: 300;
  flex-shrink: 0;
  text-decoration: none;
}

a.y-mark:hover {
  border-color: var(--accent);
}

.header-wordmark {
  color: var(--text-warm);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: vessel-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

/* ── Footer ── */
.site-footer {
  position: relative;
  z-index: 3;
  padding: 16px 56px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 8px;
}

.footer-right {
  display: flex;
  gap: 24px;
}

/* ── Typography helpers ── */
.micro {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.accent-text { color: var(--accent); }

/* ── Links ── */
.vessel-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}
.vessel-link:hover { color: var(--accent); }

.accent-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 180, 90, 0.4);
}
.accent-link:hover { border-bottom-color: var(--accent); }

/* ── Buttons ── */
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 14px 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  transition: transform 0.2s, opacity 0.2s;
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-warm);
  border: 1px solid rgba(216, 205, 184, 0.22);
  padding: 14px 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}
.btn-ghost:hover { transform: translateY(-1px); border-color: rgba(216, 205, 184, 0.4); }

.btn-outline {
  background: transparent;
  color: var(--text-warm);
  border: 1px solid rgba(255, 180, 90, 0.53);
  padding: 14px 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
}
.btn-outline:hover { transform: translateY(-1px); border-color: var(--accent); }

/* ── Animations ── */
@keyframes vessel-blink {
  0%, 50%     { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

@keyframes vessel-pulse {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}

@keyframes vessel-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes vessel-fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ── Blink cursor ── */
.blink-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: var(--accent);
  margin-left: 0.08em;
  vertical-align: -0.1em;
  animation: vessel-blink 1.05s steps(2, end) infinite;
}

/* ── Rail (left/right sidebars) ── */
.rail {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.95;
  color: var(--muted);
}

.rail--right {
  text-align: right;
}

.rail-section {
  margin-top: 40px;
}
.rail-section:first-child {
  margin-top: 0;
}

.rail-heading {
  margin-bottom: 14px;
}

.rail-line {
  display: block;
}

/* ── Three-column page grid ── */
.page-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 220px 1fr 240px;
  gap: 56px;
  padding: 72px 56px 56px;
  flex: 1;
}

.page-grid > * {
  min-width: 0;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .page-grid {
    grid-template-columns: 180px 1fr;
    gap: 40px;
    padding: 48px 40px 48px;
  }
  .rail--right {
    display: none;
  }
}

@media (max-width: 768px) {
  .page-grid {
    grid-template-columns: 1fr;
    padding: 40px 28px 40px;
    gap: 40px;
  }
  .rail--left {
    display: none;
  }
  .site-header {
    padding-left: 28px;
    padding-right: 28px;
  }
  .site-footer {
    padding-left: 28px;
    padding-right: 28px;
  }
}

@media (max-width: 480px) {
  .site-header {
    padding: 16px 20px;
    gap: 8px;
  }
  .site-footer {
    padding: 12px 20px;
  }
  .page-grid {
    padding: 28px 20px 28px;
  }
  .header-right {
    gap: 12px;
  }
}
