/* ==========================================================================
   Ascending Studios — brand foundation
   Shared by the website and the closed playtest.

   Palette (from the existing site, kept as is unless noted)
     Red          #e3131b  primary: fills, rules, active states, logo
     Red, text    #ff474d  same hue lifted for small text on dark (WCAG AA)
     Bronze       #4a4036  warm frame lines between sections and panels
     Silver       #fff → #5d6068  metallic logo word
     Ink          #050507 – #1a1b21  charcoal backgrounds
     Warm white   #e6dfd5  headings      Text #ecebe8   Muted #a7a9b0

   Shape: angular. Chamfered corners (clip-path) instead of rounded ones.
   ========================================================================== */

:root {
    /* Brand */
    --red: #e3131b;
    --red-strong: #c10f16;
    --red-deep: #9c0d13;
    --red-text: #ff474d;
    --red-glow: rgba(227, 19, 27, .45);
    --bronze: #4a4036;
    --bronze-light: #6b5c4c;

    /* Neutrals */
    --ink-950: #050507;
    --ink-900: #08090b;
    --ink-850: #0c0d10;
    --ink-800: #121318;
    --ink-700: #1a1b21;
    --line: #25272d;
    --line-strong: #62656e;

    --text: #ecebe8;
    --text-warm: #e6dfd5;
    --text-muted: #a7a9b0;
    --text-subtle: #8b8e97;
    --success: #3ccf7f;

    /* Type */
    --font-logo: 'Orbitron', 'Arial Black', sans-serif;
    --font-display: 'Rajdhani', 'Arial Narrow', sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    --fs-label: .8125rem;
    --fs-sm: .875rem;
    --fs-base: 1rem;
    --fs-md: 1.125rem;
    --fs-lg: clamp(1.375rem, 1.2rem + .6vw, 1.75rem);
    --fs-xl: clamp(2rem, 1.5rem + 2vw, 2.75rem);
    --fs-2xl: clamp(2.25rem, 1.4rem + 3.4vw, 3.75rem);

    --track-label: .2em;
    --track-head: .04em;

    /* Space (4px base) */
    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 24px;
    --s-6: 32px;
    --s-7: 48px;
    --s-8: 64px;

    /* Layout */
    --wrap: 1200px;
    --gutter: clamp(16px, 4vw, 40px);
    --header-h: 76px;

    /* Shape & motion */
    --cut: 12px;
    --cut-sm: 6px;
    --t: .18s ease;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    color-scheme: dark;
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--ink-900);
    color: var(--text);
    font: 400 var(--fs-base)/1.65 var(--font-body);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ol, ul, dl, dd, figure {
    margin: 0;
}

ol, ul {
    padding: 0;
    list-style: none;
}

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

img,
svg {
    display: block;
    max-width: 100%;
}

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

:focus-visible {
    outline: 2px solid var(--red-text);
    outline-offset: 3px;
}

::selection {
    background: var(--red);
    color: #fff;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: var(--s-4);
    z-index: 200;
    padding: var(--s-3) var(--s-4);
    background: var(--red);
    color: #fff;
    font-weight: 600;
}

.skip-link:focus {
    top: var(--s-4);
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.wrap {
    width: 100%;
    max-width: calc(var(--wrap) + 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: var(--gutter);
}

/* ---------- Chamfered shape ---------- */

.cut,
.btn,
.panel,
.panel::before {
    clip-path: polygon(
        var(--cut) 0, calc(100% - var(--cut)) 0,
        100% var(--cut), 100% calc(100% - var(--cut)),
        calc(100% - var(--cut)) 100%, var(--cut) 100%,
        0 calc(100% - var(--cut)), 0 var(--cut)
    );
}

/* clip-path hides outlines drawn outside the box */
.cut:focus-visible,
.btn:focus-visible,
.panel:focus-visible {
    outline-offset: -4px;
}

/* ---------- Typography ---------- */

.label {
    font: 700 var(--fs-label)/1.3 var(--font-display);
    letter-spacing: var(--track-label);
    text-transform: uppercase;
    color: var(--red-text);
}

.label--muted {
    color: var(--text-subtle);
}

.display {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: var(--track-head);
    line-height: 1.05;
    text-transform: uppercase;
    color: var(--text-warm);
}

/* ---------- Logo ---------- */

.logo {
    display: inline-flex;
    align-items: baseline;
    gap: .3em;
    font: 900 var(--logo-size, 1.75rem)/1 var(--font-logo);
    letter-spacing: .04em;
    white-space: nowrap;
}

.logo__mark {
    color: var(--red);
    text-shadow: 0 0 14px var(--red-glow);
}

.logo__word {
    font-size: .6em;
    letter-spacing: .14em;
    background: linear-gradient(180deg, #fff 0%, #a9abb1 45%, #5d6068 55%, #c9cbd0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- Header bar ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #0b0c0f;
    border-bottom: 2px solid var(--red);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-5);
    min-height: var(--header-h);
}

/* one logo size everywhere a page shows it top-left: site header,
   playtest header and the logo over the running game */
.site-header .logo,
.logo--header {
    --logo-size: clamp(1.25rem, .95rem + 1.2vw, 1.85rem);
}

@media (max-width: 399px) {
    .site-header .logo__word,
    .logo--header .logo__word {
        display: none;
    }
}

/* ---------- Buttons ---------- */

.btn {
    --cut: var(--cut-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    min-height: 46px;
    padding: 0 var(--s-5);
    border: 0;
    font: 700 .875rem/1 var(--font-display);
    letter-spacing: .16em;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--t), color var(--t), box-shadow var(--t);
}

.btn--primary {
    background: var(--red);
    color: #fff;
}

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

.btn--primary:active {
    background: var(--red-deep);
}

.btn--secondary {
    background: transparent;
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--line-strong);
}

.btn--secondary:hover {
    color: #fff;
    box-shadow: inset 0 0 0 1px var(--red);
}

.btn--secondary:active {
    background: rgba(227, 19, 27, .1);
}

.btn--sm {
    min-height: 40px;
    padding: 0 var(--s-4);
    font-size: .8125rem;
}

.btn--block {
    width: 100%;
}

.btn:disabled,
.btn[aria-busy='true'] {
    opacity: .6;
    cursor: progress;
}

.btn__icon {
    width: 12px;
    height: 12px;
    flex: none;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    font: 700 var(--fs-label)/1 var(--font-display);
    letter-spacing: var(--track-label);
    text-transform: uppercase;
    color: var(--text);
    transition: color var(--t);
}

.text-link:hover {
    color: var(--red-text);
}

.text-link__icon {
    width: 14px;
    height: 14px;
    transition: transform var(--t);
}

.text-link:hover .text-link__icon {
    transform: translateX(3px);
}

/* ---------- Panel: chamfered box with a bronze frame ---------- */

.panel {
    position: relative;
    isolation: isolate;
    background: linear-gradient(180deg, #5b4f43 0%, #2a2b30 55%, #3a2e2a 100%);
}

.panel::before {
    content: '';
    position: absolute;
    inset: 1px;
    z-index: -1;
    background: linear-gradient(180deg, var(--ink-800) 0%, var(--ink-850) 100%);
}

/* red edge along the top, as on the original cards */
.panel--accent::after {
    content: '';
    position: absolute;
    top: 0;
    left: 12%;
    right: 12%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--red), transparent);
}

/* ---------- Status ---------- */

.status {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    font: 700 var(--fs-label)/1.3 var(--font-display);
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--text);
}

.status__dot {
    width: 8px;
    height: 8px;
    flex: none;
    border-radius: 50%;
    background: var(--text-subtle);
}

.status--active .status__dot {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(60, 207, 127, .18);
}

.status--planned {
    color: var(--text-muted);
}

.status--planned .status__dot {
    background: transparent;
    box-shadow: inset 0 0 0 1.5px var(--text-subtle);
}

/* ---------- Forms ---------- */

.field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.field__label {
    font: 700 var(--fs-label)/1.3 var(--font-display);
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.field__error {
    font-size: var(--fs-sm);
    line-height: 1.4;
    color: #ff8a8f;
}

.input {
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    background: var(--ink-950);
    border: 1px solid var(--line-strong);
    border-radius: 0;
    font-size: 1rem; /* 16px keeps iOS from zooming in */
    line-height: 1.4;
    transition: border-color var(--t), box-shadow var(--t);
}

.input:hover {
    border-color: #80838c;
}

.input:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(227, 19, 27, .28);
}

.input[aria-invalid='true'] {
    border-color: var(--red-text);
}

textarea.input {
    min-height: 150px;
    resize: vertical;
}

.input--select {
    appearance: none;
    padding-right: 44px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23a7a9b0' stroke-width='1.6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 12px 8px;
    cursor: pointer;
}

/* ---------- Notices ---------- */

.notice {
    padding: var(--s-3) var(--s-4);
    border-left: 3px solid;
    font-size: var(--fs-sm);
    line-height: 1.5;
}

.notice a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.notice--success {
    border-color: var(--success);
    background: rgba(60, 207, 127, .08);
}

.notice--error {
    border-color: var(--red);
    background: rgba(227, 19, 27, .1);
    color: #ffd6d8;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}
