/* LNK — Y2K theme. System fonts only: no external requests, works offline. */

:root {
  color-scheme: dark;
  --bg: #05070f;
  --panel: #0d1322;
  --panel-edge: #232c47;
  --ink: #d7e3f4;
  --muted: #8b98b3;
  --cyan: #22d3ee;
  --magenta: #ff2bd1;
  --amber: #ffd23e;
  --red: #ff5470;
  --green: #3dff88;
  --mono: "Courier New", ui-monospace, monospace;
  --ui: Tahoma, Verdana, Geneva, sans-serif;
}

* { box-sizing: border-box; }

/* Author display rules (e.g. main { display: flex }) override the browser's
   built-in [hidden] styling, so re-assert it here with !important. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 12px;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--ink);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.45;
}

/* CRT scanlines. Pure decoration: never intercepts clicks. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 2px,
    rgba(0, 0, 0, 0.22) 2px 4px
  );
  opacity: 0.5;
  z-index: 50;
}

body.boot main { visibility: hidden; }

main {
  width: 100%;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.panel {
  background: linear-gradient(180deg, #141b30 0%, var(--panel) 30%, #090d18 100%);
  border: 1px solid var(--panel-edge);
  border-top-color: #3b4a73;
  border-left-color: #3b4a73;
  border-radius: 6px;
  box-shadow:
    inset 0 1px 0 rgba(215, 227, 244, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.6),
    0 0 24px rgba(34, 211, 238, 0.12),
    0 8px 40px rgba(0, 0, 0, 0.6);
  padding: 28px 28px 24px;
  text-align: center;
}

.panel.narrow { max-width: 480px; margin: 0 auto; }

.sysline {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.led {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: led-blink 2.4s steps(2, start) infinite;
}

.led-red { background: var(--red); box-shadow: 0 0 8px var(--red); }

@keyframes led-blink { 50% { opacity: 0.35; } }

.title {
  margin: 0;
  font-size: 4rem;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  font-weight: 900;
  background: linear-gradient(180deg, #ffffff 20%, #9be9f7 45%, #1a6f8a 50%, #d9f7ff 55%, #ffffff 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.8)) drop-shadow(0 0 18px rgba(34, 211, 238, 0.35));
}

.subtitle {
  margin: 4px 0 0;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.tagline { margin: 10px 0 0; font-size: 0.95rem; }
.tagline em { color: var(--magenta); font-style: normal; }

.field-label {
  display: block;
  margin: 22px 0 6px;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  color: var(--muted);
  text-align: left;
}

#input-link {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 16px; /* 16px min: no iOS zoom on focus */
  color: var(--ink);
  background: #04060c;
  border: 2px inset #3b4a73;
  border-radius: 4px;
  outline: none;
}

#input-link:focus { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan), 0 0 16px rgba(34, 211, 238, 0.35); }

.row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  color: #06121a;
  background: linear-gradient(180deg, #e8fbff 0%, #7ce7f7 45%, var(--cyan) 50%, #0e9db5 100%);
  border: 2px outset #bff3fc;
  border-radius: 4px;
  padding: 12px 28px;
  min-height: 44px;
  cursor: pointer;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.35), 0 3px 0 rgba(0, 0, 0, 0.5);
}

.btn:active { border-style: inset; box-shadow: none; transform: translateY(1px); }

.btn:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--magenta);
  outline-offset: 2px;
}

.setting { margin: 14px 0 0; font-size: 0.9rem; color: var(--muted); }
.setting input { width: 18px; height: 18px; accent-color: var(--cyan); vertical-align: -3px; }

#query-warning {
  margin: 14px 0 0;
  font-size: 0.9rem;
  background: rgba(255, 210, 62, 0.1);
  border: 1px solid var(--amber);
  border-radius: 4px;
  padding: 8px 12px;
  color: var(--ink);
  text-align: left;
}
#query-warning summary { cursor: pointer; color: var(--amber); }

#idle-hint { margin: 18px 0 0; }

.muted { color: var(--muted); font-size: 0.9rem; }

#result { margin-top: 20px; border-top: 1px dashed var(--panel-edge); padding-top: 16px; }

.result-title {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  color: var(--green);
  text-shadow: 0 0 10px rgba(61, 255, 136, 0.5);
}

.result-link-wrap { margin: 10px 0; }

#result-link, #redirect-link {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--cyan);
  word-break: break-all;
}

#result-stats { margin: 6px 0 0; }

#copy-status { min-height: 1.4em; margin: 10px 0 0; color: var(--green); }

.input-error {
  margin: 14px 0 0;
  color: var(--red);
  font-weight: 700;
}

.error-title {
  margin: 8px 0;
  font-size: 1.6rem;
  letter-spacing: 0.1em;
  color: var(--red);
  text-shadow: 0 0 16px rgba(255, 84, 112, 0.5);
}

.redirect-target { font-family: var(--mono); font-size: 0.9rem; word-break: break-all; }

.sysfooter {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-align: center;
}

.noscript {
  max-width: 620px;
  border: 1px solid var(--amber);
  padding: 12px 16px;
  border-radius: 4px;
  color: var(--amber);
}

@media (max-width: 560px) {
  .panel { padding: 20px 16px 18px; }
  .title { font-size: 2.8rem; }
  .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
