/* Clash of Civilization: shared styles for the homepage, auth pages, user panel and admin panel */

@font-face { font-family: "Marcellus"; src: url("../fonts/marcellus-latin-400.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Marcellus"; src: url("../fonts/marcellus-latin-ext-400.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0100-02AF, U+1E00-1EFF, U+2C60-2C7F; }
@font-face { font-family: "Figtree"; src: url("../fonts/figtree-latin-400.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Figtree"; src: url("../fonts/figtree-latin-ext-400.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0100-02AF, U+1E00-1EFF, U+2C60-2C7F; }
@font-face { font-family: "Figtree"; src: url("../fonts/figtree-latin-600.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Figtree"; src: url("../fonts/figtree-latin-ext-600.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0100-02AF, U+1E00-1EFF, U+2C60-2C7F; }

:root {
  --ink: #0f1719;
  --ink-2: #162124;
  --ink-3: #1e2c30;
  --line: #2d3f43;
  --bone: #efe6d4;
  --bone-2: #b3b4a8;
  --copper: #d98a57;
  --verdigris: #63b8a5;
  --marker: #e8c65a;
  --display: "Marcellus", Georgia, serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ink); color: var(--bone); font: 400 1.0625rem/1.6 var(--body); }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.1; margin: 0; }
p { margin: 0; }
a { color: inherit; }
img, svg { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--marker); outline-offset: 3px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--bone); color: var(--ink); padding: 8px 14px; z-index: 10; }
.skip:focus { left: 8px; }
.wrap { max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }

/* Placeholders: deliberately loud, so unfinished content cannot pass as real */
.ph { display: inline; color: var(--marker); background: rgba(232, 198, 90, .1); border-bottom: 1px dashed var(--marker); padding: .05em .3em; font-family: var(--body); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.ph-tag { font-size: .68em; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin-right: .4em; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 22px; border: 1px solid var(--bone); background: var(--bone); color: var(--ink); font: 600 .95rem var(--body); text-decoration: none; transition: background .15s, color .15s; }
.btn:hover { background: transparent; color: var(--bone); }
.btn-quiet { background: transparent; color: var(--bone); border-color: var(--line); }
.btn-quiet:hover { border-color: var(--bone); }
.btn[aria-disabled="true"], .btn:disabled { background: transparent; color: var(--marker); border: 1px dashed var(--marker); cursor: not-allowed; }

/* Site header */
.site-head { position: absolute; inset: 0 0 auto; z-index: 2; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font: 400 1.15rem/1.15 var(--display); text-decoration: none; }
.brand img { width: 36px; height: 36px; flex: none; }
.site-nav { display: flex; gap: clamp(14px, 3vw, 32px); font-size: .95rem; }
.site-nav a { text-decoration: none; color: var(--bone-2); }
.site-nav a:hover { color: var(--bone); }

/* Hero: two territories meeting along a frontier */
.hero { position: relative; min-height: min(100svh, 860px); display: flex; align-items: flex-end; overflow: hidden; background: var(--ink); }
.hero-map { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 78% 50%; }
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(70% 90% at 22% 40%, rgba(217, 138, 87, .13), transparent 72%), radial-gradient(45% 80% at 95% 30%, rgba(99, 184, 165, .15), transparent 72%); }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(15, 23, 25, .6) 0%, rgba(15, 23, 25, .22) 48%, rgba(15, 23, 25, 0) 66%), linear-gradient(180deg, rgba(15, 23, 25, .85) 0%, rgba(15, 23, 25, 0) 16%), linear-gradient(0deg, var(--ink) 0%, rgba(15, 23, 25, 0) 24%); }
.hero-copy { position: relative; z-index: 1; width: 100%; padding-block: 140px clamp(56px, 9vh, 96px); }
.hero h1 { font-size: clamp(3.3rem, 16vw, 8.5rem); line-height: .96; max-width: 9.5em; }
.hero h1 em { display: block; font-style: normal; font-size: .42em; line-height: 1.3; color: var(--copper); }
.hero-pitch { margin-top: 26px; max-width: 34em; font-size: clamp(1.05rem, 1.6vw, 1.25rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* Homepage sections */
.section { padding-block: clamp(64px, 10vw, 128px); border-top: 1px solid var(--line); }
.eyebrow { font-size: .85rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--verdigris); margin-bottom: 14px; }
.section h2 { font-size: clamp(2rem, 4.6vw, 3.5rem); max-width: 16em; }
.lede { margin-top: 22px; max-width: 42em; font-size: 1.15rem; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 56px; border-top: 1px solid var(--line); }
.feature { padding: 28px 28px 8px 0; }
.feature + .feature { padding-left: 28px; border-left: 1px solid var(--line); }
.feature h3 { font-size: 1.4rem; margin-bottom: 12px; }
.shots { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-top: 56px; }
.shot { display: grid; place-items: center; min-height: 170px; padding: 20px; text-align: center; border: 1px dashed var(--marker); background: repeating-linear-gradient(135deg, rgba(232, 198, 90, .05) 0 12px, transparent 12px 24px); }
.shot-main { grid-row: span 2; aspect-ratio: 16 / 9; }
.get { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 32px; }
.store-links { display: flex; flex-wrap: wrap; gap: 12px; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); padding-block: 32px; font-size: .92rem; color: var(--bone-2); }
.site-foot .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }

/* Panels (user and admin) */
.panel { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100svh; }
.side { position: relative; overflow: hidden; padding: 24px 18px; background: var(--ink-2); border-right: 1px solid var(--line); }
.side::before { content: ""; position: absolute; inset: auto 0 0; height: 300px; background: url("../images/frontier.svg") 62% 50% / 900px auto no-repeat; opacity: .5; pointer-events: none; }
.side > * { position: relative; }
.side-role { margin: 6px 0 26px 48px; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--verdigris); }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: block; padding: 10px 12px; color: var(--bone-2); text-decoration: none; border-left: 2px solid transparent; }
.side-nav a:hover { color: var(--bone); background: var(--ink-3); }
.side-nav a[aria-current] { color: var(--bone); border-left-color: var(--copper); background: var(--ink-3); }
.main { padding: clamp(20px, 4vw, 48px); }
.side-user { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 26px; padding: 16px 12px 0; border-top: 1px solid var(--line); font-size: .95rem; overflow-wrap: anywhere; }
.side-user .btn { min-height: 38px; padding: 6px 16px; background: var(--ink-2); cursor: pointer; }
.side-user .btn:hover { background: var(--ink-3); }
.flash { padding: 12px 16px; margin-bottom: 24px; border: 1px solid var(--verdigris); color: var(--bone); background: rgba(99, 184, 165, .1); font-size: .95rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 30px; }
.page-head h1 { font-size: clamp(2rem, 4vw, 3rem); }
.page-head p { color: var(--bone-2); margin-top: 8px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 30px; background: var(--ink-2); border: 1px solid var(--line); }
.stat { padding: 20px; border-left: 1px solid var(--line); margin-left: -1px; }
.stat-label { font-size: .9rem; color: var(--bone-2); }
.stat-value { font: 400 2.4rem/1.2 var(--display); margin-top: 6px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.box { padding: 22px; background: var(--ink-2); border: 1px solid var(--line); }
.box h2 { font-size: 1.4rem; margin-bottom: 16px; }
.rows { margin: 0; display: grid; }
.rows > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 11px 0; border-top: 1px solid var(--line); }
.rows dt { color: var(--bone-2); }
.rows dd { margin: 0; }
.empty { padding: 26px 8px; text-align: center; color: var(--bone-2); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th { text-align: left; font-weight: 600; color: var(--bone-2); padding: 8px 12px 8px 0; white-space: nowrap; }
td { padding: 10px 12px 10px 0; border-top: 1px solid var(--line); }
.status { color: var(--marker); white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* Forms */
.form { display: grid; gap: 18px; }
.form .btn { width: 100%; cursor: pointer; }
.form-quiet { margin-top: 12px; }
.form-quiet .btn { width: 100%; cursor: pointer; }
.field label { display: block; margin-bottom: 6px; font-size: .95rem; font-weight: 600; }
.field input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 0; background: var(--ink); color: var(--bone); font: 400 1rem var(--body); }
.field input:hover { border-color: var(--bone-2); }
.field input:focus { outline: 2px solid var(--copper); outline-offset: 0; border-color: var(--copper); }
.field input[aria-invalid="true"] { border-color: var(--copper); }
.field input:-webkit-autofill { -webkit-text-fill-color: var(--bone); box-shadow: inset 0 0 0 100px var(--ink); caret-color: var(--bone); }
.field-hint { margin-top: 6px; font-size: .88rem; color: var(--bone-2); }
.field-error { margin-top: 6px; font-size: .92rem; color: #f0a982; }
.form-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; font-size: .95rem; }
.form-row a { color: var(--bone-2); }
.form-row a:hover { color: var(--bone); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--copper); }

/* Auth pages: the homepage map beside one form */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); min-height: 100svh; }
.auth-art { position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 24px var(--gutter) clamp(32px, 7vh, 72px); background: var(--ink); }
.auth-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(15, 23, 25, .6) 0%, rgba(15, 23, 25, .15) 55%, rgba(15, 23, 25, 0) 75%), linear-gradient(180deg, rgba(15, 23, 25, .85) 0%, rgba(15, 23, 25, 0) 18%), linear-gradient(0deg, rgba(15, 23, 25, .85) 0%, rgba(15, 23, 25, 0) 30%); }
.auth-art > :not(.hero-map) { position: relative; z-index: 1; }
.auth-title { font: 400 clamp(3rem, 7vw, 6.5rem)/.96 var(--display); }
.auth-title em { display: block; font-style: normal; font-size: .42em; line-height: 1.3; color: var(--copper); }
.auth-main { display: grid; align-items: center; padding: clamp(28px, 6vw, 64px); background: var(--ink-2); border-left: 1px solid var(--line); }
.auth-box { width: 100%; max-width: 400px; margin-inline: auto; }
.auth-box h1 { font-size: clamp(2rem, 4vw, 2.75rem); margin-bottom: 24px; }
.auth-intro { margin: -10px 0 24px; color: var(--bone-2); overflow-wrap: anywhere; }
.auth-intro strong { color: var(--bone); font-weight: 600; }
.auth-links { margin-top: 24px; color: var(--bone-2); font-size: .95rem; }
.auth-links a { color: var(--bone); }

/* Error pages */
.error-page { position: relative; display: grid; place-items: center; min-height: 100svh; padding: var(--gutter); text-align: center; background: linear-gradient(rgba(15, 23, 25, .78), rgba(15, 23, 25, .78)), url("../images/frontier.svg") center / cover; }
.error-page h1 { font-size: clamp(4rem, 14vw, 8rem); }
.error-page p { margin: 10px 0 26px; }

@media (max-width: 820px) {
  .features { grid-template-columns: 1fr; }
  .feature, .feature + .feature { padding: 24px 0; border-left: 0; border-top: 1px solid var(--line); }
  .feature:first-child { border-top: 0; }
  .shots { grid-template-columns: 1fr; }
  .shot-main { grid-row: auto; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .panel { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .side { padding: 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side::before { display: none; }
  .side-role { margin: 4px 0 12px 48px; }
  .side-nav { flex-direction: row; overflow-x: auto; }
  .side-nav a { white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; }
  .side-nav a[aria-current] { border-bottom-color: var(--copper); }
  .side-user { flex-direction: row; align-items: center; justify-content: space-between; margin-top: 12px; padding: 12px 0 0; }
  .auth { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .auth-art { min-height: 150px; }
  .auth-title { display: none; }
  .auth-main { align-items: start; padding: 28px 16px 40px; border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 520px) {
  .site-nav a:not(:last-child) { display: none; }
  .hero::after { background: linear-gradient(0deg, var(--ink) 6%, rgba(15, 23, 25, .78) 46%, rgba(15, 23, 25, 0) 72%), linear-gradient(180deg, rgba(15, 23, 25, .8) 0%, rgba(15, 23, 25, 0) 14%); }
  .store-links .btn, .hero-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
