:root {
  --bg: #121210;
  --bg2: #191916;
  --ink: #e8e4d8;
  --dim: #7d7a70;
  --rule: #2b2a26;
  --accent: #d9822b;
  --mono: "Consolas", "Lucida Console", "Courier New", monospace;
  --sans: "Arial Narrow", "Franklin Gothic Medium", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); min-height: 100%; }
body { font-family: var(--mono); font-size: 14px; overflow-x: hidden; }
::selection { background: var(--accent); color: var(--bg); }

/* film grain, very faint */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .05; z-index: 50;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0%{transform:translate(0,0)} 20%{transform:translate(-3%,2%)} 40%{transform:translate(2%,-3%)} 60%{transform:translate(-2%,-1%)} 80%{transform:translate(3%,3%)} 100%{transform:translate(0,0)} }

/* ---------- wordmark letters ---------- */
.word { display: inline-flex; overflow: hidden; line-height: 1; }
.word span { display: inline-block; transform: translateY(105%); animation: rise .9s var(--ease) forwards; animation-delay: calc(var(--i) * 70ms + 150ms); }
@keyframes rise { to { transform: translateY(0); } }

/* ---------- gate ---------- */
.gate { min-height: 100vh; display: flex; align-items: center; padding: 0 8vw; position: relative; overflow: hidden; transition: opacity .45s ease, filter .45s ease; }
.gate.out { opacity: 0; filter: blur(6px); }
.gate .box { position: relative; z-index: 2; width: 100%; max-width: 560px; }
.gate .word { font-family: var(--sans); font-weight: 700; font-size: clamp(54px, 13vw, 104px); letter-spacing: -.03em; margin-bottom: 26px; }
.gate form { display: flex; align-items: center; gap: .8em; opacity: 0; animation: fade .8s ease 1.1s forwards; }
.gate label { color: var(--accent); }
.gate input {
  flex: 1; min-width: 0; background: transparent; border: 0; border-bottom: 1px solid var(--rule);
  color: var(--ink); font: inherit; font-size: 18px; padding: 6px 0; outline: none;
  caret-shape: block; caret-color: var(--accent); transition: border-color .2s;
}
.gate input:focus { border-bottom-color: var(--accent); }
.gate .hint { margin: 14px 0 0; color: var(--dim); opacity: 0; animation: fade .8s ease 1.4s forwards; }
.gate .hint + .hint { margin-top: 4px; }
.gate .hint em { font-style: normal; color: var(--ink); border-bottom: 1px solid var(--accent); }
.gate .msg { margin: 14px 0 0; color: var(--accent); min-height: 1.2em; }
.gate.bad .box { animation: nope .4s var(--ease); }
.gate.bad .msg { color: #c2412d; }
.gate.locked input { opacity: .35; }
@keyframes nope { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- hub ---------- */
.mast { position: relative; overflow: hidden; border-bottom: 1px solid var(--rule); height: clamp(110px, 24vw, 210px); }
.mast .word { position: absolute; left: -.03em; bottom: -.06em; font-family: var(--sans); font-weight: 700; font-size: clamp(100px, 25vw, 230px); letter-spacing: -.04em; }
.mast .count { position: absolute; right: 4vw; top: 12px; color: var(--dim); z-index: 2; }
.mast .clock { position: absolute; right: 4vw; bottom: 12px; color: var(--dim); z-index: 2; }
.mast .sweep { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--accent); transform-origin: left; animation: draw-x 1.2s var(--ease) .6s both; }

.bar { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; padding: 12px 4vw; border-bottom: 1px solid var(--rule); animation: fade .6s ease .5s both; }
.bar button { background: none; border: 0; color: var(--dim); font: inherit; padding: 0; cursor: pointer; transition: color .15s; }
.bar button:hover { color: var(--ink); }
.bar button[aria-pressed="true"] { color: var(--accent); }
.bar button[aria-pressed="true"]::before { content: "["; } .bar button[aria-pressed="true"]::after { content: "]"; }
.bar input { margin-left: auto; width: 12em; max-width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--rule); color: var(--ink); font: inherit; padding: 2px 0; outline: none; transition: border-color .2s, width .3s var(--ease); }
.bar input:focus { border-bottom-color: var(--accent); width: 18em; }
.resume { padding: 10px 4vw; color: var(--dim); border-bottom: 1px solid var(--rule); animation: fade .6s ease .6s both; }
.resume a { color: var(--accent); text-decoration: none; }
.resume a:hover { text-decoration: underline; }

ol.list { list-style: none; margin: 0; padding: 0; }
ol.list li { opacity: 0; animation: fade .55s var(--ease) forwards; animation-delay: calc(var(--i) * 45ms + 650ms); }
ol.list a {
  position: relative; display: grid; grid-template-columns: 3ch 1fr auto; gap: 0 2ch; align-items: baseline;
  padding: 11px 4vw; border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none;
  transition: padding-left .18s var(--ease), background .18s;
}
ol.list a::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); transform: scaleY(0); transition: transform .2s var(--ease); }
ol.list .n { color: var(--dim); }
ol.list .t { font-family: var(--sans); font-size: clamp(22px, 5vw, 34px); letter-spacing: -.01em; transition: color .15s, letter-spacing .25s var(--ease); }
ol.list .m { color: var(--dim); text-align: right; white-space: nowrap; transition: color .15s; }
ol.list a:hover, ol.list a.sel { padding-left: calc(4vw + 14px); background: var(--bg2); }
ol.list a:hover::before, ol.list a.sel::before { transform: scaleY(1); }
ol.list a.sel .t, ol.list a:hover .t { color: var(--accent); letter-spacing: .01em; }
ol.list a.sel .m, ol.list a:hover .m { color: var(--ink); }
.empty { padding: 24px 4vw; color: var(--dim); }
.foot { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; padding: 14px 4vw 40px; color: var(--dim); font-size: 12px; }
.tabname input { background: transparent; border: 0; border-bottom: 1px solid var(--rule); color: var(--ink); font: inherit; width: 11em; padding: 2px 0; outline: none; }
.tabname input:focus { border-bottom-color: var(--accent); }
body.leaving { opacity: 0; transition: opacity .25s ease; }

/* ---------- letter to the school ---------- */
.school-btn { position: fixed; right: 18px; bottom: 18px; z-index: 20; background: var(--bg); color: var(--dim); border: 1px solid var(--rule); font: inherit; font-size: 12px; letter-spacing: .12em; padding: 9px 14px; cursor: pointer; transition: color .15s, border-color .15s; }
.school-btn:hover { color: var(--accent); border-color: var(--accent); }
.school { position: fixed; inset: 0; z-index: 40; background: rgba(8, 8, 7, .86); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .3s ease both; }
.school[hidden] { display: none; }
.school-card { position: relative; width: 100%; max-width: 620px; max-height: 88vh; overflow-y: auto; background: var(--bg2); border: 1px solid var(--rule); border-left: 3px solid var(--accent); padding: 28px 30px 12px; line-height: 1.65; }
.school-card h2 { margin: 0 0 16px; font-family: var(--sans); font-size: 30px; font-weight: 700; letter-spacing: -.01em; }
.school-card p { margin: 0 0 16px; color: var(--ink); }
.school-x { position: absolute; right: 14px; top: 12px; background: none; border: 0; color: var(--dim); font: inherit; font-size: 12px; cursor: pointer; }
.school-x:hover { color: var(--accent); }

@media (max-width: 420px) {
  ol.list a { grid-template-columns: 3ch 1fr; }
  ol.list .m { grid-column: 2; text-align: left; font-size: 12px; }
  .bar input, .bar input:focus { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  body::after { display: none; }
}

.bar .chatlink { color: var(--accent); text-decoration: none; margin-left: 12px; }
.bar .chatlink:hover { text-decoration: underline; }

.bar .soon { color: var(--dim); margin-left: 12px; cursor: default; }
.bar .soon em { font-style: normal; color: var(--accent); }
