/* Elmtowers design system — shared by elmtowers.com, auth. and dashboard.
   White canvas, near-black ink, graphite feature surfaces. Inter Tight for display, Inter for text.
   No accent colour: hierarchy comes from scale, space and soft surfaces. Pill buttons, rounded cards. */

@font-face { font-family: "Elm Sans"; src: url("/fonts/hanken.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Elm Serif"; src: url("/fonts/serif.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Elm Serif"; src: url("/fonts/serif-italic.woff2") format("woff2"); font-weight: 300 700; font-style: italic; font-display: swap; }

:root {
  color-scheme: light;
  /* Ivory canvas, slate ink, a sans for headings and a serif for reading (after anthropic.com). */
  --ivory: #faf9f5;
  --ivory-2: #f0eee6;
  --oat: #e3dacc;
  --clay: #d97757;
  --sage: #bcd1ca;
  --heather: #cbcadb;
  --canvas: #faf9f5;
  --paper: #fffefb;           /* raised surface */
  --wash: #f0eee6;            /* sunken fill */
  --line: rgba(20, 20, 19, 0.1);
  --line-strong: rgba(20, 20, 19, 0.2);
  --ink: #141413;
  --ink-2: #3d3d3a;           /* body copy */
  --muted: #87867f;           /* captions, labels */
  --faint: #b0aea5;           /* disabled, decoration */
  --green: #5f8f5c;
  --blue: #6a9bcc;
  --display: "Elm Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sans: "Elm Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Elm Serif", Georgia, "Times New Roman", serif;
  --graphite: #141413;
  --r: 8px;
  --r-lg: 12px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow: 0 1px 2px rgba(20, 20, 19, 0.04), 0 24px 60px -32px rgba(20, 20, 19, 0.22);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--canvas); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
body {
  margin: 0; min-height: 100vh;
  background: var(--canvas); color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, h4, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
::selection { background: var(--ink); color: var(--canvas); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding-inline: clamp(20px, 4vw, 40px); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Type ---------- */
.eyebrow { font: 500 13px/1.2 var(--sans); color: var(--muted); }
.display { font-family: var(--display); font-weight: 500; letter-spacing: -0.03em; line-height: 1; text-wrap: balance; }
.display em, .h1 em, .serif { font-style: normal; }
.h1 { font-family: var(--display); font-weight: 500; font-size: clamp(34px, 4.2vw, 52px); line-height: 1.04; letter-spacing: -0.025em; text-wrap: balance; }
.h2 { font-family: var(--display); font-weight: 500; font-size: clamp(30px, 4vw, 48px); line-height: 1.05; letter-spacing: -0.035em; text-wrap: balance; }
.h3 { font: 500 16px/1.35 var(--sans); letter-spacing: -0.01em; }
.title { font-family: var(--display); font-weight: 500; font-size: 24px; line-height: 1.15; letter-spacing: -0.025em; }
.lede { font-family: var(--serif); font-size: 19px; line-height: 1.55; color: var(--ink-2); max-width: 54ch; text-wrap: pretty; }
.small { font-size: 14px; color: var(--muted); }
.muted { color: var(--muted); }
.link { border-bottom: 1px solid var(--line-strong); transition: border-color 0.2s; }
.link:hover { border-color: var(--ink); }

/* Logo: elm mark + wordmark. The mark is the favicon, drawn as a mask so it takes currentColor. */
.brand { display: inline-flex; align-items: center; gap: 9px; font: 600 16px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: inherit; }
.brand::before { content: ""; width: 19px; height: 23px; flex: none; background: currentColor; -webkit-mask: url("/favicon.svg") center / contain no-repeat; mask: url("/favicon.svg") center / contain no-repeat; transition: transform 0.6s var(--ease); }
.brand:hover::before { transform: rotate(-8deg) scale(1.06); }
.brand__crumb { font: 500 14px/1 var(--sans); letter-spacing: 0; text-transform: none; color: var(--muted); padding-left: 12px; margin-left: 2px; border-left: 1px solid var(--line-strong); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 46px; padding: 0 22px;
  border: 1px solid var(--ink); border-radius: 8px;
  background: var(--ink); color: var(--canvas);
  font-size: 15px; font-weight: 500; letter-spacing: -0.005em; line-height: 1; white-space: nowrap;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease), opacity 0.2s;
}
.btn:hover { background: #2b2b29; border-color: #2b2b29; }
.btn:active { transform: translateY(0) scale(0.98); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }
.btn--line { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--line:hover { background: var(--wash); border-color: var(--line-strong); }
.btn--ghost { background: transparent; color: var(--ink); border-color: transparent; }
.btn--ghost:hover { background: var(--wash); border-color: transparent; }
.btn--danger { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--danger:hover { background: var(--ink); color: var(--canvas); }
.btn--sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn--block { width: 100%; }
.btn .arrow { transition: transform 0.3s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px;
  border: 2px solid var(--canvas); border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite;
}
.btn--line.is-loading::after, .btn--ghost.is-loading::after, .btn--danger.is-loading::after { border-color: var(--ink); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.field { display: grid; gap: 8px; }
.field + .field { margin-top: 20px; }
.field__label { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; font-weight: 500; }
.field__label a, .field__label button { font-weight: 400; font-size: 13px; color: var(--muted); background: none; border: 0; padding: 0; border-bottom: 1px solid var(--line); }
.field__label a:hover, .field__label button:hover { color: var(--ink); border-color: var(--ink); }
.input {
  width: 100%; height: 48px; padding: 0 16px;
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--r);
  font-size: 16px; transition: border-color 0.2s, box-shadow 0.2s;
}
.input::placeholder { color: var(--faint); }
.input:hover { border-color: rgba(20, 20, 19, 0.36); }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(20, 20, 19, 0.07); }
.input[readonly] { background: var(--wash); color: var(--muted); border-color: var(--line); }
.field.is-error .input { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(20, 20, 19, 0.12); }
.field__hint { font-size: 13px; color: var(--muted); }
.pw { position: relative; }
.pw .input { padding-right: 70px; }
.pw__toggle { position: absolute; right: 6px; top: 7px; height: 34px; padding: 0 12px; border: 0; background: none; font-size: 13px; color: var(--muted); border-radius: 6px; }
.pw__toggle:hover { color: var(--ink); background: var(--wash); }

.strength { display: flex; gap: 4px; margin-top: 2px; }
.strength span { flex: 1; height: 3px; border-radius: 2px; background: var(--line); transition: background 0.25s; }
.strength[data-level="1"] span:nth-child(-n+1) { background: var(--faint); }
.strength[data-level="2"] span:nth-child(-n+2) { background: var(--muted); }
.strength[data-level="3"] span:nth-child(-n+3) { background: var(--ink-2); }
.strength[data-level="4"] span:nth-child(-n+4) { background: var(--ink); }

/* Notices: weight and an icon carry the meaning, not colour. */
.notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 16px; border-radius: var(--r); font-size: 14px; line-height: 1.5;
  background: var(--wash); border: 1px solid var(--line); color: var(--ink-2);
}
.notice[hidden] { display: none; }
.notice--bad { background: var(--paper); border-color: var(--ink); color: var(--ink); font-weight: 500; }
.notice--bad::before { content: "!"; flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: var(--ink); color: var(--canvas); font: 600 12px/18px var(--sans); text-align: center; }
.notice--ok { background: var(--paper); border-color: var(--line-strong); color: var(--ink); }
.notice--ok::before { content: ""; flex: none; width: 8px; height: 8px; margin: 7px 5px 0; border-radius: 50%; background: var(--green); }
.notice--warn { background: var(--wash); }

/* ---------- Chips: neutral pills, a coloured dot carries status ---------- */
.chip {
  --dot: var(--faint);
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px 0 9px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--paper);
  font: 500 12px/1 var(--sans); letter-spacing: 0; color: var(--ink-2); white-space: nowrap;
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dot); }
.chip--ok { --dot: var(--green); }
.chip--info { --dot: var(--blue); }
.chip--early { --dot: var(--ink); }
.chip--plain::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--faint); }

/* ---------- Surfaces ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

.avatar {
  --s: 36px; width: var(--s); height: var(--s); border-radius: 50%; flex: none; overflow: hidden;
  display: grid; place-items: center; background: var(--wash); color: var(--ink);
  font: 500 calc(var(--s) * 0.38)/1 var(--sans); border: 1px solid var(--line);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Column grid, drawn behind marketing/brand surfaces */
.lines { display: none; }
.lines__in { height: 100%; max-width: 1240px; margin: 0 auto; padding-inline: clamp(20px, 4vw, 40px); }
.lines__in > div { height: 100%; background: repeating-linear-gradient(90deg, rgba(20, 20, 19, 0.045) 0 1px, transparent 1px 25%); border-right: 1px solid rgba(20, 20, 19, 0.045); }
@media (max-width: 760px) { .lines__in > div { background: repeating-linear-gradient(90deg, rgba(20, 20, 19, 0.045) 0 1px, transparent 1px 50%); } }

@media (prefers-reduced-motion: no-preference) {
  .rv { opacity: 0; transform: translate3d(0, 24px, 0); transition: opacity 0.9s var(--ease), transform 1.1s var(--ease); transition-delay: var(--d, 0s); }
  .rv.is-in { opacity: 1; transform: none; }
  html:not(.js) .rv { opacity: 1; transform: none; }
}
