/*
  Debrief site: "chalkboard" design system (2026-11), matching the iOS app.

  A charcoal chalkboard, one cream (#FFF3DC) for chalk lettering and paper,
  ink lettering on paper, handwriting for headings and buttons, the system
  font for anything long enough to need reading. Cards are chalk outlines on
  the board; primary buttons are cream paper capsules.

  The values mirror HomeTheme / HomeFont in the app's HomeRedesign.swift, and
  the Polaroid, clothesline and ring art are the app's own files.
*/

/* The app is trying Neucha in place of Dekko. Both files are here, so the
   whole site switches by changing the first name in --font-hand below. */
@font-face {
    font-family: "Neucha";
    src: url("fonts/Neucha-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Dekko";
    src: url("fonts/Dekko-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: dark;

    --board: #282827;                         /* HomeTheme.charcoal */
    --chalk: #fff3dc;                         /* HomeTheme.chalk / paper */
    --chalk-2: rgba(255, 243, 220, 0.8);
    --chalk-3: rgba(255, 243, 220, 0.58);
    --line: rgba(255, 243, 220, 0.4);         /* chalkCard outline */
    --line-soft: rgba(255, 243, 220, 0.2);
    --card: rgba(0, 0, 0, 0.22);              /* chalkCard fill */
    --ink: #12100d;                           /* HomeTheme.ink */
    --ink-2: rgba(18, 16, 13, 0.74);
    --red: #f27366;                           /* HomeTheme.chalkRed */

    --font-hand: "Neucha", "Dekko", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", cursive;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    --wrap: 1080px;
    --gutter: 40px;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    color: var(--chalk);
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* The chalkboard photo, fixed behind the page the way it sits behind the
   app's scroll views. A fixed layer rather than background-attachment,
   which iOS Safari does not honour. */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100lvh;
    z-index: -1;
    background: var(--board) url("chalkboard.jpg") center / cover no-repeat;
}

a { color: inherit; }

.wrap {
    max-width: calc(var(--wrap) + var(--gutter) * 2);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* ---------- Type ---------- */

.display,
.wordmark,
.kicker,
.btn,
.btn-store {
    font-family: var(--font-hand);
    font-weight: 400;
    font-synthesis: none;
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    line-height: 1;
    letter-spacing: 0.01em;
    text-decoration: none;
    color: var(--chalk);
}

/* The three hand-drawn rings from the app icon, in chalk. */
.wordmark::before {
    content: "";
    flex: none;
    width: 1.5em;
    aspect-ratio: 354 / 120;
    background: url("rings-chalk.png") center / contain no-repeat;
}

.display {
    line-height: 1.04;
    letter-spacing: 0.005em;
    margin: 0;
}

.kicker {
    font-size: 21px;
    line-height: 1.2;
    color: var(--chalk-2);
    margin: 0;
}

.fine {
    font-size: 13px;
    color: var(--chalk-3);
    margin: 0;
}

/* ---------- Nav ---------- */

.nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 0 14px;
}

.nav-row .wordmark { font-size: 36px; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
    font-family: var(--font-hand);
    font-size: 21px;
    line-height: 1;
}

.nav-links a { text-decoration: none; }
.nav-links a:not(.btn):hover { text-decoration: underline; text-underline-offset: 5px; }

/* ---------- Buttons ----------
   Primary: a cream paper capsule with ink lettering (the app's Continue /
   Confirm). Secondary: a chalk outline. */

.btn,
.btn-store {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--chalk);
    color: var(--ink);
    border: 1.5px solid var(--chalk);
    border-radius: 999px;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s ease, background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn:hover,
.btn-store:hover { background: #fffaf0; }

.btn:active,
.btn-store:active { transform: scale(0.98); }

.btn:focus-visible,
.btn-store:focus-visible { outline: 2px solid var(--chalk); outline-offset: 3px; }

.btn-sm { font-size: 20px; padding: 8px 20px 9px; }

/* Full-width action buttons on the invite, join and referral pages. Scripts
   there swap className between "btn-store" and "btn-store btn-secondary",
   so these two class names carry the whole look on their own. */
.btn-store { font-size: 23px; padding: 13px 24px 14px; }

.btn-secondary,
.btn-store.btn-secondary {
    background: transparent;
    color: var(--chalk);
    border-color: var(--line);
    box-shadow: none;
}

.btn-secondary:hover,
.btn-store.btn-secondary:hover { background: rgba(255, 243, 220, 0.08); }

/* Apple's official "Download on the App Store" badge. Any App Store link
   that holds the badge image drops the button look, whatever its class. */
.app-badge { display: block; height: 54px; width: auto; }

.store-badge,
.btn-store:has(> .app-badge),
.btn-store.btn-secondary:has(> .app-badge) {
    display: inline-block;
    width: auto;
    padding: 0;
    background: none;
    border: none;
    border-radius: 9px;
    box-shadow: none;
    line-height: 0;
    align-self: center;
}

.store-badge:focus-visible,
.btn-store:has(> .app-badge):focus-visible { outline: 2px solid var(--chalk); outline-offset: 3px; }

/* ---------- Chalk card ----------
   The app's chalkCard(): a darker patch of board inside a chalk line. Used
   for the join, referral and password cards. */

.chalk-card {
    background: var(--card);
    border: 1.5px solid var(--line);
    border-radius: 18px;
}

.chalk-rule { border: none; border-top: 1px solid var(--line-soft); margin: 0; }

/* ---------- Paper ----------
   Cream paper lying on the board, with the scan's faintly aged edge. */

.paper {
    background: var(--chalk);
    color: var(--ink);
    border-radius: 4px;
    box-shadow:
        inset 0 0 0 0.75px rgba(107, 69, 26, 0.3),
        inset 0 0 16px rgba(107, 69, 26, 0.2),
        0 5px 12px rgba(0, 0, 0, 0.45);
}

/* A small paper label over a photo ("LOCKED"), as on the app's Polaroids. */
.paper-tag {
    display: inline-block;
    font-family: var(--font-hand);
    line-height: 1;
    color: var(--ink);
    background: var(--chalk);
    border-radius: 3px;
    padding: 0.28em 0.5em 0.3em;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* ---------- Polaroid ----------
   The app's taped hero Polaroid: the frame art has a see-through window, so
   the photo sits underneath it. Percentages are the window's pixel geometry
   in the 1395 x 906 frame (PolaroidStyle.hero in HomeRedesign.swift). */

.polaroid {
    position: relative;
    margin: 0;
    aspect-ratio: 1395 / 906;
    container-type: inline-size;
    filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.5));
}

.polaroid-photo {
    position: absolute;
    left: 3.8%;
    top: 14.9%;
    width: 92.4%;
    height: 66.8%;
    object-fit: cover;
    background: #000;
}

.polaroid-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.polaroid .paper-tag {
    position: absolute;
    left: 6.2%;
    bottom: 22%;
    font-size: 15px;
    font-size: clamp(11px, 3.4cqw, 17px);
    letter-spacing: 0.04em;
}

.polaroid figcaption {
    position: absolute;
    left: 6%;
    right: 6%;
    top: 81.4%;
    height: 16%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-family: var(--font-hand);
    font-size: 24px;
    font-size: clamp(15px, 6cqw, 31px);
    line-height: 1;
    color: var(--ink);
    white-space: nowrap;
}

/* ---------- Clothesline ---------- */

.clothesline {
    text-align: center;
    padding: 34px 0 10px;
}

.clothesline img {
    display: block;
    width: 100%;
    max-width: 820px;
    height: auto;
    margin: 0 auto;
    filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.4));
}

.clothesline p {
    font-family: var(--font-hand);
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    line-height: 1.15;
    margin: 20px 0 0;
}

/* ---------- Status line (deep-link attempt feedback) ---------- */

.status-msg {
    font-size: 14px;
    color: var(--chalk-3);
    margin: 16px 0 0 0;
    min-height: 20px;
}

.status-msg.visible { color: var(--chalk-2); }
.status-msg.error { color: var(--red); }
.status-msg:empty { min-height: 0; margin: 0; }

/* ---------- Landing layout (index, invite) ---------- */

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 56px;
    align-items: center;
    padding: 52px 0 36px;
}

.hero .kicker { margin-bottom: 14px; }

.hero h1 {
    font-size: clamp(3.2rem, 6.6vw, 5.2rem);
    margin-bottom: 22px;
}

.hero-sub {
    font-size: 19px;
    line-height: 1.5;
    color: var(--chalk-2);
    max-width: 440px;
    margin: 0 0 28px;
}

.hero .fine { margin-top: 12px; }

.hero .polaroid {
    width: 100%;
    max-width: 500px;
    justify-self: end;
    transform: rotate(2.2deg);
}

/* ---------- How it works ---------- */

.features { padding: 60px 0 52px; }

.features h2 {
    font-size: clamp(2.6rem, 6vw, 4.2rem);
    margin-bottom: 22px;
}

.feature-list { list-style: none; margin: 0; padding: 0; }

.feature {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 32px;
    align-items: center;
    padding: 26px 0;
}

.feature + .feature { border-top: 1px solid var(--line-soft); }

.feature-title {
    display: flex;
    align-items: center;
    gap: 22px;
}

/* Numbered chalk rings, as on the app's How It Works screen. */
.feature .num {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border: 2px solid var(--chalk);
    border-radius: 50%;
    font-family: var(--font-hand);
    font-size: 30px;
    line-height: 1;
}

.feature h3 {
    margin: 0;
    font-family: var(--font-hand);
    font-size: 33px;
    font-weight: 400;
    line-height: 1.1;
}

.feature p {
    margin: 0;
    font-size: 17.5px;
    line-height: 1.55;
    color: var(--chalk-2);
}

/* ---------- Download card ---------- */

.cta-band {
    max-width: 760px;
    margin: 8px auto 72px;
    padding: 46px 28px 40px;
    text-align: center;
    transform: rotate(-0.6deg);
}

.cta-band h2 {
    font-size: clamp(2.3rem, 5.4vw, 3.5rem);
    margin-bottom: 10px;
}

.cta-band p.sub {
    font-family: var(--font-hand);
    font-size: 25px;
    line-height: 1.2;
    color: var(--ink-2);
    margin: 0 0 24px;
}

.cta-band .fine { margin-top: 12px; color: var(--ink-2); }
.cta-band .store-badge:focus-visible { outline-color: var(--ink); }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; padding-top: 34px; gap: 40px; }
    .hero .polaroid { justify-self: center; max-width: 460px; }
}

@media (max-width: 720px) {
    .nav-links .nav-text { display: none; }
    .hero h1 { font-size: clamp(2.9rem, 13vw, 3.6rem); }
    .hero-sub { font-size: 17.5px; }
    .app-badge { height: 52px; }
    .clothesline { padding-top: 22px; }
    .features { padding: 44px 0 40px; }
    .feature { grid-template-columns: 1fr; gap: 12px; padding: 22px 0; }
    .feature-title { gap: 16px; }
    .feature .num { width: 48px; height: 48px; font-size: 25px; }
    .feature h3 { font-size: 28px; }
    .feature p { padding-left: 64px; font-size: 16.5px; }
    .cta-band { margin-bottom: 52px; padding: 38px 20px 34px; }
    .cta-band p.sub { font-size: 22px; }
}

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

.site-footer .footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 0 32px;
    border-top: 1px solid var(--line-soft);
}

.site-footer .wordmark { font-size: 28px; }

.footer-links {
    display: flex;
    align-items: center;
    gap: 22px;
    font-size: 13px;
    color: var(--chalk-2);
}

.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; text-underline-offset: 3px; }

.footer-links .copy {
    padding-left: 22px;
    border-left: 1px solid var(--line-soft);
    line-height: 2;
    color: var(--chalk-3);
}

/* ---------- Instagram in-app browser escape overlay ----------
   Shown by assets/store-escape.js when the Instagram iPhone webview blocks
   an App Store navigation. */

.igx-overlay { position: fixed; inset: 0; z-index: 200; display: none; }
.igx-overlay.igx-visible { display: block; }
.igx-lock, .igx-lock body { overflow: hidden; }

.igx-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.igx-arrow {
    position: absolute;
    top: max(10px, env(safe-area-inset-top));
    right: 18px;
    width: 52px;
    height: 52px;
    color: var(--chalk);
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45));
    animation: igx-nudge 1.4s ease-in-out infinite;
}

.igx-arrow svg { width: 100%; height: 100%; }

@keyframes igx-nudge {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(6px, -6px); }
}

.igx-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--board);
    color: var(--chalk);
    border: 1.5px solid var(--line);
    border-bottom: none;
    border-radius: 22px 22px 0 0;
    padding: 32px 24px calc(28px + env(safe-area-inset-bottom));
    max-width: 560px;
    margin: 0 auto;
    text-align: center;
    box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0.24, 1);
}

.igx-visible .igx-sheet { transform: translateY(0); }

.igx-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--line);
    border-radius: 50%;
    background: transparent;
    color: var(--chalk);
    cursor: pointer;
    padding: 0;
}

.igx-close svg { width: 12px; height: 12px; }

.igx-glyph {
    width: 54px;
    height: 54px;
    border: 1.5px solid var(--line);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.igx-glyph svg { width: 26px; height: 26px; color: var(--chalk); }

.igx-title {
    font-family: var(--font-hand);
    font-size: 31px;
    font-weight: 400;
    line-height: 1.1;
    margin: 0 0 10px 0;
}

.igx-body {
    font-size: 15.5px;
    color: var(--chalk-2);
    line-height: 1.55;
    margin: 0 auto 24px;
    max-width: 400px;
}

.igx-body strong { color: var(--chalk); font-weight: 600; }

.igx-dots {
    display: inline-block;
    font-weight: 700;
    color: var(--chalk);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0 6px;
    letter-spacing: 1px;
}

.igx-actions { display: flex; flex-direction: column; gap: 10px; }

.igx-actions .btn-store { width: 100%; }

.igx-hint {
    font-size: 13px;
    color: var(--chalk-3);
    line-height: 1.5;
    min-height: 18px;
    margin: 14px 0 0 0;
}

@media (prefers-reduced-motion: reduce) {
    .igx-arrow { animation: none; }
    .igx-sheet { transition: none; }
}

/* ---------- Shared responsive rules ---------- */

@media (max-width: 720px) {
    :root { --gutter: 22px; }
    .nav-row .wordmark { font-size: 31px; }
    .nav-links { gap: 18px; }
    .site-footer .footer-row { flex-direction: column; align-items: flex-start; }
    .footer-links { flex-wrap: wrap; gap: 10px 18px; }
    .footer-links .copy { padding-left: 0; border-left: none; width: 100%; }
}
