@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/SpaceGrotesk-latin-wght.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --bg: #faf8f3;
  --bg-alt: #f1ede3;
  --ink: #111418;
  --muted: #566070;
  --line: #ddd6c6;
  --petrol: #17596a;
  --petrol-deep: #0a2f3a;
  --red: #e5251e;
  --card: #ffffff;
  --btn-bg: #111418;
  --btn-ink: #ffffff;
  --shadow: 0 24px 60px -24px rgba(10, 47, 58, 0.35);
  --bezel: #1c1f24;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-alt: #0b1217;
    --ink: #ffffff;
    --muted: #9aa6b4;
    --line: #1f2a33;
    --petrol: #46b0c6;
    --red: #ff4a3f;
    --card: #10181e;
    --btn-bg: #ffffff;
    --btn-ink: #111418;
    --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.9);
    --bezel: #2a2f36;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--petrol); }

.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }

h1, h2, h3 { font-family: "Space Grotesk", -apple-system, system-ui, sans-serif; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(2.5rem, 7vw, 4.25rem); font-weight: 600; }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 600; text-wrap: balance; }
h3 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }

/* header, like 3plevel.com: sticky, blurred, icon + wordmark, menu button on narrow screens */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { position: relative; height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-icon { width: 34px; height: 34px; border-radius: 22.5%; }
.brand-word { height: 28px; width: auto; }
.nav-menu { display: flex; align-items: center; gap: 26px; }
.nav-menu a { font-size: 0.95rem; font-weight: 500; color: var(--muted); text-decoration: none; }
.nav-menu a:hover { color: var(--ink); }
.nav-cta {
  font-size: 0.95rem; font-weight: 600; white-space: nowrap;
  background: var(--btn-bg); color: var(--btn-ink); padding: 9px 18px; border-radius: 999px; opacity: 0.85;
}
.nav-toggle { background: none; border: 0; color: var(--ink); width: 44px; height: 44px; padding: 8px; cursor: pointer; }
.nav-toggle[hidden] { display: none; }
@media (min-width: 901px) { .nav-toggle { display: none; } }
@media (max-width: 900px) {
  .js-nav .nav-menu {
    display: none; position: absolute; top: 100%; left: -16px; right: -16px;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 20px;
  }
  .js-nav .nav-menu.open { display: flex; }
  .js-nav .nav-menu a { padding: 14px 0; font-size: 1.05rem; }
  .js-nav .nav-cta { margin-top: 10px; text-align: center; padding: 13px 18px; }
  html:not(.js-nav) .nav-menu { gap: 14px; overflow-x: auto; }
  html:not(.js-nav) .nav-cta { display: none; }
}
.eyebrow { font-family: "Space Grotesk", -apple-system, system-ui, sans-serif; font-weight: 600; color: var(--petrol); margin-bottom: 14px; }
html { scroll-padding-top: 80px; }

/* hero */
.hero { display: grid; gap: 40px; align-items: center; padding: 40px 0 72px; }
.hero p.lead { font-size: 1.2rem; color: var(--muted); margin-top: 20px; max-width: 34ch; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--btn-bg); color: var(--btn-ink);
  padding: 14px 22px; border-radius: 14px; text-decoration: none; font-weight: 600;
}
.btn[aria-disabled="true"] { opacity: 0.85; cursor: default; }
.note { color: var(--muted); font-size: 0.95rem; }

/* devices: thin CSS frames around raw screenshots, as on 3plevel.com */
.phone, .tablet, .phone-land { background: var(--bezel); box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.phone { width: min(280px, 100%); border-radius: 12% / 5.6%; padding: 4px; }
.tablet { width: 100%; border-radius: 2.4% / 3.4%; padding: 5px; }
.phone-land { width: 100%; border-radius: 5.6% / 12%; padding: 3px; }
.phone-screen, .device-screen { overflow: hidden; background: var(--bg-alt); }
.phone-screen { aspect-ratio: 1320 / 2868; border-radius: 11% / 5.06%; }
.tablet .device-screen { aspect-ratio: 2360 / 1640; border-radius: 2% / 2.9%; }
.phone-land .device-screen { aspect-ratio: 2868 / 1320; border-radius: 5.06% / 11%; }
.phone-screen img, .device-screen img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero-devices { position: relative; padding-bottom: 14%; max-width: 600px; width: 100%; justify-self: center; }
.hero-devices .tablet { width: 90%; }
.hero-devices .phone { position: absolute; right: 0; bottom: 0; width: 25%; padding: 3px; }

/* sections */
section { padding: 64px 0; }
section.alt { background: var(--bg-alt); }
.intro { max-width: 56ch; margin-bottom: 36px; }
.intro p { color: var(--muted); margin-top: 14px; }
.cards { display: grid; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 28px; }
.card p { color: var(--muted); margin-top: 10px; }
.feat-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; margin-bottom: 16px; color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); }
.feat-icon svg { width: 24px; height: 24px; }

/* a row of faces on different backgrounds; scrolls sideways on a phone */
.face-row { list-style: none; margin: 40px 0 0; padding: 0 0 12px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; }
.face-row li { scroll-snap-align: start; }
.face-row .phone { width: 100%; padding: 3px; }
.face-row span { display: block; text-align: center; margin-top: 12px; font-size: 0.9rem; color: var(--muted); }
.face-row li:nth-child(even) { margin-top: 28px; }

.privacy-strip { display: grid; gap: 12px; }
.privacy-strip ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.privacy-strip li { padding-left: 28px; position: relative; color: var(--muted); }
.privacy-strip li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 12px; height: 12px; border-radius: 50%; background: var(--petrol); }

.apps { display: grid; gap: 16px; }
.app { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.app-head { display: flex; align-items: center; gap: 14px; }
.app-head img { width: 56px; height: 56px; border-radius: 13px; }
/* the 3pMaster icon is dark gray, so it needs an edge on the dark card */
@media (prefers-color-scheme: dark) { .app-head img[src$="3pmaster-pro-icon.webp"] { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14); } }
.app p { color: var(--muted); }
.app .note { font-size: 0.9rem; }
.app-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: auto; padding-top: 8px; }
.badge img { height: 44px; width: auto; }

/* footer, like 3plevel.com: dark in both modes */
.footer { background: #0e1116; color: #c9d1db; padding: 56px 0 28px; font-size: 0.95rem; }
.footer a { color: #c9d1db; text-decoration: none; }
.footer a:hover { color: #fff; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; }
.brand-footer { gap: 14px; }
.brand-footer .brand-icon { width: 56px; height: 56px; }
.brand-lockup { height: 56px; width: auto; }
.footer-cols { display: flex; flex-wrap: wrap; gap: 56px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer h4 { margin: 0 0 4px; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: #8b95a3; font-weight: 600; }
.copyright { margin-top: 40px; border-top: 1px solid #222a34; padding-top: 22px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; color: #8b95a3; font-size: 0.875rem; }
.copyright p + p { margin-top: 4px; }
@media (prefers-color-scheme: dark) { .footer { background: #080a0e; border-top: 1px solid var(--line); } }

/* privacy page */
/* the article is filled by 3pmaster-website/tools/build-privacy.py */
.policy-doc { max-width: 720px; padding: 24px 0 72px; overflow-wrap: break-word; }
.policy-doc h1 { font-size: clamp(2rem, 5vw, 3rem); }
.policy-doc h2 { font-size: 1.4rem; margin-top: 40px; }
.policy-doc h3 { font-size: 1.1rem; margin-top: 28px; }
.policy-doc p, .policy-doc ul { margin-top: 14px; }
.policy-doc ul { padding-left: 1.2em; }
.policy-doc li { margin-top: 6px; }
.policy-doc hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0 0; }
.policy-doc h1 + p, .policy-doc em { color: var(--muted); }
.updated { color: var(--muted); margin-top: 12px; }

@media (min-width: 820px) {
  .hero { grid-template-columns: 1.05fr 1fr; padding-top: 64px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .apps { grid-template-columns: repeat(3, 1fr); }
  .privacy-strip { grid-template-columns: 1fr 1fr; align-items: center; gap: 48px; }
}
@media (max-width: 480px) {
  .hero-devices .phone { padding: 2px; }
  .tablet { padding: 3px; }
  .phone-land { padding: 2px; }
}

/* 3D tilt and landscape */
.split { display: grid; gap: 32px; align-items: center; }
.side { color: var(--muted); margin-top: 16px; max-width: 44ch; }
.split .note { margin-top: 14px; }
video.tilt { width: 100%; max-width: 520px; height: auto; justify-self: center; border-radius: 28px; border: 1px solid var(--line); box-shadow: var(--shadow); background: #17596a; }
.land { display: grid; gap: 20px; }
@media (min-width: 820px) {
  .split { grid-template-columns: 1fr 1fr; gap: 56px; }
  .land { grid-template-columns: 1fr 1fr; gap: 28px; }
}

.dare { font-family: "Space Grotesk", -apple-system, system-ui, sans-serif; font-size: clamp(1.35rem, 2.6vw, 1.7rem); font-weight: 500; line-height: 1.25; letter-spacing: -0.01em; margin: 22px 0 6px; text-wrap: balance; }
.dare strong { display: block; color: var(--petrol); font-weight: 700; margin-top: 4px; }
/* image on the left on wide screens, text first on a phone */
@media (min-width: 820px) { .split.flip > img { order: -1; } }
img.facedown { width: 100%; height: auto; border-radius: 24px; box-shadow: var(--shadow); }

/* the app's default background, for one section */
section.petrol {
  background: linear-gradient(180deg, #17596a, #0a2f3a);
  --ink: #ffffff; --muted: rgba(255, 255, 255, 0.78); --petrol: #4fb3c8; --line: rgba(255, 255, 255, 0.18);
  --btn-bg: #ffffff; --btn-ink: #111418;
  color: var(--ink);
}
section.petrol a { color: #ffffff; }

/* the 12 backgrounds */
.swatches { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px 8px; max-width: 460px; }
.swatches li { display: grid; justify-items: center; gap: 6px; font-size: 0.8rem; color: var(--muted); }
.swatches li::before { content: ""; width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(180deg, var(--c1), var(--c2)); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12), 0 6px 14px -6px rgba(0, 0, 0, 0.35); }
@media (prefers-color-scheme: dark) { .swatches li::before { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); } }
.faces .note { margin-top: 12px; }

/* live 3D demo */
.demo { display: grid; justify-items: center; gap: 12px; }
.stage { --R: 140px; --rb: 28px; position: relative; width: min(100%, 460px); aspect-ratio: 1; touch-action: pan-y; }
.stage .ring { position: absolute; inset: 0; color: var(--muted); }
.stage .ring svg { width: 100%; height: 100%; display: block; }
.disc3d { position: absolute; left: 50%; top: 50%; width: calc(var(--R) * 2); height: calc(var(--R) * 2); margin: calc(var(--R) * -1) 0 0 calc(var(--R) * -1); transform-style: preserve-3d; will-change: transform; }
.disc3d i { position: absolute; inset: 0; border-radius: 50%; display: block; }
.disc3d .face { background: radial-gradient(circle at 36% 28%, #ffffff 0%, #fbfaf7 45%, #ecebe6 100%); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08); }
.disc3d .rim { background: #a9b3c2; }
.shadow { position: absolute; left: 50%; top: 50%; width: calc(var(--R) * 2.2); height: calc(var(--R) * 2.2); margin: calc(var(--R) * -1.1) 0 0 calc(var(--R) * -1.1); border-radius: 50%; background: radial-gradient(circle at center, rgba(10,30,40,0.38) 0%, rgba(10,30,40,0.22) 45%, rgba(10,30,40,0) 70%); will-change: transform; }
.ball { position: absolute; left: 50%; top: 50%; width: calc(var(--rb) * 2); height: calc(var(--rb) * 2); margin: calc(var(--rb) * -1) 0 0 calc(var(--rb) * -1); border-radius: 50%; background: radial-gradient(circle at 34% 28%, #ff8f80 0%, #f63b2f 32%, #c5160f 78%, #8e0b07 100%); box-shadow: 0 6px 14px rgba(120, 10, 5, 0.35); will-change: transform; }
.btn[hidden] { display: none; }
.btn.small { padding: 10px 18px; font-size: 0.95rem; border: 0; cursor: pointer; font-family: inherit; }
@media (prefers-color-scheme: dark) {
  .disc3d .face { background: radial-gradient(circle at 36% 28%, #fbf9f4 0%, #f1eee7 45%, #d9d5cb 100%); }
  .disc3d .rim { background: #7a8696; }
  .shadow { background: radial-gradient(circle at center, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.5) 45%, rgba(0,0,0,0) 70%); }
}

/* 404: a compass that has lost it */
.notfound { text-align: center; margin: 0 auto; }
.notfound p { margin-left: auto; margin-right: auto; }
.lost { position: relative; width: min(260px, 70vw); margin: 16px auto 28px; color: var(--muted); }
.lost svg { display: block; width: 100%; height: auto; }
.lost-needle { transform-origin: 50px 50px; transform: rotate(152deg); animation: lost-spin 3.2s ease-in-out infinite; }
@keyframes lost-spin {
  0% { transform: rotate(152deg); }
  18% { transform: rotate(410deg); }
  30% { transform: rotate(350deg); }
  52% { transform: rotate(-80deg); }
  64% { transform: rotate(-20deg); }
  82% { transform: rotate(560deg); }
  100% { transform: rotate(512deg); }
}
.lost-reading { margin: 14px 0 0; color: var(--ink); font-family: -apple-system, system-ui, sans-serif; font-size: clamp(3.2rem, 9vw, 4.4rem); font-weight: 700; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.lost-reading span { margin-left: 8px; font-size: 0.42em; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.lost-calibrate { display: inline-block; margin-top: 4px; font-size: 0.95rem; font-weight: 600; color: #935d00; }
@media (prefers-color-scheme: dark) { .lost-calibrate { color: #f6bb43; } }
@media (prefers-reduced-motion: reduce) { .lost-needle { animation: none; } }
