@font-face {
  font-family: 'VCR OSD Mono';
  src: url('/fonts/VCR_OSD_MONO.woff2') format('woff2'),
       url('/fonts/VCR_OSD_MONO.ttf') format('truetype');
  font-display: swap;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --crt-black: #0a0a0a;
  --crt-dark: #111111;
  --phosphor: #00ff41;
  --phosphor-dim: #00cc33;
  --vhs-blue: #00b4d8;
  --rec-red: #ff003c;
  --glitch-cyan: #00ffff;
  --glitch-magenta: #ff00ff;
  --vhs-white: #e0e0e0;
  --vhs-gray: #888888;
  --vhs-dark-gray: #333333;
  --font-vcr: 'VCR OSD Mono', ui-monospace, monospace;
}

body {
  font-family: var(--font-vcr);
  font-size: 1.4rem;
  background: var(--crt-black);
  color: var(--vhs-white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  overflow-x: hidden;
  position: relative;
}

.scanlines {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 1000;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.15) 0px, rgba(0,0,0,0.15) 2px, transparent 2px, transparent 4px);
  contain: strict;
}

.vhs-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  opacity: 0.35;
  contain: strict;
  animation: vhs-noise 0.4s steps(4) infinite;
}

@keyframes vhs-noise {
  0% { background-position: 0 0; }
  25% { background-position: -64px -32px; }
  50% { background-position: 32px -64px; }
  75% { background-position: -32px 64px; }
}

.bg-flash {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background-size: cover;
  background-position: center;
  contain: layout style;
  opacity: 0;
  filter: grayscale(0.4) contrast(1.2) brightness(1.15);
  transition: opacity 3s ease-in-out;
}

.bg-flash.visible { opacity: 0.3; }

header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid var(--vhs-dark-gray);
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.1rem;
}

.rec-indicator {
  color: var(--rec-red);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.rec-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  background: var(--rec-red);
  border-radius: 50%;
  animation: rec-blink 1.5s infinite;
}

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

.header-title { color: var(--phosphor); }
.timecode { color: var(--vhs-gray); }

main {
  max-width: 900px;
  width: 100%;
  padding: 2rem 1.5rem;
  position: relative;
  z-index: 1;
}

h1.glitch {
  font-size: 2.8rem;
  text-align: center;
  color: var(--phosphor);
  position: relative;
  text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

h1.glitch::before, h1.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  text-align: center;
  opacity: 0;
}

h1.glitch::before {
  color: var(--glitch-cyan);
  animation: glitch-1 3s infinite;
}

h1.glitch::after {
  color: var(--glitch-magenta);
  animation: glitch-2 3s infinite;
}

@keyframes glitch-1 {
  0%, 94%, 100% { opacity: 0; transform: translate(0); }
  95% { opacity: 0.8; transform: translate(-2px, 1px); }
  96% { opacity: 0; }
  97% { opacity: 0.6; transform: translate(2px, -1px); }
}

@keyframes glitch-2 {
  0%, 96%, 100% { opacity: 0; transform: translate(0); }
  97% { opacity: 0.7; transform: translate(2px, 1px); }
  98% { opacity: 0; }
  99% { opacity: 0.5; transform: translate(-1px, -1px); }
}

.subtitle {
  text-align: center;
  color: var(--vhs-blue);
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
}

.tagline {
  text-align: center;
  color: var(--vhs-gray);
  margin-bottom: 2rem;
  font-size: 1.1rem;
  letter-spacing: 0.2em;
}

.vhs-border {
  border: 1px solid var(--vhs-dark-gray);
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.1), inset 0 0 10px rgba(0, 0, 0, 0.3);
  background: var(--crt-dark);
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.status-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 2rem;
  border-radius: 4px;
}

.status-indicator {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--vhs-gray);
  flex-shrink: 0;
  border: 2px solid var(--vhs-dark-gray);
}

.status-card.online .status-indicator {
  background: var(--phosphor);
  border-color: var(--phosphor);
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.6), 0 0 40px rgba(0, 255, 65, 0.2);
  animation: pulse-green 2s infinite;
}

.status-card.offline .status-indicator {
  background: var(--rec-red);
  border-color: var(--rec-red);
  box-shadow: 0 0 20px rgba(255, 0, 60, 0.4);
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 20px rgba(0, 255, 65, 0.6), 0 0 40px rgba(0, 255, 65, 0.2); }
  50% { box-shadow: 0 0 10px rgba(0, 255, 65, 0.3), 0 0 20px rgba(0, 255, 65, 0.1); }
}

.status-card.online { border-color: var(--phosphor-dim); }
.status-card.offline { border-color: var(--rec-red); }

.site-name {
  display: block;
  font-size: 1.3rem;
  color: var(--vhs-blue);
  letter-spacing: 0.15em;
  margin-bottom: 0.4rem;
}

.status-label {
  display: block;
  font-size: 2rem;
  color: var(--phosphor);
}

.status-card.offline .status-label { color: var(--rec-red); }

.meta {
  font-size: 1.1rem;
  color: var(--vhs-gray);
}

.notify-section, .history-section { margin-bottom: 3rem; }

.notify-section h2, .history-section h2 {
  font-size: 1.5rem;
  color: var(--vhs-blue);
  margin-bottom: 0.75rem;
}

.section-desc {
  color: var(--vhs-gray);
  margin-bottom: 1.25rem;
  font-size: 1.1rem;
}

.notify-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.notify-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 4px;
  color: var(--vhs-white);
  font-family: var(--font-vcr);
  font-size: 1.3rem;
  cursor: pointer;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.notify-btn:hover {
  border-color: var(--phosphor-dim);
  box-shadow: 0 0 15px rgba(0, 255, 65, 0.15);
}

.notify-btn .price {
  margin-left: auto;
  color: var(--phosphor-dim);
  font-size: 1.1rem;
}

.notify-btn.subscribed {
  border-color: var(--phosphor);
  opacity: 0.7;
  cursor: default;
}

.sms-btn { flex-wrap: wrap; cursor: default; }

.sms-form {
  width: 100%;
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.sms-form input {
  flex: 1;
  padding: 0.8rem 1rem;
  background: var(--crt-black);
  border: 1px solid var(--vhs-dark-gray);
  border-radius: 2px;
  color: var(--phosphor);
  font-family: var(--font-vcr);
  font-size: 1.2rem;
  text-transform: none;
}

.sms-form input:focus {
  outline: none;
  border-color: var(--phosphor);
  box-shadow: 0 0 5px rgba(0, 255, 65, 0.3);
}

.sms-form input::placeholder { color: var(--vhs-dark-gray); }

.sms-form button {
  padding: 0.8rem 1.5rem;
  background: transparent;
  color: var(--phosphor);
  border: 1px solid var(--phosphor);
  border-radius: 2px;
  font-family: var(--font-vcr);
  font-weight: normal;
  cursor: pointer;
  font-size: 1.1rem;
  text-transform: uppercase;
  transition: all 0.2s;
}

.sms-form button:hover {
  background: var(--phosphor);
  color: var(--crt-black);
}

.sms-note {
  width: 100%;
  font-size: 0.9rem;
  color: var(--vhs-gray);
  margin-top: 0.5rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--crt-dark);
  border: 1px solid var(--vhs-dark-gray);
  border-radius: 2px;
  font-size: 1.1rem;
}

.history-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.history-dot.online { background: var(--phosphor); box-shadow: 0 0 6px rgba(0, 255, 65, 0.5); }
.history-dot.offline { background: var(--rec-red); }

.history-time {
  margin-left: auto;
  color: var(--vhs-gray);
  font-size: 1rem;
}

/* ---- WHOIS Terminal ---- */
.whois-section { margin-bottom: 3rem; }
.whois-section h2 {
  font-size: 1.5rem;
  color: var(--vhs-blue);
  margin-bottom: 0.75rem;
}

.terminal {
  border-radius: 4px;
  overflow: hidden;
  contain: content;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid var(--vhs-dark-gray);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.red { background: var(--rec-red); }
.terminal-dot.yellow { background: #ffaa00; }
.terminal-dot.green { background: var(--phosphor); }

.terminal-title {
  margin-left: 0.5rem;
  font-size: 1rem;
  color: var(--vhs-gray);
  letter-spacing: 0.1em;
}

.terminal-body {
  padding: 1.25rem;
  font-size: 1.05rem;
  line-height: 1.6;
}

.whois-line { color: var(--vhs-gray); }
.whois-line.blank { height: 1rem; }

.whois-prompt {
  color: var(--phosphor);
  margin-right: 0.3rem;
}

.whois-cmd { color: var(--vhs-white); }

.whois-cursor {
  color: var(--phosphor);
  animation: cursor-blink 1s step-end infinite;
}

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

.whois-group {
  margin: 0.75rem 0;
  padding-left: 0.75rem;
  border-left: 2px solid var(--vhs-dark-gray);
}

.whois-label {
  color: var(--vhs-blue);
  font-size: 0.95rem;
  letter-spacing: 0.15em;
  margin-bottom: 0.3rem;
}

.whois-row {
  display: flex;
  gap: 0.75rem;
  padding: 0.2rem 0;
}

.whois-key {
  color: var(--vhs-gray);
  min-width: 140px;
  flex-shrink: 0;
}

.whois-key::after { content: ":"; }

.whois-val {
  color: var(--vhs-white);
  word-break: break-all;
}

.whois-val.highlight {
  color: var(--phosphor);
  text-shadow: 0 0 6px rgba(0, 255, 65, 0.3);
}

.whois-val.warn { color: #ffaa00; }

.whois-val.redacted {
  color: #ff6680;
  font-style: italic;
}

footer {
  text-align: center;
  font-size: 1rem;
  padding: 2.5rem 1.5rem;
  border-top: 1px solid var(--vhs-dark-gray);
  color: var(--vhs-gray);
  position: relative;
  z-index: 1;
}

.phosphor { color: var(--phosphor); }

.footer-tagline {
  color: var(--vhs-blue);
  margin-top: 0.5rem;
  letter-spacing: 0.3em;
}

.footer-disclaimer {
  margin-top: 1rem;
  font-size: 0.7rem;
  color: #777777;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
  text-transform: none;
  letter-spacing: 0;
}

@keyframes vhs-tracking {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(1px); }
  50% { transform: translateX(-1px); }
  75% { transform: translateX(2px); }
}

main { animation: vhs-tracking 8s infinite; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--crt-black); }
::-webkit-scrollbar-thumb { background: var(--vhs-dark-gray); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--phosphor-dim); }

/* About Section */
.about-section {
  margin-top: 3rem;
}

.about-content {
  color: var(--phosphor-dim);
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 700px;
  margin: 0 auto;
}

.about-content p {
  margin-bottom: 1rem;
}

.about-content strong {
  color: var(--phosphor-green);
}

.about-content em {
  color: var(--phosphor-dim);
  font-style: italic;
}

/* FAQ Section */
.faq-section {
  margin-top: 3rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 700px;
  margin: 0 auto;
}

.faq-item {
  padding: 0;
  cursor: pointer;
}

.faq-item summary {
  padding: 1rem 1.2rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.faq-item summary::before {
  content: '>';
  color: var(--phosphor-green);
  font-family: 'VCR', monospace;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.faq-item[open] summary::before {
  content: 'v';
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary h3 {
  font-size: 0.85rem;
  color: var(--phosphor-green);
  font-family: 'VCR', monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
}

.faq-item p {
  padding: 0 1.2rem 1rem;
  color: var(--phosphor-dim);
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 0;
}

/* Footer Nav */
.footer-nav {
  margin-top: 0.5rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.footer-nav a {
  color: var(--phosphor-dim);
  text-decoration: none;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: color 0.2s;
}

.footer-nav a:hover {
  color: var(--phosphor-green);
}

@media (max-width: 600px) {
  body { font-size: 1rem; }

  .header-inner {
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }

  .rec-indicator { order: 1; }
  .header-title { order: 2; }
  .timecode { order: 3; width: 100%; text-align: right; font-size: 0.75rem; }

  main { padding: 1.25rem 1rem; }

  h1.glitch { font-size: 1.6rem; }
  .subtitle { font-size: 1rem; }
  .tagline { font-size: 0.85rem; margin-bottom: 1.25rem; }

  .status-grid { grid-template-columns: 1fr; gap: 1rem; margin-bottom: 2rem; }

  .status-card { padding: 1.25rem; gap: 1rem; }
  .status-indicator { width: 48px; height: 48px; }
  .site-name { font-size: 1rem; }
  .status-label { font-size: 1.5rem; }
  .meta { font-size: 0.85rem; }

  .notify-section h2, .history-section h2, .whois-section h2 { font-size: 1.2rem; }
  .section-desc { font-size: 0.9rem; }

  .notify-btn { font-size: 1rem; padding: 1rem; }
  .notify-btn .price { font-size: 0.9rem; }

  .sms-form input { font-size: 1rem; padding: 0.7rem 0.8rem; }
  .sms-form button { font-size: 0.9rem; padding: 0.7rem 1rem; }
  .sms-note { font-size: 0.75rem; }

  .history-item { font-size: 0.9rem; padding: 0.75rem 1rem; }
  .history-time { font-size: 0.8rem; }

  .terminal-body { padding: 1rem; font-size: 0.85rem; }
  .whois-key { min-width: 100px; font-size: 0.8rem; }
  .whois-val { font-size: 0.8rem; }
  .whois-row { gap: 0.5rem; }

  footer { font-size: 0.85rem; padding: 1.5rem 1rem; }

  .scanlines {
    background: repeating-linear-gradient(0deg, rgba(0,0,0,0.08) 0px, rgba(0,0,0,0.08) 3px, transparent 3px, transparent 6px);
  }
}
