/* Periphony — periphony.app */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #eef0f6;
  --line: rgba(10, 20, 60, 0.10);
  --text: #0b1020;
  --muted: #4a5368;
  --faint: #7a8296;
  --brand: #0828cc;
  --accent: #0828cc;
  --accent-2: #1d63ea;
  --radius: 18px;
  --wrap: 1180px;
  --font: "KoHo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: var(--font);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 18px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 0.5em; font-weight: 700; }
h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); letter-spacing: -0.015em; }
h2 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.015em; }
h3 { font-size: 1.2rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: 0.85em; background: var(--surface-2); padding: 0.12em 0.4em; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

.eyebrow { letter-spacing: 0.01em; font-size: 0.95rem; font-weight: 600; color: var(--accent-2); margin-bottom: 0.9em; }
.eyebrow a { color: inherit; }
.lede { font-size: clamp(1.08rem, 1.6vw, 1.25rem); color: var(--muted); line-height: 1.55; }
.fine { font-size: 0.88rem; color: var(--faint); }
.fine--center { text-align: center; max-width: 760px; margin: 1.5em auto 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.55em;
  background: var(--brand); color: #fff; font-weight: 600; font-size: 1rem;
  padding: 0.85em 1.4em; border-radius: 999px; border: 1px solid transparent;
  box-shadow: 0 6px 20px rgba(8, 40, 204, 0.25);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn[hidden] { display: none; }

/* Apple Vision Pro: floating "Enter the Club environment" button, bottom right. */
.avp-dock {
  position: fixed; z-index: 60;
  right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
}
.avp-dock[hidden] { display: none; }
.avp-dock__btn { font: inherit; font-weight: 600; font-size: 1.15rem; padding: 1em 1.6em; box-shadow: 0 10px 34px rgba(8, 40, 204, 0.45), 0 0 0 4px rgba(8, 40, 204, 0.12); }
.avp-dock__btn svg { width: 1.3em; height: 1.3em; }
.avp-dock__btn--leave { background: var(--bg); box-shadow: 0 10px 30px rgba(10, 20, 60, 0.25); }
.avp-dock__status:empty { display: none; }
.avp-dock__status { margin: 0; padding: 6px 12px; border-radius: 999px; background: var(--bg); color: var(--text); font-size: 0.88rem; box-shadow: 0 4px 16px rgba(10, 20, 60, 0.18); }
.btn:hover { text-decoration: none; background: #1a3ae6; transform: translateY(-1px); box-shadow: 0 8px 26px rgba(26, 58, 230, 0.32); }
.btn svg { width: 1em; height: 1.15em; }
.btn--ghost { background: transparent; border-color: var(--line); box-shadow: none; color: var(--text); }
.btn--ghost:hover { background: var(--bg-alt); box-shadow: none; }
.btn--small { padding: 0.5em 1.05em; font-size: 0.9rem; box-shadow: none; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; gap: 28px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.logo-mark { width: 26px; height: 26px; color: var(--text); }
.site-nav { display: flex; gap: 22px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a { color: var(--muted); font-size: 0.92rem; white-space: nowrap; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--text); text-decoration: none; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 72px 0 40px; }
.hero__glow {
  position: absolute; inset: -20% -10% auto; height: 900px; pointer-events: none;
  background:
    radial-gradient(40% 50% at 70% 35%, rgba(8, 40, 204, 0.10), transparent 70%),
    radial-gradient(30% 35% at 85% 20%, rgba(255, 60, 40, 0.06), transparent 70%),
    radial-gradient(35% 40% at 55% 55%, rgba(255, 210, 0, 0.06), transparent 70%);
  filter: blur(10px);
}
.hero__inner { position: relative; display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 7fr); gap: 48px; align-items: center; }
.hero__title { display: flex; align-items: center; gap: 18px; margin-bottom: 40px; }
.hero__title h1 { font-size: clamp(1.45rem, 2.1vw, 1.7rem); margin: 0; letter-spacing: 0; line-height: 1.2; }
.hero__title p { margin: 2px 0 0; color: var(--muted); font-size: 0.95rem; }
.hero__icon { width: 72px; height: 72px; border-radius: 17px; flex: none; box-shadow: 0 10px 30px rgba(8, 40, 204, 0.25); }
.hero__quote { margin: 0 0 32px; padding-left: 24px; border-left: 3px solid var(--accent); }
.hero__quote blockquote { margin: 0; }
.hero__quote blockquote p { font-family: var(--font); font-style: italic; font-weight: 400; font-size: clamp(1.85rem, 3.3vw, 2.6rem); line-height: 1.2; letter-spacing: 0; color: var(--text); margin: 0; }
.hero__quote blockquote .hero__quote-title { font-family: var(--font); font-style: normal; font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; color: var(--accent-2); margin-bottom: 14px; line-height: 1.4; }
.hero__quote figcaption { margin-top: 16px; color: var(--muted); font-size: 0.95rem; }
.hero__quote figcaption::before { content: "— "; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 14px; }
.hero__media { position: relative; padding-bottom: 40px; }
.hero__phone { position: absolute; right: -14px; bottom: -10px; width: 30%; max-width: 210px; }
.hero__avp {
  position: absolute; left: -6%; bottom: -2%; width: 40%; max-width: 300px;
  filter: drop-shadow(0 18px 24px rgba(10, 20, 60, 0.28));
}

/* Device frames */
.device { margin: 0; }
.device img { width: 100%; }
.device--mac img, .device--wide img {
  border-radius: 14px; border: 1px solid rgba(10, 20, 60, 0.12);
  box-shadow: 0 30px 80px rgba(10, 20, 60, 0.22);
}
.device--phone img {
  border-radius: 34px; border: 5px solid #1d2233; background: #000;
  box-shadow: 0 24px 60px rgba(10, 20, 60, 0.25);
}
/* iPad Air 11" in landscape: bezel and corner radii scale with the frame width */
.device--ipad { container-type: inline-size; }
.device--ipad .ipad {
  position: relative; padding: 3.6cqw; border-radius: 5.2cqw;
  background: #0b0d12;
  box-shadow:
    0 0 0 2px #c9ccd3, 0 0 0 3px #9ea2ab,
    0 30px 80px rgba(10, 20, 60, 0.28);
}
.device--ipad .ipad::before {
  content: ""; position: absolute; top: 1.35cqw; left: 50%;
  width: 0.9cqw; height: 0.9cqw; transform: translateX(-50%);
  border-radius: 50%; background: #1c2130; box-shadow: inset 0 0 0 1px #2a3142;
}
.device--ipad img { display: block; border-radius: 1.6cqw; background: #000; }
/* Live visualizer overlays (assets/js/viz.js) drawn over a screenshot */
.viz { position: relative; }
.viz__layer { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.6s; }
.viz.is-live .viz__layer { opacity: 1; }
.device--phone .viz__layer { inset: 5px; } /* inside the phone's border */
.viz__canvas { position: absolute; display: block; max-width: none; }
.viz__svg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.viz__svg text { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif; fill: #fff; }
.viz__labels text { paint-order: stroke; stroke: rgba(0, 0, 0, 0.25); stroke-width: 2px; }
.device--center { max-width: 1000px; margin: 0 auto 56px; }
.device--wide { margin: 0 0 56px; }
.device--avp { position: relative; margin-bottom: 96px; }
.device--avp .product-avp {
  position: absolute; right: -2%; bottom: -9%; width: 36%;
  border: 0; border-radius: 0; box-shadow: none;
  filter: drop-shadow(0 18px 24px rgba(10, 20, 60, 0.28));
}

/* Ticker */
.ticker { border-block: 1px solid var(--line); background: var(--bg-alt); }
.ticker__list { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 30px; padding-block: 22px; margin: 0 auto; }
.ticker__list li { color: var(--muted); font-weight: 600; font-size: 0.95rem; letter-spacing: 0.01em; }

/* Sections */
.section { padding: clamp(72px, 10vw, 128px) 0; }
.section--alt { background: var(--bg-alt); }
.section--vision { background: radial-gradient(60% 50% at 50% 0%, rgba(8, 40, 204, 0.07), transparent 70%), var(--bg); }
.section__head { text-align: center; max-width: 760px; margin: 0 auto 56px; }

/* Cards */
.cards { display: grid; gap: 20px; }
.cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(10, 20, 60, 0.04); border-radius: var(--radius); padding: 30px; }
.card p { color: var(--muted); margin: 0; }
.card__icon { width: 48px; height: 48px; color: var(--accent); margin-bottom: 20px; }
.card h3 { margin-bottom: 0.2em; }
.card .card__kicker { color: var(--accent-2); font-weight: 600; font-size: 0.9rem; margin-bottom: 0.8em; }
.cards--plain > div { border-top: 1px solid var(--line); padding-top: 20px; }
.cards--plain p { color: var(--muted); font-size: 0.95rem; margin: 0; }

/* Formats table */
.table-wrap { margin-top: 56px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.formats { width: 100%; border-collapse: collapse; min-width: 680px; font-size: 0.95rem; }
.formats th, .formats td { padding: 16px 20px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.formats tbody tr:last-child > * { border-bottom: 0; }
.formats thead th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); font-weight: 600; }
.formats thead th:nth-child(n+3), .formats td.yes, .formats td.no { text-align: center; }
.formats tbody th { font-weight: 600; }
.formats tbody th span { display: block; font-weight: 400; color: var(--faint); font-size: 0.82rem; margin-top: 2px; }
.formats td code { margin: 2px 2px 2px 0; display: inline-block; }
.formats .yes { color: var(--accent); }
.formats .no { color: var(--faint); }

/* Split sections */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center; }
.split--reverse .split__copy { order: 2; }
.split__copy > p { color: var(--muted); }
.split__video { margin-top: 0.6em; }
.section--alt .split__video:hover { background: var(--bg); }
.phones { display: flex; justify-content: center; gap: 24px; }
.phones .device--phone { width: min(46%, 290px); }
.phones .device--phone:nth-child(2) { margin-top: 64px; }
/* iPhone with AirPods resting against its lower-right edge (Head tracking) */
.phones .phone-airpods { position: relative; width: min(46%, 290px); }
.phones .phone-airpods .device--phone { width: 100%; }
.phone-airpods__buds {
  position: absolute; right: -52%; bottom: -4%; width: 60%;
  filter: drop-shadow(0 14px 18px rgba(10, 20, 60, 0.3));
}
/* iPhone in front of a headphone photo (Adjustable Rendering) */
.phones .phone-headphones { position: relative; width: 100%; max-width: 620px; }
.phones .phone-headphones .device--phone { position: relative; width: min(44%, 290px); }
.phone-headphones__photo {
  position: absolute; right: -6%; bottom: 4%; width: 74%;
  filter: drop-shadow(0 18px 24px rgba(10, 20, 60, 0.28));
}

.ticks { list-style: none; padding: 0; margin: 1.5em 0 0; }
.ticks li { position: relative; padding-left: 28px; margin-bottom: 0.8em; color: var(--muted); }
.ticks li strong { color: var(--text); font-weight: 600; }
.ticks li::before { content: ""; position: absolute; left: 4px; top: 0.55em; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }

.pills { list-style: none; padding: 0; margin: 1.6em 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pills li { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; color: var(--muted); font-size: 0.9rem; line-height: 1.4; }
.pills strong { display: block; color: var(--text); font-size: 1rem; margin-bottom: 2px; }

.specs { display: grid; grid-template-columns: max-content 1fr; gap: 0; margin: 1.6em 0 0; border-top: 1px solid var(--line); }
.specs dt, .specs dd { padding: 14px 0; border-bottom: 1px solid var(--line); margin: 0; }
.specs dt { font-weight: 600; padding-right: 24px; }
.specs dd { color: var(--muted); }

.arrow { font-weight: 600; margin-right: 22px; white-space: nowrap; }
.arrow::after { content: " →"; }

/* About */
.about__inner { max-width: 720px; }
.about h2 { margin-bottom: 0.7em; }
.about p { font-size: 1.15rem; color: var(--muted); }
.about .about__sig { color: var(--text); font-style: italic; margin-top: 1.4em; }
.about__sig::before { content: "— "; }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; max-width: 900px; margin: 0 auto; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px; }
.plan--pro { background: linear-gradient(160deg, rgba(8, 40, 204, 0.08), var(--surface) 60%); border-color: rgba(8, 40, 204, 0.35); }
.plan__price { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 48px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-alt); padding: 56px 0 32px; font-size: 0.92rem; }
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; }
.site-footer__brand p { color: var(--muted); max-width: 400px; margin-top: 14px; }
.site-footer__links { display: grid; grid-template-columns: repeat(2, auto); gap: 10px 48px; align-content: start; }
.site-footer__links a { color: var(--muted); }
.site-footer__links a:hover { color: var(--text); }
.site-footer__legal { margin-top: 40px; }
.site-footer__legal p { color: var(--faint); font-size: 0.8rem; margin: 0; padding-top: 24px; border-top: 1px solid var(--line); }

/* Prose pages (guide, blog, collections) */
.prose-page { padding-block: 64px 96px; }
.prose { max-width: 760px; margin: 0 auto; }
.prose h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin-bottom: 0.4em; }
.prose h2 { font-size: 1.7rem; margin: 2.2em 0 0.6em; padding-top: 0.2em; }
.prose h3 { font-size: 1.25rem; margin: 1.8em 0 0.5em; }
.prose p, .prose li { color: #2c3447; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 0.4em; }
.prose strong { color: var(--text); }
.prose blockquote { margin: 1.5em 0; padding: 0.4em 0 0.4em 1.2em; border-left: 3px solid var(--accent); color: var(--muted); font-style: italic; }
.prose blockquote p { color: inherit; margin: 0.3em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: 0.92rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--faint); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.prose pre { background: var(--bg-alt); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; overflow-x: auto; font-size: 0.88rem; line-height: 1.5; }
.prose pre code { background: none; padding: 0; }
.prose img { border-radius: 12px; margin: 1.5em 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 3em 0; }
.prose .lede { color: var(--muted); }

.toc { background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin: 2em 0 3em; }
.toc ul { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 32px; }
.toc li { margin: 0 0 0.4em; break-inside: avoid; }

.post-list { list-style: none; padding: 0; margin: 2.5em 0 0; }
.post-list li { border-top: 1px solid var(--line); padding: 26px 0; }
.post-list h2 { margin: 0.1em 0 0.4em; font-size: 1.45rem; padding: 0; }
.post-list h2 a { color: var(--text); }
.post-list time { color: var(--faint); font-size: 0.85rem; }
.post-list p { color: var(--muted); margin: 0; }

.repos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 2.5em; }
.repo { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; }
.repo img { width: 64px; height: 64px; border-radius: 14px; margin: 0 0 16px; background: #fff; object-fit: contain; }
.repo h2 { font-size: 1.15rem; margin: 0 0 0.4em; padding: 0; }
.repo p { font-size: 0.93rem; color: var(--muted); flex: 1; }
.repo .badge { display: inline-block; align-self: flex-start; font-size: 0.78rem; font-weight: 600; color: var(--faint); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
.repo .btn { align-self: flex-start; }

/* Responsive */
@media (max-width: 980px) {
  .hero__inner { grid-template-columns: 1fr; gap: 48px; }
  .hero__copy { max-width: 640px; }

  .split { grid-template-columns: 1fr; gap: 48px; }
  .split--reverse .split__copy { order: 0; }
  .cards--3 { grid-template-columns: 1fr; }
  .cards--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .site-header .btn--small { display: none; }
  .site-header__inner { gap: 18px; }
  .site-nav { gap: 16px; }
  .brand span { display: none; }
  .hero { padding-top: 44px; }
  .hero__phone { right: -6px; width: 34%; }
  .hero__avp { left: -4px; width: 38%; }
  .device--avp { margin-bottom: 64px; }
  .device--avp .product-avp { width: 46%; right: -4px; bottom: -14%; }
  .phone-headphones__photo { right: 0; }
  .cards--4, .plans, .repos, .pills { grid-template-columns: 1fr; }
  .toc ul { columns: 1; }
  .specs { grid-template-columns: 1fr; }
  .specs dt { border-bottom: 0; padding-bottom: 0; }
  .specs dd { padding-top: 4px; }
}

/* Video lightbox */
.lightbox { border: 0; padding: 0; background: transparent; width: min(92vw, 1280px); max-width: none; max-height: none; overflow: visible; }
.lightbox::backdrop { background: rgba(5, 8, 20, 0.82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.lightbox[open] { animation: lightbox-in 0.22s ease-out; }
.lightbox__frame { position: relative; }
.lightbox video { display: block; width: 100%; height: auto; max-height: 86vh; aspect-ratio: 16 / 9; background: #000; border-radius: 14px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.lightbox__close { position: absolute; top: -48px; right: 0; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.14); color: #fff; cursor: pointer; transition: background 0.15s; }
.lightbox__close:hover, .lightbox__close:focus-visible { background: rgba(255, 255, 255, 0.28); }
.lightbox__close svg { width: 20px; height: 20px; }
@keyframes lightbox-in { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .lightbox[open] { animation: none; } }
