:root {
  --ink: #0d1d1a;
  --muted: #4b615c;
  --paper: #f6f8f2;
  --paper-2: #fffdf7;
  --paper-warm: #fff5e8;
  --line: #aac4ba;
  --teal: #0b4f43;
  --teal-dark: #06372f;
  --mint: #5eaf83;
  --blue: #173f5f;
  --blue-dark: #0b263a;
  --amber: #bd741e;
  --amber-soft: #f6e3c8;
  --red: #9f312d;
  --red-soft: #f2d8d6;
  --shadow: 0 24px 70px rgb(8 38 34 / 16%);
  --strong-shadow: 0 38px 100px rgb(5 18 16 / 34%);
  --radius: 8px;
  --control-radius: 5px;
  --max: 1180px;
  --gutter: 32px;
  --font-body: "Source Sans 3", Aptos, "Segoe UI", Arial, sans-serif;
  --font-heading: "Source Serif 4", Georgia, serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgb(11 79 67 / 8%) 1px, transparent 1px),
    linear-gradient(180deg, rgb(189 116 30 / 7%) 1px, transparent 1px),
    var(--paper);
  background-size: 58px 58px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

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

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  top: -80px;
  left: 16px;
  z-index: 40;
  border-radius: var(--control-radius);
  background: var(--ink);
  color: var(--paper-2);
  padding: 10px 14px;
}

.skip-link:focus {
  top: 16px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgb(13 29 26 / 14%);
  background: rgb(250 252 247 / 94%);
  padding: 0 max(16px, calc((100vw - var(--max)) / 2));
  backdrop-filter: blur(18px);
}

.brand {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 210px;
  color: var(--ink);
  font-weight: 900;
  line-height: 1.05;
  text-decoration: none;
}

.brand img {
  width: 56px;
  height: 42px;
  object-fit: contain;
}

.app-header nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 850;
}

.app-header nav a {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  text-decoration: none;
}

.hero {
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(360px, 0.7fr);
  align-items: center;
  gap: clamp(32px, 6vw, 78px);
  padding: clamp(52px, 7vw, 96px) max(16px, calc((100vw - var(--max)) / 2));
  background:
    linear-gradient(90deg, rgb(255 255 255 / 7%) 1px, transparent 1px),
    linear-gradient(180deg, rgb(255 255 255 / 7%) 1px, transparent 1px),
    radial-gradient(circle at 78% 18%, rgb(189 116 30 / 18%), transparent 28%),
    linear-gradient(116deg, #051f1b 0%, #073c33 48%, #092b42 100%);
  background-size: 52px 52px, 52px 52px, 100% 100%, auto;
  color: #f7fbf7;
}

.eyebrow {
  margin: 0 0 13px;
  color: var(--teal);
  font-size: 0.8125rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero .eyebrow,
.proof-console .console-head {
  color: #86d3ad;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.04;
  text-wrap: balance;
}

h1,
h2 {
  font-family: var(--font-heading);
  letter-spacing: 0;
}

h1 {
  max-width: 13ch;
  font-size: clamp(3rem, 7vw, 6.2rem);
  line-height: 0.95;
}

h2 {
  max-width: 18ch;
  font-size: clamp(2.1rem, 4.5vw, 4rem);
  line-height: 1;
}

h3 {
  font-size: 1.35rem;
}

p {
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.hero-copy p:not(.eyebrow) {
  max-width: 62ch;
  color: rgb(232 242 238 / 82%);
  font-size: clamp(1.125rem, 1.6vw, 1.3125rem);
  line-height: 1.62;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--control-radius);
  padding: 12px 18px;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms var(--ease), box-shadow 180ms var(--ease), background 180ms var(--ease), border-color 180ms var(--ease);
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgb(8 38 34 / 14%);
}

.button.primary {
  background: var(--teal-dark);
  color: var(--paper-2);
}

.hero .button.primary {
  background: #f7fbf7;
  color: var(--teal-dark);
}

.button.secondary {
  border-color: rgb(255 255 255 / 46%);
  color: #f7fbf7;
}

.button.compact {
  background: var(--ink);
  color: var(--paper-2);
  white-space: nowrap;
}

.proof-console,
.workspace-panel,
.qr-panel,
.form-shell,
.table-card,
.map-grid article,
.admin-grid article,
.stats-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(255 253 247 / 96%);
  box-shadow: var(--shadow);
}

.proof-console {
  position: relative;
  overflow: hidden;
  color: var(--ink);
  padding: clamp(22px, 3vw, 32px);
  box-shadow: var(--strong-shadow);
}

.proof-console::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, var(--teal), var(--amber), var(--blue));
}

.console-head {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 6px rgb(94 175 131 / 18%);
}

.proof-console dl,
.lock-list {
  margin: 22px 0 0;
  display: grid;
  gap: 10px;
}

.proof-console dl div,
.lock-list div {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1fr);
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

dt {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 850;
}

dd {
  margin: 0;
  font-weight: 850;
}

.section {
  width: min(var(--max), calc(100% - var(--gutter)));
  margin: 0 auto;
  padding: clamp(72px, 8vw, 118px) 0;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1fr);
  gap: clamp(22px, 5vw, 72px);
  align-items: end;
  margin-bottom: 34px;
}

.section-heading p:not(.eyebrow) {
  max-width: 68ch;
  color: var(--muted);
  font-size: 1.1875rem;
}

.map-grid,
.admin-grid,
.stats-grid {
  display: grid;
  gap: 14px;
}

.map-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.map-grid article,
.admin-grid article,
.stats-grid article {
  position: relative;
  overflow: hidden;
  padding: 24px;
}

.map-grid article {
  border-top: 5px solid var(--amber);
}

.map-grid article span {
  color: var(--amber);
  font-size: 0.875rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.map-grid p,
.admin-grid p {
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.48fr);
  gap: clamp(18px, 3vw, 32px);
}

.workspace-panel,
.qr-panel,
.form-shell,
.table-card {
  padding: clamp(20px, 3vw, 32px);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.compact-heading {
  display: block;
}

.cohort-form,
.evaluation-form fieldset,
.admin-grid {
  display: grid;
  gap: 14px;
}

.cohort-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 850;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--paper-2);
  color: var(--ink);
  padding: 12px 13px;
}

textarea {
  resize: vertical;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgb(189 116 30 / 34%);
  outline-offset: 2px;
}

.cohort-form .button {
  align-self: end;
}

.qr-panel {
  align-self: start;
}

.qr-canvas {
  width: 184px;
  height: 184px;
  margin: 0 auto 22px;
  border: 1px solid var(--line);
  background: var(--paper-2);
}

.link-box {
  display: grid;
  gap: 10px;
}

.form-section {
  width: 100%;
  max-width: none;
  background:
    linear-gradient(90deg, rgb(255 255 255 / 6%) 1px, transparent 1px),
    linear-gradient(180deg, rgb(255 255 255 / 6%) 1px, transparent 1px),
    linear-gradient(135deg, var(--blue-dark), #102f45 58%, var(--teal-dark));
  background-size: 56px 56px, 56px 56px, auto;
}

.form-shell {
  width: min(920px, calc(100% - var(--gutter)));
  margin: 0 auto;
}

.form-meta {
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
}

.form-meta p:not(.eyebrow) {
  color: var(--muted);
}

.evaluation-form {
  display: grid;
  gap: 22px;
  margin-top: 22px;
}

fieldset {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0;
  padding: 18px;
}

legend {
  padding: 0 8px;
  color: var(--teal-dark);
  font-weight: 900;
}

.rating-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.7fr);
  gap: 16px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.rating-row:first-of-type {
  border-top: 0;
}

.rating-row > span {
  font-weight: 850;
}

.rating-scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(42px, 1fr));
  gap: 7px;
}

.rating-scale label {
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--paper-2);
  cursor: pointer;
}

.rating-scale input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.rating-scale label:has(input:checked) {
  border-color: var(--teal-dark);
  background: var(--teal-dark);
  color: var(--paper-2);
}

.declaration {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.declaration input {
  width: 44px;
  min-width: 44px;
  height: 44px;
  margin-top: 0;
}

.form-message {
  margin: 0;
  color: var(--teal-dark);
  font-weight: 900;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 20px;
}

.stats-grid span {
  display: block;
  color: var(--teal-dark);
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 800;
  line-height: 1;
}

.stats-grid p {
  margin: 10px 0 0;
  color: var(--muted);
  font-weight: 850;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

th,
td {
  border-top: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--teal-dark);
  font-weight: 900;
}

.admin-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-grid article:nth-child(1) {
  border-top: 5px solid var(--teal);
}

.admin-grid article:nth-child(2) {
  border-top: 5px solid var(--amber);
}

.admin-grid article:nth-child(3) {
  border-top: 5px solid var(--blue);
}

footer {
  width: min(var(--max), calc(100% - var(--gutter)));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border-top: 1px solid var(--line);
  padding: 36px 0 52px;
  color: var(--muted);
}

footer img {
  width: 76px;
}

footer p {
  max-width: 680px;
  margin: 0;
  font-size: 0.9375rem;
}

footer a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--teal-dark);
  font-weight: 900;
}

@media (max-width: 980px) {
  .app-header {
    position: static;
    flex-direction: column;
    align-items: flex-start;
    padding: 14px max(16px, calc((100vw - var(--max)) / 2));
  }

  .app-header nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .hero,
  .workspace,
  .section-heading {
    grid-template-columns: 1fr;
  }

  .map-grid,
  .stats-grid,
  .admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  :root {
    --gutter: 24px;
  }

  body {
    font-size: 1rem;
  }

  .hero {
    min-height: auto;
    padding-top: 38px;
    padding-bottom: 46px;
  }

  h1 {
    font-size: clamp(2.45rem, 12vw, 3.7rem);
  }

  h2 {
    font-size: clamp(2rem, 9vw, 2.9rem);
  }

  .hero-actions .button,
  .cohort-form .button {
    width: 100%;
  }

  .map-grid,
  .stats-grid,
  .admin-grid,
  .cohort-form,
  .rating-row {
    grid-template-columns: 1fr;
  }

  .proof-console dl div,
  .lock-list div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .panel-heading,
  .table-actions,
  footer {
    flex-direction: column;
    align-items: stretch;
  }
}
