/* WaifuCave family kit: shared by waifucave.com, wstudio., wmaker. and dcwaifus.waifucave.com.
   Master copy: Website/_family/family/. Each site is its own origin, so Website/_family/sync.sh copies this
   folder into every site as /family/. Don't edit the copies: override in the site's own stylesheet.

   The look: the cave at dusk. A dark canvas (the add-on editor's dotted canvas), soft glass, round pills,
   and the purple-to-coral sunset of Wallpaper Studio's icon and add-on previews. The arch of the WaifuCave
   mark is the family's shape. Each site sets its own accent with <html data-site="…">.
   Marketing pages are dark. Text pages (privacy, terms, settings) add data-theme="auto" and follow the system. */

@font-face {
  font-family: "Clash Display";
  src: url("fonts/ClashDisplay-Variable.woff2") format("woff2");
  font-weight: 200 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "General Sans";
  src: url("fonts/GeneralSans-Variable.woff2") format("woff2");
  font-weight: 200 700; font-style: normal; font-display: swap;
}

:root {
  /* Palette: the cave at dusk */
  --cave: #0E0B1A;        /* the canvas */
  --cave-2: #130F22;
  --dusk-ink: #171225;    /* raised surfaces */
  --dusk-ink-2: #221A38;
  --moon: #F4F1FB;        /* text */
  --haze: #A89FC4;        /* secondary text */
  --haze-2: #8B82A9;      /* tertiary (5.3:1 on the canvas, AA) */
  --indigo: #261A5C; --plum: #7A2E8C; --rose: #D9548E; --coral: #F07878; --peach: #FFC59A;
  --sunset: linear-gradient(180deg, var(--indigo) 0%, var(--plum) 50%, var(--rose) 80%, var(--coral) 100%);

  /* Brand colours, one per site (see data-site below) */
  --wc-pink: #FF6FB5;     /* WaifuCave */
  --wc-violet: #B36BFF;   /* WaifuCave, second */
  --wc-lilac: #B59CFF;    /* Wallpaper Studio */
  --wc-aqua: #39E0D0;     /* Wallpaper Maker */
  --wc-blurple: #8C95FF;  /* Discord Waifus (Discord's #5865F2, lifted for contrast on the cave) */

  /* Semantic tokens. The names --bg --surface --fg --muted --accent --rule are the ones
     wstudio's pages already use: keep them. */
  --bg: var(--cave);
  --surface: var(--dusk-ink);
  --surface-2: var(--dusk-ink-2);
  --fg: var(--moon);
  --muted: var(--haze);
  --rule: rgba(244, 241, 251, .10);
  --glass: rgba(34, 26, 56, .55);
  --glass-edge: rgba(244, 241, 251, .12);
  --glass-hi: rgba(244, 241, 251, .06);
  --accent: var(--wc-pink);
  --accent-2: var(--wc-violet);
  --accent-ink: #160A1C;  /* text on an accent fill */
  --accent-soft: color-mix(in oklab, var(--accent) 16%, transparent);
  --ok: #5EE0A0; --danger: #FF5C73;

  /* Type */
  --font-display: "Clash Display", "General Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "General Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --step--1: .875rem;
  --step-0: 1.0625rem;                          /* 17px body */
  --step-1: 1.25rem;
  --step-2: clamp(1.4rem, 1.1rem + 1.2vw, 1.75rem);
  --step-3: clamp(1.9rem, 1.4rem + 2.4vw, 2.75rem);
  --step-4: clamp(2.5rem, 1.6rem + 4.6vw, 4.5rem);
  --step-5: clamp(3rem, 1.6rem + 7vw, 6.75rem);

  /* Shape and space */
  --r-sm: 10px; --r-md: 16px; --r-lg: 24px; --r-xl: 36px; --r-pill: 999px;
  --maxw: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  --section: clamp(4.5rem, 3rem + 7vw, 9rem);
  --shadow-deep: 0 40px 80px -32px rgba(0, 0, 0, .75);
  --ease-out: cubic-bezier(.2, .7, .2, 1);
}

/* One accent per site */
[data-site="cave"]     { --accent: var(--wc-pink);    --accent-2: var(--wc-violet); }
[data-site="studio"]   { --accent: var(--wc-lilac);   --accent-2: var(--coral); }
[data-site="maker"]    { --accent: var(--wc-aqua);    --accent-2: var(--wc-violet); }
[data-site="dcwaifus"] { --accent: var(--wc-blurple); --accent-2: var(--wc-pink); }

/* Text pages follow the system: a light "dawn" set */
@media (prefers-color-scheme: light) {
  [data-theme="auto"] {
    --bg: #F7F5FC; --surface: #FFFFFF; --surface-2: #F0ECF9;
    --fg: #1C1830; --muted: #5E5878; --rule: #E5E0F2;
    --glass: rgba(255, 255, 255, .72); --glass-edge: rgba(28, 24, 48, .10); --glass-hi: rgba(28, 24, 48, .04);
    --accent-ink: #FFFFFF;
  }
  [data-theme="auto"][data-site="cave"]     { --accent: #C2367F; }
  [data-theme="auto"][data-site="studio"]   { --accent: #6A3FC8; }
  [data-theme="auto"][data-site="maker"]    { --accent: #0B7F74; }
  [data-theme="auto"][data-site="dcwaifus"] { --accent: #4650D8; }
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
html[data-theme="auto"] { color-scheme: light dark; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--fg);
  font: 400 var(--step-0)/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  overflow-x: clip; /* a frame's overhang or a glow never makes the page scroll sideways (clip keeps sticky working) */
}
img, svg, video { max-width: 100%; height: auto; }
img { display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.06; letter-spacing: -.015em; word-spacing: .05em; margin: 0 0 .5em; text-wrap: balance; } /* Clash Display's spaces close up under negative tracking */
h1 { font-size: var(--step-5); letter-spacing: -.03em; line-height: .98; }
h2 { font-size: var(--step-4); letter-spacing: -.025em; }
h3 { font-size: var(--step-2); }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: from-font; }
a:hover { text-decoration-thickness: 2px; }
code, kbd, pre { font-family: var(--font-mono); font-size: .92em; }
::selection { background: color-mix(in oklab, var(--accent) 45%, transparent); color: var(--fg); }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.measure { max-width: 64ch; }
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--muted); max-width: 46ch; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* Focus: always visible for keyboards */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: var(--gutter); top: -100px; z-index: 100; padding: .6rem 1rem; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.skip:focus-visible { top: 12px; }

/* Buttons and pills: the app's round controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 46px; padding: 0 1.35rem; border-radius: var(--r-pill); border: 1px solid transparent;
  font: 600 1rem/1 var(--font-body); letter-spacing: .005em; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .2s var(--ease-out), border-color .2s var(--ease-out), color .2s var(--ease-out);
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in oklab, var(--accent) 84%, white); }
.btn-glass { background: var(--glass); border-color: var(--glass-edge); color: var(--fg); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); }
.btn-glass:hover { border-color: color-mix(in oklab, var(--accent) 55%, transparent); }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }

.pill {
  display: inline-flex; align-items: center; gap: .5em; min-height: 32px; padding: .3rem .9rem;
  border-radius: var(--r-pill); border: 1px solid var(--glass-edge); background: var(--glass-hi);
  color: var(--fg); font: 500 var(--step--1)/1.2 var(--font-body);
}
.pill-dot::before { content: ""; width: .5em; height: .5em; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 16%, transparent); flex: none; } /* mixed here, not via --accent-soft, so a block with its own accent gets its own halo */

/* Glass: the app's panels on the canvas */
.glass {
  background: var(--glass); border: 1px solid var(--glass-edge); border-radius: var(--r-lg);
  -webkit-backdrop-filter: blur(20px) saturate(150%); backdrop-filter: blur(20px) saturate(150%);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow-deep);
}

/* The editor's dotted canvas */
.dots { background-image: radial-gradient(circle, rgba(244, 241, 251, .085) 1px, transparent 1.5px); background-size: 22px 22px; }

/* The arch of the WaifuCave mark: a window onto dusk. Exact semicircle top at the default 4:5 ratio;
   for another ratio set --arch-v to 50% × width ÷ height (e.g. 3:4 → 37.5%). */
.arch { --arch-v: 40%; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 50% 50% var(--r-lg) var(--r-lg) / var(--arch-v) var(--arch-v) var(--r-lg) var(--r-lg); }
.arch > img, .arch > picture > img { width: 100%; height: 100%; object-fit: cover; }

/* Device frames. Content inside .mac-display / .display-panel scales with the frame (container units). */
.mac, .display { position: relative; margin: 0; width: 100%; container-type: inline-size; } /* containers: give them a width (they have none of their own) */
.mac-screen {
  position: relative; padding: clamp(5px, 1.1%, 14px); padding-bottom: clamp(7px, 1.6%, 18px);
  border-radius: clamp(10px, 2.2%, 22px) clamp(10px, 2.2%, 22px) 6px 6px / clamp(10px, 3.4%, 22px) clamp(10px, 3.4%, 22px) 6px 6px;
  background: #07060D; box-shadow: 0 0 0 1px rgba(244, 241, 251, .14), inset 0 0 0 1px rgba(255, 255, 255, .04), var(--shadow-deep);
}
.mac-display, .display-panel { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: clamp(4px, 1%, 10px); background: #000; container-type: inline-size; }
.mac-display > img, .display-panel > img, .mac-display > picture > img, .display-panel > picture > img { width: 100%; height: 100%; object-fit: cover; }
.mac-display::before { /* camera housing */
  content: ""; position: absolute; z-index: 5; top: 0; left: 50%; translate: -50% 0;
  width: 11cqw; height: 2.3cqw; border-radius: 0 0 1.1cqw 1.1cqw; background: #07060D;
}
.mac-base {
  position: relative; height: clamp(8px, 2.6cqw, 18px); margin: 0 -7%;
  border-radius: 2px 2px 50% 50% / 2px 2px 100% 100%;
  background: linear-gradient(180deg, #4A4560 0%, #2A2638 38%, #15131F 100%);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .8);
}
.mac-base::after { content: ""; position: absolute; top: 0; left: 50%; translate: -50% 0; width: 14%; height: 36%; border-radius: 0 0 8px 8px; background: rgba(0, 0, 0, .35); }
.mac-menubar {
  position: absolute; z-index: 4; inset: 0 0 auto 0; height: 2.3cqw; padding: 0 1.6cqw;
  display: flex; align-items: center; gap: 1.6cqw; font: 500 1.25cqw/1 var(--font-body); color: rgba(255, 255, 255, .92);
  background: rgba(20, 14, 36, .28); -webkit-backdrop-filter: blur(1.2cqw); backdrop-filter: blur(1.2cqw);
}
.mac-menubar .end { margin-left: auto; display: flex; gap: 1.4cqw; align-items: center; }
.mac-menubar strong { font-weight: 700; }

.display-screen { padding: clamp(5px, 1.2%, 16px); border-radius: clamp(10px, 1.8%, 20px); background: #0A0912; box-shadow: 0 0 0 1px rgba(244, 241, 251, .14), var(--shadow-deep); }
.display-stand { width: 16%; height: clamp(28px, 8cqw, 90px); margin: 0 auto; background: linear-gradient(90deg, #1C1A27, #3A3650 50%, #1C1A27); clip-path: polygon(12% 0, 88% 0, 100% 100%, 0 100%); }
.display-foot { width: 30%; height: clamp(5px, 1.2cqw, 10px); margin: 0 auto; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #3A3650, #1C1A27); }

/* A window of the app, as captured */
.shot { margin: 0; border-radius: clamp(8px, 1.2vw, 14px); overflow: hidden; box-shadow: 0 0 0 1px rgba(244, 241, 251, .12), var(--shadow-deep); background: var(--surface); }
.shot > img { width: 100%; height: auto; }
figcaption { margin-top: .9rem; color: var(--muted); font-size: var(--step--1); }

/* Top bar */
.fam-nav { position: sticky; top: 0; z-index: 50; background: color-mix(in oklab, var(--bg) 72%, transparent); -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%); border-bottom: 1px solid var(--rule); }
.fam-nav .wrap { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.fam-brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--fg); text-decoration: none; font: 600 1.15rem/1 var(--font-display); letter-spacing: -.01em; white-space: nowrap; }
.fam-brand img { width: 30px; height: 30px; border-radius: 8px; }
.fam-links { margin-left: auto; display: flex; align-items: center; gap: .25rem; }
.fam-links a:not(.btn) { display: inline-flex; align-items: center; min-height: 40px; padding: 0 .9rem; border-radius: var(--r-pill); color: var(--muted); text-decoration: none; font-weight: 500; font-size: .97rem; }
.fam-links a:not(.btn):hover, .fam-links a:not(.btn)[aria-current="page"] { color: var(--fg); background: var(--glass-hi); }
.fam-links .btn { min-height: 40px; margin-left: .35rem; }
@media (max-width: 640px) {
  .fam-links a:not(.btn):not(.keep) { display: none; }
}

/* Footer: the family, then the site's own small print, over the dusk horizon */
.fam-footer { position: relative; margin-top: var(--section); padding: 3rem 0 calc(clamp(110px, 16vw, 200px) + 1.5rem); border-top: 1px solid var(--rule); color: var(--muted); font-size: var(--step--1); overflow: hidden; }
.fam-footer::after { content: ""; position: absolute; inset: auto 0 0 0; height: clamp(110px, 16vw, 200px); background: url("horizon.svg") center bottom / cover no-repeat; pointer-events: none; opacity: .95; }
.fam-footer a { color: var(--muted); }
.fam-footer a:hover { color: var(--fg); }
.fam-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; justify-content: space-between; }
.fam-mark { display: inline-flex; align-items: center; gap: .6rem; color: var(--fg) !important; text-decoration: none; font: 600 1.1rem/1 var(--font-display); }
.fam-mark img { width: 28px; height: 28px; }
.fam-sites { display: flex; flex-wrap: wrap; gap: .5rem; }
.fam-sites a { display: inline-flex; align-items: center; gap: .5rem; min-height: 40px; padding: 0 .95rem; border-radius: var(--r-pill); border: 1px solid var(--rule); text-decoration: none; color: var(--fg); font-weight: 500; }
.fam-sites a::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--dot, var(--haze)); }
.fam-sites a[data-to="cave"] { --dot: var(--wc-pink); }
.fam-sites a[data-to="studio"] { --dot: var(--wc-lilac); }
.fam-sites a[data-to="maker"] { --dot: var(--wc-aqua); }
.fam-sites a[data-to="dcwaifus"] { --dot: var(--wc-blurple); }
.fam-sites a:hover { border-color: color-mix(in oklab, var(--dot) 60%, transparent); }
.fam-sites a[aria-current="page"] { background: var(--glass-hi); }
.fam-legal { margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }

/* Motion: little, and none when asked */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
}
