:root {
    color-scheme: light;
    --ink: #132822;
    --ink-muted: #52635d;
    --paper: #f3f0e5;
    --paper-deep: #e4ddca;
    --signal: #c7f464;
    --signal-dark: #6e8f22;
    --rust: #b84c32;
    --line: rgba(19, 40, 34, 0.2);
    --shadow: 0 26px 80px rgba(19, 40, 34, 0.14);
    font-family: "Avenir Next", "Gill Sans", "Trebuchet MS", sans-serif;
}

* { box-sizing: border-box; }

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        linear-gradient(90deg, transparent 49.7%, rgba(19, 40, 34, 0.045) 50%, transparent 50.3%),
        radial-gradient(circle at 82% 12%, rgba(199, 244, 100, 0.32), transparent 24rem),
        var(--paper);
}

body::before {
    position: fixed;
    inset: 0;
    pointer-events: none;
    content: "";
    opacity: 0.22;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.14'/%3E%3C/svg%3E");
}

a { color: inherit; }
button, input { font: inherit; }

.shell {
    position: relative;
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    min-height: 100vh;
}

.rail {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: column;
    padding: 2rem 1rem;
    color: var(--paper);
    background: var(--ink);
}

.rail__wordmark {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    letter-spacing: 0.24em;
    font-size: 0.76rem;
    font-weight: 800;
}

.rail__mark {
    display: grid;
    width: 2.6rem;
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid rgba(243, 240, 229, 0.55);
    border-radius: 50%;
    color: var(--signal);
    font-family: "Baskerville", "Iowan Old Style", serif;
    font-size: 1.35rem;
}

.stage {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-width: 0;
    padding: 2rem clamp(1.4rem, 5vw, 5rem) 1.5rem;
}

.topbar, .footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.topbar { padding-bottom: 2rem; }
.footer { padding-top: 2rem; color: var(--ink-muted); font-size: 0.78rem; }

.topbar nav { display: flex; gap: 1.25rem; }
.topbar a { text-underline-offset: 0.3rem; }
.eyebrow { margin: 0; letter-spacing: 0.18em; text-transform: uppercase; font-size: 0.68rem; font-weight: 800; }

.content {
    display: grid;
    grid-template-columns: minmax(16rem, 0.88fr) minmax(20rem, 1.12fr);
    align-items: center;
    gap: clamp(2rem, 7vw, 7rem);
    width: min(72rem, 100%);
    margin: auto;
}

.content--single { grid-template-columns: 1fr; width: min(66rem, 100%); align-items: start; }

.intro { max-width: 31rem; }
.kicker { display: inline-flex; gap: 0.55rem; align-items: center; margin-bottom: 1.4rem; color: var(--signal-dark); font-weight: 800; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; }
.kicker::before { width: 1.7rem; height: 2px; content: ""; background: currentColor; }

h1, h2 {
    margin: 0;
    font-family: "Baskerville", "Iowan Old Style", "Palatino Linotype", serif;
    font-weight: 500;
    line-height: 0.94;
    letter-spacing: -0.045em;
}

h1 { font-size: clamp(3.4rem, 8vw, 7.4rem); }
h2 { font-size: clamp(2.4rem, 5vw, 4.6rem); }
.intro h1 { word-break: keep-all; }
.intro p { max-width: 28rem; margin: 1.6rem 0 0; color: var(--ink-muted); line-height: 1.75; }

.seal {
    position: relative;
    width: min(19rem, 70vw);
    aspect-ratio: 1;
    margin: 2.7rem 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 50%;
}

.seal::before, .seal::after { position: absolute; inset: 12%; border: 1px solid var(--line); border-radius: inherit; content: ""; }
.seal::after { inset: 31%; border-color: var(--ink); background: var(--signal); box-shadow: inset 0 0 0 1rem var(--paper); }
.seal span { position: absolute; z-index: 1; inset: 0; display: grid; place-items: center; font-family: "Baskerville", serif; font-size: 2.8rem; }

.panel {
    position: relative;
    padding: clamp(1.6rem, 4vw, 3.5rem);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.panel::before { position: absolute; top: -1px; left: -1px; width: 4.5rem; height: 0.35rem; content: ""; background: var(--signal); }
.panel__heading { margin-bottom: 2rem; }
.panel__heading p { margin: 0.75rem 0 0; color: var(--ink-muted); line-height: 1.6; }

.form { display: grid; gap: 1.2rem; }
.field { display: grid; gap: 0.45rem; }
.field label { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; }
.field input {
    width: 100%;
    padding: 0.95rem 0.2rem 0.75rem;
    border: 0;
    border-bottom: 1px solid var(--ink);
    border-radius: 0;
    outline: none;
    color: var(--ink);
    background: transparent;
}
.field input:focus { border-bottom-width: 3px; border-color: var(--signal-dark); }
.field small { color: var(--ink-muted); line-height: 1.5; }

.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; margin-top: 0.65rem; }
.button {
    min-height: 3rem;
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--ink);
    color: var(--paper);
    background: var(--ink);
    cursor: pointer;
    font-size: 0.77rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.button:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--signal); }
.button:disabled { cursor: wait; opacity: 0.55; transform: none; box-shadow: none; }
.button--quiet { color: var(--ink); background: transparent; }
.button--danger { border-color: var(--rust); color: var(--rust); background: transparent; }

.message { min-height: 1.5rem; margin: 0.9rem 0 0; color: var(--ink-muted); line-height: 1.5; }
.message[data-kind="success"] { color: #42630d; }
.message[data-kind="error"] { color: var(--rust); }

.dashboard-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.dashboard-head p { margin: 0.75rem 0 0; color: var(--ink-muted); }
.list { display: grid; border-top: 1px solid var(--ink); }
.application {
    display: grid;
    grid-template-columns: minmax(12rem, 1fr) auto auto;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem 0;
    border-bottom: 1px solid var(--line);
}
.application__email { overflow-wrap: anywhere; font-family: "Baskerville", serif; font-size: 1.25rem; }
.application__meta { color: var(--ink-muted); font-size: 0.72rem; }
.application__actions { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.empty { padding: 3rem 0; color: var(--ink-muted); font-family: "Baskerville", serif; font-size: 1.35rem; }
.client-panel { margin-top: 3rem; }
.secret-output { display: none; margin-top: 1rem; padding: 1rem; border: 1px dashed var(--rust); overflow-wrap: anywhere; }
.secret-output[data-visible="true"] { display: block; }
.secret-output code { display: block; margin-top: 0.5rem; user-select: all; }

@media (max-width: 780px) {
    .shell { grid-template-columns: 3.5rem minmax(0, 1fr); }
    .rail { padding: 1.25rem 0.5rem; }
    .stage { padding-inline: 1.1rem; }
    .content { grid-template-columns: 1fr; gap: 2.5rem; }
    .seal { display: none; }
    .panel { padding: 1.5rem; }
    .application { grid-template-columns: 1fr; }
    .topbar { align-items: flex-start; }
    .topbar nav { flex-direction: column; gap: 0.4rem; text-align: right; }
    .dashboard-head { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: no-preference) {
    .intro, .panel { animation: arrive 560ms cubic-bezier(.2,.7,.2,1) both; }
    .panel { animation-delay: 100ms; }
    @keyframes arrive { from { opacity: 0; transform: translateY(14px); } }
}
