/* YiffCloud - retro online-service aesthetic, modern build.
   Brand: red highlights only. Period web-safe font stacks. No external requests. See docs/brand.md. */

:root {
    --navy: #0a2752;
    --navy-2: #12294d;
    --navy-3: #1b3a6b;
    --silver: #c9cdd6;
    --silver-hi: #eef1f6;
    --silver-lo: #8b90a0;
    --cream: #f4f1e8;
    --ink: #14161a;
    --red: #ff3b3b;
    --red-hi: #ff6b6b;
    --red-lo: #c81e1e;
    --term: #ff5a5a;

    --ui: Verdana, Geneva, "DejaVu Sans", Tahoma, sans-serif;
    --serif: Georgia, "Times New Roman", serif;
    --mono: "Courier New", Courier, monospace;

    --bevel-out: inset -2px -2px 0 0 var(--silver-lo), inset 2px 2px 0 0 var(--silver-hi);
    --bevel-in: inset 2px 2px 0 0 var(--silver-lo), inset -2px -2px 0 0 var(--silver-hi);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--ui);
    font-size: 15px;
    line-height: 1.55;
    color: var(--cream);
    background-color: var(--navy);
    background-image:
        radial-gradient(circle at 20% -10%, rgba(255, 59, 59, 0.10), transparent 55%),
        radial-gradient(circle at 100% 0%, rgba(255, 59, 59, 0.08), transparent 45%),
        linear-gradient(var(--navy), #071630);
    background-attachment: fixed;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

main[role="main"] {
    flex: 1 0 auto;
    width: 100%;
}

a {
    color: var(--cream);
    text-decoration: none;
}

a:hover {
    color: var(--red);
    text-decoration: underline;
}

h1,
h2,
h3 {
    font-family: var(--ui);
    line-height: 1.15;
    margin: 0 0 0.5em 0;
}

.wrap {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 18px;
}

/* ---- Title bar / header ---------------------------------------------------- */

.titlebar {
    background: linear-gradient(var(--silver-hi), var(--silver));
    box-shadow: var(--bevel-out);
    border-bottom: 2px solid #4a4f5c;
    position: sticky;
    top: 0;
    z-index: 50;
}

.titlebar .wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 8px;
    padding-bottom: 8px;
}

.brand {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    font-weight: bold;
    font-size: 22px;
    letter-spacing: 0.5px;
    color: var(--navy);
    text-decoration: none;
}

.brand:hover {
    text-decoration: none;
    color: var(--navy);
}

.brand .yiff {
    color: var(--red-lo);
}

.brand .cloud {
    color: var(--navy-3);
}

.brand .cursor {
    display: inline-block;
    width: 9px;
    height: 18px;
    margin-left: 3px;
    background: var(--navy);
    transform: translateY(2px);
    animation: blink 1.1s steps(1) infinite;
}

nav.mainnav {
    margin-left: auto;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
}

nav.mainnav a {
    color: var(--navy-2);
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 10px;
    border-radius: 2px;
}

nav.mainnav a:hover {
    color: var(--navy);
    background: rgba(11, 30, 59, 0.10);
    text-decoration: none;
}

nav.mainnav a.signin {
    color: #fff;
    background: var(--red);
    box-shadow: var(--bevel-out);
}

nav.mainnav a.signin:hover {
    background: var(--red-hi);
}

/* ---- Buttons --------------------------------------------------------------- */

.btn {
    display: inline-block;
    font-family: var(--ui);
    font-weight: bold;
    font-size: 14px;
    letter-spacing: 0.4px;
    padding: 11px 22px;
    color: #fff;
    background: var(--navy-2);
    border: 0;
    box-shadow: var(--bevel-out);
    cursor: pointer;
    text-transform: uppercase;
}

.btn:hover {
    text-decoration: none;
    color: #fff;
    background: var(--navy-3);
}

.btn:active {
    box-shadow: var(--bevel-in);
}

.btn.primary {
    background: var(--red);
    color: #fff;
}

.btn.primary:hover {
    background: var(--red-hi);
    color: #fff;
}

/* ---- ASCII cloud mark ------------------------------------------------------ */

.ascii-cloud {
    font-family: var(--mono);
    color: var(--red);
    white-space: pre;
    line-height: 1.05;
    font-size: 14px;
    margin: 0 0 14px 0;
    text-shadow: 0 0 8px rgba(255, 59, 59, 0.4);
}

.ascii-cloud.big {
    font-size: clamp(16px, 3vw, 24px);
}

/* ---- Hero ------------------------------------------------------------------ */

.hero {
    padding: 42px 0 30px;
}

.crt {
    position: relative;
    background:
        linear-gradient(180deg, rgba(255, 59, 59, 0.05), rgba(0, 0, 0, 0)),
        radial-gradient(120% 90% at 50% 0%, var(--navy-3), var(--navy) 70%);
    border: 2px solid #060f22;
    box-shadow: 0 0 0 6px var(--silver), 0 0 0 8px #4a4f5c, 0 16px 40px rgba(0, 0, 0, 0.45);
    padding: 34px 30px 30px;
    overflow: hidden;
}

.crt::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(to bottom,
            rgba(0, 0, 0, 0.16) 0,
            rgba(0, 0, 0, 0.16) 1px,
            transparent 2px,
            transparent 3px);
    mix-blend-mode: multiply;
}

.modemline {
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--term);
    letter-spacing: 0.5px;
    margin-bottom: 14px;
    text-shadow: 0 0 6px rgba(255, 90, 90, 0.5);
    position: relative;
}

.hero h1 {
    font-size: clamp(30px, 5.5vw, 52px);
    color: #fff;
    text-shadow: 0 2px 0 #05122b, 0 0 22px rgba(255, 59, 59, 0.20);
    max-width: 18ch;
    position: relative;
}

.hero h1 .accent {
    color: var(--red);
}

.hero .lede {
    font-family: var(--serif);
    font-size: clamp(16px, 2.2vw, 20px);
    color: #d6e2f2;
    max-width: 54ch;
    margin: 10px 0 24px;
    position: relative;
}

.cta-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    position: relative;
}

.cta-row.more {
    margin-top: 26px;
}

.badges {
    margin-top: 22px;
    display: flex;
    gap: 10px 22px;
    flex-wrap: wrap;
    font-size: 12.5px;
    color: var(--term);
    font-family: var(--mono);
    position: relative;
}

.badges span::before {
    content: "\25B8  ";
    color: var(--red);
}

/* ---- Section scaffolding --------------------------------------------------- */

section.band {
    padding: 40px 0;
}

.band h2 {
    font-size: clamp(22px, 3.5vw, 32px);
    color: #fff;
    display: inline-block;
    border-bottom: 3px solid var(--red);
    padding-bottom: 4px;
}

.band .sub {
    color: #b9c8de;
    max-width: 60ch;
    margin-top: -2px;
    margin-bottom: 26px;
}

/* ---- Window panels / service grid ------------------------------------------ */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.window {
    background: var(--silver);
    color: var(--ink);
    box-shadow: var(--bevel-out);
    border: 1px solid #4a4f5c;
    display: flex;
    flex-direction: column;
}

.window .tb {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(var(--navy-3), var(--navy-2));
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 5px 8px;
}

.window .tb .dot {
    width: 11px;
    height: 11px;
    background: var(--silver);
    box-shadow: var(--bevel-out);
    display: inline-block;
}

.window .body {
    padding: 14px 16px 16px;
    background: var(--cream);
    flex: 1;
}

.window .glyph {
    font-family: var(--mono);
    font-size: 26px;
    font-weight: bold;
    color: var(--red-lo);
    line-height: 1;
    margin-bottom: 8px;
}

.window h3 {
    font-size: 16px;
    color: var(--navy);
    margin-bottom: 4px;
}

.window p {
    margin: 0;
    font-size: 13.5px;
    color: #33373f;
}

/* ---- Add-ons grid ---------------------------------------------------------- */

.addons-head {
    color: #fff;
    font-size: 18px;
    margin: 34px 0 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.grid.addons .window .tb {
    background: linear-gradient(var(--navy-2), var(--navy));
}

.grid.addons .window.earn .tb {
    background: linear-gradient(var(--red), var(--red-lo));
    color: #fff;
}

.grid.addons .window.earn .body {
    background: #fff3f3;
}

/* ---- Tour stops ------------------------------------------------------------ */

.tourmap a {
    color: var(--term);
}

.tourmap a::before {
    content: "\25B8  ";
    color: var(--red);
}

.tourmap a:hover {
    color: var(--red);
}

.tourstop {
    scroll-margin-top: 64px;
}

.stopline {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--term);
    letter-spacing: 1px;
    margin-bottom: 6px;
    text-shadow: 0 0 6px rgba(255, 90, 90, 0.4);
}

.stopcols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 400px);
    gap: 30px;
    align-items: start;
}

.stopcols.flip {
    grid-template-columns: minmax(280px, 400px) minmax(0, 1fr);
}

.stopcols.flip .stopcopy {
    order: 2;
}

.stopcopy p {
    color: #cdd9ea;
    max-width: 62ch;
    margin-top: 0;
}

.stopcopy code {
    font-family: var(--mono);
    color: var(--term);
    background: #071022;
    padding: 1px 5px;
    font-size: 13px;
}

.window .body.termbody {
    padding: 0;
    background: #071022;
}

.term {
    margin: 0;
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.55;
    color: var(--term);
    padding: 14px 16px;
    white-space: pre;
    overflow-x: auto;
    text-shadow: 0 0 6px rgba(255, 90, 90, 0.35);
}

@media (max-width: 760px) {
    .stopcols,
    .stopcols.flip {
        grid-template-columns: 1fr;
    }

    .stopcols.flip .stopcopy {
        order: 0;
    }
}

/* ---- Steps ----------------------------------------------------------------- */

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    counter-reset: step;
}

.step {
    position: relative;
    background: var(--navy-2);
    border: 1px solid var(--navy-3);
    box-shadow: var(--bevel-out);
    padding: 20px 18px 18px;
}

.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    top: -14px;
    left: 16px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    background: var(--red);
    color: #fff;
    font-weight: bold;
    box-shadow: var(--bevel-out);
}

.step h3 {
    margin-top: 8px;
    font-size: 16px;
    color: var(--red-hi);
}

.step p {
    margin: 0;
    font-size: 13.5px;
    color: #cdd9ea;
}

.step code {
    font-family: var(--mono);
    color: var(--term);
    background: #071022;
    padding: 1px 5px;
    font-size: 12.5px;
}

/* ---- Pricing --------------------------------------------------------------- */

.price-wrap {
    display: flex;
    justify-content: center;
}

.plan {
    background: var(--cream);
    color: var(--ink);
    box-shadow: var(--bevel-out);
    border: 1px solid #4a4f5c;
    max-width: 380px;
    width: 100%;
    text-align: center;
}

.plan .tb {
    background: linear-gradient(var(--red), var(--red-lo));
    color: #fff;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px;
    font-size: 13px;
}

.plan .amount {
    font-size: 46px;
    font-weight: bold;
    color: var(--navy);
    padding: 18px 0 0;
}

.plan .amount small {
    font-size: 15px;
    color: #55606f;
    font-weight: normal;
}

.plan ul {
    list-style: none;
    margin: 14px 0 18px;
    padding: 0 22px;
    text-align: left;
}

.plan li {
    padding: 5px 0 5px 22px;
    position: relative;
    font-size: 13.5px;
    border-bottom: 1px dotted #b9bcc6;
}

.plan li::before {
    content: "\2714";
    position: absolute;
    left: 0;
    color: var(--red-lo);
    font-weight: bold;
}

.plan .foot {
    padding: 0 22px 22px;
}

.plan .foot input {
    width: 100%;
    font-family: var(--ui);
    font-size: 14px;
    padding: 9px 10px;
    margin-bottom: 8px;
    border: 1px solid var(--silver-lo);
    box-shadow: var(--bevel-in);
    background: #fff;
    color: var(--ink);
}

.plan .foot .btn.primary {
    width: 100%;
    margin-top: 4px;
}

.plan .fineprint,
.authwin .fineprint {
    font-size: 11px;
    color: #55606f;
    margin: 10px 0 0;
    line-height: 1.4;
}

.plan .fineprint a,
.authwin .fineprint a {
    color: var(--red-lo);
}

/* ---- Static content pages -------------------------------------------------- */

.content {
    /* longhand on purpose: .content shares its element with .wrap, and the
       padding shorthand would clobber .wrap's 18px side gutters; border-box
       means those gutters come out of max-width, hence the +36px */
    padding-top: 40px;
    padding-bottom: 20px;
    max-width: calc(70ch + 36px);
}

.content.wide {
    max-width: 1040px;
}

.content .narrow {
    max-width: 70ch;
}

.content h1 {
    color: #fff;
    border-bottom: 3px solid var(--red);
    display: inline-block;
    padding-bottom: 4px;
}

.content h2 {
    color: var(--red-hi);
    font-size: 18px;
    margin-top: 26px;
}

.content p,
.content li {
    color: #cdd9ea;
}

.content code {
    font-family: var(--mono);
    color: var(--term);
    background: #071022;
    padding: 2px 7px;
}

.content code.bigcode {
    font-size: 20px;
    letter-spacing: 1px;
}

.content .authform {
    max-width: 320px;
    margin: 18px 0;
}

.content form input {
    display: block;
    width: 100%;
    max-width: 320px;
    font-family: var(--ui);
    font-size: 14px;
    padding: 9px 10px;
    margin-bottom: 10px;
    border: 1px solid var(--silver-lo);
    box-shadow: var(--bevel-in);
    background: #fff;
    color: var(--ink);
}

.content form {
    margin: 12px 0;
}

.content .loginerror {
    color: var(--red);
    font-weight: bold;
}

.content .signout {
    margin-top: 28px;
    border-top: 1px solid var(--navy-3);
    padding-top: 18px;
}

/* ---- Auth dialogs (Sign In / Sign Up) -------------------------------------- */

.authwin {
    max-width: 380px;
    margin: 22px 0;
}

.authwin .authform {
    margin: 4px 0 0;
}

.authwin .btn {
    width: 100%;
    margin-top: 4px;
}

.signup-cols {
    display: grid;
    grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
    gap: 34px;
    align-items: start;
    margin-top: 4px;
}

.signup-info {
    max-width: 70ch;
}

.signup-info h2:first-child {
    margin-top: 8px;
}

@media (max-width: 760px) {
    .signup-cols {
        grid-template-columns: 1fr;
    }
}

/* ---- Manifesto (About) ----------------------------------------------------- */

.manifesto {
    font-family: var(--serif);
    font-size: clamp(19px, 2.6vw, 24px);
    color: #d6e2f2;
    border-left: 4px solid var(--red);
    padding: 4px 0 4px 16px;
    margin: 22px 0 26px;
    max-width: 48ch;
}

.hint {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--silver-lo);
}

/* ---- Handbook (Docs) ------------------------------------------------------- */

.toc {
    max-width: 420px;
    margin: 20px 0 8px;
}

.toc ol {
    font-family: var(--mono);
    font-size: 13.5px;
    margin: 0;
    padding-left: 26px;
}

.toc li {
    padding: 3px 0;
}

.toc a {
    color: var(--navy);
    font-weight: bold;
}

.toc a:hover {
    color: var(--red-lo);
}

.doctable {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 22px;
    font-size: 13px;
}

.doctable th,
.doctable td {
    text-align: left;
    padding: 6px 10px;
    border: 1px solid var(--navy-3);
}

.doctable th {
    background: var(--navy-3);
    color: var(--silver-hi);
    font-family: var(--ui);
}

.doctable td {
    background: var(--navy-2);
    color: #cdd9ea;
}

.doctable td:nth-child(2) {
    font-family: var(--mono);
    color: var(--term);
    white-space: nowrap;
}

/* ---- Error pages ----------------------------------------------------------- */

.errorwrap {
    min-height: 62vh;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 60px 18px;
}

.errorcode {
    font-family: var(--mono);
    font-weight: bold;
    font-size: clamp(52px, 13vw, 120px);
    color: var(--red);
    line-height: 1;
    text-shadow: 0 0 18px rgba(255, 59, 59, 0.35);
    margin: 6px 0;
}

.errorwrap h1 {
    color: #fff;
    font-size: clamp(20px, 4vw, 30px);
}

.errorwrap p {
    color: #b9c8de;
    max-width: 46ch;
    margin: 6px auto 22px;
}

/* ---- Footer ---------------------------------------------------------------- */

footer.sitefoot {
    margin-top: 20px;
    background: #060f22;
    border-top: 2px solid var(--navy-3);
    padding: 24px 0 30px;
    font-size: 12.5px;
    color: #8fa2bd;
}

footer.sitefoot .wrap {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

footer.sitefoot a {
    color: #b9c8de;
}

footer.sitefoot a:hover {
    color: var(--red);
}

.foot-note {
    font-family: var(--mono);
    color: var(--silver-lo);
}

/* ---- Portal: entitlements, add-ons, domains, homepage ---------------------- */

.addon-buy {
    margin-top: 14px;
    margin-bottom: 6px;
    font-weight: bold;
}

.addon-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.notice {
    padding: 8px 12px;
    border: 2px solid var(--navy-3);
    background: var(--navy-2);
    box-shadow: var(--bevel-in);
    font-weight: bold;
}

.notice.ok {
    border-color: var(--red-lo);
    color: var(--silver-hi);
}

.notice.err {
    border-color: var(--red);
    color: var(--red-hi);
}

.domain-list {
    list-style: none;
    padding: 0;
    margin: 8px 0;
}

.domain-list li {
    padding: 6px 10px;
    border-left: 3px solid var(--red);
    background: var(--navy-2);
    margin-bottom: 4px;
    font-family: var(--mono);
}

.domain-register {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.domain-register input {
    font-family: var(--mono);
    font-size: 14px;
    padding: 6px 8px;
    background: var(--silver-hi);
    color: var(--ink);
    border: 2px solid var(--silver-lo);
    box-shadow: var(--bevel-in);
}

/* ---- Admin tables ---------------------------------------------------------- */

.admintable {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 22px;
    font-size: 13px;
}

.admintable th,
.admintable td {
    text-align: left;
    padding: 6px 10px;
    border: 1px solid var(--navy-3);
}

.admintable th {
    background: var(--navy-3);
    color: var(--silver-hi);
    font-family: var(--ui);
}

.admintable td {
    background: var(--navy-2);
    font-family: var(--mono);
}

.admintable tr.ok td {
    color: var(--silver-hi);
}

.admintable tr.fail td {
    color: var(--red-hi);
}

.grantform {
    max-width: 420px;
}

.grantform label {
    display: block;
    font-size: 13px;
    margin: 4px 0;
}

/* ---- View transitions ------------------------------------------------------- */
/* Cross-document, same-origin (Chromium 126+, Safari 18.2+; others fall back to
   plain navigation). steps() keeps the redraw chunky - a machine repainting,
   not a modern crossfade. Titlebar + footer get their own named groups so the
   chrome holds still while the page content flips underneath. */

@view-transition {
    navigation: auto;
}

.titlebar {
    view-transition-name: titlebar;
}

footer.sitefoot {
    view-transition-name: sitefoot;
}

::view-transition-old(root) {
    animation: 110ms steps(4, end) both vt-page-out;
}

::view-transition-new(root) {
    animation: 190ms steps(6, end) both vt-page-in;
}

@keyframes vt-page-out {
    to {
        opacity: 0;
    }
}

@keyframes vt-page-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* ---- Motion / a11y --------------------------------------------------------- */

@keyframes blink {
    50% {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .brand .cursor {
        animation: none;
    }

    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) {
        animation: none !important;
    }
}

@media (max-width: 620px) {
    nav.mainnav {
        width: 100%;
        margin-left: 0;
    }

    .titlebar .wrap {
        justify-content: space-between;
    }

    .crt {
        padding: 22px 18px;
    }
}