/*
 * Shared stylesheet for every page of slowikgra.pl except the landing page.
 *
 * The landing page (index.html) keeps the inline styles of the approved design
 * prototype untouched, so a new export of the prototype can be dropped in with
 * a small diff. This file repeats the prototype's fonts, colours, header and
 * footer as classes, so the legal pages, the invite page and the 404 page look
 * the same. When the landing page's header or footer changes, change it here
 * too.
 */

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(../fonts/nunito-latin-ext-600-normal.woff2) format('woff2');
  unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,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: 'Nunito';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(../fonts/nunito-latin-600-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+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(../fonts/nunito-latin-ext-700-normal.woff2) format('woff2');
  unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,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: 'Nunito';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(../fonts/nunito-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+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-display: swap;
  font-weight: 800;
  src: url(../fonts/nunito-latin-ext-800-normal.woff2) format('woff2');
  unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,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: 'Nunito';
  font-style: normal;
  font-display: swap;
  font-weight: 800;
  src: url(../fonts/nunito-latin-800-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+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-display: swap;
  font-weight: 900;
  src: url(../fonts/nunito-latin-ext-900-normal.woff2) format('woff2');
  unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,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: 'Nunito';
  font-style: normal;
  font-display: swap;
  font-weight: 900;
  src: url(../fonts/nunito-latin-900-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+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* The prototype's palette. */
:root {
  --ink: #262320;
  --muted: #6d6357;
  --page: #f5ede0;
  --paper: #fffdf8;
  --link: #3b54ac;
  --link-hover: #2c4190;
  --line: #e8ded0;
  --green: #5f7f33;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: var(--page);
  color: var(--ink);
  font-family: Nunito, system-ui, sans-serif;
  font-weight: 600;
}

main {
  flex: 1 0 auto;
  min-width: 0;
}

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

/* Header: the same as the landing page's. */

.site-header {
  box-sizing: border-box;
  width: 100%;
  max-width: 1248px; /* the landing page's 1200 px content box plus its 24 px padding */
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand,
.brand:hover {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: block;
}

.brand span {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  font-size: 17px;
  font-weight: 700;
}

.site-nav a,
.site-nav a:hover {
  color: var(--ink);
  text-decoration: none;
}

.site-nav a.nav-cta,
.site-nav a.nav-cta:hover {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  box-sizing: border-box;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
}

/* Footer: the same as the landing page's. */

.site-footer {
  box-sizing: border-box;
  width: 100%;
  max-width: 1248px; /* the landing page's 1200 px content box plus its 24 px padding */
  margin: 0 auto;
  padding: 0 24px 48px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
}

.site-footer p { margin: 0; }

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.site-footer a,
.site-footer a:hover { color: var(--muted); }

/* A dark store button, the same as the landing page's hero buttons. */

.store-button,
.store-button:hover {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  box-sizing: border-box;
  padding: 10px 24px 10px 18px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.store-button svg { flex: none; }

.store-button-text {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.1;
}

.store-button-small { font-size: 13px; font-weight: 600; }
.store-button-big { font-size: 21px; font-weight: 800; }

/* A plain dark button with the store buttons' shape. */

.button,
.button:hover {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  box-sizing: border-box;
  padding: 10px 28px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-size: 21px;
  font-weight: 800;
}

/* A centred page head, used by the invite and 404 pages. */

.page-head {
  box-sizing: border-box;
  max-width: 1248px; /* the landing page's 1200 px content box plus its 24 px padding */
  margin: 0 auto;
  padding: 56px 24px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.page-head h1 {
  margin: 0;
  max-width: 900px;
  font-size: clamp(40px, 6.4vw, 84px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.045em;
}

.page-head .lead {
  margin: 24px 0 0;
  max-width: 640px;
  font-size: clamp(18px, 1.8vw, 22px);
  line-height: 1.5;
  font-weight: 600;
  color: var(--muted);
}

.page-head .actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 36px;
}

/* Legal pages: the policy and the terms. */

.legal-wrap {
  box-sizing: border-box;
  width: 100%;
  max-width: 1248px; /* the landing page's 1200 px content box plus its 24 px padding */
  margin: 0 auto;
  padding: 32px 24px 96px;
}

.legal {
  box-sizing: border-box;
  max-width: 820px;
  margin: 0 auto;
  padding: 64px clamp(20px, 6vw, 72px) 72px;
  border-radius: 36px;
  background: var(--paper);
  font-size: 18px;
  line-height: 1.65;
  overflow-wrap: break-word;
}

.legal h1 {
  margin: 0;
  font-size: clamp(38px, 5vw, 60px);
  line-height: 1.04;
  font-weight: 900;
  letter-spacing: -0.035em;
}

.legal .legal-date {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.legal h2 {
  margin: 56px 0 0;
  font-size: clamp(23px, 2.4vw, 28px);
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: -0.02em;
  scroll-margin-top: 24px;
}

.legal p { margin: 16px 0 0; }

/* Numbered paragraphs keep their literal numbers ("1.") as visible text,
   hung in the left margin so the paragraph body lines up. */
.legal ol {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}

.legal ol > li {
  position: relative;
  margin: 14px 0 0;
  padding-left: 2.1em;
}

.legal ol > li > .nr {
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 800;
  color: var(--muted);
}

.legal ul {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.legal ul > li {
  position: relative;
  margin: 8px 0 0;
  padding-left: 1.2em;
}

.legal ul > li::before {
  content: "";
  position: absolute;
  left: 0.2em;
  top: 0.68em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.legal a {
  overflow-wrap: anywhere;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.legal a:hover { color: var(--link-hover); }

.legal strong { font-weight: 800; }

/* Tables: a plain grid on wide screens, one card per row on phones. */
.legal table {
  width: 100%;
  margin: 20px 0 0;
  border-collapse: collapse;
  font-size: 16px;
  line-height: 1.5;
}

.legal th,
.legal td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.legal th {
  font-weight: 800;
  color: var(--muted);
  border-bottom: 2px solid var(--line);
}

.legal th:first-child,
.legal td:first-child { padding-left: 0; }

.legal th:last-child,
.legal td:last-child { padding-right: 0; }

@media (max-width: 640px) {
  .legal-wrap { padding: 16px 12px 64px; }

  .legal {
    padding: 36px 20px 44px;
    border-radius: 28px;
    font-size: 17px;
  }

  .legal h2 { margin-top: 44px; }

  .legal ol > li { padding-left: 1.9em; }

  .legal table,
  .legal thead,
  .legal tbody,
  .legal tr,
  .legal th,
  .legal td { display: block; }

  /* The header row stays readable to screen readers; each cell shows its
     column name instead. */
  .legal thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .legal tbody tr {
    padding: 14px 16px;
    margin: 12px 0 0;
    border-radius: 18px;
    background: var(--page);
  }

  .legal td,
  .legal td:first-child,
  .legal td:last-child {
    padding: 0;
    border: 0;
  }

  .legal td + td { margin-top: 8px; }

  .legal td:first-child { font-weight: 800; }

  .legal td + td::before {
    content: attr(data-label);
    display: block;
    font-size: 14px;
    font-weight: 800;
    color: var(--muted);
  }
}

/* Invite page. */

.invite-card {
  box-sizing: border-box;
  width: 100%;
  max-width: 600px;
  margin: 40px auto 0;
  padding: 40px clamp(20px, 6vw, 48px);
  border-radius: 36px;
  background: var(--paper);
  text-align: center;
}

/* The panel would otherwise beat the hidden attribute. */
.invite-card [hidden] { display: none; }

.invite-code-label {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--muted);
}

.invite-code-value {
  margin: 6px 0 0;
  font-size: clamp(44px, 13vw, 72px);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--green);
  /* A code is read out loud and typed by hand, so it must survive a 360 px
     screen without wrapping in the middle. */
  white-space: nowrap;
  user-select: all;
  -webkit-user-select: all;
}

.invite-steps {
  margin: 20px auto 0;
  max-width: 460px;
  font-size: 18px;
  line-height: 1.55;
  color: var(--muted);
}

.invite-code + .invite-steps { margin-top: 0; }

.invite-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
}

.invite-note {
  margin: 14px 0 0;
  font-size: 16px;
  color: var(--muted);
}

.invite-more {
  margin: 28px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 17px;
  font-weight: 700;
}

.page-bottom { height: 96px; }
