/* ===================================================================
   Rikhard & Saara — 10.10.2026 · Taulun Kartano
   "Pihlaja" — romanttinen syysjuhla suomalaisella kartanolla
   Paletti ja typografia: ks. brand/index.html (graafinen ohjeisto)
   =================================================================== */

:root {
  /* Paletti — syksyinen kartano */
  --paper:      #FAF3E7;   /* kynttilänvalo-kerma */
  --paper-deep: #F1E5D0;   /* vanha paperi */
  --rowan:      #A03D22;   /* pihlajanmarja — pääkorosteväri */
  --ember:      #7C2D18;   /* hiillos — tummempi korostus */
  --gold:       #B08D3F;   /* antiikkikulta */
  --moss:       #74805F;   /* sammal */
  --fir:        #3D4A3B;   /* kuusenhavu — tumma pohja */
  --ink:        #35261C;   /* espresso — teksti */
  --ink-soft:   #6E5A4B;   /* haalistunut muste */
  --line:       rgba(53, 38, 28, 0.16);

  --serif:  "Cormorant Garamond", Georgia, serif;
  --script: "Great Vibes", "Cormorant Garamond", cursive;

  --maxw: 1080px;
  --radius: 2px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.18rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
}

body.is-locked { overflow: hidden; height: 100vh; }

p { margin: 0 0 1rem; }
em { color: var(--ink-soft); }
strong { color: var(--rowan); font-weight: 600; }

::selection { background: rgba(176, 141, 63, .3); }

.link, a.link {
  color: var(--rowan);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: border-color .2s, color .2s;
}
.link:hover { color: var(--ember); border-color: var(--ember); }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--serif);
  font-size: .98rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--rowan);
  border: none;
  padding: .95rem 2.4rem;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: background .25s, transform .15s, box-shadow .25s;
  box-shadow: 0 6px 18px rgba(124, 45, 24, 0.2);
}
.btn:hover { background: var(--ember); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(124, 45, 24, 0.25); }
.btn:active { transform: translateY(0); }

/* ===================================================================
   PASSWORD GATE
   =================================================================== */
.gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 28%, var(--paper) 0%, var(--paper-deep) 75%, #E7D7BC 100%);
  padding: 2rem;
  overflow: hidden;
  transition: opacity .6s ease, visibility .6s;
}
.gate.is-open { opacity: 0; visibility: hidden; pointer-events: none; }

.gate__corner { position: absolute; width: clamp(140px, 24vw, 240px); color: var(--rowan); opacity: .16; }
.gate__corner--tl { top: 14px; left: 14px; }
.gate__corner--br { bottom: 14px; right: 14px; transform: rotate(180deg); }

.gate__inner {
  position: relative;
  max-width: 460px;
  text-align: center;
  animation: rise .8s ease both;
}
.gate__seal { width: 116px; height: 116px; color: var(--rowan); margin-bottom: 1.1rem; }
.gate__eyebrow {
  font-size: .95rem; font-weight: 600; letter-spacing: .38em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 .35rem;
}
.gate__title {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: clamp(2.3rem, 7vw, 3.1rem);
  color: var(--ink);
  margin: 0 0 .75rem; line-height: 1.1;
}
.gate__text { color: var(--ink-soft); margin-bottom: 1.6rem; }
.gate__form { display: flex; flex-direction: column; gap: .9rem; align-items: center; }
.gate__input {
  width: 100%;
  font-family: var(--serif); font-size: 1.2rem;
  text-align: center; letter-spacing: .12em;
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.65);
  color: var(--ink);
  transition: border-color .2s, background .2s;
}
.gate__input:focus { outline: none; border-color: var(--gold); background: #fff; }
.gate__btn { width: 100%; }
.gate__error { color: var(--rowan); margin-top: 1rem; font-style: italic; }

/* ===================================================================
   SITE
   =================================================================== */
.site { opacity: 0; transition: opacity .8s ease .1s; }
.site.is-visible { opacity: 1; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(250, 243, 231, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s;
}
.nav.is-scrolled { border-color: var(--line); box-shadow: 0 4px 20px rgba(53,38,28,.06); }
.nav__brand {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: 1.45rem; letter-spacing: .08em; color: var(--rowan);
  text-decoration: none; line-height: 1;
}
.nav__amp { color: var(--gold); }
.nav__links { display: flex; align-items: center; gap: 1.5rem; }
.nav__links a {
  font-size: .98rem; font-weight: 500; letter-spacing: .08em; color: var(--ink);
  text-decoration: none; transition: color .2s;
}
.nav__links a:hover { color: var(--rowan); }
.nav__cta {
  border: 1px solid var(--rowan); border-radius: var(--radius);
  padding: .35rem 1rem; color: var(--rowan) !important;
  transition: background .2s, color .2s;
}
.nav__cta:hover { background: var(--rowan); color: var(--paper) !important; }

.nav__toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav__toggle span { width: 26px; height: 2px; background: var(--rowan); transition: .3s; }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center; overflow: hidden;
}
.hero__media { position: absolute; inset: 0; }
.hero__placeholder {
  width: 100%; height: 100%;
  background:
    radial-gradient(58% 46% at 50% 34%, rgba(250,243,231,.18) 0%, rgba(250,243,231,0) 70%),
    linear-gradient(158deg, #C79A66 0%, #A85C33 45%, #6E3A22 100%);
}
/* hienovarainen paperimainen rae */
.hero__placeholder::after {
  content: ""; position: absolute; inset: 0; opacity: .16; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}
.hero__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(53,38,28,.38) 0%, rgba(53,38,28,.12) 42%, rgba(53,38,28,.48) 100%);
}
.corner { position: absolute; width: clamp(110px, 18vw, 200px); color: rgba(250,243,231,.85); z-index: 2; }
.corner--tl { top: 70px; left: 18px; }
.corner--br { bottom: 18px; right: 18px; transform: rotate(180deg); }

.hero__content { position: relative; z-index: 3; color: var(--paper); padding: 2rem; animation: rise 1s ease both; }
.hero__eyebrow {
  font-size: clamp(.95rem, 2vw, 1.15rem); font-weight: 600; letter-spacing: .42em;
  text-transform: uppercase; margin-bottom: .75rem; text-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.hero__names {
  font-family: var(--script);
  font-size: clamp(3.8rem, 13vw, 8rem);
  font-weight: 400; line-height: .95; margin: 0 0 .4rem;
  text-shadow: 0 4px 24px rgba(0,0,0,.35);
}
.hero__names .amp { display: inline-block; font-size: .7em; vertical-align: middle; opacity: .9; }
.hero__divider { width: 96px; height: 24px; color: var(--paper); opacity: .9; margin: .25rem auto .6rem; display: block; }
.hero__date, .hero__venue { font-size: clamp(1.2rem, 3vw, 1.65rem); letter-spacing: .12em; margin: 0; text-shadow: 0 2px 12px rgba(0,0,0,.35); }
.hero__venue { margin-bottom: 1.9rem; font-style: italic; color: var(--paper-deep); }
.hero__btn { background: rgba(250,243,231,.95); color: var(--ember); }
.hero__btn:hover { background: #fff; }

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1.25rem, 5vw, 2rem); }
.section--narrow { max-width: 760px; margin: 0 auto; }
.section--accent { background: var(--paper-deep); }
.section__head { text-align: center; margin-bottom: 2.6rem; }
.section__eyebrow {
  font-size: .88rem; font-weight: 600; letter-spacing: .32em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 .5rem;
}
.section__title {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: clamp(2.3rem, 5.5vw, 3.3rem);
  color: var(--rowan); margin: 0; line-height: 1.08;
}
.section__divider { width: 96px; height: 24px; color: var(--rowan); display: block; margin: .8rem auto 0; }
.lead { font-size: 1.32rem; color: var(--ink-soft); font-style: italic; text-align: center; margin-bottom: 1.5rem; }
.note { text-align: center; color: var(--ink-soft); }
/* Tekstikappaleet pysyvät lukuleveydessä myös leveissä osioissa */
.section > p, .section > .lead { max-width: 720px; margin-left: auto; margin-right: auto; }

/* Cards — kutsukorttimainen kaksoiskehys */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; max-width: var(--maxw); margin: 0 auto; }
.card {
  position: relative;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 2.2rem 1.5rem; text-align: center;
}
.card::before {
  content: ""; position: absolute; inset: 6px; pointer-events: none;
  border: 1px solid var(--line); border-radius: 1px;
}
.section--accent .card { background: #FDFAF3; }
.card__title { font-size: .92rem; letter-spacing: .28em; text-transform: uppercase; color: var(--gold); margin: 0 0 .75rem; font-weight: 600; }
.card__big { font-family: var(--serif); font-size: 1.7rem; font-weight: 500; color: var(--ink); margin: 0 0 .25rem; }

/* Two column */
.twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; max-width: var(--maxw); margin: 0 auto; }
.twocol h3 { margin-top: 0; }
.twocol .card__title { margin-top: 1.2rem; }
.twocol .card__title:first-child { margin-top: 0; }

/* Timeline — marjapisteet hiusviivalla */
.timeline { list-style: none; margin: 0 auto; padding: 0; max-width: 640px; }
.timeline__item {
  display: grid; grid-template-columns: 96px 28px 1fr; gap: .9rem;
  padding: 1.35rem 0; position: relative;
}
.timeline__time { font-size: 1.15rem; color: var(--gold); font-style: italic; text-align: right; padding-top: .15rem; }
.timeline__dot {
  position: relative; display: block; margin-top: .55rem;
  justify-self: center;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--rowan);
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--line);
}
.section--accent .timeline__dot { box-shadow: 0 0 0 3px var(--paper-deep), 0 0 0 4px var(--line); }
/* pystyviiva pisteiden välillä */
.timeline__item::after {
  content: ""; position: absolute; left: calc(96px + .9rem + 13.5px); top: 2.6rem; bottom: -1rem;
  width: 1px; background: var(--line);
}
.timeline__item:last-child::after { display: none; }
.timeline__body h3 { margin: 0 0 .25rem; color: var(--ink); font-size: 1.4rem; font-weight: 600; }
.timeline__body p { margin: 0; color: var(--ink-soft); }

/* ---------- RSVP ---------- */
.section--rsvp { background: linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%); }
.rsvp-panel {
  position: relative;
  max-width: 620px; margin: 0 auto;
  background: #FDFAF3;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.6rem, 5vw, 2.8rem);
}
.rsvp-panel::before {
  content: ""; position: absolute; inset: 7px; pointer-events: none;
  border: 1px solid var(--line); border-radius: 1px;
}
.rsvp { position: relative; }
.field { margin-bottom: 1.5rem; }
.field > label, .field legend { display: block; font-size: 1.02rem; letter-spacing: .05em; color: var(--ink); margin-bottom: .5rem; font-weight: 600; }
.req { color: var(--rowan); }
.field input[type="text"],
.field input[type="number"],
.field textarea {
  width: 100%; font-family: var(--serif); font-size: 1.1rem;
  padding: .75rem .9rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(255,255,255,.75); color: var(--ink); resize: vertical;
  transition: border-color .2s, background .2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--gold); background: #fff; }
.field fieldset { border: none; padding: 0; margin: 0; }
.radio { display: flex; align-items: center; gap: .6rem; font-weight: 400; cursor: pointer; margin-bottom: .5rem; }
.radio input { accent-color: var(--rowan); width: 1.1rem; height: 1.1rem; }
.rsvp__btn { width: 100%; margin-top: .5rem; }
.rsvp__status { margin-top: 1.25rem; text-align: center; font-size: 1.15rem; padding: 1rem; border-radius: var(--radius); }
.rsvp__status.is-ok { background: rgba(116,128,95,.16); color: #4E5A3E; }
.rsvp__status.is-err { background: rgba(160,61,34,.1); color: var(--rowan); }
.rsvp.is-sending { opacity: .6; pointer-events: none; }

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 3.8rem 1.5rem 3.2rem; background: var(--fir); color: var(--paper); }
.footer__sprig { width: 132px; height: 53px; color: var(--gold); }
.footer__names { font-family: var(--script); font-size: 2.7rem; margin: .35rem 0 .3rem; color: var(--paper); }
.footer__date { letter-spacing: .22em; font-size: .95rem; text-transform: uppercase; opacity: .8; margin: 0; }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Animations ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  body { font-size: 1.1rem; }
  .nav__toggle { display: flex; }
  .nav__links {
    position: fixed; top: 60px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: rgba(250,243,231,.98); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height .35s ease;
  }
  .nav__links.is-open { max-height: 80vh; padding: .5rem 0 1rem; }
  .nav__links a { padding: .85rem 2rem; width: 100%; border-bottom: 1px solid var(--line); }
  .nav__cta { margin: .75rem 2rem 0; text-align: center; }
  .twocol { grid-template-columns: 1fr; gap: 1.5rem; }
  .timeline__item { grid-template-columns: 68px 22px 1fr; gap: .6rem; }
  .timeline__item::after { left: calc(68px + .6rem + 10.5px); }
  .timeline__time { font-size: 1.02rem; }
  .gate__corner--tl { top: 8px; left: 8px; }
  .gate__corner--br { bottom: 8px; right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; transition: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
