/* nineties.exe hotline: Danny's CRT at 2 a.m. Windows 98 chrome, CRT blue glow, Claude orange (#DE7356) kept for him. */

@font-face {
  font-family: "PxVGA";
  src: url("/fonts/PxPlus_IBM_VGA_9x16.ttf") format("truetype");
  font-display: block;
}

:root {
  --room: #05070f;
  --desk: #0d6f73;          /* the teal desktop, a little dimmed by the dark room */
  --face: #c0c0c0;
  --hi: #ffffff;
  --lo: #808080;
  --dk: #0a0a0a;
  --navy: #000080;
  --blue: #1084d0;
  --glow: #8fd3ff;
  --claude: #de7356;
  --ui: Tahoma, Verdana, "Segoe UI", sans-serif;
  --mono: "PxVGA", "Courier New", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--room); }
body { color: #000; font: 13px/1.35 var(--ui); -webkit-font-smoothing: none; -webkit-text-size-adjust: 100%; overflow: hidden; }
button, input { font: inherit; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- the tube */

#crt {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  background: var(--desk);
  overflow: hidden;
}
#crt::before {   /* scanlines + the curve's vignette, over everything, never in the way */
  content: ""; position: absolute; inset: 0; z-index: 50; pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,.16) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55) 100%);
  mix-blend-mode: multiply;
}
#crt::after {    /* the glass: a soft blue bloom and a slow flicker */
  content: ""; position: absolute; inset: 0; z-index: 51; pointer-events: none;
  background: radial-gradient(ellipse at 50% 40%, rgba(143,211,255,.10), transparent 70%);
  animation: flicker 4s infinite steps(1);
}
@keyframes flicker { 0%, 100% { opacity: 1 } 47% { opacity: .85 } 48% { opacity: 1 } 82% { opacity: .93 } }
#crt.on .desktop { animation: poweron .5s ease-out both; }
@keyframes poweron { 0% { transform: scaleY(.004) scaleX(.6); filter: brightness(4) } 60% { transform: scaleY(1.02); filter: brightness(1.6) } 100% { transform: none; filter: none } }

.desktop {
  position: relative; flex: 1; min-height: 0;
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; padding: max(18px, env(safe-area-inset-top)) 14px 12px;
  overflow-y: auto;
}

/* ---------------------------------------------------------------- the hook: readable at 0:00 */

.hook { text-align: center; color: #fff; text-shadow: 0 0 6px var(--glow), 0 0 22px rgba(143,211,255,.55), 2px 2px 0 #00303a; margin-top: 4px; }
.hook h1 { font: 400 clamp(34px, 11vw, 64px)/1 var(--mono); margin: 0; letter-spacing: .02em; white-space: nowrap; }
.hook .prompt { color: var(--glow); }
.hook p { font: 400 clamp(15px, 4.4vw, 20px)/1.2 var(--mono); margin: 10px 0 0; color: #e6f6ff; }
.caret { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0 } }

/* ---------------------------------------------------------------- desktop icons */

.icons { position: absolute; left: 8px; top: 132px; margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; opacity: .9; }
.icons li { width: 70px; text-align: center; color: #fff; font-size: 11px; text-shadow: 1px 1px 0 #000; }
.ico { display: block; width: 32px; height: 32px; margin: 0 auto 3px; background: center/contain no-repeat; image-rendering: pixelated; }
.ico-pc { background-image: url("/img/pc.svg"); }
.ico-txt { background-image: url("/img/txt.svg"); }
.ico-folder { background-image: url("/img/folder.svg"); }
.ico-bin { background-image: url("/img/bin.svg"); }
.ico-dun { background-image: url("/img/dun.svg"); width: 40px; height: 40px; margin: 0; flex: none; }
.ico-dun.anim { animation: dun .6s steps(2) infinite; }
@keyframes dun { 50% { filter: brightness(1.5) hue-rotate(30deg) } }
@media (max-width: 560px) { .icons { display: none; } }

/* ---------------------------------------------------------------- Windows 98 chrome */

.win {
  position: relative; z-index: 2;
  background: var(--face);
  border: 2px solid; border-color: var(--hi) var(--dk) var(--dk) var(--hi);
  box-shadow: inset -1px -1px 0 var(--lo), inset 1px 1px 0 #dfdfdf, 0 0 40px rgba(0,0,0,.35);
  padding: 3px;
  width: min(100%, 420px);
}
.title {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(90deg, var(--navy), var(--blue));
  color: #fff; font-weight: 700; padding: 3px 3px 3px 6px; height: 22px;
}
.tbtns { display: flex; gap: 2px; }
.tbtns b {
  width: 18px; height: 16px; display: grid; place-items: center; font: 700 12px/1 var(--ui);
  background: var(--face); color: #000;
  border: 1px solid; border-color: var(--hi) var(--dk) var(--dk) var(--hi);
}
.body { padding: 12px 12px 10px; display: grid; gap: 8px; }
.who { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; font-size: 15px; }
label { display: grid; grid-template-columns: 104px 1fr; align-items: center; }
input {
  min-width: 0; padding: 3px 4px; background: #fff; color: #000;
  border: 2px solid; border-color: var(--lo) var(--hi) var(--hi) var(--lo); box-shadow: inset 1px 1px 0 var(--dk);
  border-radius: 0; font-size: 16px; /* 16px: iOS won't zoom */
}
input[readonly] { color: #222; }
.status { min-height: 1.4em; margin: 2px 0 0; color: #000; }
.status.bad { color: #a00; font-weight: 700; }
.buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
button {
  min-width: 92px; min-height: 30px; padding: 4px 12px; cursor: pointer;
  background: var(--face); color: #000; border-radius: 0;
  border: 2px solid; border-color: var(--hi) var(--dk) var(--dk) var(--hi);
  box-shadow: inset -1px -1px 0 var(--lo), inset 1px 1px 0 #dfdfdf;
}
button.default { outline: 1px solid #000; outline-offset: 0; }
button:active, button[aria-pressed="true"] { border-color: var(--dk) var(--hi) var(--hi) var(--dk); box-shadow: inset 1px 1px 0 var(--lo); padding: 5px 11px 3px 13px; }
button:focus-visible { outline: 1px dotted #000; outline-offset: -5px; }
button:disabled { color: var(--lo); text-shadow: 1px 1px 0 var(--hi); cursor: default; }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px) } 75% { transform: translateX(6px) } }

/* ---------------------------------------------------------------- on the call */

[data-view="call"] .hook, [data-view="call"] .fine, [data-view="connecting"] .fine { display: none; }
.notepad { flex: 1; min-height: 220px; max-height: 62vh; display: flex; flex-direction: column; width: min(100%, 560px); }
.menu { padding: 3px 6px; font-size: 12px; }
.paper {
  flex: 1; overflow-y: auto; background: #fff; padding: 8px 10px;
  border: 2px solid; border-color: var(--lo) var(--hi) var(--hi) var(--lo); box-shadow: inset 1px 1px 0 var(--dk);
  font: 18px/1.35 var(--mono); color: #000; white-space: pre-wrap; overflow-wrap: anywhere;
}
.paper p { margin: 0 0 .7em; }
.paper .you { color: #6b6b6b; }
.paper .you::before { content: "> "; }
.paper .typing::after { content: "_"; animation: blink .8s steps(1) infinite; }
.paper .cut::after { content: "—"; }

.small { width: min(100%, 560px); }
.small .body { padding: 8px 10px; gap: 6px; }
.stats { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.meters { display: grid; grid-template-columns: auto 1fr auto 1fr; align-items: center; gap: 6px; font-size: 11px; }
.meter { height: 12px; border: 2px solid; border-color: var(--lo) var(--hi) var(--hi) var(--lo); background: #000; }
.meter i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, #00c000 0 6px, transparent 6px 8px); transition: width .06s linear; }
#meter-him { background: repeating-linear-gradient(90deg, var(--claude) 0 6px, transparent 6px 8px); }

/* ---------------------------------------------------------------- fine print, taskbar */

.fine { max-width: 420px; color: #e0f4f4; font-size: 11.5px; text-align: center; text-shadow: 1px 1px 0 #003; opacity: .9; margin-top: auto; }
.fine a { color: #fff; }

.taskbar {
  position: relative; z-index: 3; display: flex; align-items: center; gap: 6px;
  height: calc(32px + env(safe-area-inset-bottom)); padding: 3px 3px calc(3px + env(safe-area-inset-bottom));
  background: var(--face); border-top: 2px solid var(--hi);
}
.start, .task, .tray { height: 24px; display: flex; align-items: center; padding: 0 8px; }
.start { font-weight: 700; border: 2px solid; border-color: var(--hi) var(--dk) var(--dk) var(--hi); }
.task { flex: 0 1 180px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border: 2px solid; border-color: var(--dk) var(--hi) var(--hi) var(--dk); background: #dcdcdc; font-weight: 700; }
.tray { margin-left: auto; gap: 8px; border: 1px solid; border-color: var(--lo) var(--hi) var(--hi) var(--lo); font-size: 12px; }
.modem { display: flex; gap: 2px; }
.modem i { width: 6px; height: 6px; background: #204020; border: 1px solid #000; }
.modem i.on { background: #3f3; box-shadow: 0 0 4px #3f3; }

/* ---------------------------------------------------------------- the line drops: every screen goes black */

.black {
  position: absolute; inset: 0; z-index: 40; background: #000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 24px;
  animation: off .35s ease-in both;
}
@keyframes off { 0% { background: #fff; clip-path: inset(49.6% 0 49.6% 0) } 40% { background: #fff; clip-path: inset(49.6% 0 49.6% 0) } 100% { background: #000; clip-path: inset(0) } }
.black pre { margin: 0; color: #d9f2ff; font: clamp(22px, 7vw, 34px)/1.35 var(--mono); text-shadow: 0 0 8px rgba(143,211,255,.7); white-space: pre-wrap; text-align: left; min-height: 3em; }
.black pre .his { color: var(--claude); text-shadow: 0 0 10px rgba(222,115,86,.7); }
.after { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.after button, .after a {
  background: none; border: 0; box-shadow: none; padding: 6px; min-width: 0;
  color: #d9f2ff; font: 20px/1.2 var(--mono); text-decoration: none; text-shadow: 0 0 8px rgba(143,211,255,.7); cursor: pointer;
}
.after button:hover, .after a:hover, .after button:focus-visible, .after a:focus-visible { color: #fff; text-decoration: underline; outline: none; }
.noscript { position: absolute; inset: auto 0 40%; text-align: center; color: #fff; font: 20px var(--mono); }

@media (prefers-reduced-motion: reduce) {
  #crt::after, .caret, .ico-dun.anim, .paper .typing::after { animation: none; }
  #crt.on .desktop, .black { animation: none; }
}
