/* ==========================================================================
   Tarjan Place — design tokens
   ========================================================================== */
:root {
  /* palette */
  --ink-900: #0c1411;
  --ink-800: #14201c;
  --ink-700: #1d2c27;
  --ink-500: #45564f;
  --ink-400: #63736c;
  --paper: #fbfaf7;
  --paper-2: #f2f0ea;
  --paper-3: #e9e5db;
  --line: #e0dbd0;
  --line-strong: #cec8ba;

  --brand-700: #123a32;
  --brand-600: #18544a;
  --brand-500: #1f6b5c;
  --brand-300: #79a79b;
  --brand-100: #dcece7;
  --brass-600: #96743f;
  --brass-500: #b08b52;
  --brass-100: #f4ead9;

  --pos: #1f6b5c;
  --neg: #a4453a;
  --warn-bg: #fdf3e0;
  --warn-line: #e3c68d;

  /* typography */
  --font-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-sans: "Inter Tight", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --t-xs: 0.75rem;
  --t-sm: 0.8125rem;
  --t-base: 0.9375rem;
  --t-md: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --t-lg: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
  --t-xl: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  --t-2xl: clamp(1.875rem, 1.5rem + 1.7vw, 2.75rem);
  --t-3xl: clamp(2.5rem, 1.8rem + 3.4vw, 4.25rem);

  /* space scale (4px base) */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 2.5rem;
  --s-8: 3.5rem;
  --s-9: 5rem;
  --s-10: 7rem;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(12, 20, 17, 0.05), 0 4px 14px rgba(12, 20, 17, 0.04);
  --shadow-md: 0 2px 6px rgba(12, 20, 17, 0.05), 0 18px 44px rgba(12, 20, 17, 0.08);
  --shadow-lg: 0 30px 70px rgba(12, 20, 17, 0.16);

  --max: 1200px;
  --max-prose: 68ch;
  --header-h: 72px;
}

/* ==========================================================================
   Base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-800);
  font-family: var(--font-sans);
  font-size: var(--t-md);
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 var(--s-3);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: var(--ink-900);
  text-wrap: balance;
}

h1 {
  font-size: var(--t-3xl);
}

h2 {
  font-size: var(--t-2xl);
}

h3 {
  font-size: var(--t-xl);
}

h4 {
  font-family: var(--font-sans);
  font-size: var(--t-md);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

p {
  margin: 0 0 var(--s-4);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--brand-600);
  text-decoration: none;
}

a:hover {
  color: var(--brand-500);
}

:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 3px;
  border-radius: 4px;
}

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--paper-3);
  padding: 0.1em 0.38em;
  border-radius: 5px;
}

/* ==========================================================================
   Layout primitives
   ========================================================================== */
.container {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}

.container--narrow {
  width: min(100% - 2.5rem, 760px);
}

.section {
  padding-block: var(--s-8);
}

.section--tight {
  padding-block: var(--s-7);
}

.section--dark {
  background: var(--ink-900);
  color: #dfe6e2;
}

.section--dark h2,
.section--dark h3 {
  color: #fff;
}

.section--paper {
  background: var(--paper-2);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-6);
}

.section-head p {
  margin: var(--s-2) 0 0;
  color: var(--ink-400);
  max-width: 52ch;
}

.eyebrow {
  margin: 0 0 var(--s-3);
  font-family: var(--font-sans);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass-600);
}

.section--dark .eyebrow {
  color: var(--brass-500);
}

.lead {
  font-size: var(--t-lg);
  line-height: 1.55;
  color: var(--ink-500);
  max-width: 58ch;
}

.section--dark .lead {
  color: #b9c7c1;
}

.fine-print {
  font-size: var(--t-sm);
  color: var(--ink-400);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--brand-600);
  color: #fff;
  padding: var(--s-2) var(--s-4);
  border-radius: 0 0 var(--r-sm) 0;
}

.skip-link:focus {
  left: 0;
  color: #fff;
}

/* ==========================================================================
   Media / image placeholders
   ========================================================================== */
.media {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--paper-3);
  aspect-ratio: var(--media-ratio, 16 / 9);
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-flag {
  position: absolute;
  left: var(--s-3);
  bottom: var(--s-3);
  padding: 0.15rem 0.5rem;
  border-radius: var(--r-pill);
  background: rgba(12, 20, 17, 0.62);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}

/* ==========================================================================
   Header / nav
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 250, 247, 0.82);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.site-header.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: 0 6px 24px rgba(12, 20, 17, 0.05);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  color: inherit;
}

.brand-mark {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(150deg, var(--brand-500), var(--brand-700));
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.brand-text {
  display: grid;
  line-height: 1.15;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.28rem;
  letter-spacing: -0.015em;
  color: var(--ink-900);
}

.brand-domain {
  font-size: var(--t-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-400);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--s-1);
}

.nav-link {
  position: relative;
  padding: 0.45rem 0.7rem;
  border-radius: var(--r-pill);
  font-size: var(--t-base);
  font-weight: 500;
  color: var(--ink-500);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-link:hover {
  color: var(--ink-900);
  background: rgba(31, 107, 92, 0.07);
}

.nav-link.is-active {
  color: var(--brand-700);
  background: var(--brand-100);
}

.nav-divider {
  width: 1px;
  height: 22px;
  margin-inline: var(--s-2);
  background: var(--line-strong);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--ink-800);
  font: 500 var(--t-base) / 1 var(--font-sans);
  cursor: pointer;
}

.nav-toggle-bars {
  display: grid;
  gap: 3px;
}

.nav-toggle-bars span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: currentColor;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.72rem 1.3rem;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-size: var(--t-base);
  font-weight: 600;
  letter-spacing: 0.005em;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--brand-600);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-700);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink-800);
}

.btn-ghost:hover {
  border-color: var(--brand-500);
  color: var(--brand-700);
}

.btn-on-dark {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.btn-on-dark:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.btn-sm {
  padding: 0.5rem 0.95rem;
  font-size: var(--t-sm);
}

.btn-block {
  width: 100%;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--t-base);
  font-weight: 600;
  color: var(--brand-600);
}

.text-link::after {
  content: "→";
  transition: transform 0.15s ease;
}

.text-link:hover::after {
  transform: translateX(3px);
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  padding-block: var(--s-9) var(--s-10);
  background: var(--ink-900);
  color: #e6ece9;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 90% at 78% 12%, rgba(31, 107, 92, 0.42), transparent 60%),
    radial-gradient(50% 60% at 8% 100%, rgba(176, 139, 82, 0.2), transparent 60%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--s-8);
  align-items: center;
}

.hero h1 {
  color: #fff;
  margin-bottom: var(--s-4);
}

.hero h1 em {
  font-style: italic;
  color: var(--brand-300);
}

.hero .lead {
  color: #b7c6c0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-6);
}

.hero-figure {
  position: relative;
}

.hero-figure .media {
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}

.hero-badge {
  position: absolute;
  bottom: calc(-1 * var(--s-5));
  left: calc(-1 * var(--s-4));
  display: grid;
  gap: 2px;
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-md);
  background: var(--paper);
  color: var(--ink-800);
  box-shadow: var(--shadow-md);
}

.hero-badge strong {
  font-family: var(--font-display);
  font-size: 1.7rem;
  line-height: 1;
  color: var(--brand-700);
}

.hero-badge span {
  font-size: var(--t-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-400);
}

/* page header (interior pages) */
.page-head {
  padding-block: var(--s-7) var(--s-6);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--paper-2), var(--paper));
}

.breadcrumb {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 var(--s-3);
  font-size: var(--t-sm);
  color: var(--ink-400);
}

.breadcrumb a {
  color: var(--ink-400);
}

.breadcrumb a:hover {
  color: var(--brand-600);
}

/* ==========================================================================
   Quick links
   ========================================================================== */
.quicklinks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-4);
  margin-top: calc(-1 * var(--s-8));
  position: relative;
  z-index: 3;
}

.quicklink {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  color: var(--ink-800);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.quicklink:hover {
  transform: translateY(-3px);
  border-color: var(--brand-300);
  box-shadow: var(--shadow-md);
  color: var(--ink-800);
}

.quicklink-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--brand-100);
  color: var(--brand-700);
}

.quicklink-icon svg {
  width: 18px;
  height: 18px;
}

.quicklink strong {
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 400;
  letter-spacing: -0.015em;
}

.quicklink span {
  font-size: var(--t-sm);
  color: var(--ink-400);
  line-height: 1.5;
}

/* ==========================================================================
   Cards / news
   ========================================================================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: var(--s-5);
}

.news-card {
  display: grid;
  gap: var(--s-4);
  color: inherit;
}

.news-card .media {
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.news-card:hover .media img {
  transform: scale(1.03);
}

.news-card .media img {
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.news-card h3 {
  font-size: var(--t-lg);
  margin-bottom: var(--s-2);
}

.news-card:hover h3 {
  color: var(--brand-700);
}

.news-card p {
  font-size: var(--t-base);
  color: var(--ink-400);
  margin: 0;
}

.meta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brass-600);
}

/* editorial list (news index) */
.article-list {
  display: grid;
  gap: var(--s-6);
}

.article-row {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--s-5);
  padding-bottom: var(--s-6);
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.article-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.article-row h2 {
  font-size: var(--t-xl);
  margin-block: var(--s-2) var(--s-2);
}

.article-row p {
  color: var(--ink-500);
  margin-bottom: var(--s-3);
}

/* article body */
.prose {
  max-width: var(--max-prose);
  font-size: var(--t-lg);
  line-height: 1.72;
  color: var(--ink-700);
}

.prose h2,
.prose h3 {
  margin-top: var(--s-6);
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose blockquote {
  margin: var(--s-6) 0;
  padding-left: var(--s-5);
  border-left: 3px solid var(--brass-500);
  font-family: var(--font-display);
  font-size: var(--t-xl);
  line-height: 1.35;
  color: var(--ink-800);
}

/* ==========================================================================
   Feature / amenity grid
   ========================================================================== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--s-6);
}

.feature h3 {
  font-size: var(--t-lg);
  margin-block: var(--s-4) var(--s-2);
}

.feature p {
  color: var(--ink-400);
  font-size: var(--t-base);
  margin: 0;
}

.section--dark .feature p {
  color: #9fb0aa;
}

.numbered {
  counter-reset: step;
}

.numbered .feature h3::before {
  counter-increment: step;
  content: "0" counter(step);
  display: block;
  margin-bottom: var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.1em;
  color: var(--brass-500);
}

/* ==========================================================================
   Metrics / finance
   ========================================================================== */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--s-4);
}

.metric {
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
}

.section--dark .metric {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.metric-label {
  margin: 0 0 var(--s-2);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-400);
}

.section--dark .metric-label {
  color: #8ea09a;
}

.metric-value {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1.4rem + 1.3vw, 2.35rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
}

.section--dark .metric-value {
  color: #fff;
}

.metric-sub {
  margin: var(--s-2) 0 0;
  font-size: var(--t-sm);
  color: var(--ink-400);
}

.metric-value--pos {
  color: var(--pos);
}

.metric-value--neg {
  color: var(--neg);
}

/* progress meter */
.meter {
  margin-top: var(--s-3);
}

.meter-track {
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--paper-3);
  overflow: hidden;
}

.section--dark .meter-track {
  background: rgba(255, 255, 255, 0.12);
}

.meter-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--brand-500), var(--brand-300));
}

.meter-legend {
  display: flex;
  justify-content: space-between;
  margin-top: var(--s-2);
  font-size: var(--t-xs);
  color: var(--ink-400);
  font-variant-numeric: tabular-nums;
}

.section--dark .meter-legend {
  color: #93a59f;
}

.callout {
  display: grid;
  gap: var(--s-2);
  margin-top: var(--s-6);
  padding: var(--s-5) var(--s-6);
  border-radius: var(--r-md);
  background: var(--brass-100);
  border: 1px solid #e8d6b4;
}

.callout h2,
.callout h3 {
  font-size: var(--t-lg);
  margin: 0;
}

.callout p {
  margin: 0;
  color: #6a5427;
}

/* ==========================================================================
   Documents
   ========================================================================== */
.docs-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--s-7);
  align-items: start;
}

.docs-rail {
  position: sticky;
  top: calc(var(--header-h) + var(--s-4));
  display: grid;
  gap: var(--s-1);
}

.rail-label {
  margin: 0 0 var(--s-2);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-400);
}

.rail-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: 0.55rem 0.8rem;
  border-radius: var(--r-sm);
  font-size: var(--t-base);
  font-weight: 500;
  color: var(--ink-500);
}

.rail-link:hover {
  background: var(--paper-2);
  color: var(--ink-900);
}

.rail-link.is-active {
  background: var(--brand-100);
  color: var(--brand-700);
  font-weight: 600;
}

.rail-count {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--ink-400);
}

.doc-search {
  position: relative;
  margin-bottom: var(--s-5);
}

.doc-search input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--paper);
  font: inherit;
  font-size: var(--t-base);
}

.doc-search svg {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--ink-400);
}

.doc-list {
  display: grid;
  gap: var(--s-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.doc-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.doc-item:hover {
  border-color: var(--brand-300);
  box-shadow: var(--shadow-sm);
}

.doc-icon {
  width: 40px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--brand-700);
}

.doc-title {
  margin: 0;
  font-weight: 600;
  font-size: var(--t-md);
  color: var(--ink-900);
}

.doc-meta {
  margin: 0.15rem 0 0;
  font-size: var(--t-sm);
  color: var(--ink-400);
}

.doc-desc {
  margin: 0.3rem 0 0;
  font-size: var(--t-sm);
  color: var(--ink-500);
}

.empty-state {
  display: grid;
  gap: var(--s-3);
  justify-items: start;
  padding: var(--s-7);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  background: var(--paper-2);
  color: var(--ink-500);
}

/* ==========================================================================
   Auth / forms
   ========================================================================== */
.auth-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - var(--header-h) - 220px);
  align-items: stretch;
}

.auth-visual {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--ink-900);
}

.auth-visual .media {
  height: 100%;
  border-radius: 0;
  aspect-ratio: auto;
  opacity: 0.55;
}

.auth-visual-copy {
  position: absolute;
  inset: auto var(--s-6) var(--s-6);
  color: #fff;
}

.auth-visual-copy p {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--t-xl);
  line-height: 1.2;
}

.auth-panel {
  display: grid;
  align-content: center;
  gap: var(--s-4);
  padding: var(--s-7) 0 var(--s-7) var(--s-8);
}

.form-card {
  display: grid;
  gap: var(--s-4);
  max-width: 420px;
}

.field {
  display: grid;
  gap: var(--s-2);
}

.field > span {
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--ink-700);
}

.field input {
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: #fff;
  font: inherit;
  font-size: var(--t-base);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(31, 107, 92, 0.14);
}

.form-error {
  margin: 0;
  padding: var(--s-3) var(--s-4);
  border: 1px solid #e8c2bc;
  border-radius: var(--r-sm);
  background: #fdeeec;
  color: #7f2f26;
  font-size: var(--t-base);
}

.banner {
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-sm);
  font-size: var(--t-base);
}

.banner--warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  color: #6f5520;
}

/* ==========================================================================
   Dashboard
   ========================================================================== */
.dash-head {
  padding-block: var(--s-7) var(--s-6);
  background: var(--ink-900);
  color: #dfe6e2;
}

.dash-head h1 {
  color: #fff;
  font-size: var(--t-2xl);
  margin-bottom: var(--s-2);
}

.dash-head .lead {
  color: #a9bab4;
  font-size: var(--t-md);
}

.dash-user {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  padding: 0.35rem 0.85rem 0.35rem 0.35rem;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.07);
  font-size: var(--t-sm);
  color: #cfdcd7;
}

.avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brass-500);
  color: #1c1405;
  font-size: var(--t-xs);
  font-weight: 700;
}

.dash-metrics {
  margin-top: var(--s-5);
}

.dash-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: var(--s-4);
  margin-bottom: var(--s-4);
}

.panel {
  padding: var(--s-5) var(--s-6);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}

.panel-head h2 {
  font-size: var(--t-lg);
  margin: 0;
}

.panel-head p {
  margin: 0;
  font-size: var(--t-sm);
  color: var(--ink-400);
}

.chart-holder {
  position: relative;
  min-height: 260px;
}

.stat-rows {
  display: grid;
  gap: 0;
  margin: 0;
}

.stat-rows > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  padding-block: 0.6rem;
  border-bottom: 1px solid var(--line);
}

.stat-rows > div:last-child {
  border-bottom: 0;
}

.stat-rows dt {
  font-size: var(--t-base);
  color: var(--ink-500);
}

.stat-rows dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-900);
}

.stat-rows .is-total dt,
.stat-rows .is-total dd {
  font-weight: 700;
  color: var(--brand-700);
}

.table-wrap {
  overflow-x: auto;
  margin-inline: calc(-1 * var(--s-6));
  padding-inline: var(--s-6);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-base);
}

.data-table th {
  padding: 0 0.7rem 0.6rem;
  border-bottom: 1px solid var(--line-strong);
  text-align: left;
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-400);
  white-space: nowrap;
}

.data-table td {
  padding: 0.7rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: var(--paper-2);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.badge {
  display: inline-block;
  padding: 0.12rem 0.55rem;
  border-radius: var(--r-pill);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge--revenue {
  background: var(--brand-100);
  color: var(--brand-700);
}

.badge--expense {
  background: #fae7e4;
  color: #883a30;
}

.badge--reserve {
  background: #e6e9f6;
  color: #3a4780;
}

.badge--other {
  background: var(--paper-3);
  color: var(--ink-500);
}

.text-pos {
  color: var(--pos);
}

.text-neg {
  color: var(--neg);
}

/* ==========================================================================
   CTA strip
   ========================================================================== */
.cta {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--s-6);
  padding: var(--s-7);
  border-radius: var(--r-lg);
  background: linear-gradient(120deg, var(--brand-700), var(--brand-500));
  color: #fff;
}

.cta h2 {
  color: #fff;
  margin-bottom: var(--s-2);
}

.cta p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  max-width: 54ch;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  margin-top: var(--s-9);
  padding-top: var(--s-8);
  background: var(--ink-900);
  color: #9fb0aa;
  font-size: var(--t-base);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: var(--s-7);
  padding-bottom: var(--s-7);
}

.site-footer .brand-name,
.footer-label {
  color: #fff;
}

.footer-label {
  margin: 0 0 var(--s-3);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.footer-links {
  display: grid;
  gap: var(--s-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  color: #9fb0aa;
}

.footer-links a:hover {
  color: #fff;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  justify-content: space-between;
  padding-block: var(--s-4);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: var(--t-sm);
  color: #7d8f89;
}

.footer-bottom p {
  margin: 0;
}

/* ==========================================================================
   Motion
   ========================================================================== */
/* Only hide pre-animation content when JS is available to reveal it again. */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1040px) {
  .quicklinks {
    grid-template-columns: repeat(2, 1fr);
  }

  .dash-grid,
  .auth-split {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    padding: var(--s-6) 0 0;
  }

  .auth-visual {
    min-height: 220px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 880px) {
  :root {
    --header-h: 64px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: var(--s-3);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--paper);
    box-shadow: var(--shadow-md);
  }

  .site-nav.is-open {
    display: flex;
  }

  .nav-link {
    padding: 0.65rem 0.8rem;
    border-radius: var(--r-sm);
  }

  .nav-divider {
    width: auto;
    height: 1px;
    margin: var(--s-2) 0;
  }

  .hero {
    padding-block: var(--s-7) var(--s-9);
  }

  .hero-grid,
  .docs-layout,
  .article-row,
  .cta {
    grid-template-columns: 1fr;
  }

  .docs-rail {
    position: static;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    padding-bottom: var(--s-2);
  }

  .rail-label {
    display: none;
  }

  .rail-link {
    border: 1px solid var(--line);
    white-space: nowrap;
  }

  .hero-badge {
    left: var(--s-4);
    bottom: calc(-1 * var(--s-4));
  }
}

@media (max-width: 560px) {
  .quicklinks {
    grid-template-columns: 1fr;
    margin-top: calc(-1 * var(--s-7));
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--s-6);
  }

  .doc-item {
    grid-template-columns: auto 1fr;
  }

  .doc-item .btn {
    grid-column: 2;
    justify-self: start;
  }

  .table-wrap {
    margin-inline: calc(-1 * var(--s-5));
    padding-inline: var(--s-5);
  }
}
