/* Boulder Factory's team website: the welcome's wall (warm ink with bolt holes), paper titles, the gold capsule. */
:root {
  --ink: #120f0d;
  --ink-2: #1b1714;
  --ink-3: #26201c;
  --line: rgba(242, 235, 222, 0.1);
  --line-strong: rgba(242, 235, 222, 0.18);
  --paper: #f2ebde;
  --muted: #b8ada1;
  --faint: #8a8076;
  --gold: #f5ad21;
  --go: #3cc07c;
  --warn: #f0b43c;
  --stop: #f06060;
  --calm: #6e9be0;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--ink);
  color: var(--paper);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 28px; line-height: 1.15; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.num { font-variant-numeric: tabular-nums; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
[hidden] { display: none !important; }

/* The wall: bolt holes on warm ink. */
.wall {
  background-color: var(--ink);
  background-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.55) 0 2.2px, rgba(242, 235, 222, 0.07) 2.6px 3.4px, transparent 3.8px);
  background-size: 44px 44px;
  background-position: 22px 22px;
}

/* Buttons */
button { font: inherit; color: inherit; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--ink-3); color: var(--paper); font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: rgba(242, 235, 222, 0.32); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .nav a:focus-visible, .list-row:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--stop); }
.btn.quiet { background: none; border-color: transparent; color: var(--muted); padding: 0 10px; }
.btn.quiet:hover { color: var(--paper); }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn.big { min-height: 52px; font-size: 17px; width: 100%; }
.btn:disabled { opacity: 0.45; cursor: default; filter: none; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Fields */
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--paper); background: var(--ink); border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 10px 12px; min-height: 44px;
}
textarea { min-height: 160px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--faint); }
.hint { font-size: 13px; color: var(--faint); font-weight: 400; }
.error { color: var(--stop); font-weight: 600; }
.segmented { display: inline-flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; padding: 3px; gap: 3px; border-radius: 999px; background: var(--ink); border: 1px solid var(--line-strong); }
.segmented button { white-space: nowrap; flex: none; border: 0; background: none; color: var(--muted); font-weight: 600; padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.segmented button[aria-pressed=true] { background: var(--paper); color: var(--ink); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--paper); font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--gold); }

/* Login */
.login { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.login-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 22px; }
.login-card h1 { font-size: 34px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: 0.02em; }
.brand img { width: 40px; height: 40px; border-radius: 10px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.providers { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.provider-slot { display: flex; justify-content: center; min-height: 44px; }
.apple-btn { background: var(--paper); color: #000; border-color: var(--paper); }

/* Shell */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 18px; padding: 22px 14px; border-right: 1px solid var(--line); background: var(--ink); }
.side .brand { padding: 0 8px; font-size: 15px; }
.side .brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; text-decoration: none; }
.nav a:hover { color: var(--paper); background: var(--ink-2); }
.nav a[aria-current=page] { color: var(--paper); background: var(--ink-3); }
.nav svg { width: 18px; height: 18px; flex: none; }
.account { margin-top: auto; padding: 12px; border-radius: 12px; background: var(--ink-2); display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.account b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { min-width: 0; padding: 28px 32px 64px; }
.page { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 14px; }

/* Cards and lists */
.card { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--ink-2); }
.list-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--paper); text-decoration: none; }
.list-row:first-child { border-top: 0; }
a.list-row:hover { background: var(--ink-3); text-decoration: none; }
.list-row .main-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list-row .main-text b, .ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .side-text { text-align: right; font-size: 13px; color: var(--muted); flex: none; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--ink-3); color: var(--muted); white-space: nowrap; }
.badge.go { color: var(--go); background: rgba(60, 192, 124, 0.12); }
.badge.warn { color: var(--warn); background: rgba(240, 180, 60, 0.12); }
.badge.stop { color: var(--stop); background: rgba(240, 96, 96, 0.12); }
.badge.calm { color: var(--calm); background: rgba(110, 155, 224, 0.12); }
.badge.gold { color: var(--ink); background: var(--gold); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar input[type=search] { max-width: 420px; }
.loading { display: flex; justify-content: center; padding: 48px; color: var(--muted); }

/* Stats */
.big-number { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 160px; padding-top: 8px; }
.bars .bar { flex: 1; min-width: 2px; display: flex; flex-direction: column-reverse; border-radius: 3px 3px 0 0; overflow: hidden; background: var(--ink-3); position: relative; }
.bars .bar span { display: block; }
.bars .bar:hover { outline: 1px solid var(--line-strong); }
.axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.k-monthly { background: var(--gold); }
.k-pack { background: var(--calm); }
.k-single { background: var(--stop); }
.meter { height: 8px; border-radius: 999px; background: var(--ink-3); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--gold); }

/* News */
.news-card { display: grid; grid-template-columns: 160px 1fr; gap: 16px; }
.thumb { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: var(--ink-3); display: block; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.media-item { position: relative; border-radius: 10px; overflow: hidden; background: var(--ink-3); aspect-ratio: 1; }
.media-item img, .media-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-item .tools { position: absolute; inset: auto 6px 6px 6px; display: flex; gap: 4px; justify-content: flex-end; }
.media-item .tools button { background: rgba(18, 15, 13, 0.85); border: 1px solid var(--line-strong); border-radius: 999px; width: 30px; height: 30px; cursor: pointer; display: grid; place-items: center; }
.media-item .tag { position: absolute; top: 6px; left: 6px; }
.media-item .progress { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(18, 15, 13, 0.6); font-weight: 700; }
.drop { background: none; border: 1.5px dashed var(--line-strong); border-radius: 10px; display: grid; place-items: center; aspect-ratio: 1; color: var(--muted); cursor: pointer; text-align: center; padding: 10px; font-weight: 600; }
.drop:hover { color: var(--paper); border-color: var(--muted); }
.body-text { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Dialog */
dialog { border: 1px solid var(--line-strong); border-radius: 18px; background: var(--ink-2); color: var(--paper); padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
dialog.wide { width: min(860px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.dialog-body { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding-top: 4px; }

/* Toast */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--paper); color: var(--ink); padding: 12px 18px; border-radius: 999px; font-weight: 600; transition: opacity 0.2s, transform 0.2s; max-width: calc(100vw - 32px); z-index: 10; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--stop); color: #fff; }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; z-index: 5; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; gap: 8px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .brand span, .account { display: none; }
  .nav { flex-direction: row; }
  .nav a { padding: 8px 10px; white-space: nowrap; }
  .nav a .label { display: none; }
  .nav a[aria-current=page] .label { display: inline; }
  .side .menu-account { display: inline-flex; margin-left: auto; }
  .main { padding: 20px 16px 48px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .news-card { grid-template-columns: 1fr; }
  .list-row .side-text { display: none; }
  h1 { font-size: 24px; }
}
.side .menu-account { display: none; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation-duration: 0.01ms !important; } }
