:root {
    color-scheme: light;
    --bg: #eef1f4;
    --paper: #fffdf7;
    --paper-deep: #f4ead8;
    --ink: #171b24;
    --muted: #59606b;
    --line: #b99a58;
    --accent: #8f1d2c;
    --accent-strong: #651320;
    --blue: #182c4f;
    --gold: #c49a3b;
    --danger: #9f2525;
    --shadow: 0 22px 70px rgba(23, 27, 36, 0.20);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        linear-gradient(90deg, rgba(24, 44, 79, 0.12) 1px, transparent 1px),
        linear-gradient(0deg, rgba(143, 29, 44, 0.08) 1px, transparent 1px),
        repeating-linear-gradient(135deg, rgba(196, 154, 59, 0.12) 0 2px, transparent 2px 18px),
        var(--bg);
    background-size: 34px 34px, 34px 34px, auto, auto;
    color: var(--ink);
    font-family: Georgia, "Times New Roman", serif;
}

.shell {
    width: min(920px, calc(100% - 32px));
    margin: 0 auto;
    padding: 56px 0;
}

.panel {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(244, 234, 216, 0.38)),
        var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: clamp(24px, 5vw, 48px);
}

.panel::before {
    content: "";
    position: absolute;
    inset: 12px;
    border: 3px double var(--gold);
    border-radius: 6px;
    pointer-events: none;
}

.panel::after {
    content: "I";
    position: absolute;
    top: 24px;
    right: 28px;
    display: grid;
    width: 56px;
    height: 56px;
    place-items: center;
    border: 3px double var(--gold);
    border-radius: 50%;
    background: var(--accent);
    color: var(--paper);
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 4px 0 rgba(24, 44, 79, 0.18);
}

.masthead {
    position: relative;
    margin-bottom: 28px;
    padding-bottom: 22px;
    padding-right: 80px;
}

.masthead::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 8px;
    border-top: 2px solid var(--gold);
    border-bottom: 2px solid var(--accent);
    background: repeating-linear-gradient(
        90deg,
        var(--blue) 0 18px,
        transparent 18px 28px,
        var(--gold) 28px 34px,
        transparent 34px 44px
    );
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent-strong);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: 3.25rem;
    line-height: 1;
    letter-spacing: 0;
    color: var(--blue);
    text-shadow: 0 1px 0 #fff;
}

.lede {
    max-width: 680px;
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.6;
}

.note-form,
.result,
.revealed {
    display: grid;
    gap: 18px;
}

.field {
    display: grid;
    gap: 8px;
    color: var(--ink);
    font-weight: 650;
}

.field-inline {
    max-width: 260px;
}

textarea,
input,
select {
    width: 100%;
    border: 1px solid rgba(185, 154, 88, 0.72);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(244, 234, 216, 0.24)),
        #fffefb;
    color: var(--ink);
    font: inherit;
    font-weight: 500;
    line-height: 1.5;
    outline: none;
}

textarea {
    min-height: 260px;
    padding: 16px;
    resize: vertical;
}

input,
select {
    min-height: 46px;
    padding: 10px 12px;
}

textarea:focus,
input:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(143, 29, 44, 0.14);
}

button {
    border: 1px solid rgba(196, 154, 59, 0.92);
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    min-height: 46px;
    padding: 0 18px;
    letter-spacing: 0;
}

.primary {
    width: fit-content;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent),
        var(--accent);
    color: #fff;
    box-shadow: 0 4px 0 var(--accent-strong);
}

.primary:hover {
    background: var(--accent-strong);
}

.secondary {
    background:
        linear-gradient(180deg, #fffdf7, var(--paper-deep));
    color: var(--ink);
}

.copy-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.result {
    margin-top: 24px;
    border-top: 3px double var(--line);
    padding-top: 24px;
}

.action-box {
    display: flex;
    align-items: center;
    min-height: 88px;
}

.muted,
.status {
    color: var(--muted);
    line-height: 1.5;
}

.status {
    min-height: 24px;
    margin: 18px 0 0;
}

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

@media (max-width: 640px) {
    .shell {
        width: min(100% - 20px, 920px);
        padding: 20px 0;
    }

    .panel {
        padding: 22px;
    }

    .panel::before {
        inset: 8px;
    }

    .panel::after {
        top: 18px;
        right: 18px;
        width: 44px;
        height: 44px;
        font-size: 1.35rem;
    }

    .masthead {
        padding-right: 56px;
    }

    h1 {
        font-size: 2.2rem;
    }

    .copy-row {
        grid-template-columns: 1fr;
    }

    .primary {
        width: 100%;
    }
}
