/* DNSSEC Inspector: dark editorial, shared with hbenali.ovh. Fonts are self-hosted (see fonts/README.md). */

@font-face { font-family: 'Big Shoulders'; font-style: normal; font-weight: 600 900; font-display: swap; src: url('/fonts/big-shoulders-latin-wght.woff2') format('woff2'); }
@font-face { font-family: 'Newsreader'; font-style: normal; font-weight: 200 800; font-display: swap; src: url('/fonts/newsreader-latin-wght.woff2') format('woff2'); }
@font-face { font-family: 'Newsreader'; font-style: italic; font-weight: 200 800; font-display: swap; src: url('/fonts/newsreader-italic-latin-wght.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 100 800; font-display: swap; src: url('/fonts/jetbrains-mono-latin-wght.woff2') format('woff2'); }

:root {
    --ink: #0c1218;
    --slate: #17212b;
    --line: #263341;
    --bone: #e7e1d3;
    --mist: #8e9aa6;
    --sodium: #e9a23b;
    --verdigris: #5db7a0;
    --fail: #e5776f;
    --glow: rgba(233, 162, 59, 0.2);
    --glow-soft: rgba(233, 162, 59, 0.06);
    --wash: rgba(23, 33, 43, 0.6);

    --display: 'Big Shoulders', 'Arial Narrow', Impact, sans-serif;
    --serif: 'Newsreader', Georgia, serif;
    --mono: 'JetBrains Mono', ui-monospace, monospace;

    --gutter: clamp(1.5rem, 4vw, 2.5rem);
    color-scheme: dark;
}

/* Light: follows the system setting until the lamp (theme.js) is used. Dark above is the default and the identity.
   Contrast on --ink (page) / --slate (surface): text 16:1, muted 6.0/5.4, accent 5.5/4.9, ok 5.2/4.7, fail 5.7/5.1. */
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --ink: #f4efe4;
        --slate: #e9e3d4;
        --line: #cbc3b0;
        --bone: #0c1218;
        --mist: #4f5b67;
        --sodium: #8a5300;
        --verdigris: #1b7058;
        --fail: #b3261e;
        --glow: rgba(233, 162, 59, 0.22);
        --glow-soft: rgba(233, 162, 59, 0.07);
        --wash: rgba(233, 227, 212, 0.7);
        color-scheme: light;
    }
}
:root[data-theme="light"] {
    --ink: #f4efe4;
    --slate: #e9e3d4;
    --line: #cbc3b0;
    --bone: #0c1218;
    --mist: #4f5b67;
    --sodium: #8a5300;
    --verdigris: #1b7058;
    --fail: #b3261e;
    --glow: rgba(233, 162, 59, 0.22);
    --glow-soft: rgba(233, 162, 59, 0.07);
    --wash: rgba(233, 227, 212, 0.7);
    color-scheme: light;
}

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

html { background: var(--ink); overflow-x: clip; }

body {
    overflow-x: clip;
    min-height: 100vh;
    background: var(--ink);
    color: var(--bone);
    font-family: var(--serif);
    font-size: 1.125rem;
    line-height: 1.7;
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection { background: var(--sodium); color: var(--ink); }
:focus-visible { outline: 2px solid var(--sodium); outline-offset: 4px; border-radius: 2px; }

a { color: inherit; }
ul { list-style: none; }
strong { font-weight: 600; }
[hidden], .hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.link, footer a {
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-repeat: no-repeat;
    background-size: 100% 1px;
    background-position: 0 100%;
    padding-bottom: 2px;
    transition: background-size 0.35s cubic-bezier(0.22, 1, 0.36, 1), color 0.2s;
}
.link:hover, .link:focus-visible, footer a:hover, footer a:focus-visible { color: var(--sodium); background-size: 100% 2px; }

.display { font-family: var(--display); font-weight: 800; line-height: 0.86; letter-spacing: -0.01em; }

.wrap { max-width: 64rem; margin: 0 auto; padding-inline: var(--gutter); }

/* Hero */
.hero { position: relative; isolation: isolate; padding-block: 4.5rem 3rem; }
.hero::before {
    content: ''; position: absolute; z-index: -1; top: -14rem; right: -12rem;
    width: min(46rem, 140vw); aspect-ratio: 1; border-radius: 50%;
    background: radial-gradient(closest-side, var(--glow), var(--glow-soft) 55%, transparent);
    pointer-events: none;
}
.hero h1 { font-size: clamp(3.4rem, 13vw, 8.5rem); margin-left: -0.03em; }
.hero h1 .line { display: block; overflow: hidden; padding-bottom: 0.05em; }
.hero h1 .line > span { display: block; animation: rise 1.1s cubic-bezier(0.16, 1, 0.3, 1) both; }
.hero h1 .line:nth-child(2) > span { animation-delay: 0.13s; }
.hero .lead { margin-top: 2rem; max-width: 38ch; font-size: clamp(1.25rem, 2.4vw, 1.6rem); line-height: 1.5; animation: fade 0.9s 0.5s both; }

@keyframes rise { from { transform: translateY(108%); } }
@keyframes fade { from { opacity: 0; transform: translateY(12px); } }

/* Sections */
.block { position: relative; padding-block: 3.5rem; }
.block::before { content: ''; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); height: 1px; background: var(--line); }
.block h2 { font-family: var(--display); font-weight: 800; font-size: clamp(2.2rem, 5vw, 3.2rem); line-height: 1; color: var(--sodium); margin-bottom: 1.25rem; }
.block h3 { font-family: var(--display); font-weight: 800; font-size: 1.7rem; line-height: 1.05; color: var(--sodium); margin: 1.75rem 0 0.5rem; }
.block h3:first-child { margin-top: 0; }

/* Lookup form */
.lookup label { display: block; color: var(--mist); font-size: 1rem; margin-bottom: 0.4rem; }
.lookup-row { display: flex; align-items: flex-end; gap: 1.5rem; }
.field { flex: 1; min-width: 0; display: flex; border-bottom: 1px solid var(--mist); transition: border-color 0.2s; }
.field:focus-within { border-color: var(--sodium); }
.field input {
    flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--bone);
    font: 500 1.25rem/1 var(--mono); padding: 0.75rem 0;
}
.field input::placeholder { color: var(--mist); opacity: 0.7; }
.btn {
    background: var(--sodium); color: var(--ink); border: 0; border-radius: 2px; cursor: pointer;
    font: 600 1.05rem/1 var(--serif); padding: 0.85rem 1.4rem; white-space: nowrap;
    transition: background-color 0.2s, transform 0.2s;
}
.btn:hover, .btn:focus-visible { background: var(--bone); transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.examples { margin-top: 1.25rem; color: var(--mist); display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.25rem; font-size: 1rem; }
.examples button {
    background: none; border: 0; cursor: pointer; color: var(--bone); font: 500 0.95rem var(--mono);
    padding: 0.25rem 0; background-image: linear-gradient(currentColor, currentColor); background-repeat: no-repeat;
    background-size: 100% 1px; background-position: 0 100%; transition: color 0.2s, background-size 0.35s;
}
.examples button:hover { color: var(--sodium); background-size: 100% 2px; }

/* Feedback and results */
.out { padding-top: 0; }
.out::before { display: none; }
.spinner {
    display: inline-block; width: 1rem; height: 1rem; border: 2px solid var(--sodium); border-top-color: transparent;
    border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: -0.15em; margin-right: 0.6rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
#feedback { color: var(--mist); padding-block: 0 2rem; overflow-wrap: anywhere; }

.verdict { border-top: 1px solid var(--line); border-left: 4px solid var(--mist); padding: 1.5rem 0 1.5rem 1.25rem; margin-bottom: 1.5rem; }
.verdict.good { border-left-color: var(--verdigris); }
.verdict.warn { border-left-color: var(--sodium); }
.verdict.bad { border-left-color: var(--fail); }
.verdict .title { font-family: var(--display); font-weight: 800; font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 0.95; }
.verdict.good .title { color: var(--verdigris); }
.verdict.warn .title { color: var(--sodium); }
.verdict.bad .title { color: var(--fail); }
.verdict .detail { margin-top: 0.75rem; max-width: 62ch; overflow-wrap: anywhere; }

.section-title { font-family: var(--display); font-weight: 800; font-size: 1.7rem; line-height: 1.05; color: var(--sodium); margin: 2rem 0 0.75rem; }
.record-list li {
    border-top: 1px solid var(--line); padding: 0.75rem 0; font: 0.9rem/1.7 var(--mono);
    display: flex; flex-wrap: wrap; gap: 0.1rem 1.5rem; overflow-wrap: anywhere;
}
.record-list li:last-child { border-bottom: 1px solid var(--line); }
.record-item .tag { font-weight: 700; color: var(--sodium); min-width: 3.5rem; }
.record-item .note { color: var(--sodium); }
.empty-note { color: var(--mist); font-style: italic; }

.raw-toggle {
    margin-top: 1.5rem; background: none; border: 0; cursor: pointer; color: var(--bone); font: inherit; font-size: 1rem;
    padding: 0.25rem 0; background-image: linear-gradient(currentColor, currentColor); background-repeat: no-repeat;
    background-size: 100% 1px; background-position: 0 100%; transition: color 0.2s;
}
.raw-toggle:hover { color: var(--sodium); }
.raw-json {
    margin-top: 1rem; border: 1px solid var(--line); background: var(--wash); border-radius: 2px;
    padding: 1rem 1.25rem; font: 0.8rem/1.7 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 20rem; overflow-y: auto;
}

/* Guide tabs */
.guide-tabs { display: flex; flex-wrap: wrap; gap: 0.25rem 1.75rem; border-bottom: 1px solid var(--line); margin-bottom: 1.75rem; }
.guide-tab {
    background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer;
    color: var(--mist); font: 500 1.1rem var(--serif); padding: 0.5rem 0; transition: color 0.2s, border-color 0.2s;
}
.guide-tab:hover { color: var(--bone); }
.guide-tab.active { color: var(--bone); border-bottom-color: var(--sodium); }
.guide-panel { display: none; max-width: 66ch; }
.guide-panel.active { display: block; }
.guide-panel p + p, .guide-panel p + h3 { margin-top: 1rem; }
.guide-panel code, .detail code { font-family: var(--mono); font-size: 0.82em; background: var(--slate); padding: 0.1em 0.4em; border-radius: 2px; }

footer { color: var(--mist); font-size: 1rem; }
.foot { padding-block: 0 3rem; }
.foot > div { border-top: 1px solid var(--line); padding-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; }

/* 404 */
.nf { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding-block: 4rem; position: relative; isolation: isolate; overflow: hidden; max-width: none; }
.nf::before {
    content: ''; position: absolute; z-index: -1; top: -12rem; right: -10rem; width: min(40rem, 140vw); aspect-ratio: 1; border-radius: 50%;
    background: radial-gradient(closest-side, var(--glow), var(--glow-soft) 55%, transparent);
}
.nf-code { font-size: clamp(9rem, 34vw, 24rem); color: var(--sodium); }
.nf h1 { font-size: clamp(2.8rem, 7vw, 5rem); margin-top: 0.5rem; }
.nf-lead { margin-top: 1rem; max-width: 40ch; color: var(--mist); font-size: 1.3rem; }
.nf-links { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; font-size: 1.25rem; }
.nf-log { margin-top: 3rem; max-width: 44rem; overflow-wrap: anywhere; border: 1px solid var(--line); background: var(--wash); padding: 1.25rem 1.5rem; font: 0.875rem/1.8 var(--mono); border-radius: 2px; }
.nf-log .err { color: var(--sodium); }
.nf-log .dim { color: var(--mist); }

@media (max-width: 36rem) {
    .lookup-row { flex-direction: column; align-items: stretch; gap: 1rem; }
    .field input { font-size: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; }
}

/* ---- Theme lamp: pull-cord switch (see theme.js). Lamp on = light theme. ---- */
.theme-lamp {
    position: absolute; /* scrolls away with the page; fixed on pages with a fixed bar, see below */
    top: 0;
    inset-inline-end: clamp(0.75rem, 3vw, 2rem);
    z-index: 1000;
    display: block;
    width: 2.75rem;
    height: 5.25rem;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
/* Pages with a fixed top bar or fixed top-right controls: the lamp stays visible and the bar
   reserves room for it (lamp offset + lamp width + gap), so it never covers a link. */
html:has(.bar-inner) .theme-lamp,
html:has(.controls) .theme-lamp { position: fixed; }
.bar-inner { padding-inline-end: calc(clamp(0.75rem, 3vw, 2rem) + 2.75rem + 0.75rem); }
.controls { right: calc(clamp(0.75rem, 3vw, 2rem) + 2.75rem + 0.75rem); }
.theme-lamp svg { display: block; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.lamp-wire { stroke: var(--mist); stroke-width: 1.2; }
.lamp-shade { fill: var(--slate); stroke: var(--bone); stroke-width: 1.4; stroke-linejoin: round; }
.lamp-bulb { fill: var(--line); transition: fill 0.4s; }
.lamp-halo { fill: var(--sodium); opacity: 0; transition: opacity 0.5s; }
.lamp-cone { fill: url(#lamp-cone); opacity: 0; transition: opacity 0.5s; }
.lamp-stop-a { stop-color: var(--sodium); stop-opacity: 0.38; }
.lamp-stop-b { stop-color: var(--sodium); stop-opacity: 0; }
.lamp-cord { stroke: var(--mist); stroke-width: 1; }
.lamp-bead { fill: var(--sodium); }
.theme-lamp[data-on="true"] .lamp-bulb { fill: #ffd27a; }
.theme-lamp[data-on="true"] .lamp-halo { opacity: 0.35; }
.theme-lamp[data-on="true"] .lamp-cone { opacity: 1; }
.lamp-swing { transform-box: view-box; transform-origin: 22px 0; animation: lamp-swing 0.9s ease-out; }
.lamp-pull { animation: lamp-pull 0.45s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes lamp-swing { 20% { transform: rotate(-5deg); } 45% { transform: rotate(3.5deg); } 70% { transform: rotate(-1.5deg); } }
@keyframes lamp-pull { 35% { transform: translateY(10px); } }

/* The theme switch is a plain cross-fade of the whole page. */
html.theme-vt::view-transition-old(root) { animation: 0.45s ease both lamp-fade-out; }
html.theme-vt::view-transition-new(root) { animation: 0.45s ease both lamp-fade-in; }
@keyframes lamp-fade-out { to { opacity: 0; } }
@keyframes lamp-fade-in { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    .lamp-swing, .lamp-pull { animation: none; }
    .lamp-bulb, .lamp-halo, .lamp-cone { transition: none; }
}
