/* ==========================================================================
   Institute for Emerging Gaming Markets
   iegm.org

   Palette and typographic scale are shared with the PMCPS standards
   documents so the site and the documents read as one system.
   ========================================================================== */

/* ---- fonts ---------------------------------------------------------- */

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('assets/fonts/dmsans-latin.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: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('assets/fonts/dmsans-latin-ext.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;
}

/* ---- tokens --------------------------------------------------------- */

:root {
  --paper:      #FCFCFD;
  --panel:      #F4F6F8;
  --ink:        #14171D;
  --text:       #2B313C;
  --muted:      #5D6675;
  --faint:      #828C9C;
  --rule:       #DCE1E8;
  --rule-soft:  #E9EDF2;
  --accent:     #155C6B;
  --accent-soft:#E4EFF1;
  --flag:       #94441F;
  --flag-soft:  #F6EDE8;

  --sans: 'DM Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI',
          Roboto, Helvetica, Arial, sans-serif;
  --body: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto,
          Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;

  --measure: 40rem;
  --wide: 68rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:      #14171C;
    --panel:      #1B1F26;
    --ink:        #EDF0F4;
    --text:       #C9D0DA;
    --muted:      #98A2B1;
    --faint:      #77808F;
    --rule:       #2C333D;
    --rule-soft:  #232931;
    --accent:     #6FB6C6;
    --accent-soft:#18313A;
    --flag:       #D08A63;
    --flag-soft:  #2A1E17;
  }
}

:root[data-theme="dark"] {
  --paper:      #14171C;
  --panel:      #1B1F26;
  --ink:        #EDF0F4;
  --text:       #C9D0DA;
  --muted:      #98A2B1;
  --faint:      #77808F;
  --rule:       #2C333D;
  --rule-soft:  #232931;
  --accent:     #6FB6C6;
  --accent-soft:#18313A;
  --flag:       #D08A63;
  --flag-soft:  #2A1E17;
}

/* ---- base ----------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--body);
  font-size: 16.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--sans);
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.014em;
  line-height: 1.16;
  text-wrap: balance;
  margin: 0;
}

p { margin: 0 0 1.15rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 3rem 0;
}

.mono { font-family: var(--mono); }

/* ---- shared shell --------------------------------------------------- */

.wrap {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (min-width: 48rem) {
  .wrap { padding: 0 2.5rem; }
}

.prose { max-width: var(--measure); }

/* small uppercase mono label, used throughout */
.label {
  font-family: var(--mono);
  font-size: 0.63rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--faint);
  margin: 0;
}

.label-accent { color: var(--accent); }

/* ---- masthead ------------------------------------------------------- */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 20;
}

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.25rem;
  flex-wrap: wrap;
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
  padding: 0.9rem 0;
}

.wordmark .sigil {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 2px;
  padding: 0.18rem 0.4rem;
  line-height: 1;
}

.wordmark .full {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.008em;
}

@media (max-width: 34rem) {
  .wordmark .full { display: none; }
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  padding: 0.5rem 0 0.9rem;
}

@media (min-width: 48rem) {
  .nav { padding: 0; }
}

.nav a {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 0.2rem 0;
  border-bottom: 1.5px solid transparent;
}

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

/* ---- page opening --------------------------------------------------- */

.opening {
  padding: 4.5rem 0 3.25rem;
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 48rem) {
  .opening { padding: 6rem 0 4rem; }
}

.opening h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.4rem);
  margin: 0.7rem 0 0;
}

.opening .standfirst {
  font-size: clamp(1.02rem, 1.9vw, 1.2rem);
  color: var(--muted);
  margin: 1.35rem 0 0;
  max-width: 38rem;
  line-height: 1.55;
}

/* action row */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.62rem 1.15rem;
  border-radius: 2px;
  border: 1px solid var(--accent);
  transition: background-color 0.14s ease, color 0.14s ease;
}

.btn-solid { background: var(--accent); color: var(--paper); }
.btn-solid:hover { background: var(--ink); border-color: var(--ink); }

.btn-line { color: var(--accent); background: transparent; }
.btn-line:hover { background: var(--accent-soft); }

/* ---- generic section ------------------------------------------------ */

.section { padding: 3.75rem 0; border-bottom: 1px solid var(--rule-soft); }
.section:last-of-type { border-bottom: 0; }

@media (min-width: 48rem) {
  .section { padding: 4.75rem 0; }
}

.section-head { margin-bottom: 2.25rem; }

.section-head h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.85rem);
  margin: 0.6rem 0 0;
}

.section-head .lede {
  color: var(--muted);
  margin: 0.9rem 0 0;
  max-width: var(--measure);
}

/* ---- three panel grid ----------------------------------------------- */

.panels {
  display: grid;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
}

@media (min-width: 52rem) {
  .panels { grid-template-columns: repeat(3, 1fr); }
}

.panel {
  background: var(--paper);
  padding: 1.85rem 1.6rem 2rem;
}

.panel .idx {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.panel h3 {
  font-size: 1.02rem;
  margin: 0.75rem 0 0.6rem;
}

.panel p {
  font-size: 0.925rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

.panel p + p { margin-top: 0.75rem; }

/* ---- register (document index table) -------------------------------- */

.register-scroll {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 3px;
}

table.register {
  width: 100%;
  min-width: 46rem;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table.register thead th {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--faint);
  text-align: left;
  padding: 0.85rem 1rem;
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

table.register td {
  padding: 1rem;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
  color: var(--muted);
}

table.register tbody tr:last-child td { border-bottom: 0; }
table.register tbody tr:hover td { background: var(--panel); }

table.register .doc-id {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

table.register .doc-title {
  color: var(--ink);
  font-weight: 500;
  min-width: 15rem;
}

table.register .doc-title span {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

table.register .col-ver,
table.register .col-date {
  font-family: var(--mono);
  font-size: 0.8rem;
  white-space: nowrap;
}

/* ---- status marks --------------------------------------------------- */

.status {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border: 1px solid currentColor;
  border-radius: 2px;
  white-space: nowrap;
  line-height: 1.35;
}

.status-draft    { color: var(--flag); }
.status-reserved { color: var(--faint); }
.status-dev      { color: var(--muted); }
.status-final    { color: var(--accent); }

/* ---- format links --------------------------------------------------- */

.formats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.formats a {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 600;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.22rem 0.5rem;
  white-space: nowrap;
}

.formats a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.formats .na {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--faint);
  border: 1px dashed var(--rule);
  border-radius: 2px;
  padding: 0.22rem 0.5rem;
}

/* ---- document entry (standards page) -------------------------------- */

.entry {
  border-top: 2px solid var(--ink);
  padding-top: 1.5rem;
  margin-top: 3rem;
}

.entry:first-of-type { margin-top: 0; }

.entry-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.entry-head .doc-id {
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.entry h3 {
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
  margin: 0 0 1rem;
}

/* definition grid for document metadata */
.docmeta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 1rem 1.75rem;
  padding: 1.1rem 0 1.35rem;
  border-top: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
  margin-bottom: 1.35rem;
}

.docmeta > div { display: flex; flex-direction: column; gap: 0.3rem; }

.docmeta .k {
  font-family: var(--mono);
  font-size: 0.61rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
}

.docmeta .v {
  font-size: 0.92rem;
  color: var(--ink);
}

.entry .scope {
  color: var(--muted);
  max-width: var(--measure);
  margin-bottom: 1.35rem;
}

/* ---- notice block --------------------------------------------------- */

.notice {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--flag);
  border-radius: 3px;
  background: var(--panel);
  padding: 1.4rem 1.5rem;
}

.notice-accent { border-left-color: var(--accent); }

.notice h3 {
  font-size: 0.95rem;
  margin: 0.5rem 0 0.6rem;
}

.notice p {
  font-size: 0.92rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

/* ---- key list (status vocabulary) ----------------------------------- */

.keylist {
  display: grid;
  gap: 0;
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
}

.keylist > div {
  display: grid;
  gap: 0.4rem 1.25rem;
  padding: 0.95rem 1.25rem;
  border-bottom: 1px solid var(--rule-soft);
  align-items: baseline;
}

@media (min-width: 40rem) {
  .keylist > div { grid-template-columns: 10rem 1fr; }
}

.keylist > div:last-child { border-bottom: 0; }

.keylist p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---- credentials ---------------------------------------------------- */

.creds {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule-soft);
}

.creds li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule-soft);
  color: var(--text);
  font-size: 0.95rem;
  display: flex;
  gap: 0.9rem;
  align-items: baseline;
}

.creds li::before {
  content: "";
  flex: none;
  width: 0.4rem;
  height: 0.4rem;
  border: 1px solid var(--accent);
  transform: rotate(45deg);
  translate: 0 -0.15rem;
}

/* ---- narrative body (about) ----------------------------------------- */

.narrative { max-width: var(--measure); }

.narrative h2 {
  font-size: 1.05rem;
  margin: 2.75rem 0 0.9rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule-soft);
}

.narrative h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.narrative p { color: var(--text); }

/* ---- contact rows --------------------------------------------------- */

.contact-grid {
  display: grid;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
}

@media (min-width: 44rem) {
  .contact-grid { grid-template-columns: repeat(2, 1fr); }
}

.contact-cell {
  background: var(--paper);
  padding: 1.6rem 1.5rem;
}

.contact-cell h3 { font-size: 0.98rem; margin: 0.7rem 0 0.5rem; }
.contact-cell p { font-size: 0.92rem; color: var(--muted); margin: 0 0 0.75rem; }
.contact-cell a { font-size: 0.92rem; }

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

.colophon {
  border-top: 1px solid var(--rule);
  background: var(--panel);
  padding: 3rem 0 3.5rem;
  margin-top: 1rem;
}

.colophon-inner {
  display: grid;
  gap: 2rem;
}

@media (min-width: 44rem) {
  .colophon-inner { grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; }
}

.colophon .org {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 0.4rem;
}

.colophon p {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0 0 0.35rem;
  line-height: 1.55;
}

.colophon ul { list-style: none; margin: 0.75rem 0 0; padding: 0; }
.colophon li { margin-bottom: 0.45rem; }

.colophon li a {
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
}

.colophon li a:hover { color: var(--accent); text-decoration: underline; }

.colophon .fineprint {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8rem;
  color: var(--faint);
}

/* ---- utilities ------------------------------------------------------ */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--paper);
  padding: 0.7rem 1.1rem;
  z-index: 50;
  font-size: 0.875rem;
  border-radius: 0 0 3px 0;
}

.skip:focus { left: 0; }

@media print {
  .masthead, .nav, .actions, .skip { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .section { border: 0; padding: 1rem 0; }
}
