/* Finding Cece
   Blush & champagne. One fine serif (Italiana) for her name, a quiet sans for
   everything else. The single flourish is the golden-hour glow behind her photo. */

@font-face {
  font-family: "Italiana";
  src: url("/fonts/italiana.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("/fonts/hanken-grotesk.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --porcelain: #f7ede8;
  --porcelain-light: #fcf7f4;
  --rose: #ebd5cc;
  --rose-deep: #e3c7bc;
  --champagne: #c8a27c;
  --champagne-light: #d3b18f;
  --cocoa: #4b3a39;
  --cocoa-soft: #7a6461;

  --serif: "Italiana", "Didot", "Bodoni 72", "Times New Roman", serif;
  --sans: "Hanken Grotesk", -apple-system, "Segoe UI", system-ui, sans-serif;

  --ease-out: cubic-bezier(0.22, 0.8, 0.26, 1);
  --shadow-soft: 0 12px 32px -14px rgb(75 58 57 / 0.28);

  color-scheme: only light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--porcelain);
  overflow-x: clip;
}

html:has(dialog[open]) {
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(28px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
  color: var(--cocoa);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* Soft golden-hour light across the page, pinned to the screen. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(75% 45% at 50% 30%, rgb(236 196 158 / 0.38), transparent 72%),
    radial-gradient(120% 60% at 50% 115%, rgb(235 213 204 / 0.9), transparent 70%);
  pointer-events: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
p {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--cocoa);
  outline-offset: 3px;
}

/* ── Profile ────────────────────────────────────────────────────────────── */

.profile {
  display: grid;
  justify-items: center;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

/* Sized from the viewport height so the links always sit above the fold,
   even inside Instagram's in-app browser on a small phone. */
.photo {
  position: relative;
  display: block;
  height: clamp(250px, 47svh, 400px);
  aspect-ratio: 4 / 5;
  max-width: 100%;
  padding: 6px;
  border-radius: 30px;
  box-shadow: inset 0 0 0 1px var(--champagne);
}

/* The golden-hour glow: warm light pooling behind the photo. */
.photo::before {
  content: "";
  position: absolute;
  inset: -40px -56px;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(232 182 136 / 0.4), rgb(232 182 136 / 0.1) 62%, transparent);
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px;
  background: var(--rose);
}

.name {
  margin-top: 22px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 11vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: 0.015em;
}

/* ── Links ──────────────────────────────────────────────────────────────── */

.links {
  display: grid;
  gap: 12px;
  width: 100%;
  margin-top: 28px;
}

.link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 58px;
  padding: 14px 56px;
  border: 0;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--cocoa);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    transform 180ms var(--ease-out),
    box-shadow 180ms var(--ease-out),
    background-color 180ms var(--ease-out);
}

.link:active {
  transform: scale(0.985);
}

.link__icon {
  position: absolute;
  left: 22px;
  top: 50%;
  translate: 0 -50%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.link__icon .fill {
  fill: currentColor;
}

.link--primary {
  background: linear-gradient(180deg, var(--champagne-light), var(--champagne));
  box-shadow:
    inset 0 1px 0 rgb(255 248 238 / 0.55),
    var(--shadow-soft);
}

.link--secondary {
  background: var(--rose);
}

@media (hover: hover) and (pointer: fine) {
  .link--primary:hover {
    transform: translateY(-1px);
    box-shadow:
      inset 0 1px 0 rgb(255 248 238 / 0.55),
      0 16px 36px -14px rgb(75 58 57 / 0.36);
  }
  .link--secondary:hover {
    background: var(--rose-deep);
  }
}

/* ── Age check (built by app.js) ────────────────────────────────────────── */

.gate {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 20px;
  border: 0;
  background: transparent;
  overscroll-behavior: contain;
}

.gate[open] {
  display: grid;
  place-items: center;
}

.gate::backdrop {
  background: rgb(75 58 57 / 0.16);
  -webkit-backdrop-filter: blur(14px) saturate(0.9);
  backdrop-filter: blur(14px) saturate(0.9);
}

.gate__card {
  width: 100%;
  max-width: 360px;
  padding: 36px 24px 20px;
  border-radius: 28px;
  background: var(--porcelain-light);
  box-shadow:
    0 0 0 1px rgb(200 162 124 / 0.25),
    0 30px 60px -24px rgb(75 58 57 / 0.38);
  text-align: center;
}

.gate__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.gate__desc {
  margin-top: 10px;
  font-size: 0.9375rem;
  color: var(--cocoa-soft);
}

.gate__actions {
  display: grid;
  gap: 6px;
  margin-top: 28px;
}

.gate__actions .link {
  padding-inline: 24px;
}

.gate__actions .link[aria-disabled="true"] {
  cursor: progress;
}

.gate__back {
  min-height: 48px;
  border: 0;
  background: transparent;
  font-size: 0.9375rem;
  color: var(--cocoa-soft);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
  .gate__back:hover {
    color: var(--cocoa);
  }
}

.gate__status:empty {
  display: none;
}

.gate__status {
  margin-top: 8px;
  font-size: 0.875rem;
  color: #8f3b3b;
}

.gate[open] .gate__card {
  animation: card-in 280ms var(--ease-out);
}

.gate[open]::backdrop {
  animation: fade-in 280ms ease-out;
}

.gate.is-closing .gate__card,
.gate.is-closing::backdrop {
  animation: fade-out 160ms ease-in forwards;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes fade-out {
  to {
    opacity: 0;
  }
}

/* ── Page-load sequence ─────────────────────────────────────────────────── */

@media (prefers-reduced-motion: no-preference) {
  .photo {
    animation: settle 900ms var(--ease-out) backwards;
  }
  .name,
  .links .link {
    animation: rise 640ms var(--ease-out) backwards;
  }
  .name {
    animation-delay: 120ms;
  }
  .links .link--primary {
    animation-delay: 220ms;
  }
  .links .link--secondary {
    animation-delay: 290ms;
  }
}

@keyframes settle {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gate[open] .gate__card {
    animation: fade-in 120ms linear;
  }
}
