/* === FONTS === */
/* Onest + Roboto Mono loaded via Google Fonts in HTML <head> */
/* Ink Trap: drop .woff2 files into /assets/fonts/ and uncomment:
@font-face {
  font-family: 'Ink Trap';
  src: url('assets/fonts/InkTrap-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
*/

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

/* === BASE === */
:root {
  --bg-color: #111;
  --text: #fff;
  --text-muted: rgba(255, 255, 255, 0.5);
  --max-width: 900px;
  --font-body: 'Onest', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-title: 'Ink Trap', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: 'Roboto Mono', 'SF Mono', 'Consolas', monospace;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text);
  background: var(--bg-color) url('assets/bg.jpg') center / cover no-repeat fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* === HEADER === */
.header {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 1.5rem;
}

.header__logo {
  height: 44px;
  width: auto;
}

/* === CONTENT === */
.content {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 1rem 1.5rem 2rem;
}

/* === FILE TREE === */
.tree {
  margin-bottom: 2.5rem;
}

.tree__heading {
  font-family: var(--font-title);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tree__list {
  list-style: none;
}

.tree__item {
  margin-bottom: 0.125rem;
}

.tree__link {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: opacity 0.2s;
}

.tree__link:hover {
  opacity: 0.65;
}

.tree__number {
  font-family: var(--font-mono);
  font-weight: 300;
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 2rem;
}

.tree__name {
  font-family: var(--font-title);
  font-weight: 500;
  font-size: 1.05rem;
}

.tree__desc {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* === FOOTER === */
.footer {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.4rem;
}

.footer__row span:first-child {
  color: var(--text);
}

.footer__legal {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.35);
  line-height: 1.6;
}

/* === TOAST === */
@property --comet-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.toast {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid transparent;
  background:
    linear-gradient(rgba(18, 18, 18, 0.88), rgba(18, 18, 18, 0.88)) padding-box,
    conic-gradient(
      from var(--comet-angle),
      rgba(255, 255, 255, 0.5),
      rgba(255, 255, 255, 0.08) 20%,
      rgba(255, 255, 255, 0.02) 40%,
      rgba(255, 255, 255, 0.02) 70%,
      rgba(255, 255, 255, 0.08) 85%,
      rgba(255, 255, 255, 0.5)
    ) border-box;
  animation: comet-spin 3s linear infinite;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 0.6rem 1rem;
  font-size: 0.75rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.7);
  border-radius: 6px;
  white-space: nowrap;
  z-index: 100;
  opacity: 1;
  transition: opacity 0.4s;
}

@keyframes comet-spin {
  to { --comet-angle: 360deg; }
}

.toast--hide {
  opacity: 0;
}

.toast__close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 0.1rem;
  line-height: 1;
}

.toast__close:hover {
  color: var(--text);
}

@media (max-width: 600px) {
  .toast {
    left: 1rem;
    right: 1rem;
    transform: none;
    white-space: normal;
  }
}

/* === 404 PAGE === */
.content--centered {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.75rem;
}

.error-code {
  font-family: var(--font-mono);
  font-weight: 300;
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.2em;
}

.error-title {
  font-family: var(--font-title);
  font-weight: 500;
  font-size: 1.5rem;
}

.error-text {
  font-weight: 300;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 520px;
}

.error-link {
  color: var(--text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.error-back {
  display: inline-block;
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 300;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  transition: opacity 0.2s;
}

.error-back:hover {
  opacity: 0.65;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
  body {
    background-attachment: scroll;
  }

  .tree__link {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .tree__desc {
    margin-left: 3.25rem;
    width: 100%;
  }

  .footer__row {
    flex-direction: column;
    gap: 0.15rem;
  }
}
