
:root {
  --bg: #FBF8F5;
  --bg-dark: #F0EAE3;
  --site-background:
    radial-gradient(circle at 18% 18%, rgba(255, 253, 247, 0.62), transparent 32%),
    radial-gradient(circle at 76% 26%, rgba(255, 248, 235, 0.34), transparent 30%),
    radial-gradient(circle at 50% 100%, rgba(93, 70, 44, 0.055), transparent 32%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-dark) 100%);
  --paper-load: #ebe2d3;
  --ink: #241a12;
  --muted: #6a5f52;
  --line: rgba(36, 26, 18, 0.22);

  --transition-fast: 0.22s ease;
  --transition-medium: 0.4s ease;
  --max-ui-width: 1440px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  position: relative;
  color: var(--ink);
  background: var(--site-background);
  user-select: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  mix-blend-mode: multiply;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(0,0,0,0.06) 0.7px, transparent 0.9px),
    radial-gradient(circle at 80% 30%, rgba(0,0,0,0.05) 0.7px, transparent 0.9px),
    radial-gradient(circle at 40% 80%, rgba(0,0,0,0.04) 0.7px, transparent 0.9px);
  background-size: 14px 14px, 19px 19px, 23px 23px;
  z-index: 0;
}

img, picture, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

canvas.webgl {
  position: fixed;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  outline: none;
  z-index: 1;
  touch-action: none;
  transition: opacity 0.4s ease;
}

#loadingOverlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--site-background);
  color: #111111;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  transition: none;
}
#loadingOverlay.is-hidden { display: none; opacity: 0; visibility: hidden; pointer-events: none; }
#loadingText { font-size: 12px; line-height: 1; opacity: 0; }

.ajm-loading-screen {
  --paper: var(--site-background);
  --outline: #111111;
  --fill: #111111;
  --muted: #9A968A;
  --loader-duration: 5600ms;
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--site-background);
  color: var(--fill);
  pointer-events: auto;
}
.ajm-loading-screen.is-hidden { display: none; visibility: hidden; pointer-events: none; }
.ajm-loading-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--paper);
}
.ajm-loading-screen .stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}
.ajm-loading-screen .loader-word {
  position: relative;
  width: min(90vw, 620px);
  aspect-ratio: 7 / 1;
  overflow: hidden;
}
.ajm-loading-screen svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.ajm-loading-screen .loader-word-svg,
.ajm-loading-screen .loader-word-fill-clip {
  position: absolute;
  inset: 0;
}
.ajm-loading-screen .loader-word-fill-clip {
  z-index: 1;
  overflow: hidden;
  transform: translate3d(-100%, 0, 0);
  will-change: transform;
}
.ajm-loading-screen .loader-word-fill-svg {
  transform: translate3d(100%, 0, 0);
  will-change: transform;
}
.ajm-loading-screen.is-progress-running .loader-word-fill-clip {
  animation: ajm-loader-fill-clip var(--loader-duration) linear forwards;
}
.ajm-loading-screen.is-progress-running .loader-word-fill-svg {
  animation: ajm-loader-fill-content var(--loader-duration) linear forwards;
}
.ajm-loading-screen .loader-word-outline-svg {
  z-index: 2;
}
.ajm-loading-screen .name-text {
  font-family: "AJM Pixel Hand";
  font-size: 72px;
  font-weight: 400;
  letter-spacing: 0.04em;
}
.ajm-loading-screen .outline-layer {
  fill: none;
  stroke: var(--outline);
  stroke-width: 1.4;
}
.ajm-loading-screen .fill-layer { fill: var(--fill); }
.ajm-loading-screen .progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ajm-loading-screen .progress-track {
  width: 220px;
  height: 2px;
  background: var(--outline);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.ajm-loading-screen .progress-bar {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  background: var(--fill);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}
.ajm-loading-screen.is-progress-running .progress-bar {
  animation: ajm-loader-fill var(--loader-duration) linear forwards;
}
.ajm-loading-screen .progress-pct {
  font-family: "AJM Pixel Hand";
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.06em;
  color: var(--muted);
  min-width: 34px;
  height: 1em;
  overflow: hidden;
}
.ajm-loading-screen .progress-pct-list {
  display: flex;
  flex-direction: column;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}
.ajm-loading-screen.is-progress-running .progress-pct-list {
  animation: ajm-loader-pct var(--loader-duration) steps(100, end) forwards;
}
.ajm-loading-screen .progress-pct-step {
  flex: 0 0 1em;
  height: 1em;
  line-height: 1;
}
@keyframes ajm-loader-fill {
  to { transform: scaleX(1); }
}
@keyframes ajm-loader-fill-clip {
  to { transform: translate3d(0, 0, 0); }
}
@keyframes ajm-loader-fill-content {
  to { transform: translate3d(0, 0, 0); }
}
@keyframes ajm-loader-fill-mobile-mask {
  to {
    -webkit-clip-path: inset(0 0 0 0);
    clip-path: inset(0 0 0 0);
  }
}
@keyframes ajm-loader-pct {
  to { transform: translate3d(0, -100em, 0); }
}

@media (hover: none) and (pointer: coarse) {
  .ajm-loading-screen .loader-word-fill-clip {
    transform: none;
    -webkit-clip-path: inset(0 100% 0 0);
    clip-path: inset(0 100% 0 0);
    will-change: clip-path;
  }

  .ajm-loading-screen .loader-word-fill-svg {
    transform: none;
    will-change: auto;
  }

  .ajm-loading-screen.is-progress-running .loader-word-fill-clip {
    animation: ajm-loader-fill-mobile-mask var(--loader-duration) linear forwards;
  }

  .ajm-loading-screen.is-progress-running .loader-word-fill-svg {
    animation: none;
  }
}

.ui { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
.ui-inner { position: relative; width: 100%; height: 100%; max-width: var(--max-ui-width); margin: 0 auto; }

.hero-stack {
  position: fixed;
  top: 30px;
  left: 32px;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.hero-stack.is-visible { opacity: 1; }
.hero-stack.is-hidden { opacity: 0; }

.hero-title {
  margin: 0;
  font-size: clamp(22px, 2.5vw, 34px);
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}

@media (max-width: 900px) { .hero-stack { top: 20px; left: 20px; } }
@media (max-width: 560px) { .hero-stack { top: 16px; left: 16px; } .hero-title { font-size: 20px; } }

.begin-wrap {
  position: absolute;
  left: 50%;
  bottom: clamp(24px, 4vw, 40px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  opacity: 0;
  transition: opacity var(--transition-medium), transform var(--transition-medium);
}
.begin-wrap.is-ready { opacity: 1; }
.begin-wrap.is-hidden { opacity: 0; transform: translateX(-50%) translateY(10px); pointer-events: none; }

.begin-button {
  position: relative;
  appearance: none;
  border: 1px solid rgba(17, 17, 17, 0.65);
  background: rgb(124, 123, 123);
  color: #f4f4f2;
  padding: 8px 14px;
  min-height: 38px;
  border-radius: 2px;
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
.begin-button::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  transform: translateX(-50%);
  width: 150px;
  height: 1px;
  background: #f4f4f2;
  opacity: 0;
}
.begin-button.is-typed::after { opacity: 1; animation: beginUnderscoreBlink 0.9s steps(1) infinite; }
@keyframes beginUnderscoreBlink { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }
.begin-button:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18); }
.begin-button:active { transform: translateY(0); }
.begin-button:focus-visible { outline: 2px solid rgba(17, 17, 17, 0.4); outline-offset: 4px; }

.boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: #F7F5F1;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0s linear 0.22s;
}
.boot-crt-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  pointer-events: none;
  z-index: 5;
}
.boot-overlay.crt-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  background: #F7F5F1;
  transition: none;
}
.boot-overlay.crt-active .boot-crt-canvas { display: block; }
.boot-overlay.crt-active.crt-revealing {
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.boot-bar { position: absolute; left: 0; right: 0; height: 50%; background: #000; pointer-events: none; z-index: 1; }
.boot-bar-top { top: 0; transform: translateY(-100%); }
.boot-bar-bottom { bottom: 0; transform: translateY(100%); }

.content-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 12%, rgba(255,255,255,0.5), transparent 40%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-dark) 100%);
  opacity: 0;
  visibility: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  user-select: text;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}
.content-overlay.is-visible { opacity: 1; visibility: visible; }

.content-page {
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(40px, 6vh, 72px) clamp(26px, 6.5vw, 104px);
}

.content-flow {
  width: 100%;
  max-width: 760px;
  margin-right: auto;
}

.content-name {
  margin: 0 0 clamp(14px, 2.2vh, 24px);
  font-size: clamp(36px, 5.52vw, 64.8px);
  line-height: 0.98;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.credo p,
.section p {
  margin: 0;
  font-size: clamp(15.6px, 2.04vh, 19.2px);
  line-height: 1.45;
  color: var(--ink);
}
.credo p { color: var(--muted); }
.credo p:first-child { color: var(--ink); }

.rule {
  margin: clamp(12px, 1.9vh, 20px) 0;
  height: 1px;
  width: 100%;
  background: var(--line);
  transform-origin: 0 50%;
}

.section { margin-top: clamp(12px, 2vh, 22px); }
.section-head {
  font-size: clamp(13.2px, 1.68vh, 14.4px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: clamp(4px, 0.8vh, 8px) !important;
}
.section a { border-bottom: 1px solid var(--line); transition: border-color var(--transition-fast); }
.section a:hover { border-color: var(--ink); }

.anim-line .wd { display: inline-block; white-space: nowrap; }
.anim-line .ch {
  display: inline-block;
  will-change: auto;
}
.content-overlay:not(.is-revealing) .anim-line { opacity: 0; }
.content-overlay:not(.is-revealing) .anim-rule { transform: scaleX(0); }
@media (prefers-reduced-motion: reduce) {
  .content-overlay:not(.is-revealing) .anim-line { opacity: 1; }
  .content-overlay:not(.is-revealing) .anim-rule { transform: none; }
}

body.content-open canvas.webgl { opacity: 0; visibility: hidden; }
body.content-open .hero-stack,
body.content-open .begin-wrap { display: none; }

@media (max-width: 820px) {
  .content-page { padding: clamp(28px, 4.5vh, 48px) clamp(22px, 6vw, 40px); }
  .content-flow { padding-bottom: 56px; }
}
@media (max-width: 560px) {
  .content-name { font-size: clamp(31.2px, 10.32vw, 40.8px); }
  .credo p, .section p { font-size: clamp(14.4px, 1.86vh, 16.8px); }
}
