/* Brand: DIVINE.md chapter 12 (indicatrix® palette). */
@font-face {
  font-family: "Inter";
  src: url("fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --brand-primary: #16877F;
  --brand-dark: #11665F;
  --brand-light: #E8F4F2;
  --background: #F8F9FA;
  --surface: #FFFFFF;
  --text-primary: #222222;
  --text-secondary: #666666;
  --border: #E0E0E0;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  color: var(--text-primary);
  background: var(--background);
  font: 400 15px/1.6 "Inter", sans-serif;
}

.wrap { width: min(1100px, 100% - 2.5rem); margin-inline: auto; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2xl); align-items: center; }

/* Dark teal for text: enough contrast on the light background. */
a { color: var(--brand-dark); }
h1, h2, h3 { font-weight: 600; line-height: 1.25; letter-spacing: -0.015em; margin: 0 0 var(--space-md); }
h1 { font-size: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
strong { font-weight: 600; }

.top { position: sticky; top: 0; z-index: 1; background: var(--surface); border-bottom: 1px solid var(--border); }
.top .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-sm) var(--space-xl); padding-block: var(--space-md); }
.logo { color: var(--brand-primary); font-weight: 700; font-size: 40px; line-height: 1.1; letter-spacing: -0.035em; text-transform: lowercase; text-decoration: none; }
.logo sup { font-size: .35em; vertical-align: top; position: relative; top: .3em; letter-spacing: 0; }
nav { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-lg); }
nav a { color: var(--text-secondary); text-decoration: none; font-size: 14px; font-weight: 500; }
nav a:hover { color: var(--brand-dark); }

section { padding-block: 5rem; }
.alt { background: var(--surface); border-block: 1px solid var(--border); }
.lead { font-size: 16px; color: var(--text-secondary); }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-md); margin-top: var(--space-xl); }

.btn { display: inline-block; padding: 10px 20px; border: 1px solid var(--brand-primary); border-radius: var(--radius-md); background: var(--brand-primary); color: #fff; font: inherit; font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--brand-dark); }
.btn.ghost:hover { background: var(--brand-light); border-color: var(--brand-primary); }

.areas { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.areas li:last-child { border-bottom: 0; }
.tools { color: var(--text-secondary); }
.tools { font-size: 12px; }

form { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); margin-top: var(--space-xl); }
label { display: flex; flex-direction: column; gap: var(--space-xs); font-size: 14px; font-weight: 500; }
input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: inherit; font: inherit; }
:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.full { grid-column: 1 / -1; }
#status { margin: 0; white-space: pre-wrap; }

footer { padding-block: var(--space-xl); color: var(--text-secondary); font-size: 14px; }
footer .logo { font-size: 20px; margin-right: var(--space-sm); }

@media (max-width: 760px) {
  .split, form { grid-template-columns: 1fr; }
  .top .logo { font-size: 32px; }
  html { scroll-padding-top: 7rem; }
  section { padding-block: 3.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.areas li { padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--border); }

.tool { display: grid; grid-template-columns: 340px 1fr; height: calc(100vh - 82px); }
.panel { overflow-y: auto; padding: var(--space-lg); background: var(--surface); border-inline-end: 1px solid var(--border); }
.panel h1 { font-size: 24px; }
.panel form { grid-template-columns: 1fr 1fr; margin-top: var(--space-lg); }
.panel #status { margin: var(--space-md) 0; }
#log { padding-inline-start: 1.2rem; font-size: 13px; color: var(--text-secondary); }
.map-area { position: relative; min-width: 0; }
#map { height: 100%; }
/* Above the map panes and controls of Leaflet. */
.map-actions { position: absolute; top: var(--space-md); right: var(--space-md); z-index: 1000; display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-sm); }
.map-actions .ghost, .map-actions .ghost:hover { background: var(--surface); }
#note { margin: 0; max-width: 280px; padding: var(--space-sm) var(--space-md); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); font-size: 13px; overflow-wrap: anywhere; }
.account { max-width: 480px; padding-block: var(--space-2xl); }
.account section { margin-bottom: var(--space-2xl); padding: 0; }
.trap { position: absolute; left: -9999px; }
#map.drawing { cursor: crosshair; touch-action: none; }
.stats { width: 100%; margin-top: var(--space-md); border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.stats td, .stats th { padding: 6px 0; border-bottom: 1px solid var(--border); text-align: end; }
.stats td:first-child, .stats th:first-child { text-align: start; }
.swatch { display: inline-block; width: 12px; height: 12px; margin-inline-end: 6px; vertical-align: -1px; }
.btn:disabled { opacity: .5; cursor: default; }
[hidden] { display: none !important; }

@media (max-width: 760px) {
  .tool { grid-template-columns: 1fr; height: auto; }
  .panel { border-inline-end: 0; order: 2; }
  #map { height: 60vh; }
  .map-actions { top: auto; bottom: var(--space-xl); }
}

.choices { display: flex; flex-wrap: wrap; gap: var(--space-md); margin-bottom: var(--space-sm); }
label.choice { flex-direction: row; align-items: center; gap: var(--space-xs); margin-bottom: var(--space-sm); }
.choice input { width: auto; }
#ramp { margin-bottom: var(--space-md); }
#ramp > div { height: 10px; border-radius: var(--radius-sm); }
#ramp p { display: flex; justify-content: space-between; margin: var(--space-xs) 0 0; }

.lang { position: relative; font-size: 14px; font-weight: 500; }
.lang summary { cursor: pointer; color: var(--text-secondary); }
.lang ul { position: absolute; inset-inline-end: 0; z-index: 1100; margin: var(--space-sm) 0 0; padding: var(--space-xs) 0; list-style: none; min-width: 10rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.lang a { display: block; padding: var(--space-xs) var(--space-md); text-decoration: none; color: var(--text-primary); }
.lang a:hover { background: var(--brand-light); }
/* The brand name reads left to right in every language. */
.logo { direction: ltr; unicode-bidi: isolate; }
.top nav { margin-inline-start: auto; }
.split p { max-width: 60ch; }
