/* =========================================================
   TOPELT SALTO — ÜHINE STIIL
   Värvid, laiused ja põhivahed on koondatud siia.
   ========================================================= */

:root {
  --color-text: #111111;
  --color-muted: #777777;
  --color-line: #dedede;
  --color-background: #E9F3F2;
  --color-footer: #020202;
  --page-width: 1440px;
  --page-gutter: clamp(20px, 5.6vw, 84px);
  --font-main: Arial, Helvetica, sans-serif;
  --image-radius: 8px;
  --footer-height: 42px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding-bottom: var(--footer-height);
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { opacity: .68; }
img { display: block; max-width: 100%; height: auto; }

/* Päis ja navigatsioon */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 48px;
  padding: 0 var(--page-gutter);
  background: var(--color-background);
}
.logo { display: inline-flex; flex: 0 0 auto; align-items: center; line-height: 0; white-space: nowrap; }
.logo img { width: 160px; height: auto; }
.main-nav { display: flex; align-items: center; gap: clamp(18px, 3vw, 42px); }
.main-nav a { font-size: 14px; text-transform: uppercase; }
.menu-toggle {
  display: none;
  padding: 8px;
  border: 0;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  line-height: 0;
}
.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  margin: 0;
  background: currentColor;
  transition: transform .2s ease, opacity .2s ease;
}
.menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-6px) rotate(-45deg); }

.page-shell { width: 100%; max-width: var(--page-width); margin: 0 auto; }
.home-intro { padding: 48px var(--page-gutter) 28px; }
.home-title {
  max-width: 1100px;
  margin: 0;
  font-size: clamp(42px, 7vw, 88px);
  font-weight: 800;
  line-height: .96;
  letter-spacing: -.055em;
  text-transform: uppercase;
}
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 40px; }
.filter-button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  text-transform: uppercase;
}
.filter-button:not(:last-child)::after { margin-left: 10px; color: var(--color-muted); content: "/"; }
.filter-button[aria-pressed="true"] .filter-label { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* Avalehe projektiruudustik */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px 16px;
  padding: 0 var(--page-gutter) clamp(64px, 7vw, 100px);
}
.project-card { min-width: 0; }
.project-card[hidden] { display: none; }
.project-image {
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border-radius: var(--image-radius);
  background: transparent;
}
.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s ease;
}
.project-card a:hover .project-image img { transform: scale(1.025); }
.project-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  font-size: 12px;
  text-transform: uppercase;
}
.project-meta strong { font-weight: 700; }
.project-category { color: var(--color-muted); text-align: right; }

/* Teenused ja kontakt */
.services,
.contact-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: clamp(48px, 6vw, 88px) var(--page-gutter);
}
.section-title {
  max-width: 480px;
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.12;
  letter-spacing: -.04em;
}
.service-list { margin: 0; padding: 0; list-style: none; font-size: 14px; line-height: 1.9; }
.contact-card { max-width: 360px; }
.contact-portrait {
  width: 320px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  margin-bottom: 20px;
  border-radius: var(--image-radius);
  object-fit: cover;
}
.contact-name { margin: 0 0 5px; font-size: 17px; }
.small-label { margin: 22px 0 4px; color: var(--color-muted); font-size: 14px; text-transform: uppercase; }
.contact-value { margin: 0; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }

/* Projektide detaillehed */
.project-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 60px);
  padding: clamp(38px, 4.5vw, 66px) var(--page-gutter) 90px;
}
.project-copy { align-self: start; position: sticky; top: 60px; }
.project-copy h1 { margin: 0 0 16px; font-size: clamp(28px, 3vw, 38px); line-height: 1.05; letter-spacing: -.035em; }
.project-description { max-width: 600px; margin: 0; color: #444444; font-size: 14px; line-height: 1.55; }
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 38px;
  color: var(--color-muted);
  font-size: 12px;
  text-transform: uppercase;
}
.project-tags span + span::before { margin-right: 12px; content: "/"; }
.project-gallery { display: grid; gap: 20px; }
.project-gallery img { width: 100%; height: auto; border-radius: var(--image-radius); }
.project-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 0 18px -8px;
  padding: 0;
  color: var(--color-text);
  vertical-align: top;
}
.project-back svg { display: block; width: 32px; height: 32px; overflow: visible; }
.project-back:hover { opacity: .55; }
.project-back:focus-visible { outline: 1px solid currentColor; outline-offset: 3px; }

/* Püsiv jalus */
.site-footer {
  position: fixed;
  z-index: 1100;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  height: var(--footer-height);
  min-height: var(--footer-height);
  padding: 0 clamp(16px, 5.6vw, 84px);
  background: var(--color-footer);
  color: #f5f5f5;
  font-size: 14px;
}
.footer-social { display: flex; grid-column: 1; align-items: center; justify-self: start; gap: 12px; }
.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: #f5f5f5;
}
.footer-social svg { display: block; flex: 0 0 18px; width: 18px; height: 18px; }
.footer-social a:hover { opacity: .55; }
.footer-center { grid-column: 2; justify-self: center; color: #f5f5f5; text-align: center; white-space: nowrap; }
.language-switch {
  display: flex;
  grid-column: 3;
  align-items: center;
  justify-self: end;
  gap: 12px;
  color: #f5f5f5;
  text-transform: uppercase;
  white-space: nowrap;
}
.language-switch .active { font-weight: 700; text-decoration: underline; }

@media (max-width: 760px) {
  .site-header { min-height: 48px; }
  .menu-toggle {
    display: flex;
    flex: 0 0 40px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    width: 40px;
    height: 40px;
    margin-left: auto;
    padding: 8px;
    position: relative;
    z-index: 1002;
  }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding: 18px var(--page-gutter) 22px;
    border-bottom: 1px solid var(--color-line);
    background: var(--color-background);
  }
  .main-nav.is-open { display: flex; }
  .main-nav a { font-size: 12px; }
  .home-title { font-size: clamp(38px, 10vw, 66px); }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .project-meta { flex-direction: column; gap: 4px; font-size: 12px; }
  .project-category { text-align: left; }
  .services,
  .contact-section { grid-template-columns: 1fr; gap: 28px; }
  .project-detail { grid-template-columns: 1fr; gap: 30px; padding-top: 34px; }
  .project-copy { position: static; }
  .project-tags { margin-top: 25px; }
  .project-gallery { gap: 12px; }
}

@media (max-width: 600px) {
  .site-footer { gap: 5px; padding: 0 10px; font-size: 8px; }
  .footer-social { gap: 5px; }
  .footer-social a { width: 18px; height: 18px; }
  .footer-social svg { flex-basis: 16px; width: 16px; height: 16px; }
  .footer-center { font-size: 8px; }
  .language-switch { gap: 4px; font-size: 8px; }
}

@media (max-width: 420px) {
  .site-header { padding-inline: 16px; }
  .main-nav { gap: 10px; }
  .main-nav a { font-size: 8px; }
  .project-grid { padding-inline: 16px; }
  .home-intro,
  .services,
  .contact-section,
  .project-detail { padding-inline: 16px; }
}
