/* craigh.com.au — shared styling.
   Lives at the site root and is linked with an ABSOLUTE path (/style.css)
   from every page. Relative paths broke once already: a page served at
   /bc/admin* resolved bc/style.css to /bc/bc/style.css and arrived unstyled. */

:root {
  --bg: #fbfaf8;
  --bg-tint: #f4f2ee;
  --surface: #ffffff;
  --border: #e6e3dd;
  --border-soft: #efece7;
  --text: #171614;
  --muted: #6b675f;
  --faint: #9a958c;
  --accent: #2f5d50;
  --accent-soft: #e8f0ed;
  --accent-text: #ffffff;
  --error: #9b2c2c;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(23, 22, 20, .04);
  --shadow: 0 1px 2px rgba(23, 22, 20, .04), 0 12px 32px rgba(23, 22, 20, .06);
  --shadow-lift: 0 2px 4px rgba(23, 22, 20, .05), 0 20px 48px rgba(23, 22, 20, .10);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131416;
    --bg-tint: #191b1e;
    --surface: #1d1f23;
    --border: #2f333a;
    --border-soft: #25282d;
    --text: #edebe8;
    --muted: #9c978f;
    --faint: #6d6963;
    --accent: #74b4a1;
    --accent-soft: #1d2b28;
    --accent-text: #0d1a17;
    --error: #ef938f;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 32px rgba(0, 0, 0, .3);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .4), 0 20px 48px rgba(0, 0, 0, .45);
  }
}

:root[data-theme="dark"] {
  --bg: #131416;
  --bg-tint: #191b1e;
  --surface: #1d1f23;
  --border: #2f333a;
  --border-soft: #25282d;
  --text: #edebe8;
  --muted: #9c978f;
  --faint: #6d6963;
  --accent: #74b4a1;
  --accent-soft: #1d2b28;
  --accent-text: #0d1a17;
  --error: #ef938f;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── header ─────────────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-soft);
}

.home {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px 6px 9px;
  margin-left: -9px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--text);
  text-decoration: none;
  transition: background .12s;
}

.home:hover { background: var(--bg-tint); }
.home svg { flex: none; opacity: .55; }
.home span { color: var(--faint); font-weight: 400; }

.topbar nav { display: flex; align-items: center; gap: 2px; }

.topbar nav a {
  padding: 6px 12px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: background .12s, color .12s;
}

.topbar nav a:hover { background: var(--bg-tint); color: var(--text); }
.topbar nav a.here { color: var(--text); font-weight: 500; }

/* ── layout ─────────────────────────────────────────────────────────── */

main {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 20px 72px;
}

main.centred {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 460px;
}

.lede { margin-bottom: 44px; }

.lede h1 {
  margin: 0 0 10px;
  font-size: clamp(30px, 6vw, 40px);
  font-weight: 640;
  letter-spacing: -.035em;
  line-height: 1.12;
}

.lede p {
  margin: 0;
  max-width: 46ch;
  font-size: 17px;
  color: var(--muted);
}

/* ── gates: the big choices on the home page ────────────────────────── */

.gates { display: grid; gap: 14px; }

@media (min-width: 620px) {
  .gates { grid-template-columns: 1fr 1fr; }
}

.gate {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 190px;
  padding: 26px 24px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.gate:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: var(--shadow-lift);
}

.gate .mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 18px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
}

.gate h2 {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 620;
  letter-spacing: -.02em;
}

.gate p {
  margin: 0;
  font-size: 14.5px;
  color: var(--muted);
}

.gate .go {
  margin-top: auto;
  padding-top: 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--accent);
}

.gate .go::after { content: " →"; }

.gate[aria-disabled="true"] {
  cursor: default;
  opacity: .62;
}

.gate[aria-disabled="true"]:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.gate[aria-disabled="true"] .go { color: var(--faint); }
.gate[aria-disabled="true"] .go::after { content: ""; }

/* ── cards ──────────────────────────────────────────────────────────── */

.card {
  width: 100%;
  padding: 36px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card h1 {
  margin: 0 0 8px;
  font-size: 25px;
  font-weight: 630;
  letter-spacing: -.025em;
}

.sub { margin: 0 0 28px; color: var(--muted); font-size: 15px; }
.sub:last-child { margin-bottom: 0; }

/* ── actions ────────────────────────────────────────────────────────── */

.actions { display: flex; flex-direction: column; gap: 10px; }

a.btn, button {
  display: block;
  width: 100%;
  padding: 13px 18px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .12s, opacity .12s, background .12s;
}

a.btn:hover, button:hover { border-color: var(--faint); background: var(--bg-tint); }

.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.primary:hover { opacity: .92; background: var(--accent); border-color: var(--accent); }
button:disabled { opacity: .5; cursor: default; }

/* ── identity strip ─────────────────────────────────────────────────── */

.who {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 26px;
  padding: 11px 14px;
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  background: var(--bg-tint);
  font-size: 13px;
  color: var(--muted);
}

.who b { font-weight: 500; color: var(--text); }
.who .dot {
  display: inline-block;
  width: 7px; height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 1px;
}

.who a {
  flex: none;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.who a:hover { color: var(--text); border-bottom-color: var(--faint); }
.who[hidden] { display: none; }

/* ── forms ──────────────────────────────────────────────────────────── */

label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

input {
  width: 100%;
  padding: 13px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* 16px stops iOS zooming on focus */
}

input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: transparent;
}

.msg { min-height: 22px; margin: 12px 0 0; font-size: 13.5px; color: var(--error); }

/* ── misc ───────────────────────────────────────────────────────────── */

.tag {
  display: inline-block;
  margin-bottom: 18px;
  padding: 4px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--faint);
}

.rule {
  margin: 26px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
  font-size: 13px;
  color: var(--muted);
}

.foot {
  padding: 0 20px 28px;
  text-align: center;
  font-size: 12.5px;
  color: var(--faint);
}

@media (max-width: 440px) {
  main { padding-top: 40px; }
  .card { padding: 28px 22px; }
}
