/* Alta är huvudtypsnittet. Lägg filen i assets/fonts/Alta.woff2 (se README),
   tills dess används Italiana som liknande reserv. */
@font-face {
  font-family: "Alta";
  src: local("Alta"), url("assets/fonts/Alta.woff2") format("woff2");
  font-display: swap;
}

:root {
  --bg: #fdfdfc;
  --ink: #2c2c2b;
  --ink-strong: #1c1c1b;
  --line: #1b1b1b;
  --red: #ff2f45;
  --font: "Alta", "Italiana", "Cormorant Garamond", Georgia, serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --gutter: clamp(20px, 5vw, 64px);
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: clamp(1.05rem, 0.9rem + 0.5vw, 1.3rem);
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
  -webkit-text-stroke: 1.3px currentColor; /* tunt typsnitt: ger lite mer tyngd */
  text-shadow: 0 0 0.5px currentColor;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 4px; }
em { font-style: normal; opacity: 0.7; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: max(10px, env(safe-area-inset-top)) var(--gutter) 10px;
  background: rgba(253, 253, 252, 0);
  backdrop-filter: saturate(180%) blur(0px);
  -webkit-backdrop-filter: saturate(180%) blur(0px);
  transition: background 0.5s var(--ease), backdrop-filter 0.5s var(--ease), -webkit-backdrop-filter 0.5s var(--ease), box-shadow 0.5s;
  font-size: 0.95rem;
}
.nav.solid {
  background: rgba(253, 253, 252, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}
.nav-logo { text-decoration: none; font-size: 1.25rem; opacity: 0; transform: translateY(-6px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.nav-logo span { color: var(--red); margin: 0 .08em; }
.nav.solid .nav-logo { opacity: 1; transform: none; }
.nav-links { display: flex; gap: clamp(14px, 3vw, 36px); opacity: 0; transform: translateY(-6px); transition: opacity .5s var(--ease) .05s, transform .5s var(--ease) .05s; }
.nav.solid .nav-links { opacity: 1; transform: none; }
.nav-links a { text-decoration: none; position: relative; padding: 4px 0; }
.nav-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease); }
.nav-links a:hover::after, .nav-links a.on::after { transform: scaleX(1); }
.lang { display: flex; gap: 2px; padding: 3px; border-radius: 99px; background: rgba(0,0,0,.05); }
.lang button { border: 0; background: transparent; padding: 3px 11px; border-radius: 99px; font-size: .85rem; transition: background .3s, color .3s; }
.lang button[aria-pressed="true"] { background: var(--bg); color: var(--ink-strong); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
@media (max-width: 640px) { .nav-links { display: none; } .nav-logo { opacity: 1; transform: none; } }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: grid; grid-template-rows: auto 1fr auto; align-items: center;
  padding: clamp(28px, 4vw, 48px) var(--gutter) clamp(24px, 3vw, 40px);
  overflow: clip;
}
.title {
  -webkit-text-stroke: 2px currentColor;
  font-weight: 400; color: #2f2f2e; line-height: 1; white-space: nowrap;
  text-align: center; text-transform: uppercase; letter-spacing: 0;
  margin-top: clamp(24px, 4vh, 56px);
  transform: translateY(calc(var(--hero, 0) * 60px)) scale(calc(1 - var(--hero, 0) * 0.06));
  opacity: calc(1 - var(--hero, 0) * 0.55);
  transform-origin: 50% 0;
  will-change: transform;
}
.title-in { display: inline-block; font-size: 10vw; }
.title .ch { display: inline-block; overflow: hidden; vertical-align: top; padding-top: .18em; margin-top: -.18em; }
.title .ch > i {
  display: inline-block; font-style: normal;
  transform: translateY(115%); opacity: 0;
  animation: rise 1.3s var(--ease) forwards;
  animation-delay: calc(var(--n) * 55ms + 150ms);
}
.title .sp { display: inline-block; width: .28em; }
@keyframes rise { to { transform: none; opacity: 1; } }

.stage {
  position: relative; display: grid; grid-template-columns: 1fr minmax(0, 560px) 1fr; align-items: center;
  gap: 16px; min-height: 0; padding-top: 8px;
}
.side { font-size: clamp(1rem, 1.5vw, 1.35rem); line-height: 1.55; display: flex; flex-direction: column; letter-spacing: .06em; }
.side-r { text-align: right; align-items: flex-end; }
.figures {
  position: relative; justify-self: center; width: 100%;
  transform: translateY(calc(var(--hero, 0) * -30px)) scale(calc(1 + var(--hero, 0) * 0.08));
  transform-origin: 50% 20%;
  will-change: transform;
}
.figs-wrap {
  width: min(100%, calc(52svh * 0.997)); margin: 0 auto;
  clip-path: inset(0 0 100% 0);
  animation: grow 2.2s var(--ease) .9s forwards;
}
.figs { width: 100%; transform-origin: 50% 100%; animation: sway 7s ease-in-out 3s infinite; transform: rotate(var(--tilt, 0deg)); transition: transform .6s var(--ease); }
@keyframes grow { to { clip-path: inset(0 0 0 0); } }
@keyframes sway { 0%,100% { rotate: -0.5deg; } 50% { rotate: 0.5deg; } }
.heart {
  position: absolute; left: 50%; top: -6%; width: clamp(64px, 9vw, 112px);
  transform: translateX(-50%) scale(0); opacity: 0;
  animation: pop 1s var(--spring) 2.2s forwards, beat 2.6s ease-in-out 3.4s infinite;
  z-index: 2;
}
@keyframes pop { to { transform: translateX(-50%) scale(1); opacity: 1; } }
@keyframes beat { 0%,100% { scale: 1; } 12% { scale: 1.1; } 24% { scale: 1; } 36% { scale: 1.07; } 48% { scale: 1; } }

.hero-foot {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 16px;
  color: var(--red); -webkit-text-stroke: 1.5px var(--red); font-size: clamp(1rem, 1.5vw, 1.35rem); line-height: 1.4; letter-spacing: .06em;
  margin-top: 12px;
}
.hero-foot > :last-child { text-align: right; text-decoration: none; }
.hero-foot > :first-child { text-align: left; }
.link-btn { -webkit-text-stroke: 1.5px var(--red); background: none; border: 0; padding: 0; color: var(--red); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.link-btn:hover { text-decoration-thickness: 2px; }
.count { text-align: center; font-size: .95rem; margin-top: 14px; opacity: .65; }
.scroll-cue { position: absolute; left: 50%; bottom: 10px; width: 22px; height: 34px; border: 1.5px solid var(--ink); border-radius: 14px; transform: translateX(-50%); opacity: .35; display: none; }
.scroll-cue i { position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--ink); animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 80%,100% { transform: translateY(12px); opacity: 0; } }

.reveal-hero { opacity: 0; animation: fade 1.4s var(--ease) 2.6s forwards; }
@keyframes fade { to { opacity: 1; } }

@media (max-width: 760px) {
  .stage { grid-template-columns: 1fr 1fr; grid-template-areas: "fig fig" "l r"; row-gap: 20px; }
  .figures { grid-area: fig; }
  .side-l { grid-area: l; } .side-r { grid-area: r; }
  .figs-wrap { width: min(100%, 44svh); }
  .heart { top: -8%; }
  .hero-foot { grid-template-columns: 1fr 1fr; }
  .hero-foot .link-btn { order: 3; grid-column: 1 / -1; justify-self: center; margin-top: 6px; }
  .hero-foot > :last-child { grid-column: 2; grid-row: 1; }
}

/* ---------- Generic sections ---------- */
.section { padding: clamp(80px, 14vw, 180px) var(--gutter); }
.wrap { max-width: 1100px; margin: 0 auto; }
.wrap.narrow { max-width: 620px; }
.wrap.center { text-align: center; }
.eyebrow { -webkit-text-stroke: 1.5px var(--red); color: var(--red); font-size: 1rem; letter-spacing: .18em; margin-bottom: 14px; }
.big { -webkit-text-stroke: 1.8px currentColor; font-weight: 400; font-size: clamp(2.6rem, 8vw, 6.5rem); line-height: 1; color: #2f2f2e; letter-spacing: 0; }
.huge { -webkit-text-stroke: 2.4px currentColor; font-weight: 400; font-size: clamp(3.2rem, 13vw, 11rem); line-height: .95; color: #2f2f2e; letter-spacing: 0; margin-bottom: clamp(24px, 4vw, 48px); }
.big.sm { font-size: clamp(2.4rem, 7vw, 4.5rem); }
.lead { margin-top: 18px; font-size: clamp(1.15rem, 1rem + .6vw, 1.5rem); }
.note { margin-top: 20px; text-align: center; opacity: .7; }

/* reveal: Apple-aktig inzoomning med dis */
.reveal { opacity: 0; transform: translateY(36px) scale(.98); filter: blur(10px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease), filter 1.1s var(--ease); transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; filter: none; }

/* knappar */
.btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-block; text-decoration: none; background: transparent; border: 1px solid var(--ink);
  padding: .8em 1.7em; border-radius: 99px; font-size: 1rem; letter-spacing: .12em;
  transition: background .35s var(--ease), color .35s, transform .35s var(--spring), border-color .35s;
}
.btn:hover { background: var(--ink-strong); color: var(--bg); transform: scale(1.04); }
.btn:active { transform: scale(.97); }
.btn.red { border-color: var(--red); color: var(--red); }
.btn.red:hover { background: var(--red); color: #fff; }
.big-btn { width: 100%; font-size: 1.15rem; padding: 1em; margin-top: 8px; }

/* ---------- Tidslinje ---------- */
.timeline { list-style: none; padding: 0; margin-top: clamp(40px, 7vw, 90px); position: relative; padding-left: clamp(24px, 4vw, 48px); }
.timeline::before, .timeline::after { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 1.5px; }
.timeline::before { background: rgba(0,0,0,.1); }
.timeline::after { background: var(--red); transform-origin: top; transform: scaleY(var(--tl, 0)); }
.tl { display: grid; grid-template-columns: clamp(90px, 16vw, 200px) 1fr; gap: 16px; padding: clamp(18px, 3vw, 34px) 0; position: relative; }
.tl::before { content: ""; position: absolute; left: calc(-1 * clamp(24px, 4vw, 48px) - 5px); top: calc(clamp(18px, 3vw, 34px) + .6em); width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--ink); transition: background .5s, border-color .5s, transform .6s var(--spring); }
.tl.lit::before { background: var(--red); border-color: var(--red); transform: scale(1.25); }
.tl time.word { font-size: clamp(1.3rem, 2.6vw, 1.9rem); color: var(--red); letter-spacing: .1em; padding-top: .35em; }
.tl time { font-size: clamp(1.8rem, 5vw, 3.6rem); line-height: 1; color: #2f2f2e; letter-spacing: 0; }
.tl h3 { font-weight: 400; font-size: clamp(1.4rem, 3vw, 2.1rem); line-height: 1.1; color: var(--ink-strong); letter-spacing: .02em; }
.tl p { margin-top: 8px; max-width: 34em; opacity: .85; }
@media (max-width: 560px) { .tl { grid-template-columns: 1fr; gap: 6px; } }

/* ---------- Kyrkan som ritas upp ---------- */
.draw { height: 320svh; position: relative; }
.draw-sticky {
  position: sticky; top: 0; height: 100svh; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(8px, 3vh, 36px);
  padding: 72px var(--gutter) 24px;
}
.draw-text { text-align: center; opacity: calc(.15 + var(--dp, 0) * 4); transform: translateY(calc((1 - min(1, var(--dp, 0) * 4)) * 24px)); }
.draw-text .big { font-size: clamp(2.4rem, 7vw, 5.5rem); }
.draw-text .lead { margin-top: 10px; }
.church { width: min(92vw, 700px, calc((100svh - 330px) * 1.52)); min-width: 280px; height: auto; overflow: visible; flex: none; }
.church .d { stroke-dasharray: 1; stroke-dashoffset: var(--o, 1); }
.church .door-fill { opacity: var(--door, 0); }
.church-heart { transform-box: fill-box; transform-origin: 50% 90%; transform: scale(var(--hs, 0)); opacity: var(--hs, 0); }

.where { padding-top: 0; }
.about { max-width: 34em; margin: 0 auto clamp(28px, 5vw, 56px); text-align: center; font-size: clamp(1.1rem, 1rem + .5vw, 1.4rem); }
.map { position: relative; border-radius: 28px; overflow: hidden; aspect-ratio: 16 / 9; background: #eee; box-shadow: 0 30px 80px -30px rgba(0,0,0,.25); }
.map iframe { width: 100%; height: 100%; border: 0; filter: grayscale(1) contrast(.95) brightness(1.03); }
@media (max-width: 640px) { .map { aspect-ratio: 4 / 5; border-radius: 22px; } }

/* ---------- Klädkod ---------- */
.dress { background: radial-gradient(ellipse at 50% 100%, rgba(255,47,69,.07), transparent 65%); }

dialog {
  border: 0; padding: 0; margin: auto; width: min(92vw, 520px); max-height: 88svh; overflow: auto;
  border-radius: 28px; background: var(--bg); color: var(--ink);
  box-shadow: 0 40px 120px -20px rgba(0,0,0,.45);
  opacity: 0; transform: translateY(40px) scale(.9);
  transition: opacity .45s var(--ease), transform .6s var(--spring), overlay .6s allow-discrete, display .6s allow-discrete;
}
dialog[open] { opacity: 1; transform: none; }
@starting-style { dialog[open] { opacity: 0; transform: translateY(40px) scale(.9); } }
dialog::backdrop { background: rgba(20,20,20,0); backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px); transition: background .5s, backdrop-filter .5s, -webkit-backdrop-filter .5s, overlay .5s allow-discrete, display .5s allow-discrete; }
dialog[open]::backdrop { background: rgba(20,20,20,.35); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
@starting-style { dialog[open]::backdrop { background: rgba(20,20,20,0); backdrop-filter: blur(0); } }
.close { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(0,0,0,.06); font-size: 1.5rem; line-height: 1; transition: background .3s, transform .4s var(--spring); }
.close:hover { background: rgba(0,0,0,.12); transform: rotate(90deg); }
.dlg-body { padding: 44px clamp(24px, 6vw, 44px) 36px; text-align: center; }
.dlg-body h3 { font-weight: 400; font-size: 2.6rem; line-height: 1; color: #2f2f2e; margin: 8px 0 18px; letter-spacing: 0; }
.dlg-body ul { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 6px; }
.dlg-body li::before { content: "·"; color: var(--red); margin-right: .6em; }
.dlg-body .small { font-size: .95rem; opacity: .7; margin-top: 18px; }
.outfit { width: 190px; margin: 0 auto; }
dialog[open] .outfit path { stroke-dasharray: 1; }

/* ---------- OSA-formulär ---------- */
.form { margin-top: 36px; display: grid; gap: 22px; }
.field { display: grid; gap: 8px; border: 0; padding: 0; min-width: 0; }
.field > span, .field > legend { font-size: 1rem; letter-spacing: .1em; padding: 0; }
.field input[type="text"], .field input[type="email"], .field textarea {
  font: inherit; letter-spacing: .04em; text-transform: none; color: var(--ink-strong);
  background: transparent; border: 0; border-bottom: 1.5px solid rgba(0,0,0,.2); border-radius: 0;
  padding: 10px 2px; width: 100%; outline: 0; resize: vertical; font-size: 1.2rem;
  transition: border-color .4s var(--ease), box-shadow .4s var(--ease);
}
.field input:focus, .field textarea:focus { border-color: var(--red); box-shadow: 0 1.5px 0 0 var(--red); }
.field.bad input, .field.bad textarea { border-color: var(--red); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 10px; }
.seg legend { width: 100%; margin-bottom: 8px; float: none; }
.seg label { position: relative; flex: 1 1 0; min-width: max-content; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg label span { display: block; text-align: center; padding: .75em 1.2em; border: 1px solid rgba(0,0,0,.25); border-radius: 99px; transition: all .4s var(--ease); font-size: 1rem; letter-spacing: .06em; }
.seg input:checked + span { background: var(--red); border-color: var(--red); color: #fff; transform: scale(1.03); }
.seg input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 3px; }
.seg label:hover span { border-color: var(--red); }
.stepper { display: inline-flex; align-items: center; gap: 22px; }
.stepper button { width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(0,0,0,.25); background: transparent; font-size: 1.6rem; line-height: 1; transition: all .35s var(--spring); }
.stepper button:hover { border-color: var(--red); color: var(--red); transform: scale(1.1); }
.stepper button:active { transform: scale(.92); }
.stepper output { font-size: 2.4rem; min-width: 1.4ch; text-align: center; color: var(--ink-strong); }
.stepper output.bump { animation: bump .4s var(--spring); }
@keyframes bump { 40% { transform: scale(1.35); color: var(--red); } }

.yes-only { display: grid; gap: 22px; overflow: hidden; max-height: 0; opacity: 0; transition: max-height .9s var(--ease), opacity .6s var(--ease); margin: -10px; padding: 10px; pointer-events: none; }
.yes-only.open { max-height: 900px; opacity: 1; pointer-events: auto; }
.error { color: var(--red); text-transform: none; font-size: 1rem; letter-spacing: .02em; }
.form.sending .big-btn { opacity: .6; pointer-events: none; }
.form.sending .big-btn span::after { content: "…"; }

.thanks { text-align: center; padding: 30px 0; }
.thanks:not([hidden]) { animation: thanks 1s var(--ease); }
@keyframes thanks { from { opacity: 0; transform: translateY(24px) scale(.96); filter: blur(8px); } }
.thanks h3 { font-weight: 400; font-size: clamp(2.4rem, 7vw, 4rem); line-height: 1; color: #2f2f2e; margin: 18px 0 12px; letter-spacing: 0; }
.thanks p { margin-bottom: 18px; }
.check { width: 92px; }
.check circle, .check path { fill: none; stroke: var(--red); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: stroke .9s var(--ease) .1s forwards; }
.check path { animation-delay: .6s; animation-duration: .6s; }
@keyframes stroke { to { stroke-dashoffset: 0; } }

/* ---------- Footer ---------- */
.foot { text-align: center; padding: clamp(60px, 10vw, 120px) var(--gutter) max(48px, env(safe-area-inset-bottom)); border-top: 1px solid rgba(0,0,0,.06); }
.foot-title { font-size: clamp(2rem, 6vw, 4rem); color: #2f2f2e; letter-spacing: 0; line-height: 1; }
.foot-sub { margin-top: 12px; color: var(--red); -webkit-text-stroke: 1.5px var(--red); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { filter: none; transform: none; }
}
