:root {
  --paber: #ece8e0;
  --paber-2: #e3ded4;
  --soe: #1b1a18;
  --hall: #5d5953;
  --hall-hele: #8d877e;
  --joon: rgba(27, 26, 24, .16);
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Karla", system-ui, -apple-system, "Segoe UI", sans-serif;
  --laius: 1240px;
  --serv: clamp(16px, 4vw, 48px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background-color: var(--paber);
  /* paberi tekstuur */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.09 0 0 0 0 0.08 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--soe);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }

/* ---------- päis ---------- */
.pais {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 14px var(--serv);
  background: color-mix(in srgb, var(--paber) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.pais.kerinud { border-bottom-color: var(--joon); }
.logo {
  font: italic 400 24px/1 var(--serif);
  text-decoration: none; letter-spacing: .01em;
  margin-right: auto;
}
.nav { display: flex; gap: 28px; }
.nav a, .keel button {
  font: 500 12px/1 var(--sans);
  letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; color: var(--hall);
}
.nav a:hover, .nav a:focus-visible { color: var(--soe); }
.keel { display: flex; align-items: center; gap: 6px; color: var(--hall-hele); font-size: 12px; }
.keel button { background: none; border: 0; padding: 6px 2px; cursor: pointer; }
.keel button[aria-pressed="true"] { color: var(--soe); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- hero ---------- */
.hero {
  max-width: var(--laius); margin: 0 auto;
  padding: clamp(32px, 7vw, 96px) var(--serv) clamp(48px, 8vw, 120px);
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(32px, 6vw, 96px);
  align-items: center;
}
.silt {
  margin: 0 0 18px;
  font: 500 12px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--hall);
}
.silt::before { content: ""; display: inline-block; width: 36px; height: 1px; background: currentColor; vertical-align: middle; margin-right: 14px; }
h1 {
  margin: 0;
  font: 300 clamp(56px, 10vw, 136px)/.9 var(--serif);
  letter-spacing: -.02em;
}
.hero-lause {
  max-width: 30ch; margin: 28px 0 36px;
  font: italic 300 clamp(21px, 2.2vw, 27px)/1.4 var(--serif); color: var(--hall);
}
.nupud { display: flex; flex-wrap: wrap; gap: 12px; }
.nupp {
  display: inline-block; cursor: pointer;
  padding: 15px 26px;
  font: 600 13px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; text-decoration: none;
  background: var(--soe); color: var(--paber);
  border: 1px solid var(--soe); border-radius: 0;
  transition: background .2s, color .2s;
}
.nupp:hover, .nupp:focus-visible { background: transparent; color: var(--soe); }
.nupp-tuhi { background: transparent; color: var(--soe); }
.nupp-tuhi:hover, .nupp-tuhi:focus-visible { background: var(--soe); color: var(--paber); }

.hero-pilt { margin: 0; position: relative; }
.hero-pilt img {
  width: 100%; max-height: 78vh; object-fit: cover;
  object-position: 50% 30%;
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 24px 48px -24px rgba(27,26,24,.35);
}
.hero-pilt img.avatav { cursor: zoom-in; }
.hero-pilt::after {
  /* söejoon pildi all */
  content: ""; position: absolute; left: -6%; right: 20%; bottom: -22px; height: 10px;
  background: var(--soe); opacity: .85; filter: url(#soeserv);
  border-radius: 50% 40% 60% 30%; transform: rotate(-1deg);
}

/* ---------- sektsioonid ---------- */
.osa { max-width: var(--laius); margin: 0 auto; padding: clamp(56px, 8vw, 112px) var(--serv); }
.osa-pea { display: grid; grid-template-columns: auto auto 1fr; align-items: baseline; gap: 18px; margin-bottom: clamp(32px, 4vw, 56px); }
.nr { font: italic 300 22px/1 var(--serif); color: var(--hall-hele); }
h2 { margin: 0; font: 400 clamp(38px, 5vw, 60px)/1 var(--serif); letter-spacing: -.01em; }
h3 { margin: 0 0 20px; font: 500 26px/1.2 var(--serif); }
.joon { width: 100%; height: 12px; align-self: center; }
.joon path { fill: none; stroke: var(--soe); stroke-width: 2.2; stroke-linecap: round; opacity: .7; filter: url(#soeserv); }

.sissejuhatus { max-width: 56ch; margin: 0 0 40px; font: 300 clamp(20px, 2vw, 24px)/1.5 var(--serif); }

/* ---------- galerii ---------- */
.galerii { display: flex; align-items: flex-start; gap: clamp(16px, 2.4vw, 32px); }
.galerii-veerg { flex: 1; min-width: 0; }
.too {
  margin: 0 0 clamp(16px, 2.4vw, 32px);
  display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: zoom-in;
  font: inherit; color: inherit;
}
.too img {
  width: 100%; background: var(--paber-2);
  transition: transform .5s cubic-bezier(.2,.7,.2,1), box-shadow .5s;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.too:hover img, .too:focus-visible img { transform: translateY(-3px); box-shadow: 0 18px 36px -20px rgba(27,26,24,.45); }
.too:focus-visible { outline: 2px solid var(--soe); outline-offset: 4px; }
.too-allkiri { display: flex; justify-content: space-between; gap: 12px; padding-top: 10px; font-size: 13px; color: var(--hall); }
.too-allkiri b { font: italic 400 18px/1.2 var(--serif); color: var(--soe); }
.tood-lisa { margin-top: 32px; color: var(--hall); }
.tood-sissejuhatus { max-width: 60ch; margin: calc(-1 * clamp(12px, 2vw, 28px)) 0 clamp(28px, 4vw, 48px); font: italic 300 clamp(19px, 1.8vw, 22px)/1.5 var(--serif); color: var(--hall); }

/* tume galerii: söejoonistused mõjuvad pimedas toas paremini kui paberil */
.tume {
  --soe: #ebe5da;
  --hall: #a29c92;
  --hall-hele: #6e6961;
  --joon: rgba(235, 229, 218, .14);
  --paber-2: #1e1c1a;
  color: var(--soe);
  background: #151412;
  /* taust ulatub üle kogu ekraani laiuse, sisu jääb keskele */
  box-shadow: 0 0 0 100vmax #151412;
  clip-path: inset(0 -100vmax);
}
.tume .too img { box-shadow: 0 1px 0 rgba(255,255,255,.04); }
.tume .too:hover img, .tume .too:focus-visible img { box-shadow: 0 24px 48px -24px rgba(0,0,0,.9); }
.tume .too:focus-visible { outline-color: var(--soe); }
.tume a { color: var(--soe); }

/* ---------- tellimine ---------- */
.seinal { margin: 0 0 clamp(48px, 6vw, 80px); }
.seinal-pildid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 2vw, 24px); }
.seinal-pildid img { width: 100%; aspect-ratio: var(--suhe, .8); object-fit: cover; background: var(--paber-2); }
.seinal figcaption { margin-top: 12px; font: italic 400 17px/1.4 var(--serif); color: var(--hall); }
.formaadid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); border-top: 1px solid var(--soe); }
.formaat { padding: 28px 28px 32px 0; border-bottom: 1px solid var(--joon); }
.formaat + .formaat { padding-left: 28px; border-left: 1px solid var(--joon); }
.formaat-nimi { font: 400 44px/1 var(--serif); }
.formaat-moot { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--hall); margin-top: 6px; }
.formaat-hind { margin: 22px 0 4px; font-size: 15px; color: var(--hall); }
.formaat-hind strong { font: 500 34px/1 var(--serif); color: var(--soe); margin-left: 4px; }
.formaat-lisa { font-size: 14px; color: var(--hall); }
.formaat-kirj { margin: 14px 0 0; }
.markus { font-size: 14px; color: var(--hall); margin: 16px 0 0; }

.kaks-veergu { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); margin-top: clamp(56px, 7vw, 96px); }
.protsess { list-style: none; margin: 0; padding: 0; counter-reset: samm; }
.protsess li { counter-increment: samm; display: grid; grid-template-columns: 48px 1fr; padding: 16px 0; border-top: 1px solid var(--joon); }
.protsess li::before { content: counter(samm, decimal-leading-zero); font: italic 300 22px/1.3 var(--serif); color: var(--hall-hele); }
.protsess b { display: block; font-weight: 600; }
.protsess span { color: var(--hall); }
.fotonoud { margin: 0; padding: 0; list-style: none; }
.fotonoud li { position: relative; padding: 14px 0 14px 28px; border-top: 1px solid var(--joon); }
.fotonoud li::before { content: ""; position: absolute; left: 2px; top: 25px; width: 12px; height: 2px; background: var(--soe); filter: url(#soeserv); }

/* ---------- minust ---------- */
.minust { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.minust.ilma-pildita { grid-template-columns: 1fr; max-width: 760px; }
.minust-pilt { margin: 0; }
.minust-pilt img { width: 100%; }
.minust-tekst p { margin: 0 0 1.2em; font: 300 clamp(20px, 2vw, 24px)/1.55 var(--serif); }

/* ---------- kontakt ---------- */
.kontakt-sisu { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 6vw, 96px); }
.otse { font: italic 400 24px/1.6 var(--serif); }
.otse a { text-decoration-thickness: 1px; text-underline-offset: 5px; }
.vorm { display: grid; gap: 22px; }
.vorm label { display: grid; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--hall); }
.vorm input, .vorm select, .vorm textarea {
  width: 100%; padding: 10px 0; font: 400 18px/1.4 var(--sans); color: var(--soe);
  background: transparent; border: 0; border-bottom: 1px solid var(--hall-hele); border-radius: 0;
  letter-spacing: normal; text-transform: none;
}
.vorm textarea { resize: vertical; min-height: 120px; }
.vorm select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--soe) 50%), linear-gradient(135deg, var(--soe) 50%, transparent 50%); background-position: calc(100% - 12px) 55%, calc(100% - 7px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.vorm input:focus, .vorm select:focus, .vorm textarea:focus { outline: none; border-bottom: 2px solid var(--soe); margin-bottom: -1px; }
.vorm [aria-invalid="true"] { border-bottom-color: #8a2b20; }
.vorm .nupp { justify-self: start; }
.vorm-teade { margin: 0; min-height: 1.6em; color: var(--hall); }
.peidus { position: absolute; left: -9999px; }

/* ---------- jalus ---------- */
.jalus { max-width: var(--laius); margin: 0 auto; padding: 32px var(--serv) 48px; border-top: 1px solid var(--joon); font-size: 13px; color: var(--hall); display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- lightbox ---------- */
.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(20, 19, 17, .96); color: var(--paber);
}
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: transparent; }
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 56px 72px 24px; max-height: 100%; }
.lightbox img { max-width: min(92vw, 1400px); max-height: calc(100vh - 190px); object-fit: contain; width: auto; }
.lb-muuk { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px 18px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #9d978c; }
.lightbox .lb-kysi {
  position: static; padding: 10px 18px; border: 1px solid #d8d2c7; color: #ece6db;
  font: 600 12px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase;
}
.lightbox .lb-kysi:hover, .lightbox .lb-kysi:focus-visible { background: #ece6db; color: #151412; }
.lightbox figcaption { font: italic 400 19px/1.3 var(--serif); color: #b9b3a8; text-align: center; min-height: 1.3em; }
.lightbox button { position: absolute; background: none; border: 0; color: #d8d2c7; cursor: pointer; font: 300 48px/1 var(--serif); padding: 12px 18px; }
.lightbox button:hover, .lightbox button:focus-visible { color: #fff; }
.lb-sulge { top: 8px; right: 12px; }
.lb-nool { top: 50%; transform: translateY(-50%); font-size: 64px !important; }
.lb-eel { left: 8px; }
.lb-jar { right: 8px; }

/* ---------- ilmumine ---------- */
.ilmu { opacity: 0; transform: translateY(18px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
.ilmu.nahtav { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .ilmu { opacity: 1; transform: none; transition: none; } }

/* ---------- mobiil ---------- */
@media (max-width: 860px) {
  .nav { display: none; }
  .hero, .minust, .kontakt-sisu, .kaks-veergu { grid-template-columns: 1fr; }
  .hero-pilt { order: -1; }
  .hero-pilt img { max-height: 62vh; }
  /* telefonis libistatav rida – kõrged pildid üksteise all oleksid liiga pikad */
  .seinal-pildid {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 68%;
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin: 0 calc(-1 * var(--serv)); padding: 0 var(--serv);
  }
  .seinal-pildid::-webkit-scrollbar { display: none; }
  .seinal-pildid img { scroll-snap-align: center; }
  .formaat, .formaat + .formaat { padding: 24px 0; border-left: 0; }
  .lightbox figure { padding: 56px 8px 16px; }
  .lb-nool { top: auto; bottom: 8px; transform: none; }
  .minust-pilt { max-width: 420px; }
}
@media (max-width: 480px) {
  .osa-pea { grid-template-columns: auto 1fr; }
  .joon { grid-column: 1 / -1; }
}
