/* GenShift WHOIS Lookup - stylesheet. No external fonts or frameworks. */
:root {
  --brand: #1d4ed8;
  --brand-dark: #1a3fb0;
  --brand-tint: #eaf0fe;
  --ink: #16223a;
  --muted: #566277;
  --line: #dde3ee;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --ok: #0b6b45;
  --ok-bg: #e6f5ee;
  --bad: #a4241b;
  --bad-bg: #fdecea;
  --warn: #8a5a00;
  --warn-bg: #fff4dc;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 var(--font); min-height: 100vh;
  display: flex; flex-direction: column;
}
main { flex: 1 0 auto; }
h1, h2, h3, p { margin: 0; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
.container { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 24px; }

:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; border-radius: 4px; }
.skip-link {
  position: absolute; left: 12px; top: -60px; background: var(--ink); color: #fff;
  padding: 10px 14px; border-radius: var(--radius-sm); z-index: 10; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-name { font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.header-nav { display: flex; align-items: center; gap: 22px; }
.header-nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.header-nav a:hover { color: var(--ink); }
.header-nav .nav-cta {
  color: var(--brand); border: 1px solid var(--line); padding: 8px 14px; border-radius: var(--radius-md);
}
.header-nav .nav-cta:hover { border-color: var(--brand); color: var(--brand-dark); }

/* Hero + search */
.hero { background: var(--brand-tint); border-bottom: 1px solid #d3def7; padding: 64px 0 56px; }
.hero-inner { max-width: 820px; }
.hero h1 { font-size: clamp(2rem, 4.6vw, 3rem); line-height: 1.1; letter-spacing: -0.025em; font-weight: 750; }
.hero-lead { margin-top: 12px; font-size: 1.15rem; color: var(--muted); }

.search { margin-top: 32px; }
.search-label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 8px; }
.search-row {
  display: flex; gap: 8px; background: var(--surface); padding: 8px;
  border: 1px solid #c9d5ee; border-radius: var(--radius-lg);
  box-shadow: 0 6px 20px rgba(29, 78, 216, 0.09);
}
.search-row:focus-within { border-color: var(--brand); }
.search-input {
  flex: 1 1 auto; min-width: 0; border: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 1.1rem; padding: 12px 14px; border-radius: var(--radius-md);
}
.search-input::placeholder { color: #7b879b; }
.search-input:focus { outline: none; }
.search-input[aria-invalid="true"] { color: var(--bad); }
.search-row:has(.search-input:focus-visible) { outline: 3px solid #f59e0b; outline-offset: 2px; }
.search-hint { margin-top: 12px; color: var(--muted); font-size: 0.92rem; }
.field-error { margin-top: 10px; color: var(--bad); font-weight: 600; font-size: 0.95rem; }

.btn {
  font: inherit; font-weight: 650; border: 1px solid transparent; border-radius: var(--radius-md);
  padding: 12px 24px; cursor: pointer; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; gap: 8px; line-height: 1.2;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.7; cursor: not-allowed; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); padding: 8px 14px; font-size: 0.9rem; }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-dark); }
.search-btn { min-width: 128px; }
.spinner {
  width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.8s linear infinite;
}

/* Results */
.results-wrap { padding-top: 32px; padding-bottom: 8px; }
.result:empty { display: none; }
.result:focus { outline: none; }

.banner {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 24px; display: flex; gap: 20px; justify-content: space-between; align-items: center;
  box-shadow: 0 2px 10px rgba(22, 34, 58, 0.05);
}
.banner-main { min-width: 0; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.9rem;
  padding: 5px 12px 5px 8px; border-radius: 999px; border: 1px solid transparent;
}
.status-pill svg { flex: none; }
.pill-registered { background: var(--brand-tint); color: var(--brand-dark); border-color: #c5d4f7; }
.pill-available { background: var(--ok-bg); color: var(--ok); border-color: #b7e2cd; }
.pill-unknown { background: var(--warn-bg); color: var(--warn); border-color: #f0d9a3; }
.pill-error { background: var(--bad-bg); color: var(--bad); border-color: #f4c3be; }
.result-domain { margin-top: 10px; font-size: clamp(1.4rem, 3.4vw, 2rem); font-weight: 750; letter-spacing: -0.02em; overflow-wrap: anywhere; line-height: 1.2; }
.result-message { margin-top: 6px; color: var(--muted); overflow-wrap: anywhere; }
.banner-actions { flex: none; display: flex; gap: 8px; flex-wrap: wrap; }
.banner.is-available { border-color: #b7e2cd; }
.banner.is-unknown { border-color: #f0d9a3; }
.banner.is-error { border-color: #f4c3be; }
.banner.is-loading { align-items: flex-start; }
.loading-line { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.spinner-dark { border-color: #c9d5ee; border-top-color: var(--brand); width: 20px; height: 20px; }

.grid { margin-top: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 20px 22px; min-width: 0; }
.card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.card-wide { grid-column: 1 / -1; }
.rows { margin: 0; display: grid; gap: 14px; }
.row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.row dt { color: var(--muted); font-size: 0.9rem; }
.row dd { margin: 0; overflow-wrap: anywhere; word-break: break-word; font-weight: 500; }
.row .sub { display: block; color: var(--muted); font-weight: 400; font-size: 0.88rem; margin-top: 2px; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.note { color: var(--muted); font-size: 0.95rem; }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.list li { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-width: 0; }
.list .item-main { min-width: 0; overflow-wrap: anywhere; }
.status-code { display: inline-block; font-family: var(--mono); font-size: 0.88rem; background: var(--bg); border: 1px solid var(--line); padding: 2px 8px; border-radius: var(--radius-sm); overflow-wrap: anywhere; }
.status-desc { display: block; color: var(--muted); font-size: 0.88rem; margin-top: 3px; }
.copy-btn {
  flex: none; font: inherit; font-size: 0.8rem; font-weight: 600; color: var(--brand); background: transparent;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 3px 10px; cursor: pointer;
}
.copy-btn:hover { border-color: var(--brand); }

.raw { margin-top: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); }
.raw summary { cursor: pointer; padding: 16px 22px; font-weight: 650; list-style-position: inside; }
.raw-body { border-top: 1px solid var(--line); padding: 16px 22px 22px; }
.raw-tools { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.raw pre {
  margin: 0; font-family: var(--mono); font-size: 0.82rem; line-height: 1.5; background: #f1f4fa;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; max-height: 420px;
  overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2;
}
.result-meta { margin-top: 16px; color: var(--muted); font-size: 0.86rem; overflow-wrap: anywhere; }

/* About */
.about { padding-top: 56px; padding-bottom: 72px; }
.about h2 { font-size: 1.35rem; letter-spacing: -0.01em; }
.about-grid { margin-top: 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.about-grid h3 { font-size: 1rem; margin-bottom: 6px; }
.about-grid p { color: var(--muted); font-size: 0.96rem; max-width: 60ch; }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: 0.9rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.noscript { padding: 16px 24px; text-align: center; color: var(--bad); }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } * { scroll-behavior: auto !important; } }

/* Tablet */
@media (max-width: 900px) {
  .hero { padding: 48px 0 44px; }
  .about-grid { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 760px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .banner { flex-direction: column; align-items: stretch; }
  .banner-actions .btn { flex: 1 1 auto; }
}
/* Mobile */
@media (max-width: 560px) {
  .container { padding: 0 16px; }
  .header-nav a:not(.nav-cta) { display: none; }
  .hero { padding: 36px 0 32px; }
  .search-row { flex-direction: column; padding: 8px; }
  .search-input { padding: 12px; font-size: 1rem; }
  .search-btn { width: 100%; }
  .row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .card { padding: 18px 16px; }
  .banner { padding: 18px 16px; }
  .raw summary, .raw-body { padding-left: 16px; padding-right: 16px; }
}
@media print { .site-header, .search, .site-footer, .copy-btn, .raw { display: none; } }
