/*
 * Privacy, terms and credits: a sheet of the ship's articles on the navigator's table
 * (docs/design.md). Tokens copied from apps/client/src/styles.css; these pages load nothing from
 * the game's bundle. The fonts are copied here at build time (src/legal/vite-plugin.ts).
 */
@font-face {
  font-family: "Kurale";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/kurale-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Nunito Variable";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("fonts/nunito-latin-wght-normal.woff2") format("woff2-variations");
}

:root {
  --abyss: #0f2c3a;
  --lagoon-deep: #1b5f93;
  --sailcloth-light: #fbf4e2;
  --sailcloth-deep: #e8d6ae;
  --doubloon: #f0b429;
  --doubloon-light: #ffd666;
  --doubloon-deep: #b27b12;
  --coral: #e0533f;
  --teak: #6e4526;
  --teak-light: #936239;
  --teak-deep: #4b2d17;
  --teak-dark: #2e1b0d;
  --brass: #b08d4f;
  --brass-light: #ecd9a0;
  --ink: var(--abyss);
  --ink-soft: #6a5238;

  --font-display: "Kurale", "Iowan Old Style", Georgia, serif;
  --font-ui: "Nunito Variable", "Nunito", ui-rounded, system-ui, sans-serif;

  --shadow-rest: 1px 2px 0 rgb(46 27 13 / 30%), 3px 6px 12px rgb(46 27 13 / 32%);
  --shadow-deep: 4px 10px 0 rgb(8 29 39 / 20%), 18px 34px 60px rgb(8 20 26 / 55%);

  --grain-paper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .3 0 0 0 0 .16 0 0 0 -1.4 1.05'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  --grain-wood: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='360'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.0035 .11' numOctaves='4' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .12 0 0 0 0 .06 0 0 0 0 .02 0 0 0 -2.6 1.45'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23w)'/%3E%3C/svg%3E");

  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 30% 0%, rgb(255 214 140 / 16%), transparent 60%), var(--grain-wood),
    var(--teak-deep);
  -webkit-font-smoothing: antialiased;
}

.desk {
  width: min(100%, 47rem);
  margin: 0 auto;
  padding: 28px 16px 40px;
}

a {
  color: var(--lagoon-deep);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

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

.tabs a:focus-visible,
.plaque:focus-visible {
  outline-color: var(--doubloon-light);
}

/* The three documents as ledger tabs standing up from the top edge of the sheet. */
.tabs {
  display: flex;
  gap: 6px;
  padding: 0 18px;
}

.tabs a {
  position: relative;
  padding: 9px 16px 7px;
  border-radius: 8px 8px 0 0;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--sailcloth-deep);
  text-decoration: none;
  background: var(--teak);
  box-shadow: inset 0 -6px 8px -6px rgb(30 14 3 / 60%);
  transform: translateY(4px);
  transition: transform 150ms ease-out;
}

.tabs a:hover {
  transform: translateY(1px);
}

.tabs a[aria-current="page"] {
  z-index: 1;
  color: var(--teak);
  background: var(--sailcloth-light) var(--grain-paper);
  box-shadow: none;
  transform: none;
}

.sheet {
  position: relative;
  padding: 34px clamp(20px, 6vw, 56px) 40px;
  border-radius: 3px 3px 6px 6px;
  background: var(--sailcloth-light) var(--grain-paper);
  box-shadow: var(--shadow-deep);
}

.sheet-head {
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 1.5px dashed rgb(110 69 38 / 35%);
}

.brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--teak-light);
  text-decoration: none;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  color: var(--teak);
}

h1 {
  margin: 4px 0 6px;
  font-size: clamp(2.2rem, 7vw, 3.1rem);
}

h2 {
  margin: 2.1em 0 0.45em;
  font-size: 1.6rem;
}

h3 {
  margin: 1.5em 0 0.3em;
  font-size: 1.2rem;
}

.updated {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-soft);
}

p,
ul,
ol,
dl {
  margin: 0 0 0.9em;
}

ul,
ol {
  padding-left: 1.3em;
}

li + li {
  margin-top: 0.35em;
}

strong {
  font-weight: 800;
}

.lede {
  font-size: 1.15rem;
  font-weight: 700;
}

/* "In short": a slip pinned to the sheet, the whole page in a few lines. */
.pinned {
  position: relative;
  margin: 8px 0 30px;
  padding: 20px 22px 14px;
  border-radius: 2px;
  background: #fffaf0;
  box-shadow: var(--shadow-rest);
  transform: rotate(-0.6deg);
}

.pinned::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--brass-light), var(--brass) 55%, #6a4c1f);
  box-shadow: 1px 2px 2px rgb(46 27 13 / 45%);
}

.pinned h2 {
  margin-top: 0;
  font-size: 1.3rem;
}

.pinned ul {
  margin-bottom: 0.4em;
}

/* Data tables (what's stored on your device, who processes what). */
.table-wrap {
  margin: 0 0 1em;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.45;
}

th,
td {
  padding: 8px 10px 8px 0;
  border-bottom: 1px solid rgb(110 69 38 / 22%);
  text-align: left;
  vertical-align: top;
}

th {
  font-weight: 800;
  color: var(--teak);
}

code {
  font-family: inherit;
  font-weight: 800;
  overflow-wrap: anywhere;
}

/* "When accounts launch": parts that describe features that don't exist yet. */
.later {
  margin: 1.4em 0 1em;
  padding: 2px 0 2px 16px;
  border-left: 4px solid var(--brass);
}

.later > h2:first-child {
  margin-top: 0.4em;
}

.roll {
  padding-left: 0;
  list-style: none;
}

.roll li + li {
  margin-top: 0.6em;
}

.who {
  display: block;
  font-weight: 800;
}

.foot {
  display: flex;
  justify-content: center;
  margin-top: 26px;
}

/* The single gold action, like the game's plaques. */
.plaque {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 26px;
  border-radius: 10px;
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--teak-dark);
  text-decoration: none;
  background: linear-gradient(var(--doubloon-light), var(--doubloon) 55%, var(--doubloon-deep));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 55%),
    0 3px 0 var(--teak-dark),
    0 8px 16px rgb(20 8 2 / 45%);
}

.plaque:hover {
  filter: brightness(1.05);
}

@media (max-width: 480px) {
  .desk {
    padding-top: 18px;
  }

  .tabs {
    padding: 0 8px;
  }

  .tabs a {
    flex: 1;
    padding-inline: 8px;
    text-align: center;
  }

  h2 {
    font-size: 1.4rem;
  }

  .pinned {
    margin-inline: -6px;
    padding-inline: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tabs a {
    transition: none;
  }
}
