/* App shell on the Industry design system (../ds/industry.css).
   Colors, type, spacing and shadows come from its tokens only. */

/* v2: a gray ground (neutral-200) with content on lifted neutral-100
   surfaces. --header-h keeps sticky things and anchor jumps clear of the
   sticky header. */
:root {
  --ground: var(--color-neutral-200);
  --surface: var(--color-neutral-100);
  --header-h: 56px;
  --sticky-top: calc(var(--header-h) + 24px);
}

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body { background: var(--ground); }

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--ground);
}

a { color: var(--color-accent-700); }
a:hover { color: var(--color-accent-800); }

/* Lucide icons, thin-stroke per the system */
.i {
  display: block; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}

.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--color-neutral-700); }
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.kicker {
  margin: 0;
  font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--color-accent-700);
}
.kicker--icon { display: flex; align-items: center; gap: 6px; }
.label-caps {
  margin: 0;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-neutral-700);
}

mark { background: var(--color-accent-200); color: inherit; }

/* Links styled as buttons keep the button's colours (the global a:hover
   above would otherwise repaint them). */
a.btn, a.btn:hover { color: var(--color-text); }
a.btn-primary, a.btn-primary:hover { color: var(--color-bg); }
a.btn-ghost, a.btn-ghost:hover { color: var(--color-accent); }
.btn-primary { transition: box-shadow .15s, background-color .15s; }
.btn-primary:hover:not(:disabled) { box-shadow: var(--shadow-md); }
.btn-icon--sm { width: 28px; height: 28px; }
.btn-wide { width: 100%; padding: 10px 12px; }
.btn-danger:hover { border-color: var(--color-neutral-800); }

/* ---------- Header ------------------------------------------------------ */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--color-neutral-100) 82%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
  box-shadow: 0 1px 0 var(--color-divider), var(--shadow-sm);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header { background: var(--color-neutral-100); }
}

.site-nav {
  max-width: 1440px; margin: 0 auto; padding: 0 32px;
  height: 56px; gap: 32px;
}

.site-nav .site-nav__brand {
  margin-right: 0;
  font-size: 20px; letter-spacing: -0.01em;
  color: var(--color-text);
}
.site-nav .site-nav__brand:hover { color: var(--color-text); }

.site-nav__links {
  display: flex; gap: 28px;
  align-self: stretch; margin-right: auto;
}
.site-nav__links a { display: flex; align-items: center; white-space: nowrap; }
.site-nav__links a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--color-accent); }

.site-nav .site-nav__auth {
  color: var(--color-neutral-800);
  font-family: var(--font-body); font-weight: 400;
}
.site-nav .site-nav__auth:hover { color: var(--color-neutral-800); }

@media (max-width: 720px) {
  /* The header wraps to two rows here; don't pin it, it would eat the screen. */
  :root { --header-h: 0px; --sticky-top: 16px; }
  .site-header { position: static; }
  .site-nav {
    flex-wrap: wrap; height: auto;
    padding: 10px 16px 0; gap: 4px 16px;
  }
  .site-nav .site-nav__auth { margin-left: auto; }
  .site-nav__links {
    order: 3; width: 100%; gap: 20px;
    min-height: 40px; margin-right: 0;
  }
}

/* ---------- Footer ------------------------------------------------------ */

.site-footer { border-top: 1px solid var(--color-divider); }
.site-footer__inner {
  max-width: 1440px; margin: 0 auto; padding: 16px 32px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 12px; color: var(--color-neutral-700);
}

/* ---------- Page -------------------------------------------------------- */

.page {
  flex: 1; width: 100%; max-width: 1440px;
  margin: 0 auto; padding: 40px 32px 56px;
}

.display {
  font-size: 60px; line-height: 0.95;
  margin: 8px 0 12px; letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .page { padding: 24px 16px 40px; }
  .site-footer__inner { padding: 16px; }
  .display { font-size: 40px; }
}

/* A framed notice (auth errors etc.) */
.notice {
  background: var(--surface); box-shadow: var(--shadow-lg);
  max-width: 560px; margin: 24px auto;
  padding: 28px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
}
.notice h2 { margin: 0; }
.notice p { margin: 0; }
.notice__detail { font-size: 14px; overflow-wrap: anywhere; }

/* ---------- Tooltips ([data-tip]) ---------------------------------------- */
/* Drawn only while hovered/focused, so a hidden tip never takes space. */

[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  display: none;
  position: absolute; bottom: calc(100% + 6px); left: 50%; z-index: 60;
  padding: 4px 8px;
  background: var(--color-accent-900); color: var(--color-bg);
  font: 500 12px/1.3 var(--font-body); letter-spacing: 0; text-transform: none;
  white-space: nowrap; pointer-events: none;
  box-shadow: var(--shadow-md);
  transform: translateX(-50%);
  animation: tip-in .12s ease-out .35s both;
}
[data-tip][data-tip-pos="end"]::after { left: auto; right: 0; transform: none; }
[data-tip][data-tip-pos="start"]::after { left: 0; transform: none; }
@media (hover: hover) { [data-tip]:hover::after { display: block; } }
[data-tip]:focus-visible::after { display: block; animation-delay: 0s; }
@keyframes tip-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Toast + flash messages -------------------------------------- */

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 1100;
  display: flex; gap: 8px; align-items: center;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  background: var(--color-accent-900); color: var(--color-bg);
  font-size: 13px; box-shadow: var(--shadow-lg);
  overflow-wrap: anywhere;
  opacity: 0; pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity .16s, transform .16s;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.flash-stack {
  position: fixed; right: 20px; bottom: 20px; z-index: 1100;
  display: grid; gap: 8px; max-width: min(420px, calc(100vw - 40px));
}
.flash {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 6px 8px 14px;
  background: var(--color-accent-900); color: var(--color-bg);
  font-size: 13px; box-shadow: var(--shadow-lg);
  animation: flash-in .25s ease-out, flash-out .4s ease-in 6s forwards;
}
.flash > span { flex: 1; }
.flash--error { background: var(--color-neutral-900); animation: flash-in .25s ease-out; }
.flash .flash__close { width: 28px; height: 28px; color: var(--color-bg); }
.flash .flash__close:hover { background: color-mix(in srgb, var(--color-bg) 14%, transparent); }
@keyframes flash-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes flash-out { to { opacity: 0; transform: translateY(8px); visibility: hidden; } }

@media (prefers-reduced-motion: reduce) {
  [data-tip]::after, .flash, .toast { animation: none; transition: none; }
}
