/* MyAdminDesk — traditional ledger, modern desk */

:root {
  --paper: #f3eee4;
  --paper-raised: #faf7f1;
  --paper-inset: #ebe4d6;
  --ink: #1a1714;
  --ink-muted: #5e574e;
  --navy: #173155;
  --navy-deep: #0e2240;
  --brass: #a67c2d;
  --brass-light: #c4a35a;
  --teal: #1b6b63;
  --teal-deep: #14544e;
  --rule: #d9d0c0;
  --rule-strong: #c4b8a4;
  --danger: #8b3a2a;
  --focus: #1b6b63;
  --shadow: 0 18px 40px rgba(23, 49, 85, 0.08);
  --radius: 4px;
  --header-h: 4.25rem;
  --font-serif: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, "Times New Roman", serif;
  --font-sans: Georgia, Palatino, "Times New Roman", serif;
  --font-mono: Consolas, "Courier New", Courier, monospace;
  --space: clamp(1.25rem, 3vw, 2.5rem);
  --measure: 72rem;
  color-scheme: light;
}

[data-theme="dark"] {
  --paper: #12161c;
  --paper-raised: #1a212b;
  --paper-inset: #0e1218;
  --ink: #ece7dc;
  --ink-muted: #a8a093;
  --navy: #d7c7a2;
  --navy-deep: #0b1016;
  --brass: #d4b36a;
  --brass-light: #e2c888;
  --teal: #5dbeb4;
  --teal-deep: #3d9a91;
  --rule: #2c3542;
  --rule-strong: #3c4654;
  --danger: #e08a78;
  --focus: #5dbeb4;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

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

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--teal-deep);
  text-underline-offset: 0.18em;
}

[data-theme="dark"] a {
  color: var(--teal);
}

a:hover {
  color: var(--navy);
}

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

::selection {
  background: var(--brass-light);
  color: #1a1714;
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--paper);
}

::-webkit-scrollbar-thumb {
  background: var(--rule-strong);
  border-radius: 999px;
  border: 3px solid var(--paper);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brass-light);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--navy-deep);
  color: var(--paper);
  padding: 0.6rem 1rem;
  border-radius: 0 0 8px 8px;
}

.skip-link:focus {
  top: 0;
}

.wrap {
  width: min(100% - 2 * var(--space), var(--measure));
  margin-inline: auto;
}

.topbar {
  position: relative;
  z-index: 2;
  background: var(--navy-deep);
  color: #f3eee4;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  border-bottom: 1px solid rgba(196, 163, 90, 0.35);
}

.topbar.lang-open,
.topbar:has(.lang-mega.is-open) {
  z-index: 40;
}

.topbar p {
  margin: 0;
}

.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.4rem;
}

.topbar a {
  color: #e2c888;
  text-decoration: none;
}

.topbar a:hover {
  color: #fff;
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  position: relative;
}

.lang-select,
.lang-mega-toggle,
.icon-btn {
  font: inherit;
  color: inherit;
  background-color: transparent;
  border: 1px solid rgba(243, 238, 228, 0.28);
  border-radius: 3px;
  padding: 0.2rem 0.7rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.lang-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 1.7rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23e2c888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 0.85em;
}

.lang-select option {
  color: #1a1714;
  background: #faf7f1;
}

.lang-mega {
  position: relative;
}

.lang-mega-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.1rem;
  max-width: 12rem;
  white-space: nowrap;
}

.lang-mega-current {
  overflow: hidden;
  text-overflow: ellipsis;
}

.lang-mega-caret {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 1.5px solid #e2c888;
  border-bottom: 1.5px solid #e2c888;
  transform: rotate(45deg) translateY(-1px);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.lang-mega.is-open .lang-mega-caret {
  transform: rotate(225deg) translateY(-1px);
}

.lang-mega-panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 50;
  width: min(38rem, calc(100vw - 1.5rem));
  background: var(--paper-raised);
  color: var(--ink);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.9rem 1rem 1rem;
}

[dir="rtl"] .lang-mega-panel {
  right: auto;
  left: 0;
}

.lang-mega-heading {
  margin: 0 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brass);
  border-bottom: 1px dashed var(--rule);
  padding-bottom: 0.5rem;
}

.lang-mega-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.15rem 1.15rem;
  align-items: start;
}

.lang-mega-col {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.lang-mega-col a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.38rem 0.45rem;
  color: var(--ink);
  text-decoration: none;
  border-radius: 2px;
  font-size: 0.9rem;
  line-height: 1.3;
  min-height: 1.85rem;
  box-sizing: border-box;
}

.lang-mega-col a:hover {
  background: var(--paper-inset);
  color: var(--navy);
}

.lang-mega-col a.is-current {
  background: rgba(166, 124, 45, 0.12);
  color: var(--navy);
  box-shadow: inset 0 0 0 1px rgba(166, 124, 45, 0.35);
}

.lang-mega-col .lang-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lang-mega-col .lang-code {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  flex-shrink: 0;
}

.lang-mega-col a.is-current .lang-code {
  color: var(--brass);
}

.icon-btn {
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 0.95rem;
}

.icon-btn:hover,
.lang-select:hover,
.lang-mega-toggle:hover,
.lang-mega.is-open .lang-mega-toggle {
  border-color: var(--brass-light);
  background-color: rgba(196, 163, 90, 0.14);
}

.icon-btn:active {
  transform: scale(0.92);
}

.site-header {
  position: relative;
  z-index: 20;
  background: var(--paper-raised);
  border-bottom: 1px solid var(--rule-strong);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
}

.logo img {
  width: 2.4rem;
  height: 2.4rem;
}

.logo:hover .logo-name {
  color: var(--brass);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-name {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.logo-mark {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.15rem;
}

.nav a {
  text-decoration: none;
  color: var(--ink);
  padding: 0.5rem 0.15rem;
  margin: 0 0.45rem;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.nav a:hover {
  color: var(--navy);
  border-bottom-color: var(--rule-strong);
}

[data-theme="dark"] .nav a:hover {
  color: var(--brass-light);
}

.nav a[aria-current="page"] {
  color: var(--navy);
  border-bottom-color: var(--brass);
}

[data-theme="dark"] .nav a[aria-current="page"] {
  color: var(--brass-light);
  border-bottom-color: var(--brass-light);
}

.nav-toggle {
  display: none;
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid var(--rule-strong);
  background: var(--paper-raised);
  border-radius: 3px;
  cursor: pointer;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: var(--ink);
  position: relative;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

main {
  position: relative;
  z-index: 1;
}

.hero {
  position: relative;
  padding: clamp(2.5rem, 6vw, 5.5rem) 0 clamp(2rem, 4vw, 3.5rem);
}

.hero::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -5%;
  height: 130%;
  background-image: repeating-linear-gradient(
    180deg,
    rgba(23, 49, 85, 0.055) 0,
    rgba(23, 49, 85, 0.055) 1px,
    transparent 1px,
    transparent 2.3rem
  );
  mask-image: linear-gradient(180deg, transparent, black 15%, black 65%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, black 15%, black 65%, transparent);
  pointer-events: none;
  z-index: -1;
}

[data-theme="dark"] .hero::before {
  background-image: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.045) 0,
    rgba(255, 255, 255, 0.045) 1px,
    transparent 1px,
    transparent 2.3rem
  );
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 0.9rem;
}

.kicker::before {
  content: "";
  width: 1.4em;
  height: 2px;
  background: var(--brass);
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.18;
  color: var(--navy);
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3 {
  color: var(--ink);
}

h1 {
  font-size: clamp(2.3rem, 5.4vw, 4.15rem);
  margin: 0 0 1rem;
}

h2 {
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  margin: 0 0 0.75rem;
}

h3 {
  font-size: 1.25rem;
  margin: 0 0 0.4rem;
}

.lead {
  font-size: 1.2rem;
  color: var(--ink-muted);
  max-width: 40rem;
  margin: 0 0 1.6rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.85rem;
  padding: 0.55rem 1.35rem;
  border-radius: 3px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 0.95rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: box-shadow 0.18s ease, background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.btn-primary {
  background: var(--navy-deep);
  color: #f3eee4;
  box-shadow: 0 6px 16px rgba(14, 34, 64, 0.22);
}

[data-theme="dark"] .btn-primary {
  background: var(--brass);
  color: #12161c;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

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

[data-theme="dark"] .btn-primary:hover {
  color: #12161c;
  background: var(--brass-light);
}

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

.btn-ghost:hover {
  border-color: var(--brass);
  color: var(--navy);
  background: var(--paper-inset);
}

[data-theme="dark"] .btn-ghost:hover {
  color: var(--brass-light);
}

.blotter {
  position: relative;
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.blotter::before,
.blotter::after {
  content: "";
  position: absolute;
  width: 1.15rem;
  height: 1.15rem;
  border: 2px solid var(--brass-light);
}

.blotter::before {
  top: 8px;
  left: 8px;
  border-right: 0;
  border-bottom: 0;
}

.blotter::after {
  right: 8px;
  bottom: 8px;
  border-left: 0;
  border-top: 0;
}

.terminal {
  margin: 0.5rem;
  background: var(--navy-deep);
  color: #d7e7df;
  border-radius: 3px;
  padding: 1.1rem 1.15rem 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.9;
  min-height: 14rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), inset 0 0 40px rgba(0, 0, 0, 0.25);
}

.terminal-bar {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}

.dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #5c6b7a;
}

.dot:nth-child(1) { background: #c4a35a; }
.dot:nth-child(2) { background: #1b6b63; }
.dot:nth-child(3) { background: #8aa0b5; }

.prompt { color: #c4a35a; }
.ok { color: #7dcea0; }
.dim { color: #8aa0b5; }

.section {
  padding: clamp(2.2rem, 5vw, 4.2rem) 0;
}

.section-head {
  max-width: 40rem;
  margin-bottom: 1.8rem;
}

.section-head::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 2px;
  margin-top: 1.1rem;
  background: var(--brass);
  box-shadow: 0 5px 0 var(--brass);
}

.muted {
  color: var(--ink-muted);
  margin: 0;
}

.roles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
}

.role-card,
.card,
.principle {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.role-card,
.card {
  position: relative;
}

.role-card::before,
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--brass);
}

.role-card:hover,
.card:hover {
  box-shadow: inset 0 0 0 1px var(--brass-light);
  border-color: var(--brass-light);
}

.role-card .code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--paper-inset);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--brass);
  margin-bottom: 0.7rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.card header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px dashed var(--rule);
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-deep);
  background: var(--paper-inset);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.15rem 0.55rem;
}

[data-theme="dark"] .badge {
  color: var(--teal);
}

.card ul {
  margin: 0.6rem 0 0;
  padding-left: 0;
  color: var(--ink-muted);
  list-style: none;
}

.card ul li {
  position: relative;
  padding-left: 1.2rem;
  margin-bottom: 0.4rem;
}

.card ul li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--brass);
}

.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.principle {
  padding-top: 1.4rem;
}

.principle:hover {
  box-shadow: inset 0 0 0 1px var(--brass-light);
  border-color: var(--brass-light);
}

.principle-num {
  display: inline-block;
  font-family: var(--font-serif);
  color: var(--brass);
  font-size: 1.4rem;
  padding-bottom: 0.35rem;
  margin-bottom: 0.5rem;
  border-bottom: 2px solid var(--brass-light);
}

.band {
  position: relative;
  background: var(--navy-deep);
  color: #f3eee4;
  border-block: 1px solid var(--navy);
}

.band .wrap {
  position: relative;
}

.band h2,
.band p {
  color: inherit;
}

.band .muted {
  color: #c9c1b3;
}

.band .btn-primary {
  background: var(--brass);
  color: #12161c;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.3);
}

.band .btn-primary:hover {
  background: var(--brass-light);
  color: #0b0f14;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.page-hero {
  position: relative;
  padding: 3rem 0 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.page-hero::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 4.5rem;
  height: 2px;
  background: var(--brass);
}

.prose {
  max-width: 46rem;
  padding: 2rem 0 3.5rem;
}

.prose h2 {
  margin-top: 2rem;
}

.prose h3 {
  margin-top: 1.4rem;
}

.prose ul {
  padding-left: 1.2rem;
}

.meta-line {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.form {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.5rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
}

input,
select,
textarea {
  font: inherit;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  padding: 0.7rem 0.8rem;
  width: 100%;
}

textarea {
  min-height: 9rem;
  resize: vertical;
}

.form-note,
.form-status {
  font-size: 0.95rem;
  color: var(--ink-muted);
}

.form-status[data-state="ok"] { color: var(--teal-deep); }
.form-status[data-state="err"] { color: var(--danger); }

.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  padding: 2rem 0 4rem;
}

.aside-card {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.3rem;
  height: fit-content;
}

.aside-card dt {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brass);
  margin-top: 0.9rem;
}

.aside-card dd {
  margin: 0.15rem 0 0;
}

.site-footer {
  position: relative;
  z-index: 1;
  background: var(--navy-deep);
  color: #e8e0d2;
  padding: 2.5rem 0 1.4rem;
  margin-top: 1rem;
  border-top: 1px solid rgba(196, 163, 90, 0.28);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.7fr 0.85fr 0.75fr 0.75fr;
  gap: 1.5rem;
}

.site-footer a {
  color: #e2c888;
  text-decoration: none;
}

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

.site-footer h3 {
  color: #f3eee4;
  font-size: 1.05rem;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.footer-grid .footer-links {
  max-height: 18rem;
  overflow-y: auto;
  padding-inline-end: 0.25rem;
}

.footer-links a {
  text-underline-offset: 0.2em;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 1.8rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(243, 238, 228, 0.12);
  font-size: 0.88rem;
  color: #b7b0a3;
}

.cookie-banner {
  position: fixed;
  z-index: 40;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  max-width: 40rem;
  margin-inline: auto;
  background: var(--paper-raised);
  color: var(--ink);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem;
  display: none;
}

.cookie-banner.is-open {
  display: block;
  animation: cookieIn 0.3s ease both;
}

@keyframes cookieIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-banner.is-open {
    animation: none;
  }
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.cookie-banner p {
  margin: 0;
}

.error-panel {
  min-height: 60vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 4rem 0;
}

.error-code {
  font-family: var(--font-mono);
  color: var(--brass);
  letter-spacing: 0.2em;
}

@media (max-width: 900px) {
  .hero-grid,
  .roles,
  .cards,
  .principles,
  .contact-grid,
  .footer-grid,
  .desk-layout {
    grid-template-columns: 1fr;
  }

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

  .nav-toggle {
    display: grid;
    place-items: center;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper-raised);
    border-bottom: 1px solid var(--rule);
    padding: 0.7rem;
    flex-direction: column;
    align-items: stretch;
  }

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

@media (max-width: 560px) {
  .roles {
    grid-template-columns: 1fr;
  }

  .topbar .wrap {
    flex-wrap: wrap;
    padding-block: 0.35rem;
  }

  .topbar-tools {
    width: 100%;
    justify-content: flex-end;
  }

  .lang-mega {
    flex: 1;
    min-width: 0;
  }

  .lang-mega-toggle {
    max-width: none;
    width: 100%;
    justify-content: space-between;
  }

  .lang-mega-panel {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    top: 3.2rem;
    width: auto;
    max-height: min(70vh, 28rem);
    overflow: auto;
  }

  [dir="rtl"] .lang-mega-panel {
    left: 0.75rem;
    right: 0.75rem;
  }

  .lang-mega-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 380px) {
  .lang-mega-grid {
    grid-template-columns: 1fr;
  }
}

#tools {
  scroll-margin-top: calc(var(--header-h) + 3rem);
}

a.role-card,
a.card {
  display: block;
  text-decoration: none;
  color: inherit;
}

a.role-card:hover h3,
a.card:hover h3 {
  color: var(--brass);
}

.crumbs {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  margin: 0 0 1rem;
}

.crumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  color: var(--ink-muted);
}

.crumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.4rem;
  color: var(--brass);
}

.crumbs a {
  color: inherit;
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--navy);
  text-decoration: underline;
}

.desk-layout {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 2rem;
  padding: 2rem 0 3.5rem;
}

.tool-list {
  display: grid;
  gap: 0.9rem;
}

.tool-item {
  position: relative;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem;
}

.tool-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--brass);
}

.tool-item header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.tool-item p {
  margin: 0;
  color: var(--ink-muted);
}

.aside-card h2 {
  margin: 0;
  font-size: 1.15rem;
}

.desk-links {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.desk-links a {
  color: var(--navy);
  text-decoration: none;
}

.desk-links a:hover {
  color: var(--brass);
  text-decoration: underline;
}

@media (max-width: 1100px) {
  .cards {
    grid-template-columns: 1fr 1fr;
  }

  .nav-toggle {
    display: grid;
    place-items: center;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper-raised);
    border-bottom: 1px solid var(--rule);
    padding: 0.7rem;
    flex-direction: column;
    align-items: stretch;
  }

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

  .nav a {
    margin: 0;
    padding: 0.65rem 0.4rem;
  }
}

[dir="rtl"] {
  direction: rtl;
}

[dir="rtl"] .crumbs li:not(:last-child)::after {
  content: "\\";
  margin-right: 0.4rem;
  margin-left: 0;
}

[dir="rtl"] .crumbs ol {
  flex-direction: row-reverse;
  justify-content: flex-end;
}

[dir="rtl"] .logo-text {
  text-align: start;
}

[dir="rtl"] .nav a {
  margin-inline: 0.15rem;
}

.reveal {
  opacity: 1;
}
