/*
  phorevia.com: one hand-written stylesheet in the app's Darkroom palette
  (Phorevia.Desktop/Themes/Palettes.axaml): umber surfaces, parchment text, safelight accent.
*/
:root {
    color-scheme: dark;
    --bg: #15100d;
    --canvas: #110d0b;
    --chrome: #1b1411;
    --surface: #1e1714;
    --raised: #2a201b;
    --border: #3d2f27;
    --divider: #33271f;
    --text: #f3e6d3;
    --text-2: #dcc8ae;
    --muted: #a88e77;
    --accent: #ff6a1f;
    --accent-border: #ff8a4c;
    --on-accent: #1b1411;
    --button: #2e231d;
    --button-border: #4a392e;
    --button-hover: #3a2c24;
    --success: #7fd39b;
    --success-bg: #1c2a1f;
    --success-border: #3e6b4a;
    --warning: #f2b84b;
    --warning-bg: #35231a;
    --warning-border: #8a5b2c;
    --focus: #f3e6d3;
    --radius: 8px;
    --gutter: 16px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.6 var(--font);
}

main { flex: 1; padding-top: 32px; padding-bottom: 56px; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 480px; }
.medium { max-width: 720px; }

a { color: var(--accent-border); text-underline-offset: 3px; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5em; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: 1.4rem; margin-top: 1.6em; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.lead { font-size: 1.15rem; color: var(--text-2); max-width: 60ch; }
.muted { color: var(--muted); }
small, .small { font-size: 0.875rem; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: 8px; background: var(--raised); padding: 8px 12px; z-index: 10; }

/* Header and footer */
.site-header { background: var(--chrome); border-bottom: 1px solid var(--divider); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 650; font-size: 1.15rem; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-nav a { color: var(--text-2); text-decoration: none; padding: 6px 0; }
.site-nav a:hover { color: var(--text); }
.site-nav .nav-account { color: var(--accent-border); }

.site-footer { background: var(--chrome); border-top: 1px solid var(--divider); color: var(--muted); font-size: 0.875rem; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 20px; padding-bottom: 20px; }
.footer-row nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.footer-row a { color: var(--text-2); text-decoration: none; }
.footer-row p { margin: 0; }

/* Panels and notices */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.notice { background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; }
.notice.success { background: var(--success-bg); border-color: var(--success-border); }
.notice.warning { background: var(--warning-bg); border-color: var(--warning-border); }
.errors { background: var(--warning-bg); border: 1px solid var(--warning-border); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; }
.errors ul { margin: 0; padding-left: 20px; }
.field-validation-error, .validation-summary-errors { color: var(--warning); }
.validation-summary-valid { display: none; }

/* Forms */
form .field { margin-bottom: 16px; }
label { display: block; margin-bottom: 6px; color: var(--text-2); font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--canvas);
    color: var(--text);
    border: 1px solid var(--button-border);
    border-radius: 6px;
    font: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent-border); outline: none; box-shadow: 0 0 0 2px rgba(255, 138, 76, 0.35); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 5px; accent-color: var(--accent); }

.button, button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 10px 18px;
    border-radius: 6px; border: 1px solid var(--button-border);
    background: var(--button); color: var(--text);
    font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.button:hover, button:hover { background: var(--button-hover); color: var(--text); }
.button.primary, button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.button.primary:hover, button.primary:hover { background: var(--accent-border); color: var(--on-accent); }
.button.danger, button.danger { border-color: var(--warning-border); color: var(--warning); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 8px; }
.link-button { background: none; border: none; padding: 0; min-height: 0; color: var(--accent-border); font-weight: 400; text-decoration: underline; cursor: pointer; }
.link-button:hover { background: none; color: var(--text); }

/* Home and marketing */
.hero { padding: 24px 0 8px; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.25rem); max-width: 18ch; }
.pillars { margin-top: 32px; }
.pillar h3 { color: var(--text); }
.price { font-size: 2.25rem; font-weight: 700; }
.price del { color: var(--muted); font-size: 1.25rem; font-weight: 400; margin-left: 8px; }
.checks { list-style: none; padding: 0; margin: 0 0 16px; }
.checks li { padding-left: 24px; position: relative; margin-bottom: 6px; }
.checks li::before { content: ""; position: absolute; left: 4px; top: 0.65em; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.faq dt { font-weight: 600; margin-top: 16px; }
.faq dd { margin: 4px 0 0; color: var(--text-2); }

/* Tables */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--divider); vertical-align: top; }
table.list th { color: var(--muted); font-weight: 500; font-size: 0.875rem; }

/* Legal and help documents */
.prose { max-width: 72ch; }
.prose h1 { margin-bottom: 0.75em; }
.prose li { margin-bottom: 0.35em; }
.prose pre { white-space: pre-wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; font-size: 0.9rem; }

code, .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.9em; }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; padding: 0; list-style: none; }
.codes li { background: var(--canvas); border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; text-align: center; }
.qr { background: #fff; padding: 12px; border-radius: var(--radius); display: inline-block; line-height: 0; }
.qr svg { width: 180px; height: 180px; }

@media (max-width: 480px) {
    main { padding-top: 20px; }
    .card { padding: 16px; }
    .button, button { width: 100%; }
    .actions .link-button { width: auto; }
}
.spaced { margin-top: 32px; }
.card > h2:first-child { margin-top: 0; }
.hash { word-break: break-all; }
.download { margin: 16px 0; }
textarea.mono { font-size: 0.85rem; }

/* Beta program */
.stepper { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 20px; counter-reset: step; }
.stepper li { counter-increment: step; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: 0.875rem; }
.stepper li::before { content: counter(step) ". "; }
.stepper li.done { color: var(--success); border-color: var(--success-border); }
.stepper li.current { color: var(--on-accent); background: var(--accent); border-color: var(--accent); font-weight: 600; }
.agreement { max-height: 60vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 8px; }
.agreement h1 { font-size: 1.4rem; }
.agreement h2 { font-size: 1.1rem; }

/* Support */
.conversation { display: grid; gap: 12px; margin: 16px 0 24px; }
.message { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; }
.message.staff { border-left: 3px solid var(--accent); }
.message.note { background: var(--warning-bg); border-color: var(--warning-border); }
.message .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.message p { margin-bottom: 6px; }
.attachments { margin: 10px 0 0; padding-left: 20px; }
input[type=file] { width: 100%; color: var(--text-2); }
