/*
 * Pinni's website, in the app's Linen look (src/theme/themes.ts): the woven board, paper cards,
 * Newsreader for display, Instrument Sans for everything else, and Pinni Pen for handwriting.
 * Fonts and icons come from scripts/build-website-assets.py.
 */

@font-face {
  font-family: 'Newsreader';
  src: url('/fonts/newsreader-regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  src: url('/fonts/newsreader-italic.woff') format('woff');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('/fonts/instrument-sans-medium.woff') format('woff');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('/fonts/instrument-sans-semibold.woff') format('woff');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Pinni Pen';
  src: url('/fonts/pinni-pen.woff') format('woff');
  font-display: swap;
}

:root {
  --bg: #e9e3d9;
  --weave: rgba(60, 45, 30, 0.035);
  --ink: #2b2723;
  --muted: #625a51;
  --accent: #a8553a;
  --pacc: #9e4b31;
  --paper: #faf7f1;
  --paper2: #f3ecdf;
  --btn: #2b2723;
  --btn-ink: #faf7f1;
  --gold: #e2c27a;
  --line: rgba(43, 39, 35, 0.22);
  --display: 'Newsreader', Georgia, serif;
  --ui: 'Instrument Sans', system-ui, -apple-system, sans-serif;
  --hand: 'Pinni Pen', 'Bradley Hand', cursive;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  /* Linen's weave: a 1 pt line every 3 pt, both ways, as on the board. */
  background-image:
    repeating-linear-gradient(0deg, var(--weave) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, var(--weave) 0 1px, transparent 1px 3px);
  color: var(--ink);
  font: 500 16px/1.55 var(--ui);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--pacc);
  text-underline-offset: 3px;
}

/* --- The header: a tiny pair of Polaroids and the name, back home ------------------------- */

.top {
  padding: 18px 20px 0;
}
.mark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
  font: italic 400 24px/1 var(--display);
}
.mark-pair {
  position: relative;
  width: 30px;
  height: 22px;
}
.mark-pair i {
  position: absolute;
  top: 2px;
  width: 15px;
  height: 18px;
  padding: 2px 2px 4px;
  background: #fffdf8;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.mark-pair i::after {
  content: '';
  display: block;
  height: 100%;
  background: var(--accent);
  opacity: 0.6;
}
.mark-pair i:first-child {
  left: 0;
  transform: rotate(-9deg);
}
.mark-pair i:last-child {
  left: 13px;
  transform: rotate(8deg);
}

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

main {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

h1,
h2 {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0;
}
h1 {
  font-size: 38px;
  line-height: 1.1;
}
h2 {
  font-size: 24px;
  line-height: 1.2;
}
h1 em,
h2 em {
  font-style: italic;
}
/* No word left alone on a line. */
h1,
h2 {
  text-wrap: balance;
}
p,
li {
  text-wrap: pretty;
}

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

.hand {
  font-family: var(--hand);
  font-weight: 400;
  font-size: 23px;
  line-height: 1.1;
}

.card {
  background: var(--paper);
  border-radius: 18px;
  padding: 22px 20px;
  box-shadow:
    0 1px 2px rgba(60, 40, 20, 0.12),
    0 14px 22px -12px rgba(60, 40, 20, 0.5);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--btn);
  color: var(--btn-ink);
  font: 600 16px/1 var(--ui);
  text-decoration: none;
  cursor: pointer;
}
.button.outline {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

/* "Coming soon to the App Store", until Pinni is live (then the real badge). */
.soon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--btn);
  color: var(--btn-ink);
  font: 600 14px/1.2 var(--ui);
}
.soon svg {
  flex: none;
}

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

.foot {
  padding: 22px 20px 30px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.foot nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-bottom: 8px;
}
.foot a {
  color: var(--muted);
}

/* --- Support's questions ---------------------------------------------------------------------- */

.faq {
  margin-top: 26px;
}
.faq h2 {
  margin: 34px 0 12px;
}
details {
  background: var(--paper);
  border-radius: 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(60, 40, 20, 0.1);
}
summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 44px 16px 18px;
  position: relative;
  font-weight: 600;
}
summary::-webkit-details-marker {
  display: none;
}
summary::after {
  content: '+';
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font: 400 22px/1 var(--ui);
  color: var(--muted);
}
details[open] summary::after {
  content: '−';
}
details > div {
  padding: 0 18px 16px;
  color: var(--muted);
}
details > div p {
  margin: 0 0 10px;
}
details > div p:last-child {
  margin-bottom: 0;
}
.path {
  color: var(--ink);
  font-weight: 600;
}

/* --- Privacy and Terms ------------------------------------------------------------------------ */

.legal h2 {
  margin: 38px 0 10px;
}
.legal h3 {
  margin: 22px 0 6px;
  font: 600 16px/1.4 var(--ui);
}
.legal p,
.legal li {
  color: #3d3732;
}
.legal ul {
  padding-left: 20px;
}
.legal li {
  margin-bottom: 8px;
}
.summary {
  margin-top: 24px;
}
.summary .hand {
  margin: 0 0 6px;
  color: var(--pacc);
}
.summary ul {
  margin: 0;
}
.summary li:last-child {
  margin-bottom: 0;
}

/* --- The invite ------------------------------------------------------------------------------- */

.invite {
  text-align: center;
}
.pinned {
  position: relative;
  width: 168px;
  height: 120px;
  margin: 6px auto 22px;
}
.pinned .polaroid {
  position: absolute;
  top: 0;
  width: 86px;
  height: 104px;
  padding: 7px 7px 22px;
  background: #fffdf8;
  box-shadow:
    0 2px 3px rgba(0, 0, 0, 0.25),
    0 12px 18px -8px rgba(0, 0, 0, 0.45);
}
.pinned .polaroid::after {
  content: '';
  display: block;
  height: 100%;
  background: linear-gradient(160deg, #e7cdb4, #c98f73);
}
.pinned .polaroid:first-child {
  left: 4px;
  transform: rotate(-8deg);
}
.pinned .polaroid:nth-child(2) {
  left: 76px;
  transform: rotate(7deg);
}
.pinned .polaroid:nth-child(2)::after {
  background: linear-gradient(160deg, #c8d3e2, #8ea2c0);
}
.pinned svg {
  position: absolute;
  left: 69px;
  top: -10px;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
}

.code {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 26px 0 14px;
}
.code span {
  width: 42px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 1px 2px rgba(60, 40, 20, 0.15);
  font: 400 30px/1 var(--display);
}
.code span:nth-child(3) {
  margin-right: 10px;
}

.steps {
  list-style: none;
  counter-reset: step;
  text-align: left;
  margin: 26px 0 0;
  padding: 0;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 18px 44px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--btn);
  color: var(--btn-ink);
  font: 600 14px/1 var(--ui);
}
.steps strong {
  display: block;
}
.steps .soon {
  margin-top: 10px;
}
.quiet {
  display: inline-block;
  margin-top: 8px;
  font-weight: 600;
}

@media (min-width: 720px) {
  h1 {
    font-size: 46px;
  }
  main {
    padding-top: 44px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .rise {
    animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  .rise-2 {
    animation-delay: 0.12s;
  }
  .rise-3 {
    animation-delay: 0.24s;
  }
  .pinned svg {
    animation: land 0.5s 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) both;
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}
@keyframes land {
  from {
    opacity: 0;
    transform: scale(1.9) rotate(-30deg);
  }
}
