/* Hammasapu – sivuston tyylit */

@font-face {
  font-family: 'Caladea';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/caladea-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Caladea';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/caladea-700.woff2') format('woff2');
}

:root {
  --bg: #1b262c;
  --black: #000;
  --text: #fff;
  --accent: #f8dcbf;
  --accent-light: #fae6d1;
  --accent-text: #5c340a;
  --input-border: #d4d7e5;
  --input-text: #555;

  --font: 'Caladea', Arial, sans-serif;
  --container: 1170px;
  --gutter: 15px;
  --nav-h: 90px;
  --nav-h-scrolled: 70px;

  --display-size: clamp(1.5rem, 4.2vw, 3.0625rem);   /* 24px → 49px */
  --lead-size: clamp(0.9rem, 1.6vw, 1.1875rem);       /* 14px → 19px */
  --section-title-size: clamp(1.7rem, 3vw, 2.25rem);  /* 27px → 36px */
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h-scrolled);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.43;
  color: var(--text);
  background: var(--bg);
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

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

h1, h2, h3, p {
  margin: 0;
}

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

@media (min-width: 992px) and (max-width: 1199px) {
  .container { max-width: 970px; }
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.section-dark { background: var(--bg); }
.section-black { background: var(--black); }

/* ---------- Typografia ---------- */

.display {
  font-size: var(--display-size);
  font-weight: 700;
  line-height: 1.25;
}

.display-light { font-weight: 400; }

.lead {
  font-size: var(--lead-size);
  line-height: 1.25;
}

.separator {
  width: 100px;
  height: 5px;
  margin: 30px 0;
  background: var(--accent);
}

/* ---------- Ylävalikko ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: transparent;
  transition: height .35s, background-color .35s, box-shadow .35s;
}

.site-header.is-scrolled {
  height: var(--nav-h-scrolled);
  background: var(--bg);
  box-shadow: 0 2px 12px 2px rgba(0, 0, 0, .35);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text);
  white-space: nowrap;
  transition: color .35s;
}

.brand:hover,
.brand:focus-visible {
  text-decoration: none;
}

.is-scrolled .brand { color: var(--accent-light); }

.site-menu ul {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-menu a {
  position: relative;
  display: block;
  padding: 8px 15px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .5px;
  text-transform: capitalize;
  color: var(--text);
  transition: color .2s;
}

.site-menu a::after {
  content: '';
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transition: transform .2s;
}

.site-menu a:hover,
.site-menu a:focus-visible,
.site-menu a.is-active {
  color: var(--accent-light);
  text-decoration: none;
}

.site-menu a.is-active::after,
.site-menu a:hover::after {
  transform: scaleX(1);
}

.menu-toggle {
  display: none;
}

/* ---------- Koti (hero) ---------- */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 85vh;
  min-height: 85svh;
  padding: calc(var(--nav-h) + 50px) 0 50px;
  overflow: hidden;
  background: var(--black);
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(27, 38, 44, .9) 2%, rgba(27, 38, 44, .6) 52%, rgba(27, 38, 44, 0) 78%),
    rgba(0, 0, 0, .5);
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-content .display {
  max-width: 470px;
}

/* ---------- Meistä ---------- */

.about {
  padding: 100px 0;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}

.about-image {
  border-radius: 5px;
  box-shadow: 0 20px 30px rgba(0, 0, 0, .15);
  overflow: hidden;
  aspect-ratio: 1 / 1;
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Hymyily kuuluu kaikille ---------- */

.smile {
  position: relative;
}

.smile-image {
  height: clamp(320px, 56vh, 520px);
  background: url('/assets/img/hymyily.jpg') center / cover no-repeat;
}

@media (min-width: 992px) and (hover: hover) and (pointer: fine) {
  .smile-image { background-attachment: fixed; }
}

.smile-box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 500px;
  margin: -180px 0 0 30px;
  padding: 60px;
  background: var(--bg);
  border-radius: 5px;
  box-shadow: 0 20px 30px rgba(0, 0, 0, .15);
}

/* ---------- Osiot ---------- */

.section {
  padding: 100px 0;
}

.section-title {
  padding-bottom: 24px;
  text-align: center;
}

.section-title h2 {
  margin-bottom: 10px;
  font-size: var(--section-title-size);
  font-weight: 400;
  line-height: 1.25;
  text-transform: uppercase;
}

.section-title hr {
  width: 50px;
  margin: 10px auto;
  border: 0;
  border-top: 2.4px solid var(--accent);
}

/* ---------- Esimerkiksi näihin keskitymme ---------- */

.services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 30px;
  text-align: center;
}

.service {
  margin-bottom: 51px;
}

.service img {
  width: 96px;
  height: 96px;
  margin: 0 auto 15px;
  border-radius: 50%;
  object-fit: cover;
}

.service h3 {
  margin: 10px 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
}

.service p {
  line-height: 1.25;
}

/* ---------- Lisätietoa ---------- */

.prose p {
  margin-bottom: 20px;
  line-height: 1.3;
}

/* ---------- Yhteydenotot ---------- */

.contact-form {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px 30px;
  margin-bottom: 50px;
}

.contact-form input {
  width: 100%;
  height: 48px;
  padding: 12px 17.6px;
  font: inherit;
  color: var(--input-text);
  background: #fff;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
}

.contact-form input::placeholder {
  color: #999;
}

.contact-form input[aria-invalid='true'] {
  border-color: #e57373;
  box-shadow: 0 0 0 2px rgba(229, 115, 115, .5);
}

.form-field-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.btn {
  display: block;
  width: 100%;
  height: 48px;
  padding: 12px 17.6px;
  font: inherit;
  line-height: 1.5;
  text-transform: uppercase;
  color: var(--accent-text);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 0;
  cursor: pointer;
  transition: background-color .2s, border-color .2s;
}

.btn:hover,
.btn:focus-visible {
  background: var(--accent-light);
}

.btn:disabled {
  opacity: .6;
  cursor: progress;
}

.form-status {
  grid-column: 1 / -1;
  min-height: 0;
}

.form-status:empty {
  display: none;
}

.form-status.is-error { color: #ffb4a8; }
.form-status.is-success { color: var(--accent); }

.contact-details {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 30px;
}

.contact-info ul {
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.contact-info li {
  line-height: 1.25;
}

.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: .4em;
  vertical-align: -.125em;
  fill: var(--accent);
}

.contact-map iframe {
  display: block;
  width: 100%;
  height: 300px;
  border: 0;
}

/* ---------- Alatunniste ---------- */

.site-footer {
  padding: 40px 0;
  font-size: 12.8px;
  line-height: 1.43;
  background: var(--bg);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-name {
  font-size: 19.2px;
}

.footer-menu ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-menu a {
  display: block;
  margin: 4px 8px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--text);
}

.footer-menu a:hover,
.footer-menu a:focus-visible {
  color: var(--accent-light);
}

/* ---------- Takaisin ylös ---------- */

.to-top {
  position: fixed;
  right: 30px;
  bottom: 30px;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, .3);
  border-radius: 2px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s, background-color .2s;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
}

.to-top:hover {
  background: rgba(0, 0, 0, .6);
}

.to-top svg {
  width: 22px;
  height: 22px;
  fill: #fff;
}

/* ---------- Ilmestymisanimaatio ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js [data-anim] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity .8s ease, transform .8s ease;
  }

  .js [data-anim].is-visible {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Tabletti ---------- */

@media (max-width: 991px) {
  .site-menu a {
    padding: 8px 10px;
    font-size: 15px;
  }

  .brand { font-size: 24px; }

  .contact-form { grid-template-columns: 1fr 1fr; }
}

/* ---------- Mobiili ---------- */

@media (max-width: 767px) {
  :root {
    --nav-h: 60px;
    --nav-h-scrolled: 60px;
  }

  .site-header,
  .site-header.is-scrolled {
    height: var(--nav-h);
    background: var(--bg);
    box-shadow: 0 2px 12px 2px rgba(0, 0, 0, .35);
  }

  .header-inner {
    justify-content: center;
    position: relative;
  }

  .brand {
    font-size: 14px;
    color: var(--accent-light);
  }

  .menu-toggle {
    position: absolute;
    left: var(--gutter);
    top: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 40px;
    height: 40px;
    padding: 8px;
    margin-top: -20px;
    background: none;
    border: 0;
    cursor: pointer;
  }

  .menu-toggle-bar {
    display: block;
    height: 3px;
    background: #fff;
    border-radius: 1px;
    transition: transform .25s, opacity .25s;
  }

  .menu-open .menu-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-open .menu-toggle-bar:nth-child(2) { opacity: 0; }
  .menu-open .menu-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .site-menu {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s, visibility .25s;
  }

  .menu-open .site-menu {
    opacity: 1;
    visibility: visible;
  }

  .site-menu ul {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
  }

  .site-menu a {
    padding: 12px 15px;
    font-size: 20px;
  }

  .menu-open {
    overflow: hidden;
  }

  .hero {
    min-height: 0;
    padding: calc(var(--nav-h) + 40px) 0 50px;
    min-height: 380px;
    text-align: center;
  }

  .hero::after {
    background: linear-gradient(rgba(27, 38, 44, .45), rgba(27, 38, 44, .45)), rgba(0, 0, 0, .5);
  }

  .hero-content .display {
    max-width: none;
  }

  .separator {
    margin: 20px auto;
  }

  .about {
    padding: 60px 0;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 30px;
    text-align: center;
  }

  .about-image {
    aspect-ratio: 345 / 250;
  }

  .smile-image {
    height: 340px;
  }

  .smile-box {
    max-width: 300px;
    margin: -80px auto 0;
    padding: 20px 10px;
    text-align: center;
  }

  .section {
    padding: 60px 0;
  }

  .services {
    grid-template-columns: 1fr;
  }

  .contact-form,
  .contact-details {
    grid-template-columns: 1fr;
  }

  .contact-info {
    text-align: center;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-menu ul {
    justify-content: center;
  }

  .to-top {
    right: 15px;
    bottom: 15px;
  }
}
