:root {
  color-scheme: light dark;
  --bg: #f6f6f4;
  --fg: #1b1b19;
  --muted: #5c5c57;
  --line: #d8d8d2;
  --card: #ffffff;
  --accent: #1f5eff;
  --error: #b3261e;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --fg: #ececea;
    --muted: #a3a39d;
    --line: #33332f;
    --card: #1d1d1b;
    --accent: #8ab0ff;
    --error: #ff8a80;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

a { color: var(--accent); }

h1, h2 { line-height: 1.2; }
h1 { margin: 0 0 0.75rem; font-size: clamp(2rem, 6vw, 3.5rem); letter-spacing: -0.02em; }
h2 { margin: 0 0 1rem; font-size: 1.375rem; }

.site-header,
.site-footer,
.site-main {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.site-brand {
  color: inherit;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.site-nav { display: flex; gap: 1.25rem; font-size: 0.9375rem; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--fg); }

.site-main { padding-bottom: 4rem; }

.hero { padding: 3rem 0 2.5rem; }

.hero__lead {
  max-width: 38rem;
  margin: 0 0 1.75rem;
  color: var(--muted);
  font-size: 1.125rem;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0; }

.cta,
.share-row button {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.cta--quiet {
  background: transparent;
  border-color: var(--line);
  color: inherit;
}

@media (prefers-color-scheme: dark) {
  /* The quiet button keeps the page's text colour; only the filled one needs
     dark text on the light accent. */
  .cta:not(.cta--quiet),
  .share-row button { color: #0b0b0a; }
}

.what { padding: 2rem 0 3rem; }

.what__list {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.what__list li {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.what__list strong { display: block; margin-bottom: 0.25rem; }
.what__list span { color: var(--muted); font-size: 0.9375rem; }

.what__later { margin: 1rem 0 0; color: var(--muted); font-size: 0.875rem; }

.showcase-home { padding: 1rem 0 0; }

.cards {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.card a {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: inherit;
  text-decoration: none;
}

.card a:hover .card__title { text-decoration: underline; }

.card img,
.card__blank {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--bg);
}

.card__title {
  padding: 0.75rem 0.875rem 0;
  font-weight: 600;
}

.card__owner {
  padding: 0.125rem 0.875rem 0.875rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.empty {
  margin: 1rem 0 0;
  padding: 3rem 1.5rem;
  border: 1px dashed var(--line);
  border-radius: 14px;
  text-align: center;
}

.empty p { margin: 0 0 1.25rem; color: var(--muted); }

.crumbs { margin: 0 0 1.5rem; font-size: 0.9375rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--fg); }

.item__head { max-width: 44rem; }
.item__by { margin: 0 0 0.5rem; color: var(--muted); }
.item__desc { margin: 0 0 1.5rem; color: var(--muted); }

.item__viewer {
  margin: 0 0 1rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

.item__viewer iframe {
  display: block;
  width: 100%;
  height: min(75vh, 60rem);
  border: 0;
}

.item__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0 0 2.5rem; }

.item__share {
  max-width: 44rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.item__share h2 { margin: 0 0 0.75rem; font-size: 1.125rem; }

.share-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.share-row input {
  flex: 1 1 16rem;
  min-width: 0;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: inherit;
  font: inherit;
  font-size: 0.9375rem;
}

.share-row button { padding: 0.625rem 1rem; }

.hint { margin: 0.75rem 0 0; color: var(--muted); font-size: 0.875rem; }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}

input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 40rem) {
  .hero { padding-top: 2rem; }
  .site-nav { gap: 0.875rem; }
  .item__viewer iframe { height: 70vh; }
}

/* The feed (S5) */

.feed-page {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

.feed-page .site-main {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  max-width: none;
  padding: 0;
}

.feed-page .site-footer { display: none; }

.feed { position: relative; flex: 1 1 auto; min-height: 0; }

.feed__track {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  background: #000;
}

.feed__slide {
  position: relative;
  height: 100%;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.feed__stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feed__still {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.feed__blank { width: 100%; height: 100%; background: #111; }

.feed__viewer { position: absolute; inset: 0; }

.feed__viewer iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

.feed__meta {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 3rem 1.25rem 4.75rem;
  background: linear-gradient(to top, rgb(0 0 0 / 0.8), transparent);
  color: #ffffff;
  pointer-events: none;
}

.feed__meta h2 { margin: 0; font-size: 1.25rem; }

.feed__meta h2 a {
  color: #ffffff;
  text-decoration: none;
  pointer-events: auto;
}

.feed__meta p {
  margin: 0.125rem 0 0;
  color: rgb(255 255 255 / 0.82);
  font-size: 0.9375rem;
}

.feed__hit {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
  border: 0;
  background: transparent;
  color: #ffffff;
  font: inherit;
  cursor: zoom-in;
}

.feed__hint {
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.55);
  font-size: 0.8125rem;
  font-weight: 600;
  backdrop-filter: blur(6px);
}

.feed__done {
  position: absolute;
  bottom: 1.25rem;
  left: 1rem;
  z-index: 5;
  padding: 0.625rem 1rem;
  border: 1px solid rgb(255 255 255 / 0.35);
  border-radius: 999px;
  background: rgb(0 0 0 / 0.55);
  color: #ffffff;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.feed__controls {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transform: translateY(-50%);
}

.feed__controls button {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 0.3);
  border-radius: 50%;
  background: rgb(0 0 0 / 0.5);
  color: #ffffff;
  font-size: 1rem;
}

.feed__controls button:disabled { opacity: 0.3; }

.feed__count {
  padding: 0.125rem 0.375rem;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.5);
  color: #ffffff;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

/* Interacting: the viewer owns the gestures; the feed does not scroll. */
.feed.is-interacting .feed__track { overflow: hidden; }

.feed.is-interacting .feed__meta,
.feed.is-interacting .feed__controls,
.feed.is-interacting .feed__hit { display: none; }

/* Interacting takes the whole viewport: the site header goes away. */
.feed-page.is-interacting .site-header { display: none; }

/* Without JavaScript the slides are a normal scrollable list. */
.no-js .feed__hit,
.no-js .feed__controls { display: none; }

.feed-empty { margin: 2rem 0; }

.showcase-home__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.showcase-home__head h2 { margin: 0; }
.feed-link { font-size: 0.9375rem; }

@media (prefers-reduced-motion: reduce) {
  .feed__track { scroll-behavior: auto; }
}

/* Two applications on the public homepage */
.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.products { max-width: 1120px; margin: 0 auto; padding: 56px 24px; }
.products > h2 { margin: 0 0 24px; font-size: clamp(26px, 3vw, 38px); }
.product-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 20px; align-items: stretch; }
.product-card { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.product-card--labelpik { display: flex; flex-direction: column; justify-content: center; padding: 32px; }
.product-card--portfolio { display: grid; grid-template-columns: 0.8fr 1.2fr; }
.product-card__image { display: block; min-height: 100%; background: var(--bg); }
.product-card__image img { width: 100%; height: 100%; object-fit: cover; }
.product-card__body { padding: 28px; }
.product-card__eyebrow { margin: 0 0 8px; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.product-card h3 { margin: 0 0 10px; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.1; }
.product-card p { margin: 0 0 12px; color: var(--muted); }
.product-card__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.portfolio-themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 1120px; margin: 0 auto; padding: 0 24px 48px; }
.portfolio-themes figure { margin: 0; }
.portfolio-themes img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border: 1px solid var(--line); border-radius: 10px; }
.portfolio-themes figcaption { padding-top: 8px; color: var(--muted); font-size: 0.8rem; }
@media (max-width: 800px) {
  .product-grid { grid-template-columns: 1fr; }
  .product-card--portfolio { grid-template-columns: 1fr; }
  .product-card__image img { height: 220px; }
  .portfolio-themes { grid-template-columns: 1fr; }
}

/* A neutral message block on a public product page. */
.notice {
  margin: 0 0 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
}
