/* Styles for the landing page (index.html). 404.html still uses styles.css. */

:root {
    --font-display: 'DM Sans', 'Outfit', system-ui, sans-serif;
    --font-body: 'DM Sans', 'Outfit', system-ui, sans-serif;

    --ink: #f5efe4;          /* headline cream */
    --text: #d8d2e2;
    --muted: #a39cb2;
    --faint: #7d768c;
    --accent: #b796f7;       /* lavender buttons */
    --accent-hover: #cbb0ff;
    --accent-ink: #1b1229;
    --violet: #9d6cf0;
    --brand: #7b2cbf;
    --badge: #3b2c55;        /* hexagon icon badge */
    --line: rgba(255, 255, 255, 0.07);
    --line-violet: rgba(201, 182, 255, 0.16);

    --surface-solid: rgba(24, 21, 29, 0.96);
    --surface-deep: rgba(15, 13, 18, 0.97);
    --card: rgba(41, 34, 51, 0.92);

    --cut: 11px;             /* clipped corner on buttons, tabs, cards */

    --hex-tile: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2752%27%20height%3D%2790%27%20viewBox%3D%270%200%2052%2090%27%3E%3Cpath%20d%3D%27M26%200L52%2015V45L26%2060L0%2045V15ZM26%2060V90%27%20fill%3D%27none%27%20stroke%3D%27%23c9b6ff%27%20stroke-opacity%3D%270.07%27%20stroke-width%3D%271%27/%3E%3C/svg%3E");
    --hex-tile-bright: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2752%27%20height%3D%2790%27%20viewBox%3D%270%200%2052%2090%27%3E%3Cpath%20d%3D%27M26%200L52%2015V45L26%2060L0%2045V15ZM26%2060V90%27%20fill%3D%27none%27%20stroke%3D%27%23c9a8ff%27%20stroke-opacity%3D%270.5%27%20stroke-width%3D%271%27/%3E%3C/svg%3E");
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
    background: #0b090c;
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* The live site's background and dark overlay, pinned to the viewport. Sections that are
   transparent (cc-hero, cc-section[surface="peek"]) reveal it as they scroll past. A fixed
   layer is used instead of background-attachment: fixed, which iOS ignores. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(11, 9, 12, 0.55) 0%, rgba(8, 6, 10, 0.88) 100%),
        url('/assets/background.png') center / cover no-repeat;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: rgba(183, 150, 247, 0.35); color: #fff; }

/* Undefined elements: lay out as blocks so the page reads before Polymer upgrades. */
cc-app, cc-header, cc-hero, cc-browser-frame, cc-section, cc-feature-tabs, cc-faq { display: block; }

h1, h2, h3 {
    font-family: var(--font-display);
    color: var(--ink);
    letter-spacing: -0.024em;
    line-height: 1.06;
    font-weight: 700;
}
h1 { font-size: clamp(2.8rem, 5.4vw, 4.3rem); }
h2 { font-size: clamp(2.1rem, 4.4vw, 3.3rem); }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; line-height: 1.3; font-weight: 600; }

.eyebrow {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 2.2rem;
    padding: 0.95rem 1.2rem 0.95rem 1.3rem;
    background: linear-gradient(180deg, #7656c2, #5f43a6);
    color: var(--ink);
    font: 600 0.92rem/1 var(--font-body);
    text-decoration: none;
    border: 0;
    cursor: pointer;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%);
    transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.btn iron-icon { --iron-icon-width: 16px; --iron-icon-height: 16px; color: #d9c8ff; transition: transform 0.25s ease; }
.btn:hover { background: linear-gradient(180deg, #8564d2, #6b4db6); transform: translateY(-2px); }
.btn:hover iron-icon { transform: translate(2px, -2px); }
.btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.btn.wide { width: 100%; }

.link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--ink);
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
}
.link iron-icon { --iron-icon-width: 16px; --iron-icon-height: 16px; color: var(--accent); }
.link:hover { color: var(--accent-hover); }
.link.accent { color: var(--accent); }

/* Square icon buttons (header nav, discord, socials). */
.square-btn {
    display: inline-block;
    border: 1px solid var(--line-violet);
    background: rgba(30, 25, 38, 0.65);
    border-radius: 6px;
    transition: border-color 0.25s ease, background 0.25s ease;
}
.square-btn:hover { border-color: rgba(201, 182, 255, 0.45); background: rgba(59, 44, 85, 0.6); }
.square-btn paper-icon-button {
    display: block;
    width: 42px;
    height: 42px;
    padding: 10px;
    color: var(--accent);
    --paper-icon-button-ink-color: #c9a8ff;
}

/* Plain icon links (header and footer). */
.icon-link paper-icon-button {
    width: 42px;
    height: 42px;
    padding: 9px;
    color: #bbbbbb;
    --paper-icon-button-ink-color: #ffffff;
    transition: color 0.2s ease;
}
.icon-link:hover paper-icon-button, .icon-link paper-icon-button:focus-visible { color: #ffffff; }

/* ---------- Header ---------- */

cc-header .brand img { height: 36px; width: auto; }
cc-header nav { display: flex; gap: 0.25rem; }

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

cc-hero h1 { margin-bottom: 1.6rem; max-width: 11ch; }
cc-hero .lede { font-size: 1.08rem; color: var(--text); max-width: 34rem; margin-bottom: 2.2rem; }
cc-hero .actions { display: flex; align-items: center; gap: 1.6rem; flex-wrap: wrap; margin-bottom: 1.8rem; }
cc-hero .status { font-size: 0.82rem; color: var(--muted); }
cc-hero .status .sep { color: var(--faint); }

/* The square d20 logo as faint line-art behind the hero. */
cc-hero .hero-deco {
    position: absolute;
    top: -6%;
    right: -7%;
    width: min(46vw, 640px);
    opacity: 0.07;
    filter: brightness(2.2) saturate(0.6);
    transform: rotate(14deg);
    animation: drift 26s ease-in-out infinite alternate;
}
@keyframes drift {
    to { transform: rotate(4deg) translate(-2%, 3%); }
}

/* Full-bleed hero video (variant B). */
cc-hero > video[slot="background"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.7) brightness(0.95);
}

@media (prefers-reduced-motion: reduce) {
    cc-hero .hero-deco { animation: none; }
}

/* ---------- Browser frame bits ---------- */

cc-browser-frame > img, cc-browser-frame > video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
.callout {
    position: relative;
    background: rgba(48, 38, 62, 0.96);
    border-left: 3px solid var(--accent);
    padding: 0.85rem 1.3rem 0.9rem 1.15rem;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
    clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
    max-width: 17rem;
}
.callout strong { display: block; color: var(--ink); font-size: 1rem; letter-spacing: -0.01em; }
.callout span { display: block; margin-top: 0.2rem; font-size: 0.82rem; line-height: 1.45; color: var(--text); }
.frame-note { font-size: 0.76rem; color: var(--muted); }

/* Variant C: a second, smaller window peeking out behind the main one. */
.frame-stack { position: relative; }
.frame-stack .behind {
    position: absolute;
    width: 62%;
    top: -12%;
    right: -6%;
    --rx: 8deg; --ry: -18deg; --rz: 3deg;
    --aspect: 4 / 3;
    opacity: 0.55;
    filter: blur(0.4px) saturate(0.8);
}
.frame-stack .front { position: relative; }

/* Variant B: floating proof chips over the full-bleed video. */
.chip-stack { display: grid; gap: 1rem; justify-items: end; }
.chip-stack .callout { max-width: 19rem; }
.chip-stack .callout:nth-child(2) { margin-right: 3rem; }
.chip-stack .callout:nth-child(3) { margin-right: 0.5rem; }

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

.center { text-align: center; }
.two-col {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 4.5rem;
    align-items: start;
}
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; gap: 2.5rem; } }

[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
[data-reveal].revealed { opacity: 1; transform: none; }
[data-reveal="2"] { transition-delay: 0.12s; }
[data-reveal="3"] { transition-delay: 0.24s; }
cc-section:not(:defined) [data-reveal] { opacity: 1; transform: none; }

/* Systems strip */
.systems { --section-pad: 2.4rem 2rem 2.2rem; }
.systems h2 { font-size: 1.15rem; letter-spacing: -0.01em; margin-bottom: 1.1rem; }
.systems ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem 1.8rem;
    margin-bottom: 1rem;
}
.systems li { display: flex; align-items: center; gap: 0.5rem; color: var(--ink); font-weight: 500; font-size: 0.95rem; }
.systems li iron-icon { --iron-icon-width: 15px; --iron-icon-height: 15px; color: var(--violet); transition: transform 0.4s ease; }
.systems li:hover iron-icon { transform: rotate(30deg); color: var(--accent-hover); }
.systems small { font-size: 0.78rem; color: var(--muted); }

/* Systems strip: official compatibility logos at a common optical size. The publishers'
   licenses forbid recoloring or altering the logos, so no filters are applied to them. */
.systems .systems-label { margin: -0.3rem 0 1.4rem; }
.systems ul.sys-logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    column-gap: 3.2rem;
    margin: 0 auto 1.8rem;
}
.sys-logo { margin-block: 0.8rem; }
/* Row breaks, so a narrow screen never leaves one logo alone on a row: one row on wide
   screens, three over two on tablets, two over three on phones. Each row is centered. */
.systems .sys-break { display: none; flex-basis: 100%; height: 0; }
@media (max-width: 1060px) {
    .systems ul.sys-logos { column-gap: 2.6rem; }
    .systems .sys-break.after-3 { display: block; }
}
@media (max-width: 760px) {
    .systems ul.sys-logos { column-gap: 1.2rem; }
    .sys-logo { margin-block: 0.6rem; }
    .systems .sys-break.after-3 { display: none; }
    .systems .sys-break.after-2 { display: block; }
}
.sys-logo img {
    display: block;
    height: 48px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    transition: transform 0.3s ease;
}
.sys-logo.tall img { height: 62px; }
.sys-logo.dnd img { height: 76px; max-width: none; }
.sys-logo:hover img { transform: translateY(-2px) scale(1.04); }
.systems small a { color: var(--accent); text-decoration: none; }
.systems small a:hover { color: var(--accent-hover); }
@media (max-width: 600px) {
    .sys-logo img { height: 36px; }
    .sys-logo.tall img { height: 46px; }
    .sys-logo.dnd img { height: 56px; }
}
@media (max-width: 420px) {
    .sys-logo img { height: 30px; }
    .sys-logo.tall img { height: 42px; }
    .sys-logo.dnd img { height: 50px; }
}

/* Trademark and license notices (required by the systems' compatibility licenses).
   Same size as the copyright line, as Paizo's license requires. */
/* Story section */
/* Story section: rotating campaign ideas (js/elements/cc-idea-deck.js).
   Titles share one grid cell; the front one sits at the bottom and the next few pile up
   behind it, each smaller, dimmer, and further right. The current idea's hooks sit beside it. */
cc-idea-deck {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "tie tie" "stack body" "controls entry";
    column-gap: 5rem;
    row-gap: 2.2rem;
    align-items: center;
}
cc-idea-deck .idea { display: contents; }
.idea-title {
    grid-area: stack;
    align-self: end;
    margin-top: var(--stack-room, 6em);
    font-size: clamp(1.9rem, 3.4vw, 2.65rem);
    line-height: 1.1;
    transform-origin: left bottom;
    transform: translate(var(--x, 0), var(--y, 0)) scale(var(--s, 1));
    transition:
        transform 1.1s cubic-bezier(0.2, 0.7, 0.2, 1),
        opacity 0.9s ease,
        filter 0.9s ease;
    pointer-events: none;
}
.idea[data-depth="0"] .idea-title { opacity: 1; }
.idea[data-depth="1"] .idea-title { opacity: 0.32; filter: blur(0.6px); }
.idea[data-depth="2"] .idea-title { opacity: 0.16; filter: blur(1.4px); }
.idea[data-depth="3"] .idea-title { opacity: 0.07; filter: blur(2.2px); }
.idea[data-depth="4"] .idea-title { opacity: 0; filter: blur(3px); }
/* The departing title drifts forward and down as it fades. */
.idea[data-depth="out"] .idea-title {
    opacity: 0;
    filter: blur(4px);
    transform: translate(-0.6em, 0.9em) scale(1.08);
    transition-duration: 0.8s;
}

.idea-body {
    grid-area: body;
    opacity: 0;
    visibility: hidden;
    transform: translateY(1.4rem);
    transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0s linear 0.8s;
}
.idea-body[data-state="in"] {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition-delay: 0.35s, 0.35s, 0s;
}
.idea-body[data-state="out"] { transform: translateY(-1.4rem); }
.idea-body .big { margin-bottom: 1.1rem; }
.idea-body .hex-list { gap: 0.7rem; }

.deck-controls { grid-area: controls; display: flex; align-items: center; gap: 0.2rem; color: var(--muted); }
.deck-controls paper-icon-button { color: #bbbbbb; --paper-icon-button-ink-color: #fff; width: 36px; height: 36px; padding: 6px; }
.deck-controls paper-icon-button:hover { color: #fff; }
.deck-track { flex: 1; margin-left: 0.8rem; max-width: 220px; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.deck-progress { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.deck-progress.run { animation: deck-progress var(--deck-interval, 8000ms) linear forwards; }
cc-idea-deck[paused] .deck-progress.run { animation-play-state: paused; }
@keyframes deck-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
/* The current idea's Lore Codex entry, styled after the real Codex. The card frame and
   every .idea-entry share one grid cell; the entries cross-fade like the hooks. */
.codex-card {
    grid-area: entry;
    position: relative;
    align-self: stretch;
    border-radius: 7px;
    background: rgba(22, 18, 29, 0.94);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.35);
    border-top: 1px solid rgba(201, 182, 255, 0.08);
}
.gm-toggle {
    position: absolute;
    z-index: 2;
    top: 0.85rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.76rem;
    color: var(--text);
    user-select: none;
    --paper-checkbox-size: 14px;
    --paper-checkbox-unchecked-color: var(--muted);
    --paper-checkbox-checked-color: var(--accent);
    --paper-checkbox-checkmark-color: var(--accent-ink);
    --paper-checkbox-label-color: var(--text);
    --paper-checkbox-label-checked-color: var(--ink);
    --paper-checkbox-label-spacing: 0.45rem;
    --paper-checkbox-ink-size: 34px;
}
.idea-entry {
    grid-area: entry;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    z-index: 1;
    padding: 0.85rem 1.3rem 1.2rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.6rem);
    transition: opacity 0.5s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0s linear 0.7s;
    font-size: 0.84rem;
    color: var(--muted);
}
.idea-entry[data-state="in"] {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition-delay: 0.5s, 0.5s, 0s;
}
.idea-entry[data-state="out"] { transform: translateY(-0.6rem); }
.idea-entry p { margin: 0; }
.idea-entry .crumbs { font-size: 0.74rem; padding-right: 6.5rem; }
.idea-entry .crumbs b { font-weight: 500; color: var(--text); }
.idea-entry .entry-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.4rem;
    margin: 0.7rem 0 0.75rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid rgba(157, 108, 240, 0.55);
}
.idea-entry .entry-name { font-size: 1.2rem; color: var(--ink); margin-right: 0.35rem; }
.idea-entry .type-pill,
.idea-entry .tag {
    font-size: 0.68rem;
    line-height: 1;
    padding: 0.28rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(201, 182, 255, 0.18);
    color: var(--muted);
}
.idea-entry .type-pill { color: #d8ccff; background: rgba(120, 90, 200, 0.22); border-color: rgba(157, 108, 240, 0.45); }
.idea-entry .entry-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin-bottom: 0.75rem; }
.idea-entry .entry-meta span { display: inline-flex; align-items: center; gap: 0.3rem; }
.idea-entry iron-icon { --iron-icon-width: 15px; --iron-icon-height: 15px; color: var(--accent); flex: none; }
.idea-entry .entry-secret {
    display: flex;
    gap: 0.6rem;
    align-items: baseline;
    padding: 0.55rem 0.7rem;
    border-radius: 5px;
    background: rgba(160, 40, 50, 0.1);
    border-left: 2px solid rgba(220, 80, 90, 0.6);
    margin-bottom: 0.95rem;
}
.idea-entry .gm-flag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex: none;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #e27d86;
}
.idea-entry .gm-flag iron-icon { color: currentColor; --iron-icon-width: 13px; --iron-icon-height: 13px; }
.idea-entry .secret-text { color: var(--text); filter: blur(4.5px); opacity: 0.7; transition: filter 0.45s ease, opacity 0.45s ease; }
cc-idea-deck:has(.gm-toggle[checked]) .secret-text { filter: none; opacity: 1; }
.idea-entry .entry-related { margin-top: auto; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.45rem; }
.idea-entry .related-label {
    flex-basis: 100%;
    text-align: center;
    font-size: 0.64rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 0.1rem;
}
.idea-entry .hex-pill {
    font-size: 0.74rem;
    color: var(--text);
    padding: 0.38rem 1rem;
    background: rgba(70, 58, 88, 0.75);
    clip-path: polygon(0.55rem 0, calc(100% - 0.55rem) 0, 100% 50%, calc(100% - 0.55rem) 100%, 0.55rem 100%, 0 50%);
}

.deck-tie { grid-area: tie; align-self: start; padding-bottom: 1.6rem; border-bottom: 1px solid var(--line); }
.deck-tie .eyebrow { display: flex; align-items: center; gap: 0.45rem; margin-bottom: 0.7rem; color: var(--text); }
.deck-tie .eyebrow iron-icon { --iron-icon-width: 16px; --iron-icon-height: 16px; color: var(--accent); }
.deck-tie { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 3rem; align-items: end; }
.deck-tie .eyebrow { grid-column: 1 / -1; }
.deck-tie .small { max-width: 44rem; }
.deck-tie .tie-link { white-space: nowrap; }
@media (max-width: 900px) {
    .deck-tie { grid-template-columns: minmax(0, 1fr); }
    .deck-tie .small { margin-bottom: 0.9rem; }
    .deck-tie .tie-link { justify-self: start; }
}
.tie-link {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}
.tie-link:hover { color: #fff; }
.tie-link iron-icon { --iron-icon-width: 18px; --iron-icon-height: 18px; transition: transform 0.2s ease; }
.tie-link:hover iron-icon { transform: translateX(3px); }

@media (max-width: 900px) {
    cc-idea-deck { grid-template-columns: minmax(0, 1fr); grid-template-areas: "tie" "stack" "body" "controls" "entry"; row-gap: 1.8rem; }
}
@media (prefers-reduced-motion: reduce) {
    .idea-title, .idea-body, .idea-entry { transition-duration: 0s !important; transition-delay: 0s !important; }
    .deck-track { display: none; }
}
/* The idea deck's link web reaches 3rem past the deck on each side; on phones that's past the
   screen edge, which let the page scroll sideways. */
cc-section.story { overflow-x: clip; }
.story .big { font-size: 1.15rem; color: var(--ink); line-height: 1.6; margin-bottom: 1.4rem; opacity: 0.92; }
.story .small { color: var(--muted); }

/* Hexagon bullet list */
.hex-list { list-style: none; display: grid; gap: 0.55rem; }
.hex-list li { position: relative; padding-left: 1.3rem; color: var(--text); }
.hex-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.42em;
    width: 11px;
    height: 11px;
    background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2024%2024%27%3E%3Cpath%20d%3D%27M12%202.5l8.2%204.75v9.5L12%2021.5l-8.2-4.75v-9.5z%27%20fill%3D%27none%27%20stroke%3D%27%239d6cf0%27%20stroke-width%3D%272.6%27/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Feature tabs */
.table-title { margin-bottom: 2.2rem; }
.ft-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.6rem; margin-bottom: 1.2rem; }
.ft-tab {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1.2rem 1.3rem;
    background: rgba(37, 31, 45, 0.9);
    border: 1px solid var(--line-violet);
    color: var(--muted);
    font: 600 0.98rem/1.2 var(--font-body);
    text-align: left;
    cursor: pointer;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%);
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.ft-tab > iron-icon:first-child { color: var(--violet); --iron-icon-width: 20px; --iron-icon-height: 20px; }
.ft-tab:hover { color: var(--ink); background: rgba(52, 42, 66, 0.9); }
.ft-tab.active { color: var(--ink); background: rgba(74, 52, 104, 0.85); border-color: rgba(201, 168, 255, 0.55); }
.ft-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ft-panel {
    display: grid;
    grid-template-columns: minmax(0, 0.62fr) minmax(0, 1.38fr);
    background: rgba(39, 33, 48, 0.94);
    border: 1px solid var(--line-violet);
    min-height: 26rem;
}
cc-feature-tabs:not(:defined) .ft-panel + .ft-panel { margin-top: 1.2rem; }
.ft-panel.active .ft-copy > * { animation: ft-in 0.5s ease both; }
.ft-panel.active .ft-copy > *:nth-child(2) { animation-delay: 0.05s; }
.ft-panel.active .ft-copy > *:nth-child(3) { animation-delay: 0.1s; }
.ft-panel.active .ft-copy > *:nth-child(4) { animation-delay: 0.15s; }
@keyframes ft-in { from { opacity: 0; transform: translateX(-10px); } }
.ft-copy { padding: 2.4rem 1.8rem; display: flex; flex-direction: column; gap: 1.3rem; }
.ft-copy h3 { font-size: 1.7rem; letter-spacing: -0.025em; }
.ft-copy p { color: var(--text); }
.ft-copy .hex-list { font-size: 0.95rem; }
.ft-views { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: auto; }
.ft-view {
    padding: 0.45rem 0.65rem;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
    font: 500 0.8rem/1 var(--font-body);
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.25s ease;
}
.ft-view:hover { color: var(--ink); border-color: var(--line-violet); }
.ft-view.active { color: var(--ink); border-color: rgba(201, 168, 255, 0.6); background: rgba(123, 44, 191, 0.22); }
.ft-media { position: relative; background: #0d0b10; border-left: 1px solid var(--line-violet); overflow: hidden; aspect-ratio: 16 / 10; }
.ft-media > [data-view] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    opacity: 0;
    transform: scale(1.025);
    transition: opacity 0.7s ease, transform 1.4s ease;
}
.ft-media > .contain { object-fit: contain; object-position: center; }
.ft-media > [data-view].active { opacity: 1; transform: none; }
cc-feature-tabs:not(:defined) .ft-media > [data-view]:first-child { opacity: 1; }
/* "Real-time demo" badge, shown over the bottom-left of the editor video while it's the active view. */
.ft-badge {
    position: absolute;
    left: 0.9rem;
    bottom: 0.9rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    background: rgba(17, 14, 21, 0.82);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--ink);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.ft-media:has(> [data-view="editor"].active) .ft-badge { opacity: 1; transform: none; }
cc-feature-tabs:not(:defined) .ft-badge { opacity: 1; transform: none; }
.ft-footnote { text-align: right; font-size: 0.76rem; color: var(--muted); margin-top: 0.9rem; }

@media (max-width: 1000px) { .ft-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
    .ft-panel { grid-template-columns: 1fr; }
    .ft-media { border-left: 0; border-top: 1px solid var(--line-violet); aspect-ratio: 16 / 11; min-height: 0; }
}

/* Feature grid */
.grid-title { font-size: 1.6rem; margin: 6rem 0 2.2rem; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1.8rem; }
/* Icon and title side by side, description underneath both. */
.feature-grid article {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 1rem;
    align-items: center;
    align-content: start;
    border-top: 1px solid var(--line);
    padding: 1.6rem 0 2.6rem;
}
.feature-grid h3 { margin: 0; }
.feature-grid p { grid-column: 1 / -1; margin-top: 0.9rem; color: var(--muted); font-size: 0.93rem; }
@media (max-width: 900px) { .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .feature-grid { grid-template-columns: 1fr; } }

/* Features that arrive after launch: a dashed panel set apart from the launch grid. */
.after-launch {
    margin-top: 2.5rem;
    padding: 2.2rem 2.4rem 0.2rem;
    border: 1px dashed var(--line-violet);
    background: rgba(59, 44, 85, 0.14);
}
.after-launch-head { margin-bottom: 1.8rem; }
.after-launch-head h3 { font-size: 1.3rem; margin: 1rem 0 0.5rem; }
.after-launch-head p { color: var(--muted); max-width: 62ch; font-size: 0.95rem; }
.phase-tag, .soon {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid var(--line-violet);
    border-radius: 999px;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
}
.phase-tag { padding: 0.35rem 0.8rem; }
.phase-tag iron-icon { --iron-icon-width: 15px; --iron-icon-height: 15px; }
.soon { padding: 0.1rem 0.5rem; margin-left: 0.4rem; font-size: 0.62rem; letter-spacing: 0.08em; vertical-align: middle; }
.feature-grid article.later { border-top-style: dashed; border-top-color: var(--line-violet); }
.later .hex-badge { background: rgba(59, 44, 85, 0.45); color: var(--muted); }
@media (max-width: 600px) { .after-launch { padding: 1.6rem 1.3rem 0; } }

/* Hexagon icon badge */
.hex-badge {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 46px;
    background: var(--badge);
    color: var(--accent);
    clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
    transition: background 0.3s ease, transform 0.4s ease;
}
.hex-badge iron-icon { --iron-icon-width: 19px; --iron-icon-height: 19px; }
.hex-badge.sm { width: 34px; height: 38px; }
.hex-badge.sm iron-icon { --iron-icon-width: 15px; --iron-icon-height: 15px; }
article:hover .hex-badge, .pillars li:hover .hex-badge { background: #55397e; transform: rotate(-8deg); }

/* No-one-way pillars */
.pillars { list-style: none; display: grid; gap: 2rem; }
.pillars li { display: grid; grid-template-columns: auto 1fr; gap: 1.1rem; align-items: start; }
.pillars h3 { margin-bottom: 0.25rem; }
.pillars p { color: var(--text); font-size: 0.95rem; opacity: 0.85; }

/* Pricing: one regular hexagon. The shape is drawn by the two pseudo-elements (::before is the
   border colour, ::after the face, inset a couple of pixels), so the content itself is never
   clipped. clip-path would cut off a box-shadow, so the shadow is a drop-shadow filter.
   Wide screens: everything sits inside the hex (.hex-core is display:contents, so its
   children join the grid around the list). Phones: the hex keeps its true proportions and
   holds just the prices and the button; the feature list follows underneath. */
.pricing {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4rem;
    align-items: center;
}
.pricing-intro h2 { margin-bottom: 2rem; }
.price-hex {
    --hex: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
    position: relative;
    isolation: isolate;
    width: 36rem;
    max-width: 100%;
    aspect-ratio: 0.866;
    display: grid;
    grid-template-areas: "deco" "prices" "list" "btn";
    align-content: center;
    justify-items: center;
    padding: 0 3.5rem;
    text-align: center;
    filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.45)) drop-shadow(0 0 40px rgba(123, 44, 191, 0.12));
}
.price-hex::before,
.price-hex::after {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    left: 0;
    right: 0;
    aspect-ratio: 0.866;
    clip-path: var(--hex);
}
.price-hex::before { background: linear-gradient(160deg, rgba(201, 182, 255, 0.5), rgba(201, 182, 255, 0.08) 45%, rgba(201, 182, 255, 0.35)); }
.price-hex::after { top: 2px; left: 2px; right: 2px; background: radial-gradient(120% 70% at 50% 0%, #332a40, #241e2c 60%); }
.price-hex .hex-core { display: contents; }
.price-hex .hex-deco { grid-area: deco; --iron-icon-width: 30px; --iron-icon-height: 30px; color: rgba(201, 182, 255, 0.35); margin-bottom: 1.1rem; }
.price-hex .prices { grid-area: prices; display: flex; align-items: stretch; }
.price-hex .price { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; padding: 0 1.8rem; }
.price-hex .price + .price { border-left: 1px solid var(--line-violet); }
.price-hex .who { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.price-hex .price strong { font-family: var(--font-display); font-size: 3.4rem; line-height: 1; color: var(--ink); letter-spacing: -0.04em; }
.price-hex .per { font-size: 0.85rem; color: var(--muted); }
.price-hex .btn { grid-area: btn; }
.price-hex ul { grid-area: list; list-style: none; display: grid; gap: 0.6rem; text-align: left; margin: 1.6rem 0 1.8rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.price-hex li { display: flex; gap: 0.7rem; align-items: flex-start; color: var(--ink); font-size: 0.95rem; }
.price-hex li iron-icon { --iron-icon-width: 14px; --iron-icon-height: 14px; flex: none; margin-top: 0.2em; color: var(--accent); }
@media (max-width: 1000px) {
    .pricing { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 3rem; }
    .pricing-intro { justify-self: stretch; }
}
@media (max-width: 640px) {
    .price-hex { display: block; aspect-ratio: auto; width: 100%; padding: 0; }
    .price-hex .hex-core {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1.4rem;
        width: 100%;
        aspect-ratio: 0.866;
    }
    .price-hex .hex-deco { display: none; }
    .price-hex .price { padding: 0 1.1rem; }
    .price-hex .price strong { font-size: 2.9rem; }
    .price-hex ul { width: max-content; max-width: 100%; margin: 2rem auto 0; padding-top: 0; border-top: 0; }
}

/* FAQ */
cc-faq h2 { font-size: clamp(2rem, 3.6vw, 2.6rem); margin-bottom: 1.6rem; }
cc-faq .square-btn { margin-bottom: 2.2rem; }
cc-faq label.eyebrow { display: block; margin-bottom: 0.6rem; }
.faq-search {
    width: 100%;
    padding: 0.85rem 0.9rem;
    background: rgba(45, 36, 58, 0.75);
    border: 1px solid var(--line-violet);
    color: var(--ink);
    font: 400 0.9rem var(--font-body);
    border-radius: 3px;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.faq-search::placeholder { color: var(--faint); }
.faq-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(183, 150, 247, 0.15); }
.faq-expand { margin-top: 0.9rem; background: none; border: 0; color: var(--muted); font: 500 0.82rem var(--font-body); cursor: pointer; }
.faq-expand:hover { color: var(--accent); }
.faq-empty { color: var(--muted); padding: 1.4rem 0; }
.faq-item { border-top: 1px solid var(--line); }
.faq-item:last-of-type { border-bottom: 1px solid var(--line); }
.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    padding: 1.15rem 0;
    background: none;
    border: 0;
    color: var(--ink);
    font: 600 0.98rem/1.4 var(--font-body);
    text-align: left;
    cursor: pointer;
    transition: color 0.2s ease;
}
.faq-question:hover { color: var(--accent-hover); }
.faq-icon { color: var(--accent); font-size: 1.1rem; transition: transform 0.35s ease; }
.faq-item.active .faq-icon { transform: rotate(45deg); }
cc-faq:not(:defined) .faq-icon { display: none; }
.faq-answer { color: var(--text); opacity: 0.88; padding-bottom: 1.3rem; font-size: 0.95rem; max-width: 40rem; }
.faq-answer p + p { margin-top: 0.8em; }
.faq-answer a { color: var(--accent); }
cc-faq:defined .faq-answer {
    display: grid;
    grid-template-rows: 0fr;
    padding-bottom: 0;
    visibility: hidden;
    transition: grid-template-rows 0.4s ease, padding 0.4s ease, visibility 0s 0.4s;
}
cc-faq:defined .faq-answer > div { min-height: 0; overflow: hidden; }
cc-faq:defined .faq-item.active .faq-answer {
    grid-template-rows: 1fr;
    padding-bottom: 1.3rem;
    visibility: visible;
    transition: grid-template-rows 0.4s ease, padding 0.4s ease, visibility 0s;
}

/* Seat CTA */
.seat { --section-pad: 8rem 2rem; text-align: center; overflow: hidden; }
.seat .seat-deco {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 340px;
    transform: translate(-50%, -50%);
    opacity: 0.12;
    filter: brightness(1.8);
    pointer-events: none;
    z-index: -1;
}
.seat h2 { font-size: clamp(2.4rem, 5vw, 3.6rem); margin-bottom: 1rem; }
.seat p { max-width: 30rem; margin: 0 auto 2rem; color: var(--text); font-size: 1.08rem; }
.seat .stack { display: flex; flex-direction: column; align-items: center; gap: 1.2rem; }

/* Footer */
.site-footer { background: rgba(17, 15, 20, 0.97); border-top: 1px solid var(--line); }
.site-footer .inner { box-sizing: content-box; max-width: 1200px; margin: 0 auto; padding: 2.4rem 2rem 2.2rem; }
/* One row: logos with the rights line under them, Careers, then the licenses link and the
   socials pushed to the right. */
.site-footer .top { display: flex; align-items: center; gap: 1.5rem 2.6rem; font-size: 0.84rem; color: var(--muted); }
.site-footer .rights { margin-top: 0.45rem; font-size: 0.8rem; color: var(--muted); }
.site-footer .brand-lockup { display: flex; align-items: center; gap: 0.65rem; }
.site-footer .top img { display: block; height: 30px; width: auto; }
.site-footer .brand-by { font-size: 0.85rem; font-style: italic; color: var(--muted); transform: translateY(2px); }
.site-footer .brand-nf { display: block; padding: 4px 0; opacity: 0.78; transform: translateY(2px); transition: opacity 0.2s ease; }
.site-footer .brand-nf:hover, .site-footer .brand-nf:focus-visible { opacity: 1; }
.site-footer .top .brand-nf img { height: 15px; }
.site-footer .socials { display: flex; justify-content: flex-end; gap: 0.25rem; }
.site-footer .foot-link,
.licenses-dialog .legal a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: rgba(201, 182, 255, 0.45);
    text-underline-offset: 0.2em;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.site-footer .foot-link:hover,
.licenses-dialog .legal a:hover { color: #fff; text-decoration-color: currentColor; }
.site-footer .licenses-link { margin-left: auto; margin-right: -1.4rem; }
iron-icon.ext {
    --iron-icon-width: 0.95em;
    --iron-icon-height: 0.95em;
    margin-left: 0.22em;
    vertical-align: -0.1em;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Pop-up dialogs (native <dialog>, opened with showModal from js/landing.js). */
.cc-dialog {
    margin: auto;
    width: min(720px, calc(100vw - 2rem));
    max-height: min(80vh, 760px);
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: #2a2333;
    color: var(--text);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 16px 48px rgba(0, 0, 0, 0.55);
    overflow: hidden;
    flex-direction: column;
}
.cc-dialog[open] { display: flex; }
.cc-dialog::backdrop { background: rgba(8, 6, 10, 0.72); backdrop-filter: blur(3px); }
.cc-dialog .dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0.8rem 1rem 1.6rem;
    border-bottom: 1px solid var(--line);
}
.cc-dialog h2 { font-size: 1.15rem; margin: 0; }
.cc-dialog .dialog-close {
    width: 32px;
    height: 32px;
    padding: 7px;
    flex: none;
    color: #b65a5a;
    --paper-icon-button-ink-color: #ff5252;
    transition: color 0.2s ease;
}
.cc-dialog .dialog-close:hover,
.cc-dialog .dialog-close:focus-visible { color: #ff5252; }
/* Server rack photo: picture beside the caption, stacked on phones. */
.photo-dialog { width: min(880px, calc(100vw - 2rem)); max-height: min(90vh, 900px); }
.photo-dialog figure {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 1.6rem;
    align-items: center;
    padding: 1.4rem 1.6rem 1.6rem;
    overflow-y: auto;
    outline: none;
    scrollbar-color: rgba(201, 182, 255, 0.3) transparent;
}
.photo-dialog img { display: block; width: 100%; height: auto; max-height: 68vh; object-fit: contain; border-radius: 5px; background: #17131d; }
.photo-dialog figcaption { font-size: 0.92rem; line-height: 1.65; color: var(--text); }
.photo-dialog figcaption p + p { margin-top: 0.8rem; }
@media (max-width: 700px) {
    .photo-dialog figure { grid-template-columns: minmax(0, 1fr); gap: 1.2rem; padding: 1.1rem 1.1rem 1.3rem; }
    .photo-dialog img { max-height: 52vh; }
}
.licenses-dialog .legal {
    overflow-y: auto;
    outline: none;
    scrollbar-color: rgba(201, 182, 255, 0.3) transparent;
    padding: 1.2rem 1.6rem 1.6rem;
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--muted);
}
.licenses-dialog .legal h3 {
    margin: 1.3rem 0 0.4rem;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text);
}
.licenses-dialog .legal h3:first-child { margin-top: 0; }
.licenses-dialog .legal p + p { margin-top: 0.6rem; }

@media (max-width: 760px) {
    .site-footer .top { flex-direction: column; text-align: center; }
    .site-footer .brand-block { display: flex; flex-direction: column; align-items: center; }
    .site-footer .licenses-link { margin: 0; }
    .site-footer .socials { justify-content: center; }
}

/* ---------- Routes ----------
   cc-app's route attribute picks the view (see js/routes.js). Home shows everything;
   route="faq" (/faq) shows only the header, the FAQ, and the footer. */
cc-app[route="faq"] > :not(cc-header, #faq, .site-footer) { display: none; }
cc-app[route="faq"] #faq { --section-pad: 9rem 2rem 7rem; border-top: 0; }
cc-app[route="faq"] .nav-faq,
cc-app:not([route="faq"]) .nav-home { display: none; }

/* ---------- Loading overlay ----------
   Hides the page until the components upgrade; removed by the script at the end of index.html. */
#cc-loading {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0b090c;
    transition: opacity 1s ease-in-out;
}
#cc-loading img {
    max-width: 50vw;
    height: auto;
    animation: cc-loading-spin 4s linear infinite;
}
#cc-loading.cc-loading-complete {
    opacity: 0;
    pointer-events: none;
}
@keyframes cc-loading-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    #cc-loading img { animation: none; }
}
