/* Field — Gary Husler's house style for his own apps, dashboards and tools.
   One file: fonts, light and dark tokens, element defaults, core components.
   Copy this file and assets/fonts/ into a project, keeping the relative path. */

/* ---------- Fonts (self-hosted, variable, OFL) ---------- */
@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("assets/fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("assets/fonts/schibsted-grotesk-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("assets/fonts/public-sans-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("assets/fonts/public-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Public Sans"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("assets/fonts/public-sans-latin-wght-italic.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- Tokens: light (default) ---------- */
:root {
  color-scheme: light;
  --font-display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Public Sans", "Helvetica Neue", Arial, sans-serif;

  --page: #FFFFFF;          /* page background */
  --raised: #FFFFFF;        /* panels and inputs sit on the page with a border, not a fill */
  --raised-2: #FFFFFF;      /* inputs */
  --band: #16201C;          /* the one strong block per screen */
  --band-text: #FFFFFF;
  --band-text-2: #C9D3CF;
  --text: #16201C;          /* green-black ink */
  --text-2: #4A5651;        /* secondary text, captions, table headers */
  --rule: #D3DBD7;          /* row dividers */
  --rule-strong: #16201C;   /* table header underline, thick section rules */
  --field: #8A9590;         /* input and secondary-button borders */
  --accent: #00745A;        /* teal-green: primary buttons, selected states, links, focus */
  --accent-hover: #005E49;
  --on-accent: #FFFFFF;
  --wash: #E5F1EC;          /* selected/available fills inside components; never a section background */
  --wash-hover: #CFE5DB;
  --bar-base: #C9D3CF;      /* baseline/comparison series in charts */
  --alert: #B3261E;         /* needs attention */
  --alert-wash: #FBE9E7;
  --good: #00745A;
  --backdrop: #EDEFEE;      /* only behind framed screens in specimens */

  --radius-btn: 6px;
  --radius-panel: 0;
  --leaf-lg: clamp(64px, 9vw, 120px);  /* the one rounded corner on photos: bottom left */
  --leaf-sm: 40px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: 160ms;
}

/* ---------- Tokens: dark ("Field, dark") ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #111714; --raised: #1A221E; --raised-2: #222B27;
    --band: #1A221E; --band-text: #EEF2EF; --band-text-2: #9DAAA4;
    --text: #EEF2EF; --text-2: #9DAAA4;
    --rule: #2C3631; --rule-strong: #9DAAA4; --field: #3A4741;
    --accent: #3FCF9A; --accent-hover: #5ADBAA; --on-accent: #0B1210;
    --wash: #173A2E; --wash-hover: #1E4A3B; --bar-base: #4A5751;
    --alert: #FF8A78; --alert-wash: #3A1F1B; --good: #3FCF9A; --backdrop: #0A0F0D;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #111714; --raised: #1A221E; --raised-2: #222B27;
  --band: #1A221E; --band-text: #EEF2EF; --band-text-2: #9DAAA4;
  --text: #EEF2EF; --text-2: #9DAAA4;
  --rule: #2C3631; --rule-strong: #9DAAA4; --field: #3A4741;
  --accent: #3FCF9A; --accent-hover: #5ADBAA; --on-accent: #0B1210;
  --wash: #173A2E; --wash-hover: #1E4A3B; --bar-base: #4A5751;
  --alert: #FF8A78; --alert-wash: #3A1F1B; --good: #3FCF9A; --backdrop: #0A0F0D;
}

/* ---------- Element defaults ---------- */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--page); color: var(--text);
  font-family: var(--font-body); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .display, .wordmark {
  font-family: var(--font-display); font-weight: 800; letter-spacing: -0.03em; line-height: 1.04;
  margin: 0; text-wrap: balance;
}
h1 { font-size: clamp(40px, 5vw, 60px); }
h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
h3 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0; max-width: 64ch; }
a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--wash); color: var(--text); }
button, input, select, textarea { font: inherit; color: inherit; }
.num, table, .stat { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.small { font-size: 15px; }

/* ---------- Name mark ---------- */
.wordmark { font-size: 22px; letter-spacing: -0.035em; color: var(--text); text-decoration: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px; border: 0; border-radius: var(--radius-btn);
  background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 17px;
  cursor: pointer; text-decoration: none; transition: background-color var(--dur) var(--ease);
}
.btn:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-line {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 14px; border-radius: var(--radius-btn);
  border: 1px solid var(--field); background: transparent; color: var(--text);
  font-size: 15px; font-weight: 600; cursor: pointer; transition: border-color var(--dur) var(--ease);
}
.btn-line:hover { border-color: var(--text); }
.btn-text { background: none; border: 0; padding: 0 4px; height: 38px; color: var(--text); font-size: 15px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.btn[disabled], .btn-line[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- Forms ---------- */
.field-label { display: block; font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.input, .select, .textarea {
  display: block; width: 100%; height: 44px; padding: 0 12px;
  border: 1px solid var(--field); border-radius: 0; background: var(--raised-2); color: var(--text); font-size: 16px;
}
.textarea { height: auto; min-height: 88px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.hint { font-size: 14px; color: var(--text-2); margin-top: 6px; }
.error { font-size: 14px; color: var(--alert); margin-top: 6px; }

/* Switch: square-cornered, on = accent. Label it with what "on" means ("Taking new bookings"). */
.switch { position: relative; width: 46px; height: 26px; flex: none; border: 0; border-radius: var(--radius-btn);
  background: var(--bar-base); cursor: pointer; transition: background-color var(--dur) var(--ease); }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 4px;
  background: #FFFFFF; transition: transform var(--dur) var(--ease); }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }

/* ---------- Choice chips (time slots, calendar days) ---------- */
.slot { height: 42px; border: 1px solid var(--field); border-radius: var(--radius-btn); background: transparent;
  color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; cursor: pointer; }
.slot:hover { border-color: var(--text); }
.slot[aria-pressed="true"], .slot.is-selected { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.day { width: 36px; height: 36px; border-radius: var(--radius-btn); border: 0; background: transparent; color: var(--text-2);
  font-variant-numeric: tabular-nums; }
.day.is-free { background: var(--wash); color: var(--text); font-weight: 600; cursor: pointer; }
.day.is-free:hover { background: var(--wash-hover); }
.day.is-selected { background: var(--accent); color: var(--on-accent); }

/* ---------- Surfaces ---------- */
/* .band is the ONE strong block per screen (ink in light, raised in dark). Do not repeat it. */
.band { background: var(--band); color: var(--band-text); border-radius: var(--radius-panel); }
.band .muted { color: var(--band-text-2); }
.panel { background: var(--raised); border: 1px solid var(--rule); border-radius: var(--radius-panel); padding: 24px; }
:root[data-theme="dark"] .panel { border-color: transparent; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .panel { border-color: transparent; } }
.rows > * + * { border-top: 1px solid var(--rule); }

/* ---------- Photos ---------- */
/* Real photographs of the work. One large rounded corner, bottom left. No gradients or tints over photos;
   text on a photo sits on a solid block (.photo-caption) overlapping its lower edge. */
.photo { display: block; width: 100%; height: auto; object-fit: cover; border-radius: 0 0 0 var(--leaf-lg); }
.photo-sm { border-radius: 0 0 0 var(--leaf-sm); }
.photo-wrap { position: relative; }
.photo-caption { position: absolute; right: 0; bottom: -24px; max-width: 70%; background: var(--band); color: var(--band-text);
  padding: 18px 22px; font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.2; letter-spacing: -0.02em; }

/* ---------- Numbers ---------- */
/* One dominant number per screen. Everything around it is smaller and denser. */
.stat-hero { font-family: var(--font-display); font-weight: 800; font-size: clamp(96px, 13vw, 172px); line-height: .8;
  letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.stat { font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 1; letter-spacing: -0.03em; }
.stat-label { font-size: 15px; color: var(--text-2); margin-top: 6px; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 14px; font-weight: 600; color: var(--text-2); padding: 0 12px 8px;
  border-bottom: 1px solid var(--rule-strong); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--rule); }
.table th:first-child, .table td:first-child { padding-left: 0; }
.table .r { text-align: right; }
.table-wrap { overflow-x: auto; }

/* ---------- Tags and flags ---------- */
.tag { display: inline-block; font-size: 14px; font-weight: 600; background: var(--wash); color: var(--text); padding: 2px 10px; line-height: 1.5; }
.flag { display: inline-block; font-size: 13px; font-weight: 600; color: var(--alert); border: 1.5px solid currentColor; padding: 1px 7px; line-height: 1.5; }

/* ---------- Charts ---------- */
.bar-base { fill: var(--bar-base); background: var(--bar-base); }
.bar-now { fill: var(--accent); background: var(--accent); }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}
