/* ---------------------------------------------------------------------------
 * knipsapp.no — the front door.
 *
 * Knips's own language, not a genre pastiche: true black, one warm off-white,
 * the serif that sets every headline in the app, real grain, and photographs
 * doing all the colour. Nothing here has an accent colour, because nothing in
 * the product does.
 *
 * Motion is scroll-driven and one-directional. Things arrive and stay; nothing
 * animates back out as you scroll past, which is the difference between a page
 * that feels alive and a page that feels restless.
 * ------------------------------------------------------------------------- */

:root {
  --ink: #f4f2ed;
  --ink-70: rgba(244, 242, 237, 0.70);
  --ink-50: rgba(244, 242, 237, 0.50);
  --ink-30: rgba(244, 242, 237, 0.30);
  --ink-12: rgba(244, 242, 237, 0.12);
  --ground: #000;
  --paper: #f4f2ed;
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --gutter: clamp(20px, 5vw, 56px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter); }

/* --------------------------------------------------------------- Grain
 * The same trick the app uses: a fixed field of noise over everything, so a
 * near-black page reads as film rather than as an empty div. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ----------------------------------------------------------------- Bar */
.bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--gutter);
  backdrop-filter: blur(14px);
  background: linear-gradient(to bottom, rgba(0,0,0,0.75), rgba(0,0,0,0));
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark { width: 17px; height: 17px; fill: var(--ink); }
.brand-word { font-size: 13px; font-weight: 600; letter-spacing: 0.16em; }
.bar-cta {
  font-size: 13px;
  color: var(--ink-70);
  border: 1px solid var(--ink-12);
  padding: 8px 15px;
  border-radius: 999px;
  transition: color 0.25s, border-color 0.25s;
}
.bar-cta:hover { color: var(--ink); border-color: var(--ink-30); }

/* ---------------------------------------------------------------- Type */
.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 7.4vw, 92px);
  line-height: 1.03;
  letter-spacing: -0.018em;
  margin: 0;
}
.title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(29px, 4.4vw, 54px);
  line-height: 1.1;
  letter-spacing: -0.012em;
  margin: 0;
}
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-50);
  margin: 0 0 18px;
}
.lede {
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.5;
  color: var(--ink-70);
  max-width: 46ch;
  margin: 26px 0 0;
}
.body { font-size: 17px; line-height: 1.55; color: var(--ink-70); max-width: 52ch; margin: 22px 0 0; }

/* -------------------------------------------------------------- Buttons */
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 38px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 30px;
  border-radius: 17px;
  font-size: 16px;
  font-weight: 600;
  transition: transform 0.2s var(--ease), opacity 0.2s;
}
.btn:active { transform: scale(0.975); }
.btn--paper { background: var(--paper); color: #000; }
.btn--ghost { color: var(--ink); border: 1px solid var(--ink-12); }
.btn--ghost:hover { border-color: var(--ink-30); }

/* ---------------------------------------------------------------- Hero */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px var(--gutter) 90px;
  overflow: hidden;
}
.hero-plate {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 85% at 24% 8%, rgba(255,255,255,0.085), transparent 62%),
    radial-gradient(90% 70% at 82% 96%, rgba(255,255,255,0.05), transparent 60%),
    #050505;
}
.hero-inner { position: relative; max-width: 1080px; margin: 0 auto; width: 100%; }
.hero-star {
  width: clamp(38px, 4.6vw, 62px);
  height: clamp(38px, 4.6vw, 62px);
  fill: var(--ink);
  margin-bottom: clamp(22px, 3vw, 40px);
  filter: drop-shadow(0 8px 26px rgba(0,0,0,0.6));
}

/* Each line is clipped and slides up from under its own edge — the headline
 * arrives as type being set, one line at a time, rather than a paragraph
 * fading in. */
.line { display: block; overflow: hidden; }
.line > span { display: block; transform: translateY(105%); }
.line--turn { color: var(--ink-50); }

.hero-hint {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-30);
}

/* ------------------------------------------------------------- Develop */
.develop { padding: clamp(90px, 13vw, 180px) 0; }

.frame {
  position: relative;
  margin: clamp(44px, 6vw, 80px) auto 0;
  max-width: 940px;
  width: calc(100% - var(--gutter) * 2);
  aspect-ratio: 4 / 3;
  border-radius: 20px;
  overflow: hidden;
}
.frame img { width: 100%; height: 100%; object-fit: cover; }

/* The undeveloped plate, lying over the photograph until the section is
 * genuinely on screen. Driven from JS so it happens once, on arrival. */
.frame-plate {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 30% 15%, rgba(255,255,255,0.06), transparent 60%),
    #0a0a0a;
  opacity: 1;
  transition: opacity 1.9s cubic-bezier(0.4, 0, 0.2, 1);
}
.frame.is-developed .frame-plate { opacity: 0; }
.frame img { transform: scale(1.06); transition: transform 2.4s var(--ease); }
.frame.is-developed img { transform: scale(1); }

.frame figcaption {
  position: absolute;
  left: 22px;
  bottom: 20px;
  font-size: 13px;
  color: rgba(255,255,255,0.82);
  text-shadow: 0 2px 10px rgba(0,0,0,0.7);
  opacity: 1;
  transition: opacity 0.6s;
}
.frame.is-developed figcaption { opacity: 0; }

/* --------------------------------------------------------------- Steps */
.steps { padding: clamp(80px, 11vw, 150px) 0; }
.step-list {
  list-style: none;
  margin: clamp(40px, 6vw, 72px) auto 0;
  padding: 0 var(--gutter);
  max-width: 1080px;
  display: grid;
  gap: 14px;
}
.step {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: start;
  gap: 6px 18px;
  padding: 28px 0;
  border-top: 1px solid var(--ink-12);
}
.step-no {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  color: var(--ink-30);
  padding-top: 3px;
}
.step h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(21px, 2.4vw, 28px); margin: 0; }
.step p { font-size: 16px; line-height: 1.5; color: var(--ink-70); margin: 9px 0 0; max-width: 44ch; }
.step img {
  grid-column: 2;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 14px;
  margin-top: 22px;
}

@media (min-width: 860px) {
  .step { grid-template-columns: 58px minmax(0, 1fr) minmax(0, 330px); align-items: center; gap: 34px; padding: 40px 0; }
  .step img { grid-column: 3; margin-top: 0; aspect-ratio: 4 / 3; }
}

/* --------------------------------------------------------------- After */
.after { padding: clamp(80px, 11vw, 150px) 0; }
.cards {
  display: grid;
  gap: 20px;
  padding: clamp(40px, 6vw, 72px) var(--gutter) 0;
  max-width: 1080px;
  margin: 0 auto;
}
@media (min-width: 780px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 16px; }
.card h3 { font-family: var(--serif); font-weight: 400; font-size: 22px; margin: 18px 0 0; }
.card p { font-size: 15px; line-height: 1.5; color: var(--ink-70); margin: 7px 0 0; }

/* --------------------------------------------------------------- Close */
.close { padding: clamp(100px, 15vw, 200px) 0 clamp(80px, 10vw, 130px); text-align: center; }
.close .wrap { display: flex; flex-direction: column; align-items: center; }
.close-star { width: 40px; height: 40px; fill: var(--ink); margin-bottom: 30px; }
.close .lede { margin-left: auto; margin-right: auto; }
.close .cta { justify-content: center; }

/* ---------------------------------------------------------------- Foot */
.foot {
  border-top: 1px solid var(--ink-12);
  padding: 46px var(--gutter);
  text-align: center;
  color: var(--ink-50);
  font-size: 13px;
}
.foot-star { width: 15px; height: 15px; fill: var(--ink-30); margin-bottom: 14px; }
.foot p { margin: 0; }
.foot-quiet { color: var(--ink-30); margin-top: 6px; }

/* ------------------------------------------------------------- Reveals
 * One direction only. `.is-in` is added when an element first crosses into
 * view and never removed, so scrolling back up does not replay the page. */
.reveal { opacity: 0; transform: translateY(22px); }
.reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
}
.line.is-in > span {
  transform: none;
  transition: transform 0.95s var(--ease);
}

/* --------------------------------------------------------- Reduced motion
 * Everything still *happens* — the plate still lifts off the photograph, the
 * headline is still there. It simply happens without travel, because the
 * information was never in the movement. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal.is-in { opacity: 1; transform: none; transition: none; }
  .line > span, .line.is-in > span { transform: none; transition: none; }
  .frame-plate { transition: opacity 0.3s; }
  .frame img, .frame.is-developed img { transform: none; transition: none; }
}
