/* Stag Hunt. Gilt engravings on graded hunter-green cloth. IM Fell for names, a clean sans for work. */
:root {
  --white: #0F1914;
  --tint: #16231B;
  --line: #2B3B31;
  --ink: #ECE5D3;
  --muted: #9DA799;
  --gold: #C9A65F;
  --gold-line: #C9A65F;
  --gold-text: #E4C886;
  --wash: #1E2C1F;
  --danger: #E8907E;
  --deep: #070D0A;
  --glow: #1B2B21;

  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 72px; --s7: 112px;
  --t-note: 15px; --t-body: 17px; --t-lede: 20px; --t-title: clamp(32px, 3.6vw, 44px);
  --r: 6px;
  --page: 1080px;

  --serif: "IM Fell English", Georgia, "Times New Roman", serif;
  --title: "IM Fell English SC", "IM Fell English", Georgia, serif;
  --sans: "Alegreya Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: radial-gradient(90% 70% at 72% 10%, var(--glow) 0%, transparent 60%), radial-gradient(140% 110% at 50% 30%, transparent 45%, var(--deep) 100%), var(--white); background-attachment: fixed; min-height: 100%; }
body { margin: 0; background: transparent; color: var(--ink); font: 400 var(--t-body)/1.55 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3, h4, p, figure, dl, dd, ul { margin: 0; }
ul { padding: 0; list-style: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: 0; line-height: 1.12; text-wrap: balance; }
h1 { font-size: var(--t-title); line-height: 1.05; }
h2 { font-size: 26px; }
h3 { font-size: var(--t-lede); }
a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--gold); }
em { font-family: var(--serif); font-style: italic; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
img { max-width: 100%; display: block; }
body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 60; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); opacity: .07; mix-blend-mode: soft-light; }

.wrap { max-width: var(--page); margin: 0 auto; padding-left: max(var(--s3), env(safe-area-inset-left, 0px)); padding-right: max(var(--s3), env(safe-area-inset-right, 0px)); }
.g { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--s3); row-gap: var(--s4); }
.left { grid-column: 1 / span 6; min-width: 0; }
.right { grid-column: 7 / span 6; min-width: 0; }
.main { grid-column: 1 / span 8; min-width: 0; }
.side { grid-column: 9 / span 4; min-width: 0; }
.stack { display: grid; gap: var(--s2); align-content: start; }
.stack-lg { display: grid; gap: var(--s4); align-content: start; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.between { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s2); }
.end { justify-content: flex-end; }

.lede { font-size: var(--t-lede); line-height: 1.4; }
.note { font-size: var(--t-note); line-height: 1.45; color: var(--muted); }
.muted { color: var(--muted); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.prose { max-width: 64ch; white-space: pre-line; }

/* ornament: a hatched gilt rule */
.band { height: 5px; background: repeating-linear-gradient(45deg, rgba(201, 166, 95, 0.32) 0 1px, transparent 1px 5px); margin-bottom: var(--s5); }
.band-sm { margin-block: var(--s4); }

/* mark */
.mk { display: block; flex: none; }
.lockup { display: inline-flex; align-items: center; gap: 0.45em; text-decoration: none; }
.lockup .mk { height: 1.25em; width: auto; }
.wm { font-family: var(--title); font-weight: 400; letter-spacing: 0.01em; line-height: 1; white-space: nowrap; }

/* top bar: the one stable thing. Brand, places, the main action, your menu. */
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: rgba(15, 25, 20, 0.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--white); z-index: 21; }
.top { display: flex; align-items: center; gap: var(--s5); height: 64px; }
.top .lockup { font-size: 19px; }
.bar-actions { margin-left: auto; gap: var(--s2); flex-wrap: nowrap; }
.nav { display: flex; align-items: center; gap: var(--s4); font-size: 15px; color: var(--muted); }
.nav a { text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] { box-shadow: 0 1px 0 var(--gold); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--tint); display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--ink); flex: none; text-decoration: none; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; list-style: none; }
.avatar::-webkit-details-marker { display: none; }
.avatar:hover, .menu[open] > .avatar { box-shadow: inset 0 0 0 1px var(--gold); }
main { padding-block: var(--s5) var(--s6); min-height: 60vh; }

/* small dropdown menus: account, manage */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; min-width: 220px; background: var(--tint); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.6); padding: 6px; display: grid; }
.menu-right .menu-panel { left: auto; right: 0; }
details.menu > .menu-panel { margin-top: 0; }
.menu-who { display: grid; padding: 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; font-size: 14px; }
.menu-who span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.menu-item { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 6px; padding: 9px 12px; font: 400 15px/1.3 var(--sans); color: var(--ink); text-decoration: none; cursor: pointer; }
.menu-item:hover { background: var(--wash); }

/* wayfinding inside a page */
.back { display: inline-block; font-size: 14px; color: var(--muted); text-decoration: none; margin-bottom: var(--s2); }
.back:hover { color: var(--ink); }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--tint); border-radius: 8px; }
.tabs a { padding: 7px 14px; border-radius: 6px; font-size: 15px; color: var(--muted); text-decoration: none; }
.tabs a[aria-current="page"] { background: var(--white); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.count { font-family: var(--sans); font-size: 0.7em; font-weight: 400; color: var(--muted); margin-left: 4px; font-variant-numeric: tabular-nums; }
.caught-up { color: var(--muted); padding-block: var(--s2); }
.side-sticky { position: sticky; top: calc(64px + var(--s3)); align-self: start; }

/* deal page: read on the left, score on the right; on phones the score sits between the deal and its updates */
.deal-main { grid-column: 1 / span 8; grid-row: 1; min-width: 0; }
.deal-updates { grid-column: 1 / span 8; grid-row: 2; min-width: 0; }
.deal-layout > .side { grid-column: 9 / span 4; grid-row: 1 / span 2; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s1) var(--s3); padding-block: var(--s3) var(--s5); font-size: var(--t-note); color: var(--muted); }

/* page heading: title and one line on the left, the main action on the right, then the molding */
.head { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s4); row-gap: 6px; align-items: end; padding-bottom: var(--s3); }
.head > * { grid-column: 1; }
.head .lede { color: var(--muted); font-size: 18px; max-width: 60ch; }
.head-actions { grid-column: 2; grid-row: 1 / span 2; align-self: end; }
.section { padding-top: var(--s5); }
.section > h2, .section > .between { margin-bottom: var(--s2); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s1); font: 600 15px/1 var(--sans); border-radius: 6px; padding: 12px 20px; cursor: pointer; border: 1px solid transparent; text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--gold); color: var(--white); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; filter: none; }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-quiet:hover { border-color: var(--muted); }
.btn-small { padding: 8px 14px; font-size: 14px; }
.stack > .btn, .form > .btn { justify-self: start; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.link:hover { color: var(--ink); text-decoration-color: var(--gold); }
.link-danger:hover { color: var(--danger); }

/* forms */
.form { display: grid; gap: var(--s4); }
.form-section { display: grid; gap: var(--s2); }
.form-section > h2 { font-size: var(--t-lede); padding-bottom: var(--s1); border-bottom: 1px solid var(--line); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
.fields .wide { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; align-content: start; }
.field > span { font-weight: 600; font-size: 15px; }
.field small { font-size: 13px; color: var(--muted); }
input[type="text"], input[type="email"], input[type="url"], input[type="date"], input[type="number"], select, textarea {
  font: 400 var(--t-body)/1.4 var(--sans); color: var(--ink); background: var(--tint);
  border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; width: 100%;
}
textarea { min-height: 104px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #66715F; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 166, 95, 0.2); }
.check { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 12px; align-items: start; cursor: pointer; line-height: 1.45; }
.check input { accent-color: var(--gold); width: 18px; height: 18px; margin: 1px 0 0; }
.choices { display: flex; flex-wrap: wrap; gap: var(--s3); }
.choices label { display: inline-flex; gap: var(--s1); align-items: center; cursor: pointer; }
.choices input { accent-color: var(--gold); }
input[type="range"] { width: 100%; margin: 6px 0 0; accent-color: var(--gold); }
details > :not(summary) { margin-top: var(--s3); }
summary { cursor: pointer; }

.flash { padding: 12px var(--s2); border-radius: var(--r); background: var(--wash); color: var(--ink); }
.flash-error { background: #33201B; color: var(--danger); }

/* deals */
.deals { border-top: 1px solid var(--line); }
.band + .deals { border-top: 0; margin-top: calc(-1 * var(--s3)); }
.deal-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--s3); row-gap: 4px; padding-block: var(--s3); border-bottom: 1px solid var(--line); text-decoration: none; align-items: baseline; }
.deal-row:hover h2 { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 5px; text-decoration-thickness: 1px; }
.deal-row h2 { font-size: 24px; }
.deal-row .what { grid-column: 1 / span 5; display: grid; gap: 2px; }
.deal-row .what p { color: var(--muted); }
.deal-row .terms-line { grid-column: 6 / span 4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); font-size: 14px; color: var(--muted); }
.deal-row .score-cell { grid-column: 10 / span 3; justify-self: end; text-align: right; display: grid; gap: 2px; }
.terms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2) var(--s3); padding-block: var(--s3); border-block: 1px solid var(--line); }
.terms div { display: grid; gap: 2px; }
.terms dt { font-size: 13px; color: var(--muted); }
.terms dd { font: 500 18px/1.2 var(--mono); font-variant-numeric: tabular-nums; }
.block { display: grid; gap: 4px; }
.block h4 { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: var(--t-body); color: var(--muted); }
.tier { font-family: var(--serif); font-style: italic; font-size: var(--t-lede); line-height: 1.2; }
.t-hit, .t-prom { color: var(--gold-text); }
.t-pass { color: var(--muted); }
.big-num { font: 400 48px/0.9 var(--title); font-variant-numeric: tabular-nums; }
.big-num small { font-size: var(--t-lede); color: var(--muted); }
.panel { background: var(--tint); border-radius: var(--r); padding: var(--s3); display: grid; gap: var(--s3); align-content: start; }
.panel-quiet { border: 1px solid var(--line); border-radius: var(--r); padding: var(--s3); display: grid; gap: var(--s2); align-content: start; }
.reveal { background: var(--wash); border-radius: var(--r); padding: var(--s2) var(--s3); display: grid; gap: 4px; }
.crit { display: grid; gap: 2px; }
.crit-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); }
.crit-top label { font-weight: 600; font-size: 15px; }
.crit-top output { font: 500 18px/1 var(--mono); min-width: 2ch; text-align: right; }
.crit small { font-size: 13px; color: var(--muted); }
.thread { display: grid; gap: var(--s3); }
.post { display: grid; gap: 4px; padding-bottom: var(--s3); border-bottom: 1px solid var(--line); }
.status { font-size: var(--t-note); color: var(--muted); }

/* tables */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 400; font-size: 13px; color: var(--muted); padding: 0 var(--s2) 10px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px var(--s2) 14px 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.table td.r, .table th.r { text-align: right; padding-right: 0; }
.scroll { overflow-x: auto; }

/* summary figures above a table */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); padding-bottom: var(--s5); }
.stat { display: grid; gap: 6px; padding-left: var(--s3); border-left: 1px solid var(--line); }
.stat:first-child { padding-left: 0; border-left: 0; }
.stat b { font: 400 clamp(38px, 4.2vw, 52px)/0.95 var(--title); font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 15px; }

.empty { padding-block: var(--s6); display: grid; gap: var(--s2); justify-items: center; text-align: center; }
.empty p { color: var(--muted); max-width: 44ch; }
.empty .column { width: 132px; height: auto; margin-bottom: var(--s2); }

/* side art beside a form */
.side-art { display: grid; gap: var(--s2); justify-items: center; text-align: center; align-content: start; position: sticky; top: var(--s4); }
.side-art img { width: 100%; height: auto; }
.side-art .column { max-width: 150px; }
.side-art .column { max-width: 132px; }

/* landing: the name, the line and sign in beside a shining stag */
.bare main { padding: 0; min-height: 100vh; min-height: 100dvh; display: grid; }
.landing { max-width: var(--page); width: 100%; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--s5); align-items: center; align-content: center; padding-block: var(--s5); padding-left: max(var(--s3), env(safe-area-inset-left, 0px)); padding-right: max(var(--s3), env(safe-area-inset-right, 0px)); }
.landing-words { display: grid; gap: var(--s2); justify-items: start; }
.landing h1 { font: 400 clamp(48px, 6.4vw, 84px)/0.95 var(--title); letter-spacing: 0.01em; }
.subquote { font: italic 400 clamp(18px, 1.7vw, 21px)/1.4 var(--serif); color: var(--muted); max-width: 30ch; text-wrap: balance; margin-bottom: var(--s3); }
.landing-art { position: relative; justify-self: center; height: min(74vh, 580px); max-width: 100%; aspect-ratio: 1800 / 2124; }
.landing-art::before { content: ""; position: absolute; inset: -14%; border-radius: 50%; background: radial-gradient(closest-side, rgba(228, 200, 134, 0.26), rgba(201, 166, 95, 0.08) 55%, transparent); }
.landing-art .shine { position: relative; width: 100%; height: 100%; filter: drop-shadow(0 0 14px rgba(228, 200, 134, 0.55)) brightness(1.08); }
.landing-art .rabbit { position: absolute; left: -26%; bottom: 1%; width: 30%; height: auto; opacity: 0.7; }
.landing-words, .landing-art { animation: fade 1.2s ease-out both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* sign in: the seal beside a short form */
.auth { align-items: center; padding-block: var(--s5) var(--s6); }
.auth .seal { grid-column: 2 / span 4; justify-self: center; }
.auth .seal img { width: 100%; max-width: 320px; height: auto; }
.auth .right { grid-column: 7 / span 5; display: grid; gap: var(--s3); }
.auth .band-sm { margin-block: 0; }

@media (max-width: 900px) {
  .left, .right, .main, .side { grid-column: 1 / -1; }
  .side-art { position: static; }
  .side-sticky { position: static; }
  .deal-main, .deal-updates, .deal-layout > .side { grid-column: 1 / -1; grid-row: auto; }
  .deal-layout > .side { order: 2; }
  .deal-updates { order: 3; }
  .side-art .column { display: none; }
  .auth .seal { grid-column: 1 / -1; justify-self: start; }
  .auth .seal img { max-width: 96px; }
  .landing { grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
  .landing-art { order: -1; height: 300px; }
  .landing-art .rabbit { left: -34%; }
  .auth .right { grid-column: 1 / -1; }
  .deal-row .what, .deal-row .terms-line, .deal-row .score-cell { grid-column: 1 / -1; justify-self: start; text-align: left; }
}
@media (max-width: 640px) {
  .wrap { padding-left: max(var(--s2), env(safe-area-inset-left, 0px)); padding-right: max(var(--s2), env(safe-area-inset-right, 0px)); }
  .top { flex-wrap: wrap; height: auto; padding-block: 12px; row-gap: 10px; column-gap: var(--s2); }
  .nav { order: 3; width: 100%; gap: var(--s3); }
  main { padding-top: var(--s4); }
  .head { grid-template-columns: minmax(0, 1fr); }
  .head-actions { grid-column: 1; grid-row: auto; padding-top: var(--s1); }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .terms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* simple pages: one narrow column */
.narrow { max-width: 760px; }
.page-title { margin-bottom: var(--s4); }
.deal-row .what { grid-column: 1 / span 9; }
.deal-row .score-cell { grid-column: 10 / span 3; }
.score-it { color: var(--gold-text); font-weight: 500; }
.names li { padding-block: 12px; border-bottom: 1px solid var(--line); font-size: 18px; }
ol.rules { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; color: var(--muted); }

/* compact */
main { padding-block: var(--s4) var(--s5); }
.page-title { margin-bottom: var(--s3); }
.stack-lg { gap: var(--s3); }
.form { gap: var(--s2); }
.fields { gap: 12px var(--s2); }
.field { gap: 4px; }
.field > span { font-size: 14px; }
input[type="text"], input[type="email"], textarea { padding: 8px 12px; }
textarea { min-height: 84px; }
.panel { padding: var(--s2) var(--s3); gap: var(--s2); }
.crits { display: grid; grid-template-columns: 1fr 1fr; gap: 10px var(--s3); }
.crit-top label { font-size: 14px; }
.deal-row { padding-block: var(--s2); }
.names li { padding-block: 8px; }
.post { padding-bottom: var(--s2); }
.auth { padding-block: var(--s4); }
.auth .right { gap: var(--s2); }
.auth .seal img { max-width: 240px; }
.auth .band-sm { display: none; }
@media (max-width: 640px) { .crits { grid-template-columns: 1fr; } }
