:root {
  --bg: #090908;
  --bg-soft: #12110f;
  --text: #f2eadc;
  --muted: #b5aa99;
  --faint: #817666;
  --gold: #d8b76b;
  --line: rgba(216, 183, 107, 0.22);
  --max-width: 1080px;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 0%, rgba(216, 183, 107, 0.13), transparent 34rem),
    radial-gradient(circle at 18% 70%, rgba(242, 234, 220, 0.05), transparent 24rem),
    linear-gradient(180deg, #090908 0%, #0f0e0d 48%, #080807 100%);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Layered CSS texture keeps the page lightweight while adding a subtle analog feel. */
body::before,
body::after {
  position: fixed;
  inset: 0;
  content: "";
  pointer-events: none;
}

body::before {
  z-index: 0;
  background:
    radial-gradient(circle at center, transparent 0, rgba(0, 0, 0, 0.52) 78%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
  background-size: auto, 3px 3px, 4px 4px;
}

body::after {
  z-index: 0;
  opacity: 0.2;
  background-image:
    repeating-radial-gradient(circle at 12% 20%, rgba(255, 255, 255, 0.18) 0 1px, transparent 1px 3px),
    repeating-radial-gradient(circle at 80% 40%, rgba(216, 183, 107, 0.11) 0 1px, transparent 1px 4px);
  background-size: 90px 90px, 130px 130px;
  animation: grain-drift 7s steps(6) infinite;
  mix-blend-mode: overlay;
}

main,
.footer {
  position: relative;
  z-index: 1;
}

a {
  color: inherit;
}

.hero {
  position: relative;
  display: grid;
  min-height: 100svh;
  padding: 3rem 1.25rem;
  background:
    radial-gradient(circle at 50% 46%, rgba(9, 9, 8, 0.18), rgba(9, 9, 8, 0.02) 38%, rgba(9, 9, 8, 0.22) 100%),
    url("./assets/flek-background.png") center / cover no-repeat;
  animation: hero-breath 16s ease-in-out infinite alternate;
  isolation: isolate;
  place-items: center;
  text-align: center;
}

.hero::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

.hero::after {
  z-index: 0;
  background:
    radial-gradient(ellipse at 50% 46%, rgba(9, 9, 8, 0.52), rgba(9, 9, 8, 0.18) 34%, transparent 62%),
    linear-gradient(180deg, transparent 64%, rgba(9, 9, 8, 0.42));
}

.hero__content {
  position: relative;
  z-index: 1;
  width: min(100%, 980px);
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--gold);
  font-size: clamp(0.78rem, 1vw, 0.92rem);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: var(--text);
  font-family: var(--serif);
  font-weight: 500;
  line-height: 0.95;
}

h1 {
  font-size: clamp(4rem, 14vw, 12.5rem);
}

h2 {
  max-width: 860px;
  margin-inline: auto;
  font-size: clamp(2.6rem, 7vw, 6.5rem);
}

.hero__text {
  max-width: 680px;
  margin: 1.5rem auto 2.25rem;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.45rem);
}

.button {
  display: inline-flex;
  min-height: 3.1rem;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(216, 183, 107, 0.08);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: uppercase;
  transition:
    background 220ms ease,
    border-color 220ms ease,
    color 220ms ease,
    transform 220ms ease;
}

.button:hover,
.button:focus-visible {
  border-color: rgba(216, 183, 107, 0.75);
  background: rgba(216, 183, 107, 0.18);
  color: #fff8e8;
  transform: translateY(-2px);
}

.button:focus-visible {
  outline: 2px solid rgba(216, 183, 107, 0.5);
  outline-offset: 4px;
}

.button--ghost {
  margin-top: 1.25rem;
  letter-spacing: 0.04em;
  text-transform: none;
}

.section {
  padding: clamp(5rem, 12vw, 11rem) 1.25rem;
}

.section__inner {
  width: min(100%, var(--max-width));
  margin: 0 auto;
  text-align: center;
}

.section__inner--narrow {
  width: min(100%, 760px);
}

.copy {
  max-width: 720px;
  margin: 2rem auto 0;
  color: var(--muted);
  font-size: clamp(1.04rem, 1.8vw, 1.35rem);
}

.copy p,
.access p,
.trace__text {
  margin: 0;
}

.copy p + p {
  margin-top: 1.45rem;
}

.fragments {
  padding: clamp(3.5rem, 9vw, 8rem) 1.25rem;
  border-block: 1px solid rgba(216, 183, 107, 0.12);
  background: rgba(255, 255, 255, 0.015);
}

.fragments__grid {
  display: grid;
  width: min(100%, var(--max-width));
  margin: 0 auto;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  background: rgba(216, 183, 107, 0.16);
}

.fragments__grid p {
  min-height: 12rem;
  margin: 0;
  padding: 1.35rem;
  background: rgba(9, 9, 8, 0.92);
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(1.45rem, 2.6vw, 2.35rem);
  line-height: 1.05;
}

.fragments__grid p:nth-child(2) {
  transition-delay: 70ms;
}

.fragments__grid p:nth-child(3) {
  transition-delay: 140ms;
}

.fragments__grid p:nth-child(4) {
  transition-delay: 210ms;
}

.fragments__grid p:nth-child(5) {
  transition-delay: 280ms;
}

.trace__text,
.access p {
  max-width: 650px;
  margin-top: 1.65rem;
  margin-inline: auto;
  color: var(--muted);
  font-size: clamp(1.1rem, 2vw, 1.55rem);
}

.note {
  margin: 1rem auto 0;
  color: var(--faint);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.access {
  text-align: center;
}

.access h2 {
  margin-inline: auto;
}

.access-form {
  display: grid;
  max-width: 620px;
  margin: 2.25rem auto 0;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.45rem;
  text-align: left;
}

.field label {
  color: var(--faint);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid rgba(216, 183, 107, 0.18);
  border-radius: 0;
  background: rgba(9, 9, 8, 0.62);
  color: var(--text);
  font: inherit;
  outline: none;
  padding: 0.95rem 1rem;
  transition:
    background 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

.field textarea {
  min-height: 9rem;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(216, 183, 107, 0.62);
  background: rgba(9, 9, 8, 0.82);
  box-shadow: 0 0 0 3px rgba(216, 183, 107, 0.1);
}

.field--trap {
  position: absolute;
  width: 1px;
  height: 1px;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.access-form .button {
  justify-self: center;
  margin-top: 0.75rem;
}

.result-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 2rem 1.25rem;
}

.result {
  width: min(100%, 720px);
  text-align: center;
}

.result h1 {
  font-size: clamp(3.5rem, 10vw, 8rem);
}

.result__text {
  max-width: 560px;
  margin: 1.5rem auto 2rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.footer {
  width: min(100% - 2.5rem, var(--max-width));
  margin: 0 auto;
  padding: 2.5rem 0 3rem;
  border-top: 1px solid rgba(216, 183, 107, 0.14);
  color: var(--faint);
  font-size: 0.86rem;
  text-align: center;
}

.footer p {
  margin: 0;
}

.footer__legal {
  margin-inline: auto;
}

.footer__legal span {
  display: block;
}

.reveal {
  animation: reveal 900ms ease both;
}

.section__inner,
.fragments__grid,
.fragments__grid p {
  transition:
    opacity 900ms ease,
    transform 900ms ease,
    filter 900ms ease;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hero-breath {
  from {
    background-position: center, 50% 50%;
  }

  to {
    background-position: center, 51% 49%;
  }
}

@keyframes grain-drift {
  0% {
    transform: translate3d(0, 0, 0);
  }

  25% {
    transform: translate3d(-1%, 1%, 0);
  }

  50% {
    transform: translate3d(1%, -1%, 0);
  }

  75% {
    transform: translate3d(-1%, -1%, 0);
  }

  100% {
    transform: translate3d(0, 0, 0);
  }
}

@keyframes scroll-reveal {
  from {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(36px);
  }

  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@supports (animation-timeline: view()) {
  .section__inner,
  .fragments__grid,
  .fragments__grid p {
    opacity: 0;
    animation: scroll-reveal both;
    animation-range: entry 10% cover 34%;
    animation-timeline: view();
  }

  .fragments__grid p:nth-child(2) {
    animation-range: entry 14% cover 38%;
  }

  .fragments__grid p:nth-child(3) {
    animation-range: entry 18% cover 42%;
  }

  .fragments__grid p:nth-child(4) {
    animation-range: entry 22% cover 46%;
  }

  .fragments__grid p:nth-child(5) {
    animation-range: entry 26% cover 50%;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 860px) {
  .fragments__grid {
    grid-template-columns: 1fr 1fr;
  }

  .fragments__grid p:last-child {
    grid-column: 1 / -1;
  }

  .footer {
    text-align: center;
  }
}

@media (max-width: 560px) {
  .hero {
    min-height: 100svh;
  }

  .eyebrow {
    letter-spacing: 0.13em;
  }

  .button {
    width: 100%;
    max-width: 22rem;
  }

  .fragments__grid {
    grid-template-columns: 1fr;
  }

  .fragments__grid p {
    min-height: 8.5rem;
  }
}
