:root {
  color-scheme: dark;
  --text: #f0f0f0;
  --muted: #a0a0a0;
  --accent: #ffffff;
}

* {
  box-sizing: border-box;
}

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

/* ── BODY – dark room on desktop ───────────────── */
body {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  color: var(--text);
  background: #0c0b09;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 28px 12px 0;
}

/* ── DESKTOP: CRT MONITOR CASING ───────────────── */
.device-wrap {
  position: relative;
  width: min(92vw, 1200px);
  background: linear-gradient(150deg, #cec8be 0%, #b9b2a6 50%, #a9a29a 100%);
  border-radius: 14px 14px 10px 10px;
  padding: 20px 20px 0;
  box-shadow:
    inset 3px 3px 0 rgba(255, 255, 255, 0.52),
    inset -3px -3px 0 rgba(0, 0, 0, 0.36),
    0 30px 80px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(0, 0, 0, 0.5);
}

/* Phone elements hidden on desktop */
.phone-top,
.phone-statusbar,
.phone-navbar {
  display: none;
}

/* ── CRT SCREEN GLASS ──────────────────────────── */
.device-screen {
  background: #000;
  border-radius: 6px 6px 0 0;
  overflow: hidden;
  position: relative;
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.75),
    0 0 0 2px #221f18,
    0 0 0 4px #161410;
}

/* CRT scanlines */
.device-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.18),
    rgba(0, 0, 0, 0.18) 1px,
    transparent 1px,
    transparent 3px
  );
}

/* CRT glass reflection */
.device-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 11;
  background: radial-gradient(
    ellipse at 28% 18%,
    rgba(255, 255, 255, 0.055) 0%,
    transparent 52%
  );
}

/* ── MONITOR BOTTOM CONTROLS BAR ──────────────── */
.monitor-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 14px;
}

.monitor-led {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #50e050;
  box-shadow: 0 0 5px #50e050, 0 0 10px rgba(80, 224, 80, 0.35);
  flex-shrink: 0;
}

.monitor-btns {
  display: flex;
  gap: 5px;
  margin-left: 6px;
}

.monitor-btns span {
  display: block;
  width: 13px;
  height: 5px;
  background: linear-gradient(to bottom, #afa89e, #857e74);
  border-radius: 2px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.28);
}

.monitor-label {
  margin-left: auto;
  font-size: 0.55rem;
  color: #8a8278;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  user-select: none;
}

/* ── MONITOR STAND ─────────────────────────────── */
.monitor-stand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 40px;
}

.monitor-neck {
  width: 58px;
  height: 36px;
  background: linear-gradient(to bottom, #b5aea4, #7e7870);
  clip-path: polygon(20% 0%, 80% 0%, 88% 100%, 12% 100%);
}

.monitor-base {
  width: 240px;
  height: 14px;
  background: linear-gradient(to bottom, #b5aea4 0%, #8a8278 60%, #7a7268 100%);
  border-radius: 4px 4px 10px 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

/* ── LAYOUT ──────────────────────────────────── */
.shell {
  padding: 24px;
}

.terminal-card {
  width: 100%;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.75rem;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 0.95;
}

.subtitle {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
  max-width: 42ch;
}

/* ── TERMINAL BOX ─────────────────────────────── */
.terminal {
  margin-top: 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.85);
}

.terminal__bar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.terminal__bar span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
}

pre {
  margin: 0;
  padding: 16px 14px 18px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.75;
  color: #f0f0f0;
  height: 148px;
  overflow: hidden;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
}

pre.typing::after {
  content: "_";
  margin-left: 2px;
  animation: blink 1s steps(1, end) infinite;
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0;
  }
}

/* ── BUTTONS ─────────────────────────────────── */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 120px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 3px;
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.button__icon {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex: 0 0 auto;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.44);
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

/* ────────────────────────────────────────────────
   MOBILE: OLD PHONE SCREEN (2010s)
──────────────────────────────────────────────── */
@media (max-width: 640px) {
  body {
    background: #080808;
    padding: 0;
    justify-content: flex-start;
    align-items: stretch;
  }

  /* Phone chassis fills viewport */
  .device-wrap {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    background: #161618;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
  }

  /* Earpiece + front camera row */
  .phone-top {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 26px;
    background: #111113;
    flex-shrink: 0;
  }

  .phone-speaker {
    width: 58px;
    height: 4px;
    background: #060608;
    border-radius: 999px;
    box-shadow:
      inset 0 1px 2px rgba(0, 0, 0, 0.9),
      0 0 0 1px rgba(255, 255, 255, 0.04);
  }

  .phone-camera {
    position: absolute;
    right: 26px;
    top: 50%;
    transform: translateY(-50%);
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #0c0c10;
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.07),
      inset 0 0 3px rgba(80, 80, 160, 0.25);
  }

  /* Status bar */
  .phone-statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 14px 4px;
    background: #0d0d0f;
    font-size: 0.6rem;
    color: #999;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
  }

  /* Screen grows to fill space between bars */
  .device-screen {
    flex: 1;
    background: #060608;
    border-radius: 0;
    box-shadow: none;
  }

  .device-screen::before {
    background: repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.01),
      rgba(255, 255, 255, 0.01) 1px,
      transparent 1px,
      transparent 3px
    );
  }

  .device-screen::after {
    display: none;
  }

  /* Capacitive nav bar */
  .phone-navbar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 48px;
    background: #0d0d0f;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
  }

  .phone-btn {
    color: rgba(255, 255, 255, 0.4);
    font-size: 1rem;
    line-height: 1;
    padding: 4px 28px;
    cursor: default;
    user-select: none;
  }

  .phone-btn--home {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.58);
  }

  /* Hide desktop-only elements */
  .monitor-controls,
  .monitor-stand {
    display: none;
  }

  /* Content adjustments */
  .shell {
    padding: 14px;
  }

  h1 {
    font-size: 1.75rem;
  }

  .links {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  pre {
    color: #e8e8e4;
  }
}
