/*
 * Honeyglass: the design tokens, base element styles and page layout. Every component styles
 * itself in its own Name.razor.css with these variables only, never raw colours.
 * Fonts: see fonts-OFL.txt; the flag font: see twemoji-country-flags-LICENSE.md.
 */

@font-face {
    font-family: "Space Grotesk";
    src: url("space-grotesk-latin-wght-normal.woff2") format("woff2");
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "JetBrains Mono";
    src: url("jetbrains-mono-latin-wght-normal.woff2") format("woff2");
    font-weight: 100 800;
    font-style: normal;
    font-display: swap;
}

/* Country flags as emoji, the same on every system: only the regional-indicator letters use it. */
@font-face {
    font-family: "Twemoji Country Flags";
    src: url("twemoji-country-flags.woff2") format("woff2");
    unicode-range: U+1F1E6-1F1FF;
    font-display: swap;
}

:root {
    /* Surfaces, from the page down into the terminal. */
    --color-bg: #0E0F12;
    --color-surface: #121418;
    --color-surface-raised: #16181D;
    --color-surface-hover: #1A1D24;
    --color-surface-sunken: #07080A;
    --color-track: #1C1F26;
    --color-border: #2A2D35;
    --color-border-subtle: #22252C;

    /* Text, from the strongest to the faintest. */
    --color-text: #E8E6E1;
    --color-text-soft: #C9CCD2;
    --color-text-muted: #A8ADB7;
    --color-text-faint: #8B909A;
    --color-terminal-text: #D4D7DD;
    --color-terminal-output: #A9AEB8;
    --color-on-bright: #0E0F12;

    /* Amber: humans, attacks, the site's own links and actions. */
    --color-amber: #F5B83D;
    --color-amber-light: #FFD27A;
    --color-amber-bg: #3A2A10;
    --color-amber-surface: #2A2010;
    --color-amber-border: #5C4718;

    /* Blue: bots, and the bars of charts. */
    --color-blue: #6EA8FE;
    --color-blue-light: #9EC5FF;
    --color-blue-bg: #1C2433;
    --color-blue-border: #2E4466;

    /* Green: decoys. */
    --color-green: #3DD68C;
    --color-green-light: #8FE5B9;
    --color-green-bg: #10261C;
    --color-green-border: #1F5C42;
    --color-offline: #6B7080;

    /* Violet: AI, and nothing else. */
    --color-violet: #C9B8FF;
    --color-violet-bg: #1E1A2E;

    /* Red: live right now, and destructive actions. */
    --color-red: #E5484D;
    --color-red-light: #FF9B9E;
    --color-red-pale: #FFC9CB;
    --color-red-bg: #3A1416;
    --color-red-surface: #2A1416;
    --color-red-border: #5C2A2D;

    --font-sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

    --text-xs: 13px;
    --text-sm: 14px;
    --text-md: 16px;
    --text-lg: 18px;
    --text-xl: 20px;
    --text-2xl: 24px;
    --text-3xl: 28px;
    --text-4xl: 36px;
    --text-5xl: 44px;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-pill: 999px;

    --target-size: 44px;
    --page-width: 1240px;
    --page-width-text: 760px;
    --gutter: var(--space-6);
    --focus-ring: 2px solid var(--color-amber);
}

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

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

/* A country's flag: two regional-indicator letters in the flag font. */
.flag {
    font-family: "Twemoji Country Flags", var(--font-sans);
    font-style: normal;
    line-height: 1;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: var(--text-md);
    line-height: 1.5;
}

h1,
h2,
h3 {
    margin: 0;
    line-height: 1.15;
    font-weight: 700;
}

h1 {
    font-size: var(--text-5xl);
}

h2 {
    font-size: var(--text-2xl);
}

h3 {
    font-size: var(--text-lg);
}

p {
    margin: 0;
}

a {
    color: var(--color-amber);
}

a:hover {
    color: var(--color-amber-light);
}

/* What only works with script, e.g. a Copy button: disabled until the page is interactive, and without
   script unseen while keeping its place, so nothing moves when it becomes usable. */
@media (scripting: none) {
    .needs-script {
        visibility: hidden;
    }
}

/* A session in full screen covers the window: the page under it doesn't scroll. */
html:has(.full-screen) {
    overflow: hidden;
}

/* What only a browser without script needs, e.g. a filter form's Show button: never there with script,
   from the first paint on. */
@media (scripting: enabled) {
    .no-script-only {
        display: none !important;
    }
}

/* A link inside a line of facts, e.g. a nickname or a country in a session row: it looks like the text
   around it until hovered or focused, then like a link. It sits above a row's stretched action. */
a.quiet-link {
    position: relative;
    z-index: 1;
    color: inherit;
    text-decoration: none;
}

a.quiet-link:hover,
a.quiet-link:focus-visible {
    color: var(--color-amber);
    text-decoration: underline;
    text-underline-offset: 2px;
}

code,
pre,
kbd,
samp {
    font-family: var(--font-mono);
}

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

button {
    cursor: pointer;
}

:focus-visible {
    outline: var(--focus-ring);
    outline-offset: 2px;
}

[hidden] {
    display: none !important;
}

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

/* Page layout: one centred column with gutters, the same width on every page. */
.page {
    width: 100%;
    max-width: var(--page-width);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

/* The header the site's layout and admin's share: skip link, brand and links. */
.skip-link {
    position: absolute;
    left: var(--space-4);
    top: -100px;
    padding: var(--space-2) var(--space-4);
    background: var(--color-amber);
    color: var(--color-on-bright);
    border-radius: var(--radius-md);
    z-index: 10;
}

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

.site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding-block: var(--space-6);
}

/* Under .site-header: the session player has a .brand of its own. */
.site-header .brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: var(--target-size);
    color: var(--color-text);
    font-size: var(--text-xl);
    font-weight: 700;
    text-decoration: none;
}

.site-header .brand svg {
    color: var(--color-amber);
}

.site-header .brand:hover {
    color: var(--color-text);
}

.links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-6);
}

.links a {
    display: inline-flex;
    align-items: center;
    min-height: var(--target-size);
    color: var(--color-text-muted);
    text-decoration: none;
}

.links a:hover,
.links a[aria-current="page"] {
    color: var(--color-text);
}

.links .account {
    padding: 0 var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    color: var(--color-text);
}

.links a[aria-current="page"] {
    text-decoration: underline;
    text-decoration-color: var(--color-amber);
    text-underline-offset: 6px;
}

/* The button item on its own page: filled, not underlined. */
.links .account[aria-current="page"] {
    background: var(--color-amber-surface);
    border-color: var(--color-amber-border);
    color: var(--color-amber);
    text-decoration: none;
}

/* Sign out, for a signed-in visitor: a form whose button looks like the links around it. Under .links:
   the phone menu has a sign-out form of its own. */
.links .sign-out {
    display: contents;
}

.links .sign-out button {
    display: inline-flex;
    align-items: center;
    min-height: var(--target-size);
    padding: 0;
    background: transparent;
    border: 0;
    color: var(--color-text-muted);
    font: inherit;
    cursor: pointer;
}

.links .sign-out button:hover {
    color: var(--color-text);
}

main:focus {
    outline: none;
}

@media (max-width: 760px) {
    .links {
        display: none;
    }
}

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

/* Phones: the gutter shrinks, headings get smaller and the main links move behind the menu button. */
@media (max-width: 760px) {
    :root {
        --gutter: var(--space-4);
    }

    h1 {
        font-size: var(--text-4xl);
    }
}
