/* Viktoria & Joakim · 19 juni 2027
   Grafisk profil: papper #f8f7f3, salvia #6b7a5f, mörk salvia #47523f, bläck #2b2a26.
   Cormorant Garamond (spärrade versaler), Mulish (löptext), La Belle Aurore (endast datumet). */

:root {
  --paper: #f8f7f3;
  --paper-2: #fdfcf9;
  --sage: #6b7a5f;
  --sage-dark: #47523f;
  --sage-text: #5b6852;
  --sage-fill: #eef0e9;
  --ink: #2b2a26;
  --text: #44433c;
  --muted: #6d6b62;
  --grey: #8b897f;
  --line: #e2e1d8;
  --line-2: #e7e6dd;
  --line-3: #eceade;
  --rule: #cfd4c6;
  --tl-line: #d5d9cc;
  --input-border: #d6d5cb;
  --serif: 'Cormorant Garamond', 'Times New Roman', Georgia, serif;
  --sans: 'Mulish', 'Helvetica Neue', Arial, sans-serif;
  --script: 'La Belle Aurore', 'Brush Script MT', cursive;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.75; }
body.is-locked { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--sage-text); text-decoration: none; }
a:hover { color: var(--sage-dark); }
input, textarea, button { font-family: var(--sans); }
input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; }
::selection { background: #dde3d6; }
::placeholder { color: #a9a89e; }
p { margin: 0; }
[hidden] { display: none !important; }
.mobile-only { display: block; }
@media (min-width: 900px) { .mobile-only { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- Gemensamma element ---------- */
.eyebrow { font-family: var(--serif); font-weight: 500; font-size: 15px; letter-spacing: .42em; text-indent: .42em; color: var(--muted); }
.script { font-family: var(--script); font-size: 32px; color: var(--sage-text); line-height: 1; }
.place-label { font-size: 13px; letter-spacing: .3em; text-indent: .3em; color: var(--muted); }
.label { font-size: 10px; letter-spacing: .26em; text-indent: .26em; color: var(--sage-text); font-weight: 700; }
.rule { width: 44px; border-top: 1px solid var(--rule); }
.rule-center { margin: 30px auto 0; }
.branch { position: absolute; pointer-events: none; user-select: none; }
.branch-tl { top: -22px; left: -30px; width: 175px; transform: rotate(158deg); }
.branch-br { bottom: -18px; right: -34px; width: 190px; transform: rotate(-14deg); }
.branch-faint { width: 150px; bottom: -30px; right: -44px; transform: rotate(-18deg); opacity: .85; }
.monogram { width: 118px; height: 118px; object-fit: contain; }
.monogram-sm { width: 64px; height: 64px; object-fit: contain; opacity: .9; margin: 0 auto; }

.btn { display: inline-block; padding: 15px 36px; border: 1px solid var(--sage); background: transparent; color: var(--sage-dark); font-size: 12px; font-weight: 600; letter-spacing: .22em; text-indent: .22em; cursor: pointer; text-align: center; transition: background .2s, color .2s; }
.btn:hover { background: var(--sage-fill); color: var(--sage-dark); }
.btn-sm { padding: 10px 20px; font-size: 11px; letter-spacing: .2em; text-indent: .2em; }
.btn-ghost { border-color: var(--input-border); color: var(--muted); font-weight: 600; letter-spacing: .18em; text-indent: 0; padding: 16px 22px; }
.btn-ghost:hover { background: #f0efe9; }
.btn-wide { flex: 1; padding: 16px 22px; font-weight: 700; }
.btn[disabled] { opacity: .5; cursor: default; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 32px; }
.wrap-narrow { max-width: 560px; }

/* ---------- Startvy / entré ---------- */
.hero { position: relative; overflow: hidden; background: var(--paper); text-align: center; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
.hero-bg { position: absolute; inset: 0; }
.hero-bg video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.8s ease .4s; }
.hero.is-open .hero-bg video.is-playing { opacity: 1; }
.hero-tint { position: absolute; inset: 0; background: rgba(248,247,243,.8); }
.hero .topnav, .hero-inner { position: relative; }
.hero .branch { z-index: 1; }

/* Allt i startvyn vecklas ut i tur och ordning (--d = fördröjning) när sigillet trycks */
.hero .reveal { opacity: 0; transform: translateY(14px); transition: opacity .9s ease var(--d, 0s), transform 1.1s cubic-bezier(.2,.6,.2,1) var(--d, 0s); }
.hero.is-open .reveal { opacity: 1; transform: none; }
.hero .branch.reveal, .hero.is-open .branch.reveal { transition: opacity 1.6s ease var(--d, 0s); }
.hero .branch-tl.reveal, .hero.is-open .branch-tl.reveal { transform: rotate(158deg); }
.hero .branch-br.reveal, .hero.is-open .branch-br.reveal { transform: rotate(-14deg); }
.hero.is-instant .reveal { transition: none !important; }

.seal-scene { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; background: var(--paper); transition: opacity .9s ease, transform .9s ease; }
.hero.is-open .seal-scene { opacity: 0; transform: scale(1.04); pointer-events: none; }
.seal { width: 104px; height: 104px; border-radius: 50%; background: var(--paper); border: 1px solid var(--sage); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; transition: background .25s, transform .25s; animation: seal-breathe 3.2s ease-in-out infinite; }
.seal:hover { background: var(--sage-fill); }
.seal img { width: 72px; height: 72px; object-fit: contain; }
@keyframes seal-breathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(107,122,95,.28); } 50% { box-shadow: 0 0 0 16px rgba(107,122,95,0); } }
.intro-open-label { font-size: 11px; font-weight: 600; letter-spacing: .3em; text-indent: .3em; color: var(--muted); }
.intro-open-label .rule { display: block; width: 30px; margin: 16px auto 0; }
.hero-scroll { position: absolute; left: 0; right: 0; bottom: max(22px, env(safe-area-inset-bottom)); font-size: 10px; letter-spacing: .24em; text-indent: .24em; color: var(--grey); }
.hero-scroll .tick { display: block; width: 1px; height: 26px; background: var(--rule); margin: 10px auto 0; animation: tick 1.8s ease-in-out infinite; }
@keyframes tick { 0%, 100% { transform: scaleY(1); transform-origin: top; } 50% { transform: scaleY(.6); transform-origin: top; } }

.topnav { display: none; justify-content: center; gap: 56px; padding: 30px 0; border-bottom: 1px solid var(--line-2); }
.topnav a { font-size: 11px; font-weight: 600; letter-spacing: .26em; color: var(--text); }
.topnav a:hover { color: var(--sage-dark); }
.hero-inner { flex: 1; padding: 72px 36px 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hero .eyebrow { margin-top: 40px; }
.names { margin: 20px 0 0; font-family: var(--serif); font-weight: 500; font-size: 34px; line-height: 1.25; letter-spacing: .24em; text-indent: .24em; }
.hero .script { margin-top: 26px; }
.hero .place-label { margin-top: 14px; }
.hero .rule-center { margin: 40px 0 30px; }
.countdown { display: flex; }
.countdown > div { padding: 0 20px; border-right: 1px solid var(--line); text-align: center; }
.countdown > div:last-child { border-right: 0; }
.countdown b { display: block; font-family: var(--serif); font-weight: 500; font-size: 34px; font-variant-numeric: tabular-nums; line-height: 1; }
.countdown span { display: block; margin-top: 7px; font-size: 10px; letter-spacing: .24em; text-indent: .24em; color: var(--grey); }
.hero .btn-lg { margin-top: 44px; }

/* ---------- Sektioner ---------- */
.section { position: relative; overflow: hidden; padding: 60px 0 70px; border-top: 1px solid var(--line-2); }
.section-head { text-align: center; }
.section h2 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 24px; letter-spacing: .3em; text-indent: .3em; }
.section-head .sub { margin-top: 12px; font-size: 13px; color: var(--muted); }

/* Programmet */
.program-grid { margin-top: 38px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 62px 17px 1fr; }
.timeline li { display: contents; }
.timeline time { font-family: var(--serif); font-weight: 600; font-size: 20px; font-variant-numeric: tabular-nums; text-align: right; padding: 0 14px 34px 0; line-height: 1; }
.timeline i { position: relative; display: block; }
.timeline i::before { content: ""; position: absolute; left: 3px; top: 5px; bottom: 0; border-left: 1px solid var(--tl-line); }
.timeline li.last i::before { display: none; }
.timeline i::after { content: ""; position: absolute; left: 0; top: 2px; width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--sage); background: var(--paper); }
.timeline div { padding: 0 0 34px 14px; }
.timeline b { display: block; font-size: 13px; font-weight: 700; letter-spacing: .14em; color: var(--ink); }
.timeline p { margin-top: 5px; font-size: 13px; color: var(--muted); line-height: 1.6; max-width: 420px; }
.places { margin-top: 14px; display: flex; flex-direction: column; gap: 16px; }
.place { border: 1px solid var(--line); padding: 22px 22px 24px; background: var(--paper); }
.place h3 { margin: 10px 0 0; font-family: var(--serif); font-weight: 600; font-size: 21px; }
.place .sub { margin-top: 4px; font-size: 13px; color: var(--muted); line-height: 1.6; }
.place .btn { margin-top: 14px; }

/* Praktiskt */
.accordion { margin-top: 8px; }
.accordion details { border-bottom: 1px solid var(--line-2); }
.accordion summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 24px 2px; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary span { font-size: 11px; letter-spacing: .26em; text-indent: .26em; color: var(--sage-text); font-weight: 700; }
.accordion summary i { font-size: 0; line-height: 1; }
.accordion summary i::after { content: "+"; font-family: var(--serif); font-style: normal; font-size: 22px; line-height: 1; color: var(--muted); }
.accordion details[open] summary i::after { content: "−"; }
.acc-body { padding: 0 2px 26px; font-size: 14px; line-height: 1.75; color: var(--text); text-wrap: pretty; max-width: 460px; }
.contact { margin-top: 30px; text-align: center; font-size: 13px; color: var(--muted); line-height: 1.7; }
.contact a { border-bottom: 1px solid var(--rule); }

/* Anmälan */
.rsvp { margin-top: 34px; }
.rsvp-progress .row { display: flex; justify-content: space-between; align-items: baseline; }
.step-count { font-size: 11px; letter-spacing: .2em; color: var(--grey); }
.step-count b { font-weight: 400; }
.step-name { font-size: 12px; color: var(--grey); }
.rsvp-progress .bar { margin-top: 10px; height: 1px; background: var(--line); position: relative; }
.rsvp-progress .bar i { position: absolute; left: 0; top: 0; height: 1px; background: var(--sage); transition: width .4s ease; }
.step { display: none; margin-top: 34px; flex-direction: column; gap: 22px; }
.step.is-active { display: flex; animation: step-in .35s ease; }
@keyframes step-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.field { display: block; }
.field > span { display: block; font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--text); }
.field input, .field textarea { margin-top: 10px; width: 100%; padding: 15px 16px; font-size: 16px; line-height: 1.6; border: 1px solid var(--input-border); background: var(--paper-2); color: var(--ink); border-radius: 0; -webkit-appearance: none; }
.field textarea { resize: none; }
.choice-group { display: flex; flex-direction: column; gap: 14px; }
.step-intro { font-size: 13px; color: var(--muted); margin-bottom: -8px; }
.choice { width: 100%; text-align: left; padding: 20px 22px; cursor: pointer; background: transparent; border: 1px solid var(--input-border); color: var(--ink); transition: background .2s, border-color .2s; }
.choice:hover { background: #f3f2ec; }
.choice.is-selected { background: var(--sage-fill); border-color: var(--sage); }
.choice b { display: block; font-family: var(--serif); font-weight: 600; font-size: 22px; line-height: 1.2; }
.choice span { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.error { font-size: 12px; color: #8b5a4b; min-height: 0; }
.error:empty { display: none; }
.rsvp-nav { margin-top: 36px; display: flex; gap: 12px; }
.rsvp-done { margin-top: 40px; text-align: center; animation: step-in .6s ease; }
.rsvp-done img { width: 120px; opacity: .9; margin: 0 auto; }
.done-title { margin-top: 26px; font-family: var(--serif); font-weight: 500; font-size: 26px; line-height: 1.4; }
.done-text { margin-top: 14px; font-size: 14px; color: var(--muted); line-height: 1.7; }
.rsvp-done .script { margin-top: 22px; font-size: 26px; }

/* Footer */
.footer { text-align: center; border-top: 1px solid var(--line-2); padding: 44px 32px calc(48px + env(safe-area-inset-bottom)); }
.footer .script { margin-top: 14px; font-size: 24px; }
.footer-links { margin-top: 22px; font-size: 11px; letter-spacing: .08em; color: var(--grey); }
.footer-links a { color: var(--grey); }
.footer-links a:hover { color: var(--sage-dark); }

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
  .branch-tl { top: -34px; left: -40px; width: 300px; }
  .branch-br { bottom: -30px; right: -48px; width: 320px; }
  .topnav { display: flex; }
  .hero-inner { padding: 60px 60px 110px; }
  .monogram { width: 140px; height: 140px; }
  .hero .eyebrow { margin-top: 44px; font-size: 17px; letter-spacing: .5em; text-indent: .5em; }
  .names { margin-top: 26px; font-size: 58px; line-height: 1.15; letter-spacing: .3em; text-indent: .3em; }
  .hero .script { margin-top: 30px; font-size: 44px; }
  .hero .place-label { margin-top: 16px; font-size: 14px; letter-spacing: .34em; text-indent: .34em; }
  .hero .rule-center { width: 52px; margin: 52px 0 36px; }
  .countdown > div { padding: 0 40px; }
  .countdown b { font-size: 46px; }
  .countdown span { margin-top: 9px; font-size: 11px; letter-spacing: .26em; }
  .hero .btn-lg { margin-top: 56px; padding: 17px 48px; font-size: 13px; letter-spacing: .24em; text-indent: .24em; }

  .section { padding: 88px 0 96px; }
  .section h2 { font-size: 28px; }
  .section-head { text-align: left; }
  .section-head .rule-center { display: none; }
  #anmalan .section-head { text-align: center; }
  .program-grid { margin-top: 40px; display: grid; grid-template-columns: 1fr 380px; gap: 80px; align-items: start; }
  .timeline { grid-template-columns: 70px 17px 1fr; }
  .timeline time { font-size: 22px; padding: 0 16px 36px 0; }
  .timeline div { padding: 0 0 36px 16px; }
  .places { margin-top: 0; }
  .place { padding: 24px 26px 26px; }
  .place h3 { font-size: 22px; }
  .accordion { margin-top: 36px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 80px; align-items: start; }
  .contact { margin-top: 48px; }
  #anmalan .wrap-narrow { max-width: 624px; }
  .rsvp { margin-top: 40px; border: 1px solid var(--line); padding: 40px 48px 48px; }
}
