/* Palport: brochure site
   Colours are sampled from the app: the sky behind the passport in the hero
   video, passport paper, and the stamp and sticky-note inks. */

:root {
  --sky: #e9f0ef;           /* the hero video's backdrop, as browsers render it (±2) */
  --paper: #f5f1ea;
  --paper-deep: #ece6dc;
  --ink: #1c1c1e;
  --ink-2: #4f5358;
  --ink-3: #8b8d91;
  --line: rgb(28 28 30 / 0.12);

  --stamp-blue: #4f6ea6;
  --stamp-green: #6c9474;
  --stamp-purple: #7c6cb4;
  --stamp-red: #b85a55;
  --stamp-gold: #b38a52;

  --note-yellow: #fbf1a9;
  --note-pink: #f8d7dd;
  --note-blue: #d9e9f6;
  --note-purple: #ddd5f3;

  --serif: "Bodoni Moda", "Bodoni 72", Didot, "Bodoni MT", Georgia, serif;  /* the PALPORT wordmark */
  --display: "Newsreader", "Iowan Old Style", Charter, Georgia, serif;       /* headings */
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --hand: "Caveat", "Bradley Hand", "Segoe Print", cursive;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
  --radius: 16px;

  /* faint guilloche waves, like the passport's security print */
  --guilloche: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='18' viewBox='0 0 120 18'%3E%3Cpath d='M0 9c15-8 45-8 60 0s45 8 60 0' fill='none' stroke='%231c1c1e' stroke-opacity='.045'/%3E%3C/svg%3E");

  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--sky);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, video, svg { display: block; max-width: 100%; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--stamp-blue);
  outline-offset: 3px;
  border-radius: 6px;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 500;
  font-variation-settings: "opsz" 72;  /* Newsreader's display cut at every heading size */
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

/* Small spaced caps, as on the passport's field labels */
.label {
  font: 600 0.6875rem/1.4 var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.label span { white-space: nowrap; } /* break between languages, not inside them */

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Wordmark (footer) ---------- */

.brand-word {
  font: 700 1.5rem/1 var(--serif);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-right: -0.2em; /* trailing tracking */
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Hero ---------- */

.hero { background: var(--sky); }

.hero-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(8px, 2vw, 16px) var(--gutter) clamp(16px, 3vw, 40px);
  display: grid;
  justify-items: center;
}

/* Centred, as large as the column allows, but never taller than the screen
   (the 60px is the hero's own top and bottom padding). */
.hero-media {
  position: relative;
  margin: 0;
  width: min(100%, calc((100vh - 60px) * 2852 / 2008));
  width: min(100%, calc((100svh - 60px) * 2852 / 2008));
}

/* Small screens: bleed to the edges; the video has its own empty margins */
@media (max-width: 640px) {
  .hero-media {
    width: calc(100% + 2 * var(--gutter));
    margin: 0 calc(-1 * var(--gutter));
  }
}

/* The video's sky backdrop is feathered into the page across its whole empty
   margin, so the small colour differences between browsers' video decoding,
   the poster and the CSS colour never show as a rectangle. The passport
   itself sits inside ~10% / 9% margins and is never faded. */
.hero-frame {
  position: relative;
  aspect-ratio: 2852 / 2008;
  --fade-x: linear-gradient(to right, transparent, #000 9.5%, #000 90.5%, transparent);
  --fade-y: linear-gradient(to bottom, transparent, #000 8%, #000 94%, transparent);
  -webkit-mask-image: var(--fade-x), var(--fade-y);
  -webkit-mask-composite: source-in;
  mask-image: var(--fade-x), var(--fade-y);
  mask-composite: intersect;
  /* It's an animation, not a video: no long-press callout or text selection */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.hero-poster,
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Clicks and right-clicks go to the page, so there's no video menu
     (Show controls, Pause, Loop…) and nothing to drag */
  pointer-events: none;
}

.hero-video {
  opacity: 0;
  transition: opacity 0.35s ease;
}
.is-playing .hero-video { opacity: 1; }

/* iOS draws a play button on a video it won't autoplay (Low Power Mode) */
.hero-video::-webkit-media-controls,
.hero-video::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none;
}

/* Turning the pages by hand (set up by the hero script). Sideways drags are
   the page's; up and down still scroll. */
.hero-media.is-interactive {
  cursor: grab;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}
.hero-media.is-dragging { cursor: grabbing; }
.hero-media:focus-visible {
  outline-offset: -4px;
  border-radius: var(--radius);
}

/* Sits in the sky below the passport, until the first touch */
.hero-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2.5%;
  margin: 0;
  text-align: center;
  font: 600 0.6875rem/1.4 var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.hint-on .hero-hint { opacity: 1; }

/* ---------- Sections ---------- */

.section { padding: clamp(72px, 10vw, 128px) 0; }
.sky { background: var(--sky); }
.paper {
  background-color: var(--paper);
  background-image: var(--guilloche);
}

.section-head {
  display: grid;
  gap: 16px;
  max-width: 40rem;
  margin: 0 auto clamp(40px, 6vw, 64px);
  text-align: center;
  justify-items: center;
}
.section-head h2 { font-size: clamp(2.1rem, 2.6vw + 1.2rem, 3.4rem); }
.section-head p:not(.label) { color: var(--ink-2); font-size: 1.125rem; }

/* Coming soon */

.coming-soon { text-align: center; }
.coming-soon h2 { font-size: clamp(2.6rem, 4vw + 1.2rem, 4.6rem); }

/* Notes wall */

.notes {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 1000px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(16px, 3vw, 28px);
}

.note {
  --tilt: 0deg;
  width: min(280px, 100%);
  padding: 22px 22px 18px;
  display: grid;
  align-content: space-between;
  gap: 18px;
  transform: rotate(var(--tilt));
  box-shadow:
    0 1px 1px rgb(40 50 60 / 0.06),
    0 14px 24px -16px rgb(40 50 60 / 0.35);
  transition: transform 0.2s ease;
}
.note:hover { transform: rotate(0deg) translateY(-2px); }
.note p {
  font: 500 1.75rem/1.12 var(--hand);
  color: #2b2b2e;
}
.note-trip {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 600 0.625rem/1.3 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgb(28 28 30 / 0.55);
}
.tag {
  font-style: normal;
  letter-spacing: 0.06em;
  text-transform: none;
  font-size: 0.6875rem;
  padding: 2px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
}

.note-pink   { background: var(--note-pink);   --tilt: -1.6deg; }
.note-yellow { background: var(--note-yellow); --tilt: 1.2deg; }
.note-blue   { background: var(--note-blue);   --tilt: -0.8deg; }
.note-purple { background: var(--note-purple); --tilt: 1.8deg; }
.note-white  { background: #fffdf8;            --tilt: -1.2deg; }
.notes li:last-child { --tilt: 0.8deg; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--paper);
  padding: 40px 0 calc(32px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

/* Machine-readable zone, like the bottom of the ID page */
.mrz {
  max-width: var(--max);
  margin: 0 auto 32px;
  padding: 0 var(--gutter);
  display: grid;
  gap: 4px;
  overflow: hidden;
  font: 500 clamp(0.75rem, 1.5vw, 1.125rem)/1.3 var(--mono);
  letter-spacing: 0.14em;
  color: var(--ink-3);
  white-space: nowrap;
}

.footer-row {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
}
.footer-row .brand-word { font-size: 1.125rem; }
.footer-nav { display: flex; gap: 24px; font-size: 0.9375rem; }
.footer-nav a { color: var(--ink-2); text-decoration: none; }
.footer-nav a:hover { color: var(--ink); }
.footer-nav { flex-wrap: wrap; }
.footer-legal {
  max-width: var(--max);
  margin: 20px auto 0;
  padding: 0 var(--gutter);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 24px;
  color: var(--ink-3);
  font-size: 0.8125rem;
}
.footer-legal small { font-size: inherit; }

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
