/* ==========================================================================
   Karumed Ehitus OÜ — site stylesheet
   Palette: brand amber #DB9B3A (from logo), warm charcoal, white base.
   Type: Inter variable (self-hosted), 900 display / 400 body.
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --amber: #DB9B3A;
  --amber-dark: #B77E27;
  --ink: #1D1712;
  --ink-2: #2A221A;
  --paper: #FFFFFF;
  --surface: #F5F1EA;
  --line: #E7E1D6;
  --text: #33302B;
  --text-muted: #6E675D;
  --text-on-dark: #F3EEE6;
  --text-muted-dark: #BdB2A1;
  --container: 1140px;
  --radius: 6px;
  --shadow: 0 10px 30px rgba(29, 23, 18, 0.08);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--paper);
}

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

h1, h2, h3 { line-height: 1.12; margin: 0 0 1rem; letter-spacing: -0.02em; color: var(--ink); }
h1 { font-size: clamp(2.3rem, 6vw, 4rem); font-weight: 900; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.5rem); font-weight: 800; }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1.1rem; }

a { color: var(--amber-dark); }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* Signature: amber marker bar behind the key word of a headline */
.marker {
  background: var(--amber);
  color: var(--ink);
  padding: 0.02em 0.16em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.9rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber-dark);
}
.eyebrow::before {
  content: '';
  width: 26px;
  height: 4px;
  background: var(--amber);
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(1.1rem, 4vw, 2rem);
}

/* --------------------------------------------------------------------------
   Header / navigation
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}
.brand { display: inline-flex; align-items: center; }
.brand img { height: 40px; width: auto; }

.nav { display: flex; align-items: center; gap: 1.7rem; }
.nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.35rem 0;
  border-bottom: 3px solid transparent;
}
.nav a:hover { border-bottom-color: var(--amber); }
.nav a[aria-current='page'] { border-bottom-color: var(--amber); }
.nav .nav-cta {
  background: var(--amber);
  color: var(--ink);
  padding: 0.55rem 1.1rem;
  border-radius: 4px;
  border-bottom: none;
}
.nav .nav-cta:hover { background: var(--amber-dark); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: 0;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background: var(--ink);
  transition: transform 0.25s, opacity 0.25s;
}

@media (max-width: 800px) {
  .nav-toggle { display: flex; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a {
    padding: 0.95rem clamp(1.1rem, 4vw, 2rem);
    border-bottom: 1px solid var(--line);
  }
  .nav a:hover { background: var(--surface); border-bottom-color: var(--line); }
  .nav a[aria-current='page'] { border-bottom-color: var(--line); box-shadow: inset 4px 0 0 var(--amber); }
  .nav .nav-cta { margin: 0.9rem clamp(1.1rem, 4vw, 2rem) 1.1rem; text-align: center; }
  .nav-toggle[aria-expanded='true'] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle[aria-expanded='true'] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded='true'] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-block;
  padding: 0.95rem 1.7rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn-primary {
  background: var(--amber);
  color: var(--ink);
  border-color: var(--amber);
}
.btn-primary:hover { background: var(--amber-dark); border-color: var(--amber-dark); }
.btn-outline-light {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.75);
}
.btn-outline-light:hover { background: #fff; color: var(--ink); border-color: #fff; }
.btn-outline-dark {
  color: var(--ink);
  border-color: var(--ink);
}
.btn-outline-dark:hover { background: var(--ink); color: #fff; }
.btn-group { display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* --------------------------------------------------------------------------
   Hero (homepage)
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: min(88vh, 820px);
  padding: clamp(5rem, 12vh, 8rem) 0;
  background:
    linear-gradient(100deg, rgba(24, 18, 10, 0.93) 0%, rgba(24, 18, 10, 0.72) 45%, rgba(24, 18, 10, 0.35) 100%),
    url('../img/hero-ehitus.jpg') center / cover no-repeat;
}
.hero .container { width: 100%; }
.hero h1 { color: #fff; max-width: 13ch; }
.hero .lead {
  color: var(--text-on-dark);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  max-width: 46ch;
  margin-bottom: 2rem;
}
.hero-kicker {
  color: var(--amber);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 1.1rem;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
.hero .rise { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.hero .rise:nth-child(2) { animation-delay: 0.12s; }
.hero .rise:nth-child(3) { animation-delay: 0.24s; }
.hero .rise:nth-child(4) { animation-delay: 0.36s; }

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.section { padding: clamp(4rem, 9vw, 6.5rem) 0; }
.section-alt { background: var(--surface); }
.section-head { max-width: 640px; margin-bottom: 2.6rem; }
.section-head p { color: var(--text-muted); }

/* Services grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.6rem;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--amber);
}
.card figure {
  margin: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.card figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.card:hover figure img { transform: scale(1.05); }
.card-body { padding: 1.4rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.card-body h3 { margin: 0; }
.card-body p { color: var(--text-muted); font-size: 0.97rem; margin: 0; flex: 1; }
.card-more {
  margin-top: 0.9rem;
  font-weight: 700;
  color: var(--amber-dark);
  font-size: 0.95rem;
}
.card:hover .card-more::after { transform: translateX(4px); }
.card-more::after {
  content: ' →';
  display: inline-block;
  transition: transform 0.25s;
}

/* Extra service strip (polüurea) */
.extra-strip {
  margin-top: 1.6rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  border: 1px solid var(--line);
  border-left: 6px solid var(--amber);
  border-radius: var(--radius);
  padding: 1.5rem 1.8rem;
  background: var(--paper);
}
.extra-strip h3 { margin: 0 0 0.2rem; }
.extra-strip p { margin: 0; color: var(--text-muted); }

/* Trust band */
.trust-strip {
  position: relative;
  color: var(--text-on-dark);
  background:
    linear-gradient(rgba(24, 18, 10, 0.9), rgba(24, 18, 10, 0.9)),
    url('../img/band-projekt.jpg') center / cover no-repeat;
  padding: clamp(4rem, 9vw, 6rem) 0;
}
.trust-strip h2 { color: #fff; }
.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-top: 2.4rem;
}
.trust-item { border-top: 4px solid var(--amber); padding-top: 1.1rem; }
.trust-item h3 { color: #fff; margin-bottom: 0.4rem; }
.trust-item p { color: var(--text-muted-dark); margin: 0; font-size: 0.97rem; }

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
}
.gallery figure { margin: 0; }
.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
}
.gallery figcaption {
  font-size: 0.88rem;
  color: var(--text-muted);
  padding-top: 0.5rem;
}

/* Contact */
.contact-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
@media (max-width: 800px) {
  .contact-block { grid-template-columns: 1fr; }
}
.contact-rows { display: grid; gap: 1.3rem; margin-top: 1.8rem; }
.contact-row { border-left: 4px solid var(--amber); padding-left: 1.1rem; }
.contact-row .label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin: 0 0 0.15rem;
}
.contact-row .value { font-size: 1.15rem; font-weight: 700; margin: 0; }
.contact-row .value a { color: var(--ink); text-decoration: none; }
.contact-row .value a:hover { color: var(--amber-dark); }

.contact-card {
  background: var(--ink);
  color: var(--text-on-dark);
  border-radius: var(--radius);
  padding: clamp(1.8rem, 4vw, 2.6rem);
}
.contact-card h3 { color: #fff; font-size: 1.5rem; }
.contact-card p { color: var(--text-muted-dark); }

/* --------------------------------------------------------------------------
   Service page layout
   -------------------------------------------------------------------------- */

.page-hero {
  background: var(--ink);
  color: var(--text-on-dark);
  padding: clamp(3.5rem, 8vw, 5.5rem) 0;
}
.page-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
@media (max-width: 800px) {
  .page-hero-grid { grid-template-columns: 1fr; }
}
.page-hero h1 { color: #fff; }
.page-hero .lead { color: var(--text-on-dark); font-size: clamp(1.02rem, 2vw, 1.18rem); margin: 0; }
.page-hero .eyebrow { color: var(--amber); }
.page-hero img {
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.content-section { padding: clamp(3.5rem, 8vw, 5.5rem) 0; }
.content-section .container { max-width: 980px; }
.prose { max-width: 720px; }
.prose h2 { margin-top: 2.6rem; }
.prose h2:first-child { margin-top: 0; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
  margin: 2.6rem 0;
}
@media (max-width: 800px) {
  .split { grid-template-columns: 1fr; }
}
.split img { border-radius: var(--radius); }

.check-list {
  list-style: none;
  margin: 1.4rem 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}
.check-list li {
  position: relative;
  padding-left: 2rem;
}
.check-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 900;
  color: var(--amber-dark);
}
.check-list.two-col { grid-template-columns: 1fr 1fr; column-gap: 2rem; }
@media (max-width: 700px) {
  .check-list.two-col { grid-template-columns: 1fr; }
}

/* CTA band */
.cta-band {
  background: var(--amber);
  color: var(--ink);
  padding: clamp(3.5rem, 8vw, 5rem) 0;
}
.cta-band h2 { color: var(--ink); max-width: 22ch; }
.cta-band p { max-width: 56ch; margin-bottom: 1.8rem; }
.cta-band .btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.cta-band .btn-primary:hover { background: var(--ink-2); border-color: var(--ink-2); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  background: var(--ink);
  color: var(--text-muted-dark);
  padding: clamp(3rem, 7vw, 4.5rem) 0 0;
  font-size: 0.95rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
}
@media (max-width: 800px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.site-footer h3 {
  color: #fff;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 1rem;
}
.site-footer img { height: 34px; width: auto; margin-bottom: 1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.site-footer a { color: var(--text-on-dark); text-decoration: none; }
.site-footer a:hover { color: var(--amber); }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 1.3rem 0;
  font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   404
   -------------------------------------------------------------------------- */

.error-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  text-align: center;
}
.error-page .container { max-width: 560px; }
.error-code {
  font-size: clamp(5rem, 18vw, 9rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--amber);
  margin-bottom: 0.5rem;
}

/* --------------------------------------------------------------------------
   Motion preferences
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
