/* Oracle: the shell shared by every page. Dark warm table, gold accents.
   Mobile first. Logical properties (margin-inline, text-align: start) keep
   the layout right for Arabic and Hebrew. */

/* Old Standard TT has Latin and Cyrillic. Greek, Arabic, Hebrew, Georgian
   and Armenian fall back to the system serif. */
@font-face {
  font-family: "Old Standard TT";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/old-standard-tt-cyrillic-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Old Standard TT";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/old-standard-tt-cyrillic-400-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Old Standard TT";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/old-standard-tt-latin-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Old Standard TT";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/old-standard-tt-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Old Standard TT";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/old-standard-tt-cyrillic-ext-400-italic.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Old Standard TT";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/old-standard-tt-cyrillic-400-italic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Old Standard TT";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/old-standard-tt-latin-ext-400-italic.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Old Standard TT";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/old-standard-tt-latin-400-italic.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Old Standard TT";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/old-standard-tt-cyrillic-ext-700-normal.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Old Standard TT";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/old-standard-tt-cyrillic-700-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Old Standard TT";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/old-standard-tt-latin-ext-700-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Old Standard TT";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/old-standard-tt-latin-700-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #120d09;
  --ink: #efe6d2;
  --muted: #b5a487;
  --faint: #857659;
  --gold: #d9b66a;
  --gold-hi: #fce7ac;
  --line: rgba(217, 182, 106, 0.3);
  --quantum: #8fe0cf;
  --serif: "Old Standard TT", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: 16px;
  color-scheme: dark;
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

html:has(dialog[open]) {
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(130% 60% at 50% -12%, #3d2b17 0%, #20160d 48%, rgba(18, 13, 9, 0) 78%),
    var(--bg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  overflow-x: hidden;
}

body > main {
  flex: 1 0 auto;
}

.defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

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

button {
  font: inherit;
  color: inherit;
}

a {
  color: var(--muted);
  text-underline-offset: 2px;
}

:focus-visible {
  outline: 2px solid var(--gold-hi);
  outline-offset: 3px;
}

/* ---------- header: brand and language ---------- */

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 12px var(--gutter) 0;
}

.brand {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-decoration: none;
}

.brand:hover {
  color: var(--gold-hi);
}

.lang {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding-inline: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  transition: border-color 0.15s, color 0.15s;
}

.lang:hover,
.lang:focus-within {
  border-color: rgba(217, 182, 106, 0.65);
  color: var(--ink);
}

.lang-icon {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  pointer-events: none;
}

.lang select {
  appearance: none;
  max-width: 13ch;
  padding: 6px 4px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  text-overflow: ellipsis;
  cursor: pointer;
}

.lang select:focus {
  outline: none;
}

/* the open list uses the system palette, keep it readable */
.lang option {
  background: #2b2016;
  color: var(--ink);
}

/* ---------- footer ---------- */

.site-foot {
  padding: 40px var(--gutter) 30px;
  text-align: center;
  font-size: 13px;
  color: var(--faint);
}

.site-foot p {
  margin: 4px 0;
}

.foot-links {
  margin-top: 10px !important;
}

/* ---------- where the randomness came from (source-badge.js) ---------- */

.status {
  text-wrap: balance;
  max-width: 640px;
  min-height: 1.5em;
  margin: 22px auto 0;
  padding: 0 var(--gutter);
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.status .badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  color: var(--gold-hi);
}

.status .badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.status.quantum .badge {
  color: var(--quantum);
}

.status.local .badge {
  color: var(--gold);
}

.status.offline .badge {
  color: var(--muted);
}

.status .note {
  display: block;
  margin-top: 2px;
}

/* ---------- simple pages: home, about, 404 ---------- */

.page {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 28px var(--gutter) 0;
}

.page-title {
  margin: 0;
  text-align: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(38px, 11vw, 58px);
  line-height: 1.1;
  letter-spacing: 0.05em;
  color: var(--gold-hi);
  background: linear-gradient(180deg, #fff3cf 0%, #e9c77c 52%, #a77f3c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.55));
}

.page-lead {
  max-width: 560px;
  margin: 10px auto 0;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--muted);
  text-wrap: balance;
}

.back-link {
  margin-top: 28px;
  text-align: center;
}

.tiles {
  --gap: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--gap);
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.tiles > li {
  flex: 0 1 calc((100% - var(--gap)) / 2);
  min-width: 0;
}

@media (min-width: 700px) {
  .tiles {
    --gap: 18px;
  }

  .tiles > li {
    flex-basis: calc((100% - 2 * var(--gap)) / 3);
  }
}

@media (min-width: 1000px) {
  .tiles > li {
    flex-basis: calc((100% - 3 * var(--gap)) / 4);
  }
}

.tile {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 240, 210, 0.04);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.tile:hover {
  border-color: rgba(217, 182, 106, 0.65);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

.tile-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 40 / 21;
  object-fit: cover;
  background: #1c140d;
}

.tile-name {
  padding: 10px 12px 0;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--gold-hi);
}

.tile-line {
  padding: 2px 12px 12px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}

.prose {
  max-width: 700px;
}

.prose section {
  margin-top: 30px;
}

.prose h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--gold-hi);
}

.prose p {
  margin: 0 0 12px;
  font-size: 17px;
  line-height: 1.6;
}

/* Arabic, Hebrew, Georgian and Armenian have no italics: browsers would only
   slant the letters. Covers the italic text of every page. */
:is(:lang(ar), :lang(he), :lang(ka), :lang(hy)) :is(.page-lead, .subtitle, .hint, .sheet-kw, .label .kw, .m-kw) {
  font-style: normal;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}
