/* ==========================================================================
   1337 Solutions — IRC / ASCII theme.
   Everything is monospace; rules and frames are drawn with characters.
   No gradients, no rounded corners, no cards, no JavaScript.
   ========================================================================== */

:root {
  color-scheme: dark;

  --bg: #070a07;
  --fg: #cdd6cd;
  --muted: #9fb09f;
  --dim: #7d8f7d;
  --accent: #5cf08a;
  --accent-2: #e6b450;
  --rule: #223022;
  --rule-bright: #2c3d2c;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", "Courier New", monospace;

  --wrap: 82ch;
}

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-style: solid;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wrap {
  width: min(var(--wrap), 100% - 2rem);
  margin-inline: auto;
}

.dim {
  color: var(--dim);
}

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

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.35rem 0.6rem;
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
  font-weight: 700;
}

.skip:focus {
  top: 0.6rem;
}

/* --- Top bar -------------------------------------------------------------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
}

.bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.5rem;
  padding-block: 0.6rem 0.35rem;
}

.brand {
  color: var(--fg);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand .bracket {
  color: var(--dim);
  font-weight: 400;
}

.brand-name {
  color: var(--accent);
}

.brand:hover .brand-name {
  background: var(--accent);
  color: var(--bg);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
}

.nav a {
  color: var(--fg);
  text-decoration: none;
}

.nav .hash {
  color: var(--dim);
}

.nav a:hover,
.nav a:focus-visible,
.nav a:hover .hash {
  color: var(--accent);
}

.status {
  margin-left: auto;
  color: var(--dim);
  font-size: 0.88rem;
}

.led {
  color: var(--accent);
  animation: pulse 2.6s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .led {
    animation: none;
  }
}

.rule-line {
  overflow: hidden;
  white-space: nowrap;
  color: var(--rule);
  font-size: 0.8rem;
  line-height: 1;
  user-select: none;
}

/* --- Hero ----------------------------------------------------------------- */

.hero {
  padding-block: clamp(2rem, 6vw, 3.5rem) clamp(2rem, 5vw, 3rem);
}

.banner {
  margin: 0 0 1.6rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: clamp(0.65rem, 3.4vw, 1rem);
  line-height: 1.05;
  white-space: pre;
  overflow-x: auto;
  scrollbar-width: none;
}

.banner::-webkit-scrollbar {
  display: none;
}

.banner-line {
  display: block;
}

/* Standalone pages (404, thanks) reuse the old prompt styling. */
.prompt {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

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

.path {
  color: var(--accent-2);
}

h1 {
  font-size: clamp(1.3rem, 3.6vw, 1.85rem);
  font-weight: 700;
  max-width: 62ch;
  margin-bottom: 1rem;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.lede {
  color: var(--muted);
  max-width: 74ch;
  margin-bottom: 1.7rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-bottom: 0;
}

.btn {
  color: var(--accent);
  text-decoration: none;
  padding: 0.1rem 0.35rem;
  margin-left: -0.35rem;
}

.btn:hover,
.btn:focus-visible {
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
}

/* --- Terminal block ------------------------------------------------------- */

.term {
  border: 1px solid var(--rule-bright);
  background: #040604;
}

.term-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  background: #0a0f0a;
  color: var(--dim);
  font-size: 0.82rem;
}

.term-meta {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.term-replay {
  padding: 0;
  border: 0;
  background: none;
  color: var(--dim);
  font: inherit;
  cursor: pointer;
}

.term-replay:hover,
.term-replay:focus-visible {
  color: var(--accent);
}

.term-body {
  position: relative;
  padding: 1rem 1.1rem 1.15rem;
  font-size: 0.92rem;
  line-height: 1.8;
}

.term-line {
  display: block;
}

.term-loading {
  display: none;
}

/* boot.js adds .anim before first paint; terminal.js reveals as it types. */
.anim .banner {
  visibility: hidden;
}

.anim .term-line {
  visibility: hidden;
}

.anim .term-loading {
  position: absolute;
  top: 1rem;
  left: 1.1rem;
  display: block;
  visibility: visible;
}

.anim .term-line.is-shown {
  visibility: visible;
}

.term-output {
  margin-block: 0.4rem 0.9rem;
}

.term-output h1 {
  font-size: clamp(1.15rem, 2.8vw, 1.55rem);
  line-height: 1.35;
  max-width: 62ch;
  margin-bottom: 0.7rem;
}

.term-output .lede {
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1.1rem;
}

.term-output .actions {
  margin-bottom: 0;
}

.t-prompt,
.t-ok,
.term-cursor {
  color: var(--accent);
}

.t-path {
  color: var(--accent-2);
}

.t-dim {
  color: var(--dim);
}

.term-cursor {
  animation: blink 1.1s steps(1) infinite;
}

@media (prefers-reduced-motion: reduce) {
  .term-cursor {
    animation: none;
  }
}

/* --- Sections ------------------------------------------------------------- */

.section {
  padding-block: clamp(1.75rem, 4.5vw, 3rem);
  scroll-margin-top: 4.5rem;
}

.hero {
  scroll-margin-top: 4.5rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  margin-bottom: 1.1rem;
}

h2 {
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
}

h2 .dim {
  font-weight: 400;
}

.rule {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  color: var(--rule);
  font-size: 0.85rem;
  user-select: none;
}

.section-lede {
  color: var(--muted);
  max-width: 74ch;
  margin-bottom: 1.6rem;
}

/* --- Services ------------------------------------------------------------- */

.services {
  display: grid;
  gap: 1.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.services li {
  display: grid;
  grid-template-columns: 2.8rem 1fr;
}

.num {
  color: var(--dim);
  font-size: 0.9rem;
  padding-top: 0.1rem;
}

h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.services li:hover h3 {
  color: var(--accent);
}

.service-body p {
  color: var(--muted);
  max-width: 68ch;
}

/* --- Approach (IRC log) --------------------------------------------------- */

.log {
  display: grid;
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.log li {
  display: grid;
  grid-template-columns: 7.5ch 1fr;
  gap: 0.5rem;
}

.nick {
  color: var(--accent-2);
}

.log li > span:last-child {
  color: var(--muted);
}

/* --- About (whois) -------------------------------------------------------- */

.whois {
  margin-bottom: 1.8rem;
}

.whois dl {
  display: grid;
  gap: 0.1rem;
  margin: 0;
}

.whois dl > div {
  display: grid;
  grid-template-columns: 9ch 1fr;
  column-gap: 0.75rem;
}

.whois dt {
  color: var(--dim);
}

.whois dt::after {
  content: ":";
}

.whois dd {
  margin: 0;
}

.about-copy p {
  color: var(--muted);
  max-width: 74ch;
}

.about-copy p + p {
  margin-top: 1rem;
}

.about-copy p:last-child {
  color: var(--fg);
}

/* --- Footer --------------------------------------------------------------- */

.footer {
  padding-block: 1.5rem 2.5rem;
}

.footer .rule-line {
  margin-bottom: 0.9rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.6rem;
  color: var(--dim);
  font-size: 0.85rem;
}

/* --- Small screens -------------------------------------------------------- */

@media (max-width: 640px) {
  .bar-inner {
    gap: 0.2rem 1rem;
    padding-block: 0.55rem 0.3rem;
  }

  .prompt-host {
    display: none;
  }

  .status {
    display: none;
  }

  .nav {
    gap: 0.1rem 0.9rem;
    font-size: 0.9rem;
  }

  .services li {
    grid-template-columns: 2rem 1fr;
  }

  .log li {
    grid-template-columns: 1fr;
    gap: 0.05rem;
  }

  .section-head {
    gap: 0.5rem;
  }

  h2 {
    font-size: 0.95rem;
  }
}
