:root {
    --bg: #020403;
    --surface: rgba(5, 18, 8, 0.88);
    --surface-strong: rgba(3, 12, 5, 0.96);
    --text: #d9ffe1;
    --muted: #73c18a;
    --line: rgba(87, 255, 134, 0.16);
    --accent: #4dff88;
    --accent-strong: #16c451;
    --danger: #ff5c7a;
    --shadow: 0 0 32px rgba(34, 255, 102, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Consolas, "Lucida Console", monospace;
    background:
        linear-gradient(rgba(77, 255, 136, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(77, 255, 136, 0.03) 1px, transparent 1px),
        radial-gradient(circle at top left, rgba(77, 255, 136, 0.1), transparent 24%),
        radial-gradient(circle at bottom right, rgba(22, 196, 81, 0.08), transparent 22%),
        var(--bg);
    background-size: 100% 4px, 4px 100%, auto, auto, auto;
    color: var(--text);
    min-height: 100vh;
    text-shadow: 0 0 8px rgba(77, 255, 136, 0.18);
    overflow-x: hidden;
}

body.secure-read-mode {
    -webkit-user-select: none;
    user-select: none;
}

body.secure-read-mode .note-body {
    -webkit-user-select: text;
    user-select: text;
    cursor: text;
}

body.secure-read-mode .note-body.screenshot-blocked {
    filter: blur(14px);
}

.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at center, rgba(77, 255, 136, 0.14), transparent 34%),
        linear-gradient(rgba(2, 4, 3, 0.72), rgba(2, 4, 3, 0.78));
    backdrop-filter: blur(2px);
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

.splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.splash-logo {
    width: min(340px, 62vw);
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 28px rgba(77, 255, 136, 0.2));
    animation: splashPulse 1.8s ease-in-out infinite;
}

.preloaded {
    opacity: 0;
}

.page-shell {
    transition: opacity 0.45s ease;
}

.page-shell.ready {
    opacity: 1;
}

.matrix-rain {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.42;
    pointer-events: none;
}

@keyframes splashPulse {
    0%,
    100% {
        transform: scale(0.98);
        opacity: 0.92;
    }
    50% {
        transform: scale(1.02);
        opacity: 1;
    }
}

.runtime-warning {
    width: min(1180px, calc(100% - 32px));
    margin: 20px auto 0;
    padding: 14px 16px;
    border: 1px solid rgba(255, 92, 122, 0.35);
    border-radius: 18px;
    background: rgba(40, 8, 12, 0.82);
    color: #ffd7df;
    box-shadow: 0 0 24px rgba(255, 92, 122, 0.14);
}

.capture-warning {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
    width: min(540px, calc(100% - 24px));
    padding: 14px 16px;
    border: 1px solid rgba(255, 92, 122, 0.35);
    border-radius: 18px;
    background: rgba(40, 8, 12, 0.94);
    color: #ffd7df;
    box-shadow: 0 0 24px rgba(255, 92, 122, 0.14);
    text-align: center;
}

.integrity-banner {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 7;
    width: min(760px, calc(100% - 24px));
    padding: 14px 16px;
    border: 1px solid rgba(255, 92, 122, 0.62);
    border-radius: 18px;
    background: rgba(40, 8, 12, 0.96);
    color: #ffd7df;
    box-shadow: 0 0 28px rgba(255, 92, 122, 0.2);
    text-align: center;
}

.integrity-banner:hover {
    color: #fff;
    border-color: var(--danger);
}

button,
input,
textarea,
select {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

code {
    font-family: Consolas, monospace;
}

.page-shell {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 48px;
}

.topbar,
.hero,
.content-grid,
.link-mode {
    display: grid;
    gap: 24px;
}

.link-mode {
    min-height: calc(100vh - 120px);
    place-items: center;
}

.link-card {
    width: min(720px, 100%);
    padding: 30px;
    border-radius: 30px;
    border: 1px solid var(--line);
    background: rgba(2, 14, 5, 0.9);
    box-shadow: 0 0 40px rgba(77, 255, 136, 0.16);
    backdrop-filter: blur(14px);
}

.compact {
    max-width: 52ch;
    margin-bottom: 0;
}

.topbar {
    grid-template-columns: 1fr auto;
    align-items: center;
    margin-bottom: 42px;
}

.brand {
    font-family: Consolas, "Lucida Console", monospace;
    font-size: 1.8rem;
    letter-spacing: 0.04em;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 12px;
    opacity: 0.82;
    filter: drop-shadow(0 0 12px rgba(77, 255, 136, 0.14));
}

.nav {
    display: flex;
    gap: 18px;
    color: var(--muted);
}

.hero {
    grid-template-columns: 1fr 1.08fr;
    align-items: start;
    margin-bottom: 28px;
}

.hero-copy {
    padding: 30px 8px;
}

.hero-intro {
    display: grid;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.76rem;
    font-weight: 700;
}

h1,
h2,
h3,
summary {
    margin: 0;
}

h1 {
    font-family: Consolas, "Lucida Console", monospace;
    font-size: clamp(2.6rem, 7vw, 5rem);
    line-height: 0.98;
    max-width: 11ch;
    text-transform: uppercase;
}

.lede {
    max-width: 58ch;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.7;
    margin: 18px 0 24px;
}

.hero-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pill-button {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 10px 14px;
    background: var(--surface);
    box-shadow: inset 0 0 16px rgba(77, 255, 136, 0.06);
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.pill-button small {
    color: var(--accent);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.pill-button:hover,
.pill-button:focus-visible {
    border-color: rgba(87, 255, 134, 0.45);
    background: rgba(8, 28, 12, 0.96);
    box-shadow:
        inset 0 0 18px rgba(77, 255, 136, 0.08),
        0 0 22px rgba(77, 255, 136, 0.18);
    transform: translateY(-1px);
}

.pill-button:focus-visible {
    outline: 2px solid rgba(87, 255, 134, 0.5);
    outline-offset: 2px;
}

.card,
.panel {
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

.card::before,
.panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(77, 255, 136, 0.06), transparent 18%, transparent 82%, rgba(77, 255, 136, 0.04));
    pointer-events: none;
}

.create-card,
.panel {
    border-radius: 28px;
    padding: 22px;
}

.card-head,
.upload-head,
.link-row,
.success-actions,
.attachment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.note-form,
.advanced-grid,
.manual-form,
.password-gate,
.note-view,
.attachment-list,
.confirm-actions {
    display: grid;
    gap: 16px;
}

.note-form label,
.advanced-grid label,
.manual-form label,
.password-gate label {
    display: grid;
    gap: 8px;
}

textarea,
input[type="password"],
input[type="text"],
input[readonly],
select,
input[type="file"] {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--surface-strong);
    color: var(--text);
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: inset 0 0 20px rgba(77, 255, 136, 0.05);
}

.native-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.file-picker-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

#pickFiles {
    border: 0;
    border-radius: 18px;
    cursor: pointer;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #021107;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    box-shadow: 0 0 24px rgba(77, 255, 136, 0.24);
}

textarea {
    resize: vertical;
    min-height: 170px;
}

.upload-block {
    display: grid;
    gap: 10px;
    border: 1px dashed var(--line);
    border-radius: 20px;
    padding: 16px;
}

.advanced {
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 0;
    overflow: hidden;
}

.advanced summary {
    cursor: pointer;
    font-weight: 700;
    list-style: none;
    border: 0;
    border-radius: 18px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #021107;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    box-shadow: 0 0 24px rgba(77, 255, 136, 0.24);
}

.advanced summary::-webkit-details-marker {
    display: none;
}

.advanced[open] summary {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.advanced-grid {
    margin-top: 0;
    padding: 14px 16px 16px;
}

.checkbox {
    grid-template-columns: auto 1fr;
    align-items: center;
}

.checkbox input {
    width: 18px;
    height: 18px;
}

.primary {
    border: 0;
    border-radius: 18px;
    cursor: pointer;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #021107;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    box-shadow: 0 0 24px rgba(77, 255, 136, 0.24);
}

a.primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

#copyLink {
    border: 0;
    border-radius: 18px;
    cursor: pointer;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #021107;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    box-shadow: 0 0 24px rgba(77, 255, 136, 0.24);
    min-width: 180px;
    flex-shrink: 0;
}

#openLink,
#newNote {
    border: 0;
    border-radius: 18px;
    cursor: pointer;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #021107;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    box-shadow: 0 0 24px rgba(77, 255, 136, 0.24);
}

.secondary {
    width: fit-content;
}

.success {
    margin-top: 22px;
    border-top: 1px solid var(--line);
    padding-top: 22px;
}

.muted {
    color: var(--muted);
}

.view-status.error {
    color: var(--danger);
}

.note-body,
.attachment-item {
    padding: 16px;
    border-radius: 18px;
    background: var(--surface-strong);
    border: 1px solid var(--line);
}

.note-body {
    white-space: pre-wrap;
    line-height: 1.7;
    min-height: 140px;
    font-size: 1.05rem;
    transition: filter 0.18s ease;
}

.attachment-item a {
    color: var(--accent);
}

.attachment-list.hidden {
    display: none;
}

.attachment-section-title {
    margin: 0 0 4px;
    color: var(--accent);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.attachment-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

.attachment-meta {
    width: 100%;
    color: var(--text);
    line-height: 1.5;
    word-break: break-word;
}

.attachment-actions button,
#openAttachment,
#saveAttachment,
.attachment-dialog button {
    border: 1px solid var(--line);
    border-radius: 14px;
    cursor: pointer;
    padding: 10px 14px;
    background: var(--surface-strong);
    color: var(--text);
}

.attachment-actions .view-button,
.attachment-actions .save-button {
    width: 100%;
    border: 0;
    border-radius: 14px;
    padding: 10px 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #021107;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    box-shadow: 0 0 18px rgba(77, 255, 136, 0.22);
}

#copyLink:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

#createFromRead {
    width: fit-content;
}

.attachment-dialog {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(3, 12, 5, 0.96);
    color: var(--text);
    box-shadow: 0 0 40px rgba(77, 255, 136, 0.16);
    width: min(420px, calc(100% - 24px));
}

.attachment-dialog::backdrop {
    background: rgba(0, 0, 0, 0.65);
}

.attachment-dialog-card {
    display: grid;
    gap: 16px;
    padding: 24px;
}

.info-dialog {
    width: min(640px, calc(100% - 24px));
}

.info-dialog-card {
    gap: 18px;
}

.info-copy {
    display: grid;
    gap: 12px;
    color: var(--muted);
    line-height: 1.7;
}

.logo-dialog {
    width: min(760px, calc(100% - 24px));
}

.logo-dialog-card {
    justify-items: center;
    text-align: center;
}

.logo-dialog-image {
    width: min(360px, 100%);
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 24px rgba(77, 255, 136, 0.18));
}

.site-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-top: 28px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow);
    position: relative;
    z-index: 1;
}

.footer-nav {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-nav a,
.legal-line a {
    color: var(--accent);
}

.legal-main {
    margin-top: 12px;
}

.legal-panel {
    max-width: 860px;
}

.legal-line {
    color: var(--muted);
    line-height: 1.7;
}

.secure-panel {
    max-width: 1100px;
}

.secure-status {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
}

.secure-download {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin: 22px 0 4px;
}

.secure-download p {
    margin: 0;
    max-width: 58ch;
}

.secure-download-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.secure-status h2 {
    margin: 0 0 4px;
}

.secure-indicator {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    flex: 0 0 auto;
    box-shadow: 0 0 18px currentColor;
}

.secure-indicator.pending {
    color: #ffd166;
    background: #ffd166;
}

.secure-indicator.ok {
    color: var(--accent);
    background: var(--accent);
}

.secure-indicator.bad {
    color: #ff5d5d;
    background: #ff5d5d;
}

.secure-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 18px;
}

.secure-dns {
    display: grid;
    gap: 14px;
    margin: 0 0 24px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.025);
}

.secure-dns h2 {
    margin: 0;
}

.secure-dns dl {
    display: grid;
    gap: 10px;
    margin: 0;
}

.secure-dns dl div {
    display: grid;
    grid-template-columns: minmax(150px, 0.35fr) 1fr;
    gap: 12px;
}

.secure-dns dt {
    color: var(--muted);
}

.secure-dns dd {
    margin: 0;
    min-width: 0;
}

.secure-dns code {
    font-family: var(--mono);
    color: var(--accent);
    overflow-wrap: anywhere;
}

.secure-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

.secure-table th,
.secure-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.secure-table th {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.secure-table tr:last-child td {
    border-bottom: 0;
}

.secure-table code {
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--accent);
    white-space: nowrap;
}

.secure-ok-row td:nth-child(2) {
    color: var(--accent);
}

.secure-bad-row td:nth-child(2),
.secure-bad-row code {
    color: #ff5d5d;
}

.legal-title-break {
    display: inline-block;
}

.content-grid {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 24px;
}

.link-row input[readonly] {
    min-width: 0;
    flex: 1 1 auto;
}

.hidden {
    display: none;
}

@media print {
    body * {
        visibility: hidden !important;
    }
}

@media (max-width: 900px) {
    .hero,
    .content-grid,
    .topbar {
        grid-template-columns: 1fr;
    }

    .nav,
    .card-head,
    .upload-head,
    .link-row,
    .success-actions,
    .attachment-item {
        flex-direction: column;
        align-items: stretch;
    }

    .page-shell {
        width: min(100% - 20px, 1180px);
        padding: 18px 0 36px;
    }

    h1 {
        max-width: none;
    }

    .secondary {
        width: 100%;
    }

    .link-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .link-row input[readonly] {
        min-width: 0;
        word-break: break-all;
    }

    #copyLink,
    #openLink,
    #newNote {
        width: 100%;
    }

    .hero-copy {
        padding: 12px 2px 0;
    }

    .link-card,
    .create-card,
    .panel {
        padding: 18px;
        border-radius: 22px;
    }

    .topbar {
        margin-bottom: 24px;
        gap: 14px;
    }

    .nav {
        gap: 10px;
        flex-wrap: wrap;
        font-size: 0.95rem;
    }

    .hero {
        margin-bottom: 14px;
    }

    .runtime-warning {
        width: min(100% - 20px, 1180px);
        margin-top: 14px;
        padding: 12px 14px;
    }

    .attachment-dialog {
        width: min(100% - 16px, 420px);
        margin: 0 auto;
    }

    .attachment-dialog-card {
        padding: 18px;
    }

    .site-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    body {
        text-shadow: 0 0 6px rgba(77, 255, 136, 0.16);
    }

    .page-shell {
        width: min(100% - 14px, 1180px);
        padding: 12px 0 28px;
    }

    .topbar {
        margin-bottom: 18px;
    }

    .brand {
        font-size: 1.35rem;
        gap: 8px;
    }

    .brand-logo {
        width: 30px;
        height: 30px;
        border-radius: 9px;
        opacity: 0.72;
    }

    .splash-logo {
        width: min(260px, 72vw);
    }

    .matrix-rain {
        opacity: 0.62;
    }

    .nav {
        font-size: 0.88rem;
        justify-content: space-between;
    }

    h1 {
        font-size: clamp(2rem, 13vw, 3rem);
        line-height: 1.02;
    }

    h2 {
        font-size: 1.2rem;
    }

    h3 {
        font-size: 1rem;
    }

    .lede,
    .compact {
        font-size: 0.96rem;
        line-height: 1.55;
    }

    .eyebrow {
        font-size: 0.68rem;
        letter-spacing: 0.1em;
        margin-bottom: 10px;
    }

    .hero-pills {
        gap: 8px;
    }

    .hero-copy {
        display: contents;
    }

    .hero-intro {
        order: 1;
        padding: 12px 2px 0;
    }

    .create-card {
        order: 2;
    }

    .hero-pills {
        order: 3;
    }

    .hero-pills span {
        width: 100%;
        text-align: center;
        padding: 9px 12px;
    }

    .pill-button {
        width: 100%;
        text-align: center;
        padding: 9px 12px;
        justify-content: space-between;
    }

    .link-card,
    .create-card,
    .panel {
        padding: 16px;
        border-radius: 18px;
    }

    .upload-block,
    .advanced {
        padding: 14px;
        border-radius: 16px;
    }

    .note-form,
    .advanced-grid,
    .manual-form,
    .password-gate,
    .note-view,
    .attachment-list,
    .confirm-actions {
        gap: 12px;
    }

    textarea,
    input[type="password"],
    input[type="text"],
    input[readonly],
    select {
        padding: 12px 14px;
        border-radius: 14px;
        font-size: 16px;
    }

    textarea {
        min-height: 150px;
    }

    .file-picker-row,
    .upload-head {
        align-items: stretch;
    }

    #pickFiles,
    .primary,
    #openLink,
    #newNote,
    .attachment-actions button,
    #openAttachment,
    #saveAttachment,
    .attachment-dialog button {
        width: 100%;
        padding: 12px 14px;
    }

    .success {
        margin-top: 18px;
        padding-top: 18px;
    }

    .success-actions,
    .attachment-item {
        gap: 10px;
    }

    .attachment-actions {
        grid-template-columns: 1fr;
    }

    .attachment-item {
        padding: 14px;
        align-items: stretch;
    }

    .attachment-meta {
        width: 100%;
        word-break: break-word;
    }

    .note-body {
        min-height: 120px;
        padding: 14px;
        font-size: 0.98rem;
        line-height: 1.6;
    }

    .link-mode {
        min-height: auto;
    }

    #createFromRead,
    #submitButton {
        width: 100%;
    }

    .attachment-dialog {
        border-radius: 18px;
    }

    .attachment-dialog-card {
        gap: 12px;
        padding: 16px;
    }

    .site-footer {
        padding: 16px;
        border-radius: 18px;
    }

    .footer-nav {
        gap: 12px;
    }

    .legal-title-break {
        display: grid;
        gap: 2px;
    }

    .legal-title-break span {
        display: block;
    }

    .legal-panel .lede,
    .legal-line {
        font-size: 0.95rem;
        line-height: 1.6;
    }
}
