/* WidgetThemes site. Cream on warm ink, with no colour of its own, so the themes do the talking. */

:root {
  --bg: #121110;
  --bg-raised: #181715;
  --panel: #1f1d1a;
  --stroke: rgba(239, 235, 226, 0.09);
  --stroke-strong: rgba(239, 235, 226, 0.18);
  --text: #efebe2;
  --dim: rgba(239, 235, 226, 0.64);
  --faint: rgba(239, 235, 226, 0.4);
  --accent: #efe6d2;
  --sand: #cdbfa3;
  --accent-ink: #2b261c;
  --radius: 18px;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  /* A faint warm light over the top of the page, like a lamp over a desk. */
  background: radial-gradient(1200px 700px at 50% -12%, rgba(239, 230, 210, 0.07), transparent 62%), var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
em { font-style: italic; }
h1, h2, h3 { margin: 0; font-weight: 400; }
h1, h2 { font-family: var(--serif); letter-spacing: -0.01em; line-height: 1.02; }
h1 em, h2 em { color: var(--sand); }
/* Paper grain over everything, faint enough to feel rather than see. */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: 0.06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.dim { color: var(--dim); }
.fine { color: var(--faint); font-size: 13px; }
.eyebrow {
  margin: 0 0 14px;
  color: var(--sand);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.lede { color: var(--dim); font-size: clamp(16px, 1.6vw, 18.5px); max-width: 60ch; }

/* Buttons and chips */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 650; font-size: 15px; text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 10px 30px -14px rgba(0, 0, 0, 0.8);
}
.button:hover { transform: translateY(-1px); filter: brightness(1.05); }
.button.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--stroke-strong); }
.button.ghost:hover { background: rgba(255, 255, 255, 0.05); }
.button.small { height: 36px; padding: 0 16px; font-size: 13.5px; }
.button.large { height: 56px; padding: 0 30px; font-size: 17px; }
.chip {
  height: 34px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  background: var(--panel); color: var(--dim); border: 1px solid var(--stroke);
  font: 600 13px var(--sans); transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.chip:hover { color: var(--text); border-color: var(--stroke-strong); }
.chip.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* Navigation */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 12px var(--gutter);
  background: rgba(18, 17, 16, 0.74);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--stroke);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; letter-spacing: -0.01em; }
.brand img { border-radius: 7px; }
.nav nav { display: flex; gap: 22px; margin-left: auto; }
.nav nav a { color: var(--dim); text-decoration: none; font-size: 14px; }
.nav nav a:hover { color: var(--text); }
@media (max-width: 720px) { .nav nav { display: none; } .nav .button { margin-left: auto; } }

/* Hero */
.hero {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(48px, 8vw, 110px) var(--gutter) 40px;
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 72px); align-items: center;
}
.hero h1 { font-size: clamp(46px, 6.4vw, 86px); }
.hero .lede { margin: 22px 0 30px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } }

.laptop { margin: 0; }
.laptop-screen {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  border-radius: 14px 14px 4px 4px;
  border: 10px solid #1b1b1e; border-bottom-width: 14px;
  background: #000;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 40px 80px -30px rgba(0,0,0,0.9), 0 0 140px -40px rgba(239,230,210,0.14);
}
.laptop-screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 0.9s ease; }
.laptop-screen img.next { opacity: 0; }
.laptop-screen img.next.show { opacity: 1; }
.laptop-base {
  height: 14px; margin: 0 -6%; border-radius: 0 0 14px 14px;
  background: linear-gradient(#2a2a2e, #141416);
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset;
}
.laptop figcaption { margin-top: 18px; text-align: center; font-size: 14px; }
.laptop figcaption #hero-theme { font-weight: 650; }

/* Stats */
.stats {
  max-width: var(--max); margin: 30px auto 0; padding: 0 var(--gutter);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
}
.stats div { padding: 22px 8px; text-align: center; border-top: 1px solid var(--stroke); border-bottom: 1px solid var(--stroke); }
.stats strong { display: block; font: 400 clamp(32px, 4vw, 48px)/1 var(--serif); }
.stats span { color: var(--faint); font-size: 13px; }
@media (max-width: 600px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* Sections */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(80px, 10vw, 140px) var(--gutter) 0; }
.section-head { margin-bottom: 36px; }
.section-head h2 { font-size: clamp(38px, 5vw, 64px); margin-bottom: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }

/* Theme gallery */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.theme-card {
  position: relative; border-radius: var(--radius); overflow: hidden; cursor: pointer;
  background: var(--bg-raised); border: 1px solid var(--stroke);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  text-align: left; padding: 0; color: inherit; font: inherit;
}
.theme-card:hover { transform: translateY(-3px); border-color: var(--stroke-strong); box-shadow: 0 24px 50px -24px rgba(0,0,0,0.9); }
.theme-card .shot { aspect-ratio: 16 / 10; background: #000 center / cover; }
.theme-card .shot img { width: 100%; height: 100%; object-fit: cover; }
.theme-card .meta { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; }
.theme-card .title { font-weight: 650; display: flex; align-items: center; gap: 8px; }
.theme-card .tagline { color: var(--dim); font-size: 13.5px; }
.theme-card .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: 0 0 10px currentColor; }
.theme-card[hidden] { display: none; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  padding: var(--gutter); background: rgba(8, 7, 6, 0.88); backdrop-filter: blur(10px);
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; width: min(1200px, 100%); }
.lightbox img { width: 100%; border-radius: 12px; box-shadow: 0 40px 100px -30px #000; }
.lightbox figcaption { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 16px; }
.lightbox figcaption div { display: flex; flex-direction: column; }
.lightbox-close {
  position: absolute; top: 16px; right: 20px; width: 40px; height: 40px; border-radius: 50%;
  background: var(--panel); color: var(--text); border: 1px solid var(--stroke); font-size: 22px; cursor: pointer;
}

/* Playground */
.playground {
  background: var(--bg-raised); border: 1px solid var(--stroke); border-radius: 22px; padding: 14px;
}
.pg-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 4px 4px 14px; }
.select { display: inline-flex; align-items: center; gap: 10px; color: var(--dim); font-size: 13px; }
.select select {
  appearance: none; -webkit-appearance: none; height: 34px; padding: 0 34px 0 14px; border-radius: 999px;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23aaa' fill='none' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 13px center;
  color: var(--text); border: 1px solid var(--stroke); font: 600 13px var(--sans); cursor: pointer;
}
.select.inline { margin-bottom: 22px; }
.pg-stage-wrap { border-radius: 12px; overflow: hidden; }
.pg-stage {
  position: relative; aspect-ratio: 16 / 10; width: 100%; overflow: hidden;
  background: #000 center / cover no-repeat; user-select: none; -webkit-user-select: none; touch-action: none;
  container-type: inline-size;
}
.pg-menubar {
  position: absolute; left: 0; right: 0; top: 0; height: 2.6cqw; min-height: 14px; z-index: 5;
  display: flex; align-items: center; gap: 1.4cqw; padding: 0 1.2cqw;
  background: rgba(20, 20, 24, 0.35); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  color: rgba(255,255,255,0.92); font-size: max(8px, 0.95cqw);
}
.pg-menubar .clock { margin-left: auto; }
.pg-ornament { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pg-ornament[hidden] { display: none; }
.pg-widget { position: absolute; cursor: grab; transition: filter 0.15s ease; will-change: left, top; }
.pg-widget img { width: 100%; height: 100%; pointer-events: none; }
.pg-widget:hover { filter: drop-shadow(0 0 0.4cqw rgba(255,255,255,0.35)); }
.pg-widget.dragging { cursor: grabbing; z-index: 4; filter: drop-shadow(0 1cqw 1.6cqw rgba(0,0,0,0.6)); }
.pg-tray { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 4px 4px; }
.pg-tray .chip.off { opacity: 0.45; }

/* Widget gallery */
/* dense: a later small widget fills the hole a wide one leaves at the end of a row. */
.widget-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); grid-auto-flow: row dense; gap: 16px; }
.widget-card {
  border-radius: var(--radius); border: 1px solid var(--stroke); overflow: hidden; background: var(--bg-raised);
  display: flex; flex-direction: column;
}
.widget-card.medium { grid-column: span 2; }
@media (max-width: 480px) { .widget-card.medium { grid-column: span 1; } }
.widget-card .stage { position: relative; display: grid; place-items: center; padding: 18px; background: #000 center / cover; aspect-ratio: 1.25; }
.widget-card.medium .stage { aspect-ratio: 2.55; }
.widget-card .stage img { max-height: 100%; width: auto; filter: drop-shadow(0 12px 22px rgba(0,0,0,0.45)); }
.widget-card .meta { padding: 12px 16px 14px; }
.widget-card .meta b { display: block; font-size: 14.5px; }
.widget-card .meta span { color: var(--dim); font-size: 13px; }

/* Features */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature {
  padding: 26px; border-radius: var(--radius); border: 1px solid var(--stroke);
  background: var(--bg-raised);
}
.feature h3 { font-size: 19px; font-weight: 650; margin: 10px 0 8px; letter-spacing: -0.01em; }
.feature p { color: var(--dim); margin: 0; font-size: 15px; }
.feature .hint { margin-top: 12px; color: var(--faint); font-size: 13px; }
.feature-icon { font-size: 22px; color: var(--sand); }
.feature.wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 32px; align-items: center; }
.feature.wide h3 { font: 400 clamp(30px, 3.4vw, 42px)/1.05 var(--serif); margin: 0 0 12px; }
.feature-visual { border-radius: 14px; overflow: hidden; }
@media (max-width: 900px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .feature.wide { grid-template-columns: 1fr; }
}
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.swatch {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; border: 2px solid transparent;
  box-shadow: inset 0 0 0 2px var(--bg-raised); transition: transform 0.15s;
}
.swatch:hover { transform: scale(1.08); }
.swatch.active { border-color: var(--text); }
.accent-visual { display: grid; place-items: center; padding: 34px; background: radial-gradient(circle at 50% 40%, #2b2823, #100f0d 70%); min-height: 260px; }
.accent-visual img { width: min(520px, 100%); filter: drop-shadow(0 22px 40px rgba(0,0,0,0.6)); }

.compare { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.compare > img, .compare-top img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare-top { position: absolute; inset: 0; clip-path: inset(0 50% 0 0); }
.compare input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.compare-handle {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: #fff; pointer-events: none;
  box-shadow: 0 0 12px rgba(0,0,0,0.5);
}
.compare-handle::after {
  content: "‹ ›"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 38px; height: 38px; border-radius: 50%; background: #fff; color: #111;
  display: grid; place-items: center; font: 700 14px var(--sans); letter-spacing: 2px;
}

/* Download */
.download { text-align: center; display: flex; flex-direction: column; align-items: center; }
.download-icon { border-radius: 24px; margin-bottom: 24px; filter: drop-shadow(0 20px 40px rgba(0,0,0,0.6)); }
.download h2 { font-size: clamp(42px, 5.5vw, 72px); margin-bottom: 14px; }
.download .lede { margin: 0 auto 28px; }
.download .fine { margin-top: 16px; }
.install {
  width: min(680px, 100%); text-align: left;
  background: var(--bg-raised); border: 1px solid var(--stroke); border-radius: 22px; padding: 22px;
}
.install-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.install-panel p { color: var(--dim); margin: 0 0 14px; }
.install-panel .fine { margin: 12px 0 0; }
.install-panel .fine a { color: var(--text); }
.install-panel .button { margin-bottom: 18px; }
.command {
  display: flex; align-items: center; gap: 10px;
  background: #0b0a09; border: 1px solid var(--stroke-strong); border-radius: 12px; padding: 8px 8px 8px 16px;
}
.command code {
  flex: 1; overflow-x: auto; white-space: nowrap; scrollbar-width: none;
  font: 14px/1.6 ui-monospace, "SF Mono", Menlo, monospace; color: var(--text);
}
.command code::-webkit-scrollbar { display: none; }
.copy {
  flex: none; height: 34px; padding: 0 14px; border-radius: 8px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); border: 0; font: 650 13px var(--sans);
}
.copy.done { background: #3ecf8e; }
.steps { margin: 0; padding-left: 22px; color: var(--dim); }
.steps li { margin-bottom: 10px; }
.steps b { color: var(--text); }
.faq code { font: 13px ui-monospace, "SF Mono", Menlo, monospace; color: var(--text); }

/* FAQ */
.faq { max-width: 820px; }
.faq h2 { font-size: clamp(34px, 4vw, 48px); margin-bottom: 20px; }
.faq details { border-top: 1px solid var(--stroke); padding: 18px 0; }
.faq details:last-child { border-bottom: 1px solid var(--stroke); }
.faq summary { cursor: pointer; font-weight: 600; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--sand); font-size: 22px; line-height: 1; transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--dim); margin: 12px 0 0; max-width: 64ch; }

/* Footer */
.footer {
  max-width: var(--max); margin: 120px auto 0; padding: 36px var(--gutter) 48px;
  border-top: 1px solid var(--stroke);
  display: grid; grid-template-columns: auto 1fr; gap: 14px 30px; align-items: center;
}
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.footer-brand img { border-radius: 5px; }
.footer nav { display: flex; gap: 22px; justify-self: end; }
.footer nav a { color: var(--dim); text-decoration: none; font-size: 14px; }
.footer nav a:hover { color: var(--text); }
.footer .fine { grid-column: 1 / -1; margin: 0; }
.footer .fine a { color: var(--dim); }
@media (max-width: 600px) { .footer { grid-template-columns: 1fr; } .footer nav { justify-self: start; } }

/* Simple pages (privacy, credits) */
.page { max-width: 760px; margin: 0 auto; padding: 70px var(--gutter) 0; }
.page h1 { font-size: clamp(40px, 5vw, 60px); margin-bottom: 10px; }
.page h2 { font: 650 20px/1.3 var(--sans); margin: 40px 0 10px; letter-spacing: -0.01em; }
.page p, .page li { color: var(--dim); }
.page a { color: var(--text); }
.page ul { padding-left: 20px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .laptop-screen img, .theme-card, .button { transition: none; }
}
