/*
 * Clingphilm presentation: a black page in the style of shadcn/ui's dark theme.
 * The tokens below are shadcn's zinc dark palette (oklch); Card and Badge are rebuilt in plain CSS,
 * so the page ships no JavaScript. The protection mechanism lives in clingfilm.css.
 */

@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --background: oklch(0.12 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.17 0 0);
  --card-foreground: oklch(0.985 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --border: oklch(1 0 0 / 10%);
  --radius: 0.625rem;

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html {
  background: var(--background);
}

body {
  background:
    radial-gradient(60rem 28rem at 50% -8rem, oklch(1 0 0 / 7%), transparent 70%),
    var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- layout ------------------------------------------------------------------------------ */

.page {
  display: grid;
  gap: 1.5rem;
  max-inline-size: 44rem;
  margin-inline: auto;
  padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 5vw, 1.5rem) 3rem;
}

.hero {
  display: grid;
  justify-items: center;
  gap: 1rem;
  margin-block-end: 0.5rem;
  text-align: center;
}

h1 {
  margin: 0;
  color: var(--foreground);
  font-size: clamp(2.5rem, 7vw, 4rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  h1 {
    background: linear-gradient(180deg, oklch(1 0 0), oklch(0.7 0 0));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

.lede {
  max-inline-size: 34rem;
  margin: 0;
  color: var(--muted-foreground);
  font-size: clamp(1rem, 2.4vw, 1.125rem);
  text-wrap: pretty;
}

/* ---- badge ------------------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: oklch(1 0 0 / 3%);
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.badge::before {
  content: "";
  inline-size: 0.375rem;
  block-size: 0.375rem;
  border-radius: 50%;
  background: var(--foreground);
  box-shadow: 0 0 0.5rem oklch(1 0 0 / 60%);
}

/* ---- card -------------------------------------------------------------------------------- */

.card {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 0.25rem);
  background: var(--card);
  color: var(--card-foreground);
  box-shadow:
    inset 0 1px 0 oklch(1 0 0 / 5%),
    0 1.5rem 3.5rem -1.25rem oklch(0 0 0 / 80%);
}

#content {
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 3vw, 1.25rem);
}

/* Wraps the image so the experimental watermark (flag CLINGPHILM_CLIENT_WATERMARK) can sit on top of it. */
.photo {
  position: relative;
  display: inline-block;
  max-inline-size: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  line-height: 0;
}

.photo--marked::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--wm) 0 0 / 220px 140px repeat;
  pointer-events: none;
}

#content img {
  display: block;
  max-inline-size: 100%;   /* never upscaled: the source is 380px wide */
  block-size: auto;
  border-radius: var(--radius);
}

/* ---- notes ------------------------------------------------------------------------------- */

.notes {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 40rem) {
  .notes {
    grid-template-columns: 1fr 1fr;
  }
}

.note {
  padding: 1.25rem 1.5rem;
}

.note h2 {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.note ul {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.note li {
  position: relative;
  padding-inline-start: 1.25rem;
  color: var(--muted-foreground);
  font-size: 0.9375rem;
}

.note li::before {
  content: "";
  position: absolute;
  inset-block-start: 0.6em;
  inset-inline-start: 0;
  inline-size: 0.4rem;
  block-size: 0.4rem;
  border-radius: 50%;
  background: var(--foreground);
}

.note--limits li::before {
  border: 1px solid var(--muted-foreground);
  background: transparent;
}

/* ---- footer ------------------------------------------------------------------------------ */

.footer {
  margin-block-start: 0.5rem;
  padding-block-start: 1.5rem;
  border-block-start: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  text-align: center;
}

/* ---- motion ------------------------------------------------------------------------------ */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero,
  #content,
  .notes,
  .footer {
    animation: rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  #content { animation-delay: 0.08s; }
  .notes   { animation-delay: 0.16s; }
  .footer  { animation-delay: 0.24s; }
}
