/* =====================================================================
   Hanneleine.fi – tyylit
   ---------------------------------------------------------------------
   1. Värit ja asetukset (MUOKKAA TÄSTÄ värejä ja fontteja)
   2. Perustyylit
   3. Yleiset komponentit (painikkeet, otsikot, kuvat)
   4. Yläpalkki ja valikko
   5. Hero
   6. Minusta
   7. Palvelut
   8. Galleria ja kuvanäkymä
   9. Yhteystiedot ja alapalkki
   10. Animaatiot
   11. Paikkamerkit
   ===================================================================== */


/* ---------- 1. Värit ja asetukset ---------- */
:root {
  --paper:     #F4EFE7;   /* taustaväri */
  --paper-2:   #EAE2D6;   /* toissijainen tausta */
  --ink:       #23211D;   /* tumma teksti */
  --ink-soft:  #5E584F;   /* leipäteksti */
  --clay:      #A8583A;   /* korostusväri */
  --clay-dark: #8C4529;
  --moss:      #5B6650;
  --line:      rgba(35, 33, 29, .14);

  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans:  "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --container: 1320px;
  --gutter: clamp(1rem, 4vw, 3rem);
  --section-space: clamp(5rem, 12vw, 10rem);
  --radius: 4px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}


/* ---------- 2. Perustyylit ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: clamp(1rem, .95rem + .2vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
html { overflow-x: clip; }

img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0 0 1em; }

::selection { background: var(--clay); color: var(--paper); }

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

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 100;
  padding: .75rem 1rem;
  background: var(--ink); color: var(--paper);
}
.skip-link:focus { top: 1rem; }


/* ---------- 3. Yleiset komponentit ---------- */
em {
  font-style: italic;
  font-family: var(--font-serif);
}

.eyebrow,
.section-label {
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
}

.section-label {
  display: flex;
  align-items: center;
  gap: .9rem;
}
.section-label span {
  font-family: var(--font-serif);
  font-size: .95rem;
  letter-spacing: 0;
  color: var(--clay);
}
.section-label::after {
  content: "";
  width: 3rem;
  height: 1px;
  background: currentColor;
  opacity: .5;
}

.section { padding-block: var(--section-space); }

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 1.6rem + 3.6vw, 4.75rem);
  line-height: 1.02;
  letter-spacing: -.02em;
  font-variation-settings: "opsz" 144;
  font-weight: 350;
}
.section-title em,
.hero-title em,
.contact-title em { color: var(--clay); font-weight: 300; }

.section-head { max-width: 46rem; margin-bottom: clamp(3rem, 6vw, 5rem); }
.section-intro { color: var(--ink-soft); margin-top: 1.5rem; max-width: 34rem; }

.section-head-row {
  max-width: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem 3rem;
}
.section-head-row .section-intro { margin: 0; }

/* Painikkeet */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: 1rem 1.75rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-weight: 500;
  font-size: .95rem;
  letter-spacing: .01em;
  transition: background .35s var(--ease), transform .35s var(--ease);
}
.btn:hover { background: var(--clay); transform: translateY(-2px); }
.btn-small { padding: .6rem 1.2rem; font-size: .875rem; }
.btn-large { padding: 1.25rem 2.25rem; font-size: 1.05rem; }

.link-arrow {
  text-decoration: none;
  font-weight: 500;
  font-size: .95rem;
  display: inline-flex;
  gap: .4rem;
}
.link-arrow span { transition: transform .3s var(--ease); }
.link-arrow:hover span { transform: translateX(4px); }

.link-underline {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  transition: background-size .35s var(--ease);
  padding-bottom: 1px;
}
.link-underline:hover { background-size: 0 1px; background-position: 100% 100%; }

/* Kaarenmuotoinen kuva */
.arch { border-radius: 999px 999px var(--radius) var(--radius); overflow: hidden; }

/* Kuvien yhteinen tyyli */
.hero-image img,
.hero-image-small img,
.about-image img,
.service-image img,
.g-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--paper-2);
}


/* ---------- 4. Yläpalkki ja valikko ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background .4s var(--ease), box-shadow .4s var(--ease), padding .4s var(--ease);
  padding-block: 1.4rem;
}
.site-header.is-scrolled {
  background: rgba(244, 239, 231, .88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line);
  padding-block: .8rem;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.wordmark {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-style: italic;
  font-weight: 400;
  text-decoration: none;
  letter-spacing: -.01em;
  position: relative;
  z-index: 2;
}

.main-nav { display: flex; align-items: center; gap: 2.5rem; }
.main-nav ul { display: flex; gap: 2rem; list-style: none; margin: 0; padding: 0; }
.main-nav ul a {
  text-decoration: none;
  font-size: .9rem;
  position: relative;
}
.main-nav ul a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .4s var(--ease);
}
.main-nav ul a:hover::after,
.main-nav ul a.is-active::after { transform: scaleX(1); transform-origin: left; }

.menu-toggle {
  display: none;
  align-items: center;
  gap: .7rem;
  background: none;
  border: 0;
  padding: .5rem 0;
  font: inherit;
  font-size: .85rem;
  color: var(--ink);
  cursor: pointer;
  position: relative;
  z-index: 2;
}
.menu-toggle-icon { width: 22px; height: 10px; position: relative; display: block; }
.menu-toggle-icon span {
  position: absolute; left: 0;
  width: 100%; height: 1.5px;
  background: currentColor;
  transition: transform .4s var(--ease), top .4s var(--ease);
}
.menu-toggle-icon span:first-child { top: 0; }
.menu-toggle-icon span:last-child { top: 8.5px; }
.menu-toggle[aria-expanded="true"] .menu-toggle-icon span:first-child { top: 4.25px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-icon span:last-child { top: 4.25px; transform: rotate(-45deg); }

@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; }

  .main-nav {
    position: fixed;
    inset: 0;
    z-index: 1;
    background: var(--paper);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 3rem;
    padding: 6rem var(--gutter) 3rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity .45s var(--ease), visibility .45s;
  }
  .main-nav ul { flex-direction: column; gap: .4rem; }
  .main-nav ul a {
    font-family: var(--font-serif);
    font-size: clamp(2.4rem, 11vw, 3.5rem);
    line-height: 1.15;
    display: inline-block;
    transform: translateY(1rem);
    opacity: 0;
    transition: transform .6s var(--ease), opacity .6s var(--ease);
  }
  .main-nav ul a::after { display: none; }
  .nav-open .main-nav { opacity: 1; visibility: visible; }
  .nav-open .main-nav ul a { transform: none; opacity: 1; }
  .nav-open .main-nav li:nth-child(2) a { transition-delay: .05s; }
  .nav-open .main-nav li:nth-child(3) a { transition-delay: .1s; }
  .nav-open .main-nav li:nth-child(4) a { transition-delay: .15s; }
  .nav-open { overflow: hidden; }
  .nav-open .site-header { background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .nav-cta { font-size: 1rem; padding: 1rem 1.75rem; }
}


/* ---------- 5. Hero ---------- */
.hero {
  padding-top: clamp(7rem, 14vw, 10rem);
  padding-bottom: clamp(4rem, 8vw, 7rem);
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2rem;
  align-items: center;
}

.hero-text { grid-column: 1 / span 7; position: relative; z-index: 2; }

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.9rem, 1.4rem + 6.4vw, 7.25rem);
  line-height: .98;
  letter-spacing: -.03em;
  font-weight: 330;
  font-variation-settings: "opsz" 144;
  margin-bottom: 2rem;
  text-wrap: balance;
}

.hero-lead {
  font-size: clamp(1.05rem, 1rem + .3vw, 1.2rem);
  color: var(--ink-soft);
  max-width: 30rem;
  margin-bottom: 2.5rem;
}

.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 2rem; }

.hero-media {
  grid-column: 8 / -1;
  position: relative;
}

.hero-image {
  aspect-ratio: 4 / 5;
  animation: hero-in 1.6s var(--ease) both;
}
.hero-image img { animation: hero-zoom 2.4s var(--ease) both; }

@keyframes hero-in {
  from { clip-path: inset(100% 0 0 0 round 999px 999px 0 0); }
  to   { clip-path: inset(0 0 0 0 round 999px 999px 0 0); }
}
@keyframes hero-zoom {
  from { transform: scale(1.15); }
  to   { transform: scale(1); }
}

.hero-image-small {
  position: absolute;
  width: 42%;
  aspect-ratio: 1;
  left: -22%;
  bottom: -8%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 8px solid var(--paper);
  box-shadow: 0 30px 60px -30px rgba(35, 33, 29, .35);
}

.stamp {
  position: absolute;
  top: 6%;
  right: -4%;
  width: clamp(96px, 11vw, 140px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: var(--clay);
  color: var(--paper);
  border-radius: 50%;
  overflow: hidden;
}
.stamp svg {
  position: absolute;
  inset: 0;
  animation: spin 22s linear infinite;
}
.stamp text {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  text-transform: uppercase;
  fill: currentColor;
}
.stamp-mark { font-size: 1.6rem; line-height: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 3.5rem; }
  .hero-text, .hero-media { grid-column: 1 / -1; }
  .hero-media { width: 88%; margin-left: auto; margin-bottom: 2rem; }
  .hero-image-small { left: -12%; width: 40%; border-width: 6px; }
  .stamp { right: -3%; }
}


/* ---------- 6. Minusta ---------- */
.about { background: var(--paper-2); }

.about-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2rem;
  align-items: center;
}
.about-image { grid-column: 1 / span 5; aspect-ratio: 3 / 4; }
.about-text  { grid-column: 7 / -1; }

.about .section-title { margin-bottom: 2rem; }

.prose { color: var(--ink-soft); max-width: 36rem; }
.prose .lead {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 1.1rem + .6vw, 1.6rem);
  line-height: 1.4;
  color: var(--ink);
  font-weight: 350;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 3rem 0 0;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.facts dt {
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: .4rem;
}
.facts dd { margin: 0; font-family: var(--font-serif); font-size: 1.15rem; }

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 3rem; }
  .about-image, .about-text { grid-column: 1 / -1; }
  .about-image { width: 80%; max-width: 420px; }
}
@media (max-width: 520px) {
  .facts { grid-template-columns: 1fr; gap: 1rem; }
  .facts > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
}


/* ---------- 7. Palvelut ---------- */
.service-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: clamp(2rem, 4vw, 3rem);
}

.service { display: flex; flex-direction: column; }
.service-image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  margin-bottom: 1.75rem;
}
.service-image img { transition: transform 1.2s var(--ease); }
.service:hover .service-image img { transform: scale(1.05); }

.service-body {
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
  position: relative;
  color: var(--ink-soft);
  flex: 1;
  display: flex;
  flex-direction: column;
}
.service-num {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--clay);
  font-size: .95rem;
  display: block;
  margin-bottom: .75rem;
}
.service-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem);
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: .9rem;
  font-weight: 380;
}
.service-meta {
  margin-top: auto;
  padding-top: .5rem;
  font-size: .85rem;
  color: var(--ink);
  font-weight: 500;
}

.services-note {
  margin-top: clamp(3rem, 6vw, 4.5rem);
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 1.05rem + .5vw, 1.5rem);
  text-align: center;
}


/* ---------- 8. Galleria ja kuvanäkymä ---------- */
.gallery { padding-top: 0; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: clamp(140px, 17vw, 240px);
  grid-auto-flow: dense;
  gap: clamp(.6rem, 1.2vw, 1rem);
}

.g-item {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  cursor: zoom-in;
}
.g-item.tall { grid-row: span 2; }
.g-item.wide { grid-column: span 2; }
.g-item img { transition: transform 1.2s var(--ease), filter .6s var(--ease); }
.g-item:hover img { transform: scale(1.06); }
.g-item::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(35, 33, 29, .3), transparent 50%);
  opacity: 0;
  transition: opacity .5s var(--ease);
}
.g-item:hover::after { opacity: 1; }

@media (max-width: 760px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 44vw; }
}

/* Kuvanäkymä */
.lightbox {
  width: 100vw; height: 100dvh;
  max-width: none; max-height: none;
  margin: 0; padding: 0;
  border: 0;
  background: rgba(24, 22, 19, .96);
  color: var(--paper);
}
.lightbox[open] {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  animation: fade .35s var(--ease);
}
.lightbox::backdrop { background: transparent; }
.lightbox figure {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 0 2rem;
  min-width: 0;
}
.lightbox img {
  max-height: calc(100dvh - 9rem);
  max-width: 100%;
  width: auto;
  object-fit: contain;
  border-radius: var(--radius);
}
.lightbox figcaption {
  margin-top: 1rem;
  font-family: var(--font-serif);
  font-style: italic;
  opacity: .8;
}
.lightbox button {
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  font-size: 1.6rem;
  cursor: pointer;
  width: 3.5rem; height: 3.5rem;
  border-radius: 50%;
  margin: 0 clamp(.25rem, 2vw, 1.5rem);
  transition: background .3s;
}
.lightbox button:hover { background: rgba(255, 255, 255, .1); }
.lb-close { position: absolute; top: 1rem; right: 0; font-size: 2rem !important; }
@keyframes fade { from { opacity: 0; } }

@media (max-width: 600px) {
  .lightbox[open] { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto; }
  .lightbox figure { grid-column: 1 / -1; grid-row: 1; padding-inline: 1rem; }
  .lb-prev { grid-row: 2; justify-self: start; margin-bottom: 1.5rem !important; }
  .lb-next { grid-row: 2; justify-self: end; margin-bottom: 1.5rem !important; }
}


/* ---------- 9. Yhteystiedot ja alapalkki ---------- */
.contact {
  background: var(--ink);
  color: var(--paper);
}
.contact .section-label { color: rgba(244, 239, 231, .65); }
.contact .section-label span { color: #D99877; }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 3rem 2rem;
  align-items: end;
}
.contact-main { grid-column: 1 / span 7; }
.contact-details { grid-column: 9 / -1; }

.contact-title {
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 1.5rem + 5vw, 6rem);
  line-height: 1;
  letter-spacing: -.025em;
  font-weight: 330;
  font-variation-settings: "opsz" 144;
  margin-bottom: 2rem;
  text-wrap: balance;
}
.contact-title em { color: #D99877; }

.contact-lead { color: rgba(244, 239, 231, .72); max-width: 30rem; margin-bottom: 2.5rem; }

.contact .btn { background: var(--paper); color: var(--ink); }
.contact .btn:hover { background: var(--clay); color: var(--paper); }

.contact-details { margin: 0; }
.contact-details > div {
  padding-block: 1.1rem;
  border-top: 1px solid rgba(244, 239, 231, .16);
}
.contact-details > div:last-child { border-bottom: 1px solid rgba(244, 239, 231, .16); }
.contact-details dt {
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(244, 239, 231, .55);
  margin-bottom: .3rem;
}
.contact-details dd { margin: 0; font-size: 1.05rem; }
.contact-details a { text-decoration: none; transition: color .3s; }
.contact-details a:hover { color: #D99877; }
.social { display: flex; gap: 1.25rem; flex-wrap: wrap; }

@media (max-width: 860px) {
  .contact-main, .contact-details { grid-column: 1 / -1; }
}

.site-footer {
  background: var(--ink);
  color: rgba(244, 239, 231, .6);
  font-size: .85rem;
  padding-block: 2.5rem;
  border-top: 1px solid rgba(244, 239, 231, .1);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem 2rem;
}
.footer-inner p { margin: 0; }
.footer-mark {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--paper);
}
.footer-top { text-decoration: none; }
.footer-top:hover { color: var(--paper); }

/* Mobiilin kiinteä painike */
.sticky-cta {
  display: none;
  position: fixed;
  right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  z-index: 40;
  padding: .9rem 1.4rem;
  border-radius: 999px;
  background: var(--clay);
  color: var(--paper);
  text-decoration: none;
  font-weight: 500;
  font-size: .9rem;
  box-shadow: 0 12px 30px -10px rgba(35, 33, 29, .5);
  transform: translateY(150%);
  transition: transform .5s var(--ease);
}
.sticky-cta.is-visible { transform: none; }
@media (max-width: 860px) {
  .sticky-cta { display: block; }
  .site-footer { padding-bottom: 6rem; }
}


/* ---------- 10. Animaatiot ---------- */
/* Elementit, joilla on luokka "reveal", nousevat esiin vieritettäessä.
   Luokka "js" lisätään vain, kun JavaScript toimii – ilman sitä kaikki näkyy heti. */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: var(--delay, 0s);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

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


/* ---------- 11. Paikkamerkit ---------- */
/* Luokka "pm" korostaa vaihdettavat esimerkkisisällöt.
   Kun kaikki on vaihdettu, poista luokat HTML:stä – tai poista tämä sääntö. */
.pm {
  background: rgba(168, 88, 58, .1);
  box-shadow: inset 0 -1px 0 rgba(168, 88, 58, .5);
  border-radius: 2px;
  padding-inline: .15em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.contact .pm { background: rgba(217, 152, 119, .14); box-shadow: inset 0 -1px 0 rgba(217, 152, 119, .5); }
