@font-face {
  font-family: "DM Sans";
  src: url("/assets/fonts/dm-sans.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("/assets/fonts/space-grotesk.ttf") format("truetype");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --font-body: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --ink: #192322;
  --navy: #1b262b;
  --paper: #edf0e9;
  --surface: #fdfcf6;
  --line: #c5cfc4;
  --muted: #4e5b55;
  --accent: #235746;
  --focus: #136649;
  --signal: #d5f54b;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; line-height: 1.55; accent-color: var(--accent); }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { color: #0b3829; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, p, dl { margin: 0; }
h1, h2 { font-family: var(--font-display); }
h1 { font-size: clamp(2.15rem, 5vw, 3.7rem); line-height: 1; letter-spacing: -.055em; }
h2 { font-size: 1.35rem; line-height: 1.25; letter-spacing: -.03em; }
small { color: var(--muted); font-size: .875rem; }

.skip-link {
  position: fixed; z-index: 10; inset: 1rem auto auto 1rem; transform: translateY(-200%);
  padding: .65rem 1rem; color: var(--ink); background: var(--signal); font-weight: 700;
}
.skip-link:focus { transform: none; }

.topbar { background: var(--navy); color: #f6f7ef; border-bottom: 1px solid #3e4a4b; }
.topbar-inner {
  display: flex; justify-content: space-between; align-items: center; gap: .75rem;
  max-width: 80rem; min-height: 4.5rem; margin: auto; padding: .5rem clamp(1rem, 4vw, 2.75rem);
}
.brand {
  display: inline-flex; gap: .65rem; align-items: center; color: #f6f7ef; text-decoration: none;
  font-family: var(--font-display); font-size: 1.28rem; font-weight: 500;
  letter-spacing: -.035em; white-space: nowrap;
}
.brand:hover { color: #fff; }
.brand strong { font-weight: 700; }
.brand-mark {
  width: 2rem; height: 2rem; display: flex; gap: .2rem; justify-content: center; align-items: center;
  border-radius: .35rem; background: var(--signal);
}
.brand-mark i { width: .17rem; border-radius: .18rem; background: #263627; height: .53rem; }
.brand-mark i:nth-child(2) { height: .96rem; }
.brand-mark i:nth-child(3) { height: .71rem; }
.account { display: flex; gap: .85rem; align-items: center; font-size: .9375rem; }
.main { max-width: 80rem; margin: auto; padding: 2.5rem clamp(1rem, 4vw, 2.75rem) 4rem; }

.signed-out { min-height: 100vh; background: #182126; }
.signed-out .topbar { background: #182126; border-color: #46504c; }
.signed-out .main { display: grid; align-items: center; padding-block: clamp(1.5rem, 7vh, 5rem); }
.access-layout {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  min-height: 33rem; overflow: hidden; border: 1px solid #515e53; border-radius: .9rem;
  background: var(--surface);
}
.access-visual {
  position: relative; display: flex; align-items: start; isolation: isolate; overflow: hidden;
  min-height: 15rem; padding: clamp(1.5rem, 4vw, 3.5rem);
  background: #27352c; color: #f5f6e9;
}
.access-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 58%; z-index: -2; }
.access-visual::after {
  position: absolute; inset: 0; z-index: -1; content: "";
  background: linear-gradient(150deg, #131d17f5, #18251ba6 31%, transparent 67%);
}
.access-title {
  font: 650 clamp(2.5rem, 5vw, 4.6rem) / .97 var(--font-display);
  letter-spacing: -.055em;
}
.login-card { align-self: center; width: 100%; padding: clamp(1.5rem, 5vw, 4.5rem); }
.login-card h1 { font-size: clamp(2.2rem, 4vw, 3.35rem); }
.page-header { display: flex; flex-wrap: wrap; gap: .8rem 1rem; align-items: center; margin-bottom: 1.45rem; }
.intro { color: var(--muted); margin: -.35rem 0 1.5rem; }
.form { display: grid; gap: .5rem; }
.form label { font-weight: 700; font-size: .9375rem; }
.form input + label, .form select + label, .form small + label { margin-top: .6rem; }
.form button { justify-self: start; margin-top: .85rem; }
.login-card .form button { width: 100%; }
.form-link { display: inline-flex; align-items: center; min-height: 2.75rem; margin-top: .65rem; }

input, select {
  width: 100%; min-height: 2.85rem; padding: .5rem .75rem; font: inherit; color: inherit;
  border: 1px solid #75877b; border-radius: .35rem; background-color: #fffefa;
}
select {
  appearance: none; padding-right: 2.2rem;
  background-image: linear-gradient(45deg, transparent 50%, #435a4d 50%), linear-gradient(135deg, #435a4d 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; cursor: pointer;
  padding: .5rem 1rem; font: inherit; font-size: .9375rem; font-weight: 750; line-height: 1.25;
  border: 1px solid transparent; border-radius: .35rem;
}
.button-primary { background: var(--signal); color: #1a2a1c; border-color: #93aa33; }
.button-primary:hover { background: #c1e03a; color: #142419; }
.button-secondary { background: var(--surface); border-color: #75877b; color: var(--ink); }
.button-secondary:hover { background: #e2e9dc; }
.button-quiet { background: transparent; color: #f6f7ef; border-color: #89948b; }
.button-quiet:hover { background: #364640; }
.topbar :focus-visible { outline-color: var(--signal); }

.context { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.context + .workspace { margin-top: 1.75rem; }
.breadcrumb { display: flex; gap: .65rem; align-items: center; font-weight: 700; }
.breadcrumb span { color: var(--muted); }
.selector, .actions { display: flex; gap: .65rem; align-items: center; flex-wrap: wrap; }
.selector label { color: var(--muted); font-size: .875rem; font-weight: 700; }
.selector select { width: auto; min-width: 7rem; min-height: 2.75rem; font-size: .9375rem; }
.tabs { display: flex; flex-wrap: wrap; gap: .25rem .6rem; border-bottom: 1px solid var(--line); margin: 1.25rem 0 1.75rem; }
.tabs a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: .5rem .65rem; text-decoration: none; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; }
.tabs a:hover, .tabs a[aria-current] { color: var(--accent); }
.tabs a[aria-current] { border-color: var(--accent); }
.simulation, .outcome {
  display: inline-block; padding: .2rem .6rem; border-radius: .25rem; font-size: .875rem; font-weight: 700;
}
.simulation { color: #37503e; background: #dce9d5; }
.outcome.success { background: #dcefdf; color: #215338; }
.outcome.rejected { background: #fae6e8; color: #7c2c3c; }
.outcome.uncertain { background: #f6ebcc; color: #685019; }

.catalog-heading {
  align-items: end; justify-content: space-between; padding: clamp(1rem, 3vw, 2.25rem) 0 1.5rem;
  margin-bottom: 1.75rem; border-bottom: 2px solid #46534a;
}
.catalog-heading .intro { margin: 0; max-width: 24rem; }
.catalog { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 1rem; }
.project-card {
  display: flex; flex-direction: column; gap: .85rem; padding: 1.25rem; background: var(--surface);
  border: 1px solid #b9c7ba; border-radius: .55rem;
}
.project-card-restaurant { background: #e3eada; border-color: #b1c1ad; }
.project-card header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.project-card header span { font-size: .875rem; color: var(--muted); }
.project-card h2 { font-size: clamp(1.55rem, 3vw, 2.25rem); }
.project-mark {
  display: grid; grid-template-columns: repeat(4, .23rem); place-content: center; place-items: center;
  gap: .18rem; width: 3.15rem; height: 3.15rem; border-radius: .35rem; background: #263c36;
}
.project-mark i { width: 100%; height: .8rem; border-radius: .24rem; background: #c3dfbe; }
.project-mark i:nth-child(2) { height: 1.38rem; }
.project-mark i:nth-child(3) { height: 1.02rem; }
.project-mark i:nth-child(4) { height: .49rem; }
.project-card-restaurant .project-mark { grid-template-columns: repeat(2, .62rem); gap: .24rem; background: #4b5942; }
.project-card-restaurant .project-mark i { height: .62rem; border-radius: .09rem; background: #e4eed5; }
.module-link {
  display: block; min-height: 6rem; margin-top: auto; padding: .8rem .75rem .65rem 0; color: var(--accent); text-decoration: none;
  border-top: 1px solid #aebead;
}
.module-link strong { text-decoration: underline; text-underline-offset: .22em; }
.module-link:hover strong { text-decoration-thickness: .15em; }
.module-link span { display: block; color: var(--muted); font-size: .9375rem; margin-top: .35rem; }

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: .75rem; margin-bottom: 2rem; }
.panel, .metrics > div, .table-panel, .empty { background: var(--surface); border: 1px solid var(--line); border-radius: .5rem; }
.metrics > div { padding: 1.1rem 1.25rem; border-top: .24rem solid #78a17e; }
.metrics dt, .details dt { color: var(--muted); font-weight: 700; font-size: .875rem; }
.metrics dd { margin: .3rem 0 0; font: 700 1.3rem / 1.25 var(--font-display); }
.details { display: grid; gap: .25rem; margin-bottom: 1.1rem; }
.details > div { display: flex; gap: .5rem 1rem; align-items: baseline; flex-wrap: wrap; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.details dt { min-width: 8.65rem; }
.details dd { margin: 0; font-weight: 650; }
.identifier { overflow-wrap: anywhere; }
.amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.panel { padding: clamp(1rem, 4vw, 1.5rem); }
.form-panel { max-width: 38rem; }
.form-panel .actions { margin-top: 1.1rem; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; margin-bottom: .65rem; }
.empty { padding: 1.05rem; color: var(--muted); }
.table-panel { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .9375rem; }
th, td { padding: .65rem .9rem; border-bottom: 1px solid var(--line); }
th { background: #e1e9dd; color: #304639; white-space: nowrap; }
tr:last-child td { border: 0; }
.pagination { margin-top: 1rem; }
.feedback { margin-bottom: 1rem; padding: .75rem 1rem; border-left: .25rem solid; border-radius: .28rem; font-size: .9375rem; }
.feedback-error { background: #fce9eb; border-color: #9e4b58; color: #7c2c3c; }
.feedback-notice { background: #e5f2eb; border-color: #44775b; color: #214e3b; }

@media (max-width: 49rem) {
  .access-layout { grid-template-columns: 1fr; min-height: 0; }
  .access-visual { min-height: 12rem; }
  .access-image { object-position: 50% 60%; }
  .login-card { max-width: 34rem; margin-inline: auto; }
}
@media (max-width: 35rem) {
  .topbar-inner { gap: .5rem; }
  .account { gap: .4rem; }
  .account span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .main { padding-top: 1.35rem; }
  .catalog-heading { align-items: start; flex-direction: column; }
  .tabs a { padding: .5rem; }
  th, td { padding: .6rem .7rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; }
}
