/* ── Pixelbuilders brand tokens ───────────────────────────────────────────── */
:root {
    --pb-blue:         #000EFF;
    --pb-blue-hover:   #0009eb;
    --pb-navy:         #000734;
    --pb-white:        #ffffff;
    --pb-page-bg:      #F6F7FB;
    --pb-text:         #0d0d12;
    --pb-text-muted:   #383848;
    --pb-text-subtle:  #60607a;
    --pb-border:       rgba(0, 7, 52, 0.14);
    --pb-border-input: rgba(0, 7, 52, 0.18);
    --pb-bg-subtle:    #eef0f7;
    --font-display:    'Neue Haas Grotesk Display', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-mono:       ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace;
    --radius-sm:       4px;
    --radius:          6px;
    --max-w:           960px;
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-display);
    background: var(--pb-page-bg);
    color: var(--pb-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.site-header {
    background: var(--pb-navy);
    flex-shrink: 0;
}

.header-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pb-wordmark {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    line-height: 1;
    transition: opacity 0.1s;
}

.pb-wordmark:hover {
    opacity: 0.8;
}

.pb-wordmark:focus-visible {
    outline: 2px solid var(--pb-blue);
    outline-offset: 3px;
    border-radius: 2px;
}

.pb-wordmark img {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: block;
}

.pb-wordmark > svg {
    display: block;
    flex-shrink: 0;
}

.product-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.42);
}

.product-label svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    stroke: rgba(255, 255, 255, 0.42);
}

/* ── Main ─────────────────────────────────────────────────────────────────── */
.site-main {
    flex: 1;
    background: var(--pb-page-bg);
    padding: 48px 24px;
}

.container {
    max-width: var(--max-w);
    margin: 0 auto;
}

/* ── Panel ────────────────────────────────────────────────────────────────── */
.panel {
    background: var(--pb-white);
    border: 1px solid rgba(0, 7, 52, 0.12);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0, 7, 52, 0.05), 0 2px 10px rgba(0, 7, 52, 0.04);
    padding: 40px;
}

/* ── Panel heading ────────────────────────────────────────────────────────── */
.panel-heading {
    margin-bottom: 32px;
}

.panel-heading h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--pb-text);
    line-height: 1.15;
    margin-bottom: 8px;
}

.panel-heading p {
    font-size: 15px;
    color: var(--pb-text-muted);
    line-height: 1.5;
}

/* ── Policy callout ───────────────────────────────────────────────────────── */
.policy-callout {
    padding: 12px 16px;
    border-left: 3px solid var(--pb-blue);
    background: var(--pb-bg-subtle);
    font-size: 14px;
    line-height: 1.5;
    color: var(--pb-text);
    margin-bottom: 24px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ── Form elements ────────────────────────────────────────────────────────── */
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--pb-text-muted);
    margin-bottom: 8px;
}

.form-textarea {
    display: block;
    width: 100%;
    min-height: 220px;
    padding: 12px 14px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.65;
    color: var(--pb-text);
    background: var(--pb-white);
    border: 1px solid var(--pb-border-input);
    border-radius: var(--radius-sm);
    resize: vertical;
    outline: none;
    transition: border-color 0.12s, box-shadow 0.12s;
}

.form-textarea:focus {
    border-color: var(--pb-blue);
    box-shadow: 0 0 0 3px rgba(0, 14, 255, 0.12);
}

.form-textarea::placeholder {
    color: var(--pb-text-subtle);
    font-family: var(--font-display);
}

.textarea-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    margin-bottom: 24px;
}

.textarea-hint {
    font-size: 12px;
    color: var(--pb-text-subtle);
}

.char-count {
    font-size: 12px;
    color: var(--pb-text-subtle);
    font-variant-numeric: tabular-nums;
}

.char-count.near-limit { color: #a05a00; }
.char-count.at-limit   { color: #cc0000; font-weight: 500; }

/* ── Primary button ───────────────────────────────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 340px;
    max-width: 100%;
    padding: 14px 24px;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    color: var(--pb-white);
    background: var(--pb-blue);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    outline: none;
    white-space: nowrap;
    transition: background-color 0.12s;
}

.btn-primary:hover {
    background: var(--pb-blue-hover);
}

.btn-primary:focus-visible {
    outline: 2px solid var(--pb-blue);
    outline-offset: 2px;
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-subtext {
    margin-top: 8px;
    font-size: 12px;
    color: var(--pb-text-subtle);
}

/* ── Result panel ─────────────────────────────────────────────────────────── */
.result-panel {
    margin-top: 24px;
    padding: 20px 24px;
    border: 1px solid rgba(0, 14, 255, 0.2);
    border-radius: var(--radius-sm);
    background: rgba(0, 14, 255, 0.025);
}

.result-panel--muted {
    border-color: var(--pb-border);
    background: var(--pb-bg-subtle);
}

.result-panel-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.result-panel-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--pb-text);
}

.result-pill {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--pb-blue);
    border: 1px solid var(--pb-blue);
    border-radius: 2px;
    padding: 2px 7px;
    line-height: 1.6;
}

.result-pill--muted {
    color: var(--pb-text-subtle);
    border-color: var(--pb-border);
}

.panel-subtext {
    font-size: 13px;
    color: var(--pb-text-muted);
    line-height: 1.55;
}

/* ── Result URL row ───────────────────────────────────────────────────────── */
.result-url-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.result-url-field {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--pb-text);
    background: var(--pb-white);
    border: 1px solid var(--pb-border);
    border-radius: var(--radius-sm);
    outline: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-url-field:focus {
    border-color: var(--pb-blue);
    box-shadow: 0 0 0 3px rgba(0, 14, 255, 0.12);
}

.btn-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 14px;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 500;
    color: var(--pb-blue);
    background: var(--pb-white);
    border: 1px solid rgba(0, 14, 255, 0.3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    outline: none;
    transition: background-color 0.12s, border-color 0.12s;
}

.btn-copy:hover {
    background: rgba(0, 14, 255, 0.04);
    border-color: var(--pb-blue);
}

.btn-copy:focus-visible {
    outline: 2px solid var(--pb-blue);
    outline-offset: 2px;
}

.btn-copy svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.result-actions {
    margin-top: 12px;
}

.btn-text {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 13px;
    color: var(--pb-text-muted);
    text-decoration: underline;
    text-underline-offset: 2px;
    padding: 0;
    outline: none;
}

.btn-text:hover {
    color: var(--pb-text);
}

.btn-text:focus-visible {
    outline: 2px solid var(--pb-blue);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ── Error notice ─────────────────────────────────────────────────────────── */
.error-notice {
    margin-top: 16px;
    padding: 12px 16px;
    border-left: 3px solid #c00;
    background: #fff5f5;
    font-size: 14px;
    line-height: 1.5;
    color: #7a0000;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ── Secret display (view page — revealed state) ──────────────────────────── */
.secret-display {
    margin-top: 24px;
}

.secret-label {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--pb-text-muted);
    margin-bottom: 8px;
}

.secret-content {
    padding: 14px 16px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.7;
    color: var(--pb-text);
    background: var(--pb-bg-subtle);
    border: 1px solid var(--pb-border);
    border-radius: var(--radius-sm);
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: auto;
    user-select: all;
    min-height: 80px;
}

.secret-actions {
    margin-top: 10px;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
    background: transparent;
    flex-shrink: 0;
}

.footer-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 16px 24px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.footer-inner span {
    font-size: 12px;
    color: var(--pb-text-subtle);
    line-height: 1.4;
}

/* ── Utilities ────────────────────────────────────────────────────────────── */
[hidden] { display: none !important; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .site-main {
        padding: 24px 16px;
    }

    .header-inner,
    .footer-inner {
        padding-left: 16px;
        padding-right: 16px;
    }

    .panel {
        padding: 24px;
        border-radius: var(--radius-sm);
    }

    .panel-heading h1 {
        font-size: 24px;
    }

    .btn-primary {
        width: 100%;
    }

    .result-url-row {
        flex-direction: column;
    }

    .btn-copy {
        width: 100%;
        justify-content: center;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .product-label {
        display: none;
    }
}

/* ── Reduced motion ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
