/* Subnet calculator page. Extends styles.css rather than replacing it — the
   brand tokens, wrap, buttons and prose styles all come from there. */

.tool {
    padding-block: 3rem 4rem;
}

.tool h1 {
    margin: 0 0 0.6rem;
    font-size: clamp(2rem, 5vw, 2.8rem);
    letter-spacing: -0.02em;
}

.lede {
    margin: 0 0 2rem;
    max-width: 60ch;
    color: var(--kodura-text-dim, #8e9bb0);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* The tool itself sits above everything else on the page, because the search
   that brings people here is transactional — they want the answer, not prose. */
.calc {
    background: var(--bg-card, #0b1220);
    border: 1px solid var(--border-solid, #182234);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
}

.calc-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.95rem 1.1rem;
    font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
    font-size: 1.15rem;
    color: var(--text, #e8edf5);
    background: #02050b;
    border: 1px solid var(--border-solid, #182234);
    border-radius: var(--radius);
}

.calc-field input:focus {
    outline: none;
    border-color: var(--kodura-brand-bright, #3d92ff);
    box-shadow: 0 0 0 3px #3d92ff33;
}

.calc-note {
    margin: 0.75rem 0 0;
    min-height: 1.2em;
    font-family: var(--mono, monospace);
    font-size: 0.85rem;
    color: var(--text-dim, #8e9bb0);
}

.calc-error {
    margin: 0.75rem 0 0;
    font-size: 0.9rem;
    color: var(--pending, #f0a83c);
}

.result-grid {
    display: grid;
    gap: 0.1rem 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    margin-top: 1.2rem;
}

.result {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border-solid, #182234);
}

.result.wide {
    grid-column: 1 / -1;
}

.result dt {
    color: var(--text-dim, #8e9bb0);
    font-size: 0.9rem;
}

.result dd {
    margin: 0;
    text-align: right;
}

.copy {
    background: none;
    border: 0;
    padding: 0;
    color: var(--text, #e8edf5);
    font: inherit;
    font-size: 1rem;
    cursor: pointer;
    /* Long IPv6 addresses and 39-digit counts must wrap rather than push the
       card wider than the viewport. */
    overflow-wrap: anywhere;
    text-align: right;
}

.copy.mono {
    font-family: var(--mono, monospace);
}

.absent {
    color: var(--text-faint, #5b6779);
    font-size: 0.9rem;
}

.copy:hover {
    color: var(--kodura-brand-bright, #3d92ff);
}

.copy.copied {
    color: var(--ok, #2fd08a);
}

.binary {
    margin-top: 1.2rem;
}

.binary summary {
    cursor: pointer;
    color: var(--text-dim, #8e9bb0);
    font-size: 0.9rem;
}

.binary-rows {
    margin-top: 0.8rem;
    display: grid;
    gap: 0.4rem;
}

.binary-row {
    display: flex;
    gap: 1rem;
    align-items: baseline;
}

.binary-row span {
    width: 4.5rem;
    flex: none;
    color: var(--text-dim, #8e9bb0);
    font-size: 0.85rem;
}

.binary-row code {
    font-family: var(--mono, monospace);
    font-size: 0.8rem;
    color: var(--kodura-brand-cyan, #00b9fd);
    overflow-x: auto;
}

.examples {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin: 1rem 0 0;
    font-size: 0.85rem;
    color: var(--text-dim, #8e9bb0);
}

.examples button {
    background: var(--bg-card);
    border: 1px solid var(--border-solid, #182234);
    border-radius: var(--radius);
    padding: 0.35rem 0.8rem;
    color: var(--text, #e8edf5);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

.examples button:hover {
    border-color: var(--kodura-brand-bright, #3d92ff);
    color: var(--kodura-brand-bright, #3d92ff);
}

.tool-prose {
    /* .prose already supplies up to 4rem of padding-block; adding a margin on
       top of it left a dead band between the tool and the text. */
    padding-block-start: 1.5rem;
    max-width: 68ch;
}

.app-pitch {
    margin-top: 3rem;
    padding: 1.6rem;
    border: 1px solid var(--border-solid, #182234);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    max-width: 68ch;
}

.app-pitch h2 {
    margin-top: 0;
}
