/* Pameria's site: the game's own paper, ink and pixel type. No outside
   requests: font and pictures are served from this folder. */

@font-face {
  font-family: "Pixeloid";
  src: url("assets/fonts/pixeloid_sans.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Pixeloid";
  src: url("assets/fonts/pixeloid_sans_bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --ink: #263023;
  --muted: #50513b;
  --cream: #f1dfb3;
  --paper: #fff0c9;
  --forest: #3f6648;
  --forest-dark: #233c2d;
  --night: #16261c;
  --gold: #e8b75c;
  --gold-dark: #b18c43;
  --edge: #695936;
  --px: 4px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  color: var(--ink);
  font-family: "Pixeloid", "Courier New", monospace;
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: none;
  font-smooth: never;
  background-color: var(--forest-dark);
  /* A quiet pixel weave, as the game's dark panels. */
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.025) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.025) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
}

/* One language at a time. */
html[data-lang="tr"] [lang="en"],
html[data-lang="en"] [lang="tr"] { display: none; }

img {
  display: block;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* --- The top strip ------------------------------------------------------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background: var(--night);
  border-bottom: var(--px) solid #0e1a13;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--paper);
  text-decoration: none;
  font-weight: 700;
  font-size: 27px;
  line-height: 1;
}

.lang { display: flex; gap: 8px; }

.lang button {
  font: inherit;
  font-size: 18px;
  line-height: 1;
  min-height: 44px;
  padding: 8px 12px;
  color: var(--paper);
  background: var(--forest);
  border: var(--px) solid #0e1a13;
  cursor: pointer;
}
.lang button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--gold);
}
.lang button:focus-visible,
.button:focus-visible,
.brand:focus-visible {
  outline: var(--px) solid var(--paper);
  outline-offset: 2px;
}

/* --- The page ------------------------------------------------------------ */

main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 16px 8px;
  display: grid;
  gap: 24px;
}

/* Paper with a stepped pixel corner, as the game's boxes. */
.panel {
  background: var(--cream);
  border: var(--px) solid var(--edge);
  box-shadow: inset 0 0 0 var(--px) var(--paper);
  padding: 20px 24px;
  clip-path: polygon(
    0 8px, 4px 8px, 4px 4px, 8px 4px, 8px 0,
    calc(100% - 8px) 0, calc(100% - 8px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 8px, 100% 8px,
    100% calc(100% - 8px), calc(100% - 4px) calc(100% - 8px), calc(100% - 4px) calc(100% - 4px), calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) 100%,
    8px 100%, 8px calc(100% - 4px), 4px calc(100% - 4px), 4px calc(100% - 8px), 0 calc(100% - 8px));
}

.frame {
  border: var(--px) solid #0e1a13;
  background: #0e1a13;
  box-shadow: 0 var(--px) 0 0 rgba(0, 0, 0, 0.35);
  align-self: start;
}
.frame img { width: 100%; }

h1, h2 {
  margin: 0 0 10px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--forest-dark);
}
h1 { font-size: 54px; }
h2 { font-size: 27px; }

p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

ul { margin: 0 0 12px; padding-left: 22px; }
ul:last-child { margin-bottom: 0; }
li { margin-bottom: 6px; }
li::marker { color: var(--gold-dark); }

/* --- The first screen ---------------------------------------------------- */

.hero { display: grid; gap: 16px; }
.title { text-align: center; }
.tag { font-size: 27px; line-height: 1.25; color: var(--ink); margin-bottom: 6px; }
.facts { color: var(--muted); }

/* --- Picture beside words ------------------------------------------------ */

.pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.pair.flip .frame { order: 2; }

.row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

/* --- Contact ------------------------------------------------------------- */

.contact { text-align: center; }

.button {
  display: inline-block;
  min-height: 48px;
  padding: 10px 20px;
  color: var(--ink);
  background: var(--gold);
  border: var(--px) solid var(--edge);
  box-shadow: inset 0 calc(-1 * var(--px)) 0 0 var(--gold-dark);
  text-decoration: none;
  font-weight: 700;
}
.button:hover { background: #f1c873; }
/* An address must be read without a doubt: the plain weight, a size larger
   (the bold "@" of the pixel type closes up at body size). */
.button.mail { font-weight: 400; font-size: 27px; line-height: 1.2; letter-spacing: 1px; }

.foot {
  max-width: 1040px;
  margin: 0 auto;
  padding: 16px 16px 40px;
  color: #b9c7a8;
  text-align: center;
  font-size: 18px;
}

/* --- Narrow screens ------------------------------------------------------ */

@media (max-width: 760px) {
  .pair { grid-template-columns: minmax(0, 1fr); }
  .pair.flip .frame { order: 0; }
  .row { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 45px; }
  .tag { font-size: 18px; }
  .brand { font-size: 18px; }
  .panel { padding: 16px; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
