/*
 * getbeachy.app: every page. The home page adds home.css.
 *
 * Colours are the app's tokens (src/design_system/tokens.ts) and keep its
 * rule: warm shell and sand, sea as the one accent, amber for small marks.
 * Newsreader stands in for Tiempos Headline, which has no web licence here;
 * body text is Inter, as in the app. Light only, like the app's own pages.
 */

@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/assets/fonts/newsreader-normal-latin.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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/assets/fonts/newsreader-normal-latin-ext.woff2') format('woff2');
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/newsreader-italic-latin.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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/newsreader-italic-latin-ext.woff2') format('woff2');
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/assets/fonts/inter-normal-latin.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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/assets/fonts/inter-normal-latin-ext.woff2') format('woff2');
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

:root {
  color-scheme: light;
  interpolate-size: allow-keywords;

  --shell: #fbf7ef;
  --sand: #f3eada;
  --sand-2: #e9ddc6;
  --cream: #fffdf8;
  --ink: #1c1a17;
  --ink-2: #4a463f;
  /* Darker than the app's #8A847A: small grey text on shell needs 4.5:1
     (WCAG AA) and the app's tone gives 3.5. */
  --ink-3: #6a645b;
  --line: rgb(28 26 23 / 9%);
  --sea: #3f7a8c;
  --sea-deep: #2f6070;
  /* Sea for small text: #3F7A8C itself sits at 4.49:1 on shell, just under
     AA. Fills, buttons and big serif type keep the brand sea. */
  --sea-ink: #356b7c;
  --sea-soft: #d6e5ea;
  --amber: #e3a857;
  --moss: #6b8e6a;
  --heart: #e63946;

  --serif: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --gutter: clamp(20px, 4.5vw, 56px);
  --wide: 1320px;
  --ease-out: cubic-bezier(0.16, 0.84, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.5, 1);

  background: var(--shell);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 88px;
}

@media (prefers-reduced-motion: no-preference) {
  :root {
    scroll-behavior: smooth;
  }
  /* Same-site page changes cross-fade, with the header held in place. */
  @view-transition {
    navigation: auto;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--shell);
}
body > main {
  flex: 1;
}
img,
svg,
picture {
  display: block;
  max-width: 100%;
}
a {
  color: var(--sea-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover {
  color: var(--sea-deep);
}
:focus-visible {
  outline: 2px solid var(--sea);
  outline-offset: 3px;
  border-radius: 4px;
}
::selection {
  background: var(--sea-soft);
  color: var(--ink);
}
[hidden] {
  display: none !important;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-wrap: balance;
  margin: 0;
}
h1 em,
h2 em {
  color: var(--sea);
}
p {
  margin: 0;
  text-wrap: pretty;
}
.eyebrow {
  margin: 0;
  color: var(--sea-ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.fine {
  color: var(--ink-3);
  font-size: 14px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--shell);
  text-decoration: none;
}
.skip:focus {
  top: 12px;
}

/* ---------- the header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px var(--gutter);
  padding-top: max(14px, env(safe-area-inset-top));
  border-bottom: 1px solid rgb(28 26 23 / 12%);
  background: rgb(251 247 239 / 88%);
  box-shadow: 0 10px 30px -24px rgb(28 26 23 / 45%);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  transition:
    background-color 300ms var(--ease-out),
    border-color 300ms var(--ease-out),
    box-shadow 300ms var(--ease-out);
  view-transition-name: site-header;
}
/* site.js sets this while the page sits at the very top. Without the script
   the header simply stays solid. */
.site-header.is-top {
  border-bottom-color: transparent;
  background: rgb(251 247 239 / 0%);
  box-shadow: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover {
  color: var(--ink);
}
.brand .mark {
  width: 32px;
  height: 32px;
  transition: transform 600ms var(--ease-spring);
}
.brand:hover .mark {
  transform: rotate(-18deg);
}
.brand span {
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1;
  letter-spacing: -0.02em;
}
.site-nav {
  display: flex;
  gap: 26px;
  margin-left: auto;
  font-size: 15px;
  font-weight: 500;
}
.site-nav a {
  position: relative;
  color: var(--ink-2);
  text-decoration: none;
}
.site-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 1.5px;
  background: var(--sea);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 360ms var(--ease-out);
}
.site-nav a:hover {
  color: var(--ink);
}
.site-nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}
@media (max-width: 760px) {
  .site-nav {
    display: none;
  }
  .site-header .badge {
    margin-left: auto;
  }
}

/* ---------- App Store badge, QR, buttons ---------- */

/* Apple's artwork, unmodified. Never under 40 px tall, and a quarter of its
   height clear around it. */
.badge {
  display: inline-block;
  flex: none;
  border-radius: 9px;
  transition:
    transform 400ms var(--ease-spring),
    box-shadow 400ms var(--ease-out);
}
.badge img {
  width: auto;
  height: 100%;
}
/* The QR card beside it stands exactly as tall (.qr). */
.badge--large {
  height: 60px;
}
.badge--small {
  height: 40px;
}
.badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -10px rgb(28 26 23 / 45%);
}
.badge:active {
  transform: translateY(0) scale(0.98);
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
}
.qr {
  display: none;
  align-items: center;
  gap: 12px;
  max-width: 250px;
  height: 60px;
  padding: 5px 14px 5px 5px;
  border: 1px solid var(--sand-2);
  border-radius: 14px;
  background: var(--cream);
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.35;
}
.qr img {
  width: 48px;
  height: 48px;
  padding: 3px;
  border-radius: 6px;
  background: #fff;
  image-rendering: pixelated;
}
@media (min-width: 900px) and (hover: hover) {
  .qr {
    display: flex;
  }
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  padding: 14px 24px;
  border-radius: 999px;
  background: var(--sea);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  transition:
    background 200ms,
    transform 300ms var(--ease-spring);
}
.button:hover {
  background: var(--sea-deep);
  color: #fff;
  transform: translateY(-1px);
}
.button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}
.text-link {
  font-weight: 600;
  text-decoration: none;
}
.text-link::after {
  content: '→';
  display: inline-block;
  margin-left: 0.3em;
  transition: transform 300ms var(--ease-out);
}
.text-link:hover::after {
  transform: translateX(4px);
}

/* ---------- the footer ---------- */

/* Sand, the one warm block that closes every page. */
.site-footer {
  display: grid;
  gap: 32px;
  padding: 56px var(--gutter) max(36px, env(safe-area-inset-bottom));
  background: var(--sand);
  color: var(--ink-2);
  font-size: 15px;
}
.site-footer a {
  color: var(--ink-2);
  text-decoration: none;
}
.site-footer a:hover {
  color: var(--sea-ink);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px 48px;
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
}
.site-footer__brand {
  display: grid;
  justify-items: start;
  gap: 12px;
}
.site-footer__brand p {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.site-footer .brand,
.site-footer .brand:hover {
  color: var(--ink);
}
.site-footer__links {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  align-content: start;
  gap: 12px 40px;
}
@media (max-width: 560px) {
  .site-footer__links {
    grid-template-columns: 1fr;
  }
}
.site-footer__legal {
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid rgb(28 26 23 / 10%);
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.6;
}

/* ---------- contact ---------- */

.contact-main {
  display: grid;
  gap: clamp(40px, 6vw, 64px);
  width: min(1080px, 100% - 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(48px, 9vw, 104px) 0 clamp(64px, 9vw, 112px);
}
.contact-head {
  display: grid;
  justify-items: start;
  gap: 16px;
  max-width: 640px;
}
.contact-head h1 {
  font-size: clamp(52px, 8vw, 96px);
  letter-spacing: -0.035em;
}
.contact-head > p:not(.eyebrow) {
  color: var(--ink-2);
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.55;
}
.contact-email {
  margin-top: 4px;
  color: var(--sea);
  font-family: var(--serif);
  font-size: clamp(26px, 3.4vw, 38px);
  letter-spacing: -0.02em;
  text-decoration: none;
  background: linear-gradient(var(--sea), var(--sea)) 0 100% / 0 1.5px no-repeat;
  transition: background-size 400ms var(--ease-out);
}
.contact-email:hover {
  background-size: 100% 1.5px;
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.contact-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 24px 24px 22px;
  border: 1px solid var(--sand-2);
  border-radius: 22px;
  background: var(--cream);
  transition:
    transform 400ms var(--ease-spring),
    box-shadow 400ms var(--ease-out);
}
.contact-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px -26px rgb(72 51 35 / 45%);
}
.contact-card h2 {
  font-size: 26px;
  letter-spacing: -0.015em;
}
.contact-card p {
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.55;
}
.contact-card .text-link {
  margin-top: 4px;
}
.contact-card--company {
  border-color: transparent;
  background: var(--sand);
}
.contact-card--company:hover {
  transform: none;
  box-shadow: none;
}
.contact-card--company p {
  line-height: 1.7;
}

/* ---------- static pages: privacy, terms, support, guidelines ---------- */

.prose {
  width: min(760px, 100% - 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(40px, 8vw, 88px) 0 96px;
}
.prose h1 {
  font-size: clamp(42px, 7vw, 68px);
  margin-bottom: 12px;
}
.prose h2 {
  margin: 44px 0 10px;
  font-size: clamp(25px, 3vw, 30px);
  letter-spacing: -0.015em;
}
.prose p,
.prose li {
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.7;
}
.prose p + p {
  margin-top: 14px;
}
.prose ul {
  padding-left: 22px;
}
.prose .meta {
  color: var(--ink-3);
  font-size: 14px;
}
.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 40px;
}
.legal-nav a {
  padding: 7px 14px;
  border: 1px solid var(--sand-2);
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition:
    border-color 200ms,
    color 200ms;
}
.legal-nav a:hover,
.legal-nav a[aria-current='page'] {
  border-color: var(--sea);
  color: var(--sea-ink);
}

/* ---------- shared links and the 404 ---------- */

.share-main {
  display: grid;
  place-items: center;
  padding: clamp(32px, 8vw, 96px) var(--gutter);
  background:
    url('/assets/img/atlas-coarse.svg') center 70% / min(1400px, 220%) auto no-repeat,
    var(--shell);
}
.share-card {
  display: grid;
  gap: 16px;
  width: min(560px, 100%);
  padding: clamp(28px, 6vw, 48px);
  border: 1px solid var(--sand-2);
  border-radius: 28px;
  background: rgb(255 253 248 / 94%);
  box-shadow: 0 30px 80px -30px rgb(72 51 35 / 28%);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.share-card h1 {
  font-size: clamp(36px, 7vw, 52px);
}
.share-card > p {
  color: var(--ink-2);
}
.share-card > .button {
  justify-self: start;
  margin-top: 6px;
}
.share-card__install {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-top: 24px;
  border-top: 1px solid var(--sand-2);
}
.share-card__install h2 {
  font-size: 24px;
}
.share-card__install p {
  color: var(--ink-2);
  font-size: 15px;
}

/* ---------- the auth fallback pages (rendered by the Worker) ---------- */

.auth-main {
  display: grid;
  min-height: 100vh;
  place-items: center;
  width: min(560px, 100% - 40px);
  margin: 0 auto;
  padding: 32px 0;
}
.auth-card {
  width: 100%;
  padding: clamp(24px, 6vw, 44px);
  border: 1px solid var(--sand-2);
  border-radius: 24px;
  background: var(--cream);
  box-shadow: 0 18px 60px rgb(72 51 35 / 10%);
}
.auth-card .eyebrow {
  margin-bottom: 10px;
}
.auth-card h1 {
  margin-bottom: 10px;
  font-size: clamp(34px, 7vw, 46px);
}
.auth-card p {
  color: var(--ink-2);
  line-height: 1.6;
}
.auth-card .meta {
  margin-top: 18px;
  color: var(--ink-3);
  font-size: 14px;
}
.auth-card form {
  margin-top: 28px;
}
.auth-card label {
  display: block;
  margin: 18px 0 7px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
}
.auth-card input {
  width: 100%;
  border: 1px solid rgb(28 26 23 / 12%);
  border-radius: 12px;
  padding: 13px 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.auth-card input:focus {
  border-color: var(--sea);
  outline: 3px solid rgb(63 122 140 / 18%);
}
.auth-button {
  width: 100%;
  margin-top: 20px;
}
/* The live password checklist. Mirrors the chips the app shows under the same
   field; the rules themselves come from src/features/auth/password-policy.ts. */
.rules {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
}
.rule {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 8px;
  border: 1px solid var(--sand-2);
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
  transition:
    background-color 200ms,
    border-color 200ms,
    color 200ms;
}
.rule::before {
  content: '\25cb';
}
.rule.met {
  border-color: transparent;
  background: var(--sea-soft);
  color: var(--sea-ink);
}
.rule.met::before {
  content: '\2713';
}
.auth-status {
  min-height: 26px;
  margin: 18px 0 0;
  font-weight: 600;
}
.auth-status.success {
  color: var(--moss);
}
.auth-status.error {
  color: var(--heart);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
  }
}
