/* ephemeral.exe — three phosphor themes on a black screen */

:root {
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --scan: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 0px, rgba(255, 255, 255, 0.02) 1px, transparent 1px, transparent 3px);
}

:root,
:root[data-mode="amber"] {
  --base: #0a0705;
  --glow-a: rgba(255, 160, 50, 0.14);
  --glow-b: rgba(255, 160, 50, 0.05);
  --title: #ffb347;
  --nav: #b8791f;
  --meta: #ba7c22;
  --body: #d99a3f;
  --divider: #2e1d0c;
  --accent: #ffb347;
}

:root[data-mode="green"] {
  --base: #060a07;
  --glow-a: rgba(51, 255, 102, 0.14);
  --glow-b: rgba(51, 255, 102, 0.05);
  --title: #5dffa0;
  --nav: #2fa35a;
  --meta: #30a354;
  --body: #3fe06e;
  --divider: #123a1e;
  --accent: #5dffa0;
}

:root[data-mode="dos"] {
  --base: #050505;
  --glow-a: rgba(255, 255, 255, 0.1);
  --glow-b: rgba(255, 255, 255, 0.035);
  --title: #f2f2f2;
  --nav: #8a8a8a;
  --meta: #878787;
  --body: #c9c9c9;
  --divider: #2a2a2a;
  --accent: #f2f2f2;
}

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

html {
  background: var(--base);
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--base);
  color: var(--body);
}

.screen {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 96px 24px 120px;
  background:
    var(--scan),
    radial-gradient(1200px 820px at 50% 340px, var(--glow-a), var(--glow-b) 40%, transparent 70%),
    var(--base);
}

.wrap {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 64px;
}

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

:focus-visible {
  outline: 1px dashed var(--accent);
  outline-offset: 3px;
}

/* masthead */

.masthead {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.masthead-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
}

.site-title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 28px;
  letter-spacing: 0.3px;
  color: var(--title);
}

.nav {
  display: flex;
  gap: 20px;
}

.nav a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--nav);
}

.nav a[aria-current="page"],
.nav a:hover {
  color: var(--title);
}

.tagline {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2px;
  color: var(--meta);
}

.controls {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--meta);
}

.link-btn {
  appearance: none;
  background: none;
  border: 0;
  padding: 0 0 1px;
  margin: 0;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--meta);
  border-bottom: 1px dotted currentColor;
}

.link-btn[aria-pressed="true"],
.link-btn:hover {
  color: var(--title);
}

.rule {
  height: 0;
  margin: 0;
  border: 0;
  border-top: 1px dashed var(--divider);
  width: 100%;
}

/* log entries */

.log {
  display: flex;
  flex-direction: column;
  gap: 52px;
}

.entry {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.entry-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 21px;
  line-height: 1.3;
  color: var(--title);
}

.entry-title a:hover {
  border-bottom: 1px dotted currentColor;
}

.stamp {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--meta);
  white-space: nowrap;
}

.entry-body {
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--body);
}

.entry-body > :first-child {
  margin-top: 0;
}

.entry-body > :last-child {
  margin-bottom: 0;
}

.entry-body p,
.entry-body ul,
.entry-body ol,
.entry-body blockquote,
.entry-body pre {
  margin: 0 0 1em;
}

.entry-body h2,
.entry-body h3 {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--title);
  margin: 1.6em 0 0.5em;
}

.entry-body h2 {
  font-size: 18px;
}

.entry-body h3 {
  font-size: 16px;
}

.entry-body a {
  color: var(--accent);
  border-bottom: 1px dotted currentColor;
}

.entry-body a:hover {
  border-bottom-style: solid;
}

.entry-body blockquote {
  padding-left: 16px;
  border-left: 1px dashed var(--divider);
  font-style: italic;
}

.entry-body img,
.entry-body video {
  max-width: 100%;
  height: auto;
}

.entry-body code,
.entry-body pre {
  font-family: var(--mono);
  font-size: 13px;
}

.entry-body pre {
  overflow-x: auto;
  padding: 12px 14px;
  border: 1px dashed var(--divider);
}

.entry-body hr {
  border: 0;
  border-top: 1px dashed var(--divider);
  margin: 2em 0;
}

/* archive */

.year-head {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.5px;
  color: var(--title);
}

.year {
  margin-bottom: 40px;
}

.archive-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.archive-list li {
  display: flex;
  gap: 14px;
  align-items: baseline;
  flex-wrap: wrap;
}

.archive-list a {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--title);
}

.archive-list a:hover {
  border-bottom: 1px dotted currentColor;
}

/* links under entries */

.more-wrap {
  margin: 0;
  display: flex;
  justify-content: center;
}

.more {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px dotted currentColor;
  padding-bottom: 2px;
}

.more:hover {
  border-bottom-style: solid;
}

/* footer + terminal */

.footer {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.footer-line {
  margin: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--meta);
}

.term {
  display: none;
  flex-direction: column;
  gap: 4px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.3px;
}

.js .term {
  display: flex;
}

#term-log {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.term-line {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.term-boot,
.term-in {
  color: var(--meta);
}

.term-out {
  color: var(--title);
}

.term-buf {
  color: var(--body);
  padding-left: 14px;
}

.term-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.term-prompt {
  color: var(--meta);
}

#term-input {
  flex-grow: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  color: var(--title);
  caret-color: var(--title);
}

#term-input::placeholder {
  color: var(--meta);
  opacity: 0.8;
}

/* degauss */

@keyframes degauss {
  0%   { transform: skewY(0deg) scale(1); filter: hue-rotate(0deg) saturate(1) brightness(1) blur(0px); }
  5%   { transform: skewY(-2.5deg) scale(1.015) translateX(6px); filter: hue-rotate(70deg) saturate(3.5) brightness(1.4) blur(1.5px); }
  11%  { transform: skewY(3deg) scale(0.985) translateX(-8px); filter: hue-rotate(150deg) saturate(4) brightness(0.75) blur(2.5px); }
  17%  { transform: skewY(-4deg) scale(1.02) translateX(7px); filter: hue-rotate(230deg) saturate(3.8) brightness(1.5) blur(2px); }
  24%  { transform: skewY(3.2deg) scale(0.98) translateX(-6px); filter: hue-rotate(310deg) saturate(3.2) brightness(0.85) blur(2px); }
  31%  { transform: skewY(-2.2deg) scale(1.015) translateX(4px); filter: hue-rotate(30deg) saturate(2.6) brightness(1.3) blur(1.5px); }
  39%  { transform: skewY(1.6deg) scale(0.995) translateX(-3px); filter: hue-rotate(100deg) saturate(2.1) brightness(1.05) blur(1px); }
  48%  { transform: skewY(-1deg) scale(1.008) translateX(2px); filter: hue-rotate(170deg) saturate(1.7) brightness(1.15) blur(0.6px); }
  58%  { transform: skewY(0.6deg) scale(1) translateX(-1px); filter: hue-rotate(50deg) saturate(1.35) brightness(1) blur(0.3px); }
  70%  { transform: skewY(-0.3deg) scale(1); filter: hue-rotate(15deg) saturate(1.1) brightness(1) blur(0px); }
  82%  { transform: skewY(0.15deg) scale(1); filter: hue-rotate(4deg) saturate(1.02) brightness(1) blur(0px); }
  100% { transform: skewY(0deg) scale(1) translateX(0); filter: hue-rotate(0deg) saturate(1) brightness(1) blur(0px); }
}

.screen.degauss {
  animation: degauss 1.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

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

@media (max-width: 520px) {
  .screen {
    padding: 56px 16px 80px;
  }
}
