/* Shared terminal palette, CSS frame and page layouts. */
:root {
  color-scheme: dark;
  --bg: #090b0d;
  --text: #e2e7e8;
  --muted: #89949b;
  --dim: #647079;
  --border: #303a40;
  --dash-horizontal: repeating-linear-gradient(to right, var(--border) 0 6px, transparent 6px 10px);
  --dash-vertical: repeating-linear-gradient(to bottom, var(--border) 0 6px, transparent 6px 10px);
  --accent: #a4dbe2;
  --font: "JetBrains Mono", Consolas, monospace;
  --inset: 22px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --frame-top: calc(var(--inset) + var(--safe-top));
  --frame-right: calc(var(--inset) + var(--safe-right));
  --frame-bottom: calc(var(--inset) + var(--safe-bottom));
  --frame-left: calc(var(--inset) + var(--safe-left));

}

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

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  font-size: 12px;
  line-height: 1.9;
}

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

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

a:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 5px;
}

.frame {
  position: fixed;
  inset: var(--frame-top) var(--frame-right) var(--frame-bottom) var(--frame-left);
  z-index: 11;
  pointer-events: none;
  background:
    var(--dash-horizontal) top left / 100% 1px no-repeat,
    var(--dash-horizontal) bottom left / 100% 1px no-repeat,
    var(--dash-vertical) top left / 1px 100% no-repeat,
    var(--dash-vertical) top right / 1px 100% no-repeat;
}

.landing {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 95px 38px;
}

.center {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ascii-wrap {
  max-width: 100%;
  cursor: crosshair;
  user-select: none;
  -webkit-user-select: none;
}

.ascii {
  display: block;
  margin: 0;
  color: var(--text);
  font: 800 clamp(7px, 2.4vw, 22px)/1.32 var(--font);
  letter-spacing: 0;
  white-space: pre;
  text-shadow: 0 0 25px rgba(164, 219, 226, .055);
}

.edge-link {
  bottom: calc(var(--frame-bottom) + 26px);
  z-index: 3;
  padding: 8px 10px;
  color: var(--muted);
  font: 500 11px/1.5 var(--font);
  transition: color .18s ease;
}

.edge-link::before {
  content: "[ ";
  color: var(--border);
}

.edge-link::after {
  content: " ]";
  color: var(--border);
}

.edge-link:hover,
    .edge-link:hover::before,
    .edge-link:hover::after {
  color: var(--accent);
}

.edge-left {
  position: fixed;
  left: calc(var(--frame-left) + 20px);
}

.edge-right {
  right: calc(var(--frame-right) + 20px);
}

@media (max-width: 600px) {
      :root { --inset: 14px; }
      .landing { padding-inline: 25px; }
      .ascii { font-size: clamp(6px, 2.35vw, 12px); }
      .edge-link { bottom: calc(var(--frame-bottom) + 18px); font-size: 10px; }
      .edge-left { left: calc(var(--frame-left) + 8px); }
      .edge-right { right: calc(var(--frame-right) + 8px); }
    }

@media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { animation: none !important; transition: none !important; }
    }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 48px;
}

.bracket-link::before {
  content: "[ ";
  color: var(--border);
}

.bracket-link::after {
  content: " ]";
  color: var(--border);
}

.bracket-link:hover::before, .bracket-link:hover::after {
  color: var(--accent);
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

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

/* Shared viewport utilities. */
.edge-links {
  position: fixed;
  bottom: calc(var(--frame-bottom) + 26px);
  z-index: 3;
  display: flex;
  gap: 4px;
}
.system-time {
  position: fixed; z-index: 3;
  top: calc(var(--frame-top) + 22px);
  right: calc(var(--frame-right) + 30px);
  color: var(--muted);
  font: 400 11px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
}
/* Plain document layout; hierarchy comes from type and whitespace. */
.page {
  width: min(100% - 100px, 600px);
  margin: 0 auto;
  padding: 78px 0 70px;
  font-size: 12px;
  line-height: 1.85;
}
.navigation { margin-bottom: 36px; font-size: 11px; color: var(--muted); }
.intro { margin-bottom: 36px; }
.page h1 { margin: 0 0 8px; font-size: 20px; line-height: 1.4; font-weight: 500; }
.updated { color: var(--dim); font-size: 10px; }
.block + .block { margin-top: 32px; }
.page h2 { margin: 0 0 12px; font-size: 12px; font-weight: 500; }
.page h3 { margin: 20px 0 6px; font-size: 12px; font-weight: 400; }
.page p { margin: 0 0 12px; color: var(--muted); }
.page p:last-child { margin-bottom: 0; }
.page strong { color: var(--text); font-weight: 400; }
.details { color: var(--muted); }
.page a { overflow-wrap: anywhere; }
.block a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.page a:hover { color: var(--accent); }
.page ul { margin: 12px 0; padding-left: 2ch; list-style-type: "– "; color: var(--muted); }
.page li { margin: 4px 0; }
.page-footer { margin-top: 32px; font-size: 10px; color: var(--muted); }
@media (max-width: 600px) {
  .edge-links { bottom: calc(var(--frame-bottom) + 18px); gap: 0; }
  .edge-link { padding-inline: 7px; }
  .system-time { top: calc(var(--frame-top) + 18px); right: calc(var(--frame-right) + 15px); font-size: 10px; }
  .page { width: calc(100% - 72px); padding-top: 70px; }
  .navigation { margin-bottom: 28px; }
}

/* Content is clipped inside the frame; the surrounding canvas matches the page background. */
html { height: 100%; overflow: hidden; background: var(--bg); }
body { position: fixed; inset: 0; height: 100%; min-height: 0; overflow: hidden; background: var(--bg); }
.site-scroll {
  position: fixed;
  inset: calc(var(--frame-top) + 1px) calc(var(--frame-right) + 1px) calc(var(--frame-bottom) + 1px) calc(var(--frame-left) + 1px);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  scroll-padding-top: 48px;
}

.site-scroll::-webkit-scrollbar { display: none; }
