/* ================================================
   Rakennuspalvelu Esko Hintsala Oy
   Design: Bold Typography Hero / Warm Amber + Forest Green
   Fonts: Fraunces (display) + Onest (body)
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,600;0,9..144,700;0,9..144,900;1,9..144,400&family=Onest:wght@300;400;500;600&display=swap');

/* === DESIGN TOKENS === */
:root {
  /* Brand colors — warm amber / ochre */
  --brand:       oklch(0.62 0.14 68);
  --brand-light: color-mix(in oklab, var(--brand) 25%, white);
  --brand-dark:  color-mix(in oklab, var(--brand) 80%, black);

  /* Accent — forest pine green */
  --accent:      oklch(0.42 0.12 155);
  --accent-light: color-mix(in oklab, var(--accent) 20%, white);

  /* Tinted neutrals */
  --surface-1:   oklch(0.98 0.006 75);
  --surface-2:   oklch(0.93 0.012 70);
  --surface-3:   oklch(0.18 0.015 68);
  --surface-4:   oklch(0.12 0.012 65);

  --text-primary:   oklch(0.16 0.015 65);
  --text-secondary: oklch(0.48 0.025 70);
  --text-on-dark:   oklch(0.96 0.006 75);
  --text-muted:     oklch(0.65 0.012 68);

  --border: oklch(0.85 0.015 70);
  --border-light: oklch(0.92 0.008 72);

  /* Spacing — 4-point base */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* Typography scale — Perfect Fourth (1.333) */
  --text-xs:   clamp(0.75rem, 1.5vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 1.8vw, 1rem);
  --text-base: clamp(1rem, 2vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 2.2vw, 1.333rem);
  --text-xl:   clamp(1.333rem, 2.8vw, 1.777rem);
  --text-2xl:  clamp(1.777rem, 3.5vw, 2.369rem);
  --text-3xl:  clamp(2.369rem, 5vw, 3.157rem);
  --text-4xl:  clamp(3rem, 7vw, 4.5rem);

  /* Transitions */
  --transition-fast: 150ms ease-out;
  --transition-base: 250ms ease-out;
  --transition-slow: 400ms ease-out;

  /* Shadows */
  --shadow-sm: 0 1px 3px oklch(0.1 0.01 68 / 0.12), 0 1px 2px oklch(0.1 0.01 68 / 0.08);
  --shadow-md: 0 4px 12px oklch(0.1 0.01 68 / 0.15), 0 2px 6px oklch(0.1 0.01 68 / 0.1);
  --shadow-lg: 0 12px 32px oklch(0.1 0.01 68 / 0.2), 0 4px 12px oklch(0.1 0.01 68 / 0.12);
}

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Onest', system-ui, sans-serif;
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--surface-1);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

::selection { background: color-mix(in oklab, var(--brand) 30%, white); }

/* === SCROLL-DRIVEN ANIMATIONS === */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    animation: fade-up linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 60%;
  }
  .reveal-left {
    animation: fade-right linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 60%;
  }
  @keyframes fade-up {
    from { opacity: 0; translate: 0 32px; }
    to   { opacity: 1; translate: 0 0; }
  }
  @keyframes fade-right {
    from { opacity: 0; translate: -32px 0; }
    to   { opacity: 1; translate: 0 0; }
  }

  .service-card:nth-child(1) { animation-delay: 0ms; }
  .service-card:nth-child(2) { animation-delay: 100ms; }
  .service-card:nth-child(3) { animation-delay: 200ms; }
  .service-card:nth-child(4) { animation-delay: 300ms; }

  .pain-card:nth-child(1) { animation-delay: 0ms; }
  .pain-card:nth-child(2) { animation-delay: 120ms; }
  .pain-card:nth-child(3) { animation-delay: 240ms; }
}

/* === LAYOUT === */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
}
@media (max-width: 768px) {
  .container { padding: 0 var(--space-md); }
}

/* === NAVIGATION === */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--surface-3);
  border-bottom: 1px solid oklch(0.28 0.015 68 / 0.8);
  backdrop-filter: blur(8px);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav__logo {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav__logo-name {
  font-family: 'Fraunces', serif;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--brand);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.nav__logo-sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}
.nav__link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition-fast);
  position: relative;
  padding-bottom: 2px;
}
.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 100%;
  height: 2px;
  background: var(--brand);
  transition: right var(--transition-base);
}
.nav__link:hover { color: var(--brand); }
.nav__link:hover::after { right: 0; }
.nav__cta {
  background: var(--brand);
  color: var(--surface-3);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 6px;
  transition: background var(--transition-fast), transform var(--transition-fast);
  white-space: nowrap;
}
.nav__cta:hover { background: var(--brand-dark); transform: scale(1.02); }
.nav__cta:active { transform: scale(0.98); }
.nav__cta:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.nav__phone {
  color: var(--brand);
  font-weight: 600;
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}
.nav__phone:hover { color: var(--brand-light); }

/* Hamburger */
.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: 4px;
  transition: background var(--transition-fast);
}
.nav__hamburger:hover { background: oklch(0.28 0.015 68); }
.nav__hamburger:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.nav__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-on-dark);
  border-radius: 2px;
  transition: transform var(--transition-base), opacity var(--transition-base);
}
.nav__hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav__hamburger.open span:nth-child(2) { opacity: 0; }
.nav__hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile nav */
.nav__mobile {
  display: none;
  flex-direction: column;
  gap: 0;
  background: var(--surface-4);
  border-top: 1px solid oklch(0.28 0.015 68);
  padding: var(--space-md);
}
.nav__mobile.open { display: flex; }
.nav__mobile-link {
  display: block;
  color: var(--text-on-dark);
  font-size: var(--text-base);
  padding: var(--space-md) 0;
  border-bottom: 1px solid oklch(0.28 0.015 68);
  transition: color var(--transition-fast);
}
.nav__mobile-link:hover { color: var(--brand); }
.nav__mobile-cta {
  display: block;
  background: var(--brand);
  color: var(--surface-3);
  text-align: center;
  font-weight: 600;
  padding: var(--space-md);
  border-radius: 6px;
  margin-top: var(--space-md);
  transition: background var(--transition-fast);
}
.nav__mobile-cta:hover { background: var(--brand-dark); }

@media (max-width: 768px) {
  .nav__links { display: none; }
  .nav__hamburger { display: flex; }
}

/* === HERO === */
.hero {
  background: var(--surface-3);
  padding: calc(64px + var(--space-4xl)) var(--space-md) var(--space-4xl);
  min-height: 100svh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse 60% 50% at 80% 50%, oklch(0.62 0.14 68 / 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 20% 80%, oklch(0.42 0.12 155 / 0.05) 0%, transparent 50%);
  pointer-events: none;
}
.hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4xl);
  align-items: center;
}
.hero__label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: oklch(0.62 0.14 68 / 0.12);
  border: 1px solid oklch(0.62 0.14 68 / 0.3);
  color: var(--brand);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: var(--space-xl);
}
.hero__label::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  background: var(--brand);
  border-radius: 50%;
}
.hero__headline {
  font-family: 'Fraunces', serif;
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--text-on-dark);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-xl);
}
.hero__headline em {
  font-style: italic;
  color: var(--brand);
}
.hero__sub {
  font-size: var(--text-lg);
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-2xl);
  max-width: 46ch;
}
.hero__actions {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--brand);
  color: var(--surface-3);
  font-size: var(--text-base);
  font-weight: 600;
  padding: 16px 32px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  white-space: nowrap;
}
.btn-primary:hover {
  background: var(--brand-dark);
  transform: scale(1.02);
  box-shadow: 0 8px 20px oklch(0.62 0.14 68 / 0.35);
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:focus-visible { outline: 3px solid var(--brand-light); outline-offset: 2px; }
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-muted);
  font-size: var(--text-base);
  font-weight: 500;
  transition: color var(--transition-fast);
}
.btn-secondary:hover { color: var(--text-on-dark); }
.btn-secondary:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

.hero__visual {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}
.hero__card {
  background: oklch(0.24 0.018 68);
  border: 1px solid oklch(0.32 0.02 68);
  border-radius: 12px;
  padding: var(--space-xl);
}
.hero__card-title {
  font-family: 'Fraunces', serif;
  font-size: var(--text-lg);
  color: var(--brand);
  margin-bottom: var(--space-sm);
  font-weight: 600;
}
.hero__card-text {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.6;
}
.hero__card-price {
  margin-top: var(--space-md);
  font-size: var(--text-xl);
  font-family: 'Fraunces', serif;
  font-weight: 700;
  color: var(--text-on-dark);
}
.hero__card-price small {
  font-size: var(--text-sm);
  font-family: 'Onest', sans-serif;
  color: var(--text-muted);
  font-weight: 400;
}

@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__visual { display: none; }
  .hero { min-height: auto; padding: calc(64px + var(--space-2xl)) var(--space-md) var(--space-3xl); }
}

/* === TRUST BAR === */
.trust-bar {
  background: var(--brand);
  padding: var(--space-2xl) 0;
}
.trust-bar__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  text-align: center;
}
.trust-bar__stat-number {
  font-family: 'Fraunces', serif;
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--surface-3);
  line-height: 1;
  margin-bottom: var(--space-xs);
}
.trust-bar__stat-label {
  font-size: var(--text-sm);
  color: color-mix(in oklab, var(--surface-3) 70%, transparent);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
@media (max-width: 600px) {
  .trust-bar__grid { grid-template-columns: 1fr; gap: var(--space-xl); }
}

/* === PROBLEM SECTION === */
.problem {
  background: var(--surface-3);
  padding: var(--space-4xl) 0;
}
.section-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand);
  margin-bottom: var(--space-md);
}
.section-headline {
  font-family: 'Fraunces', serif;
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-xl);
}
.problem .section-headline { color: var(--text-on-dark); }
.problem__intro {
  color: var(--text-muted);
  font-size: var(--text-lg);
  margin-bottom: var(--space-3xl);
  max-width: 52ch;
}
.pain-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}
.pain-card {
  background: oklch(0.24 0.018 68);
  border: 1px solid oklch(0.30 0.02 68);
  border-radius: 12px;
  padding: var(--space-xl);
}
.pain-card__icon {
  width: 48px;
  height: 48px;
  background: oklch(0.62 0.14 68 / 0.12);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-lg);
  font-size: 22px;
}
.pain-card__title {
  font-family: 'Fraunces', serif;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--brand);
  margin-bottom: var(--space-sm);
}
.pain-card__text {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.65;
}
@media (max-width: 768px) {
  .pain-grid { grid-template-columns: 1fr; }
}

/* === SERVICES === */
.services {
  background: var(--surface-1);
  padding: var(--space-4xl) 0;
}
.services .section-headline { color: var(--text-primary); }
.services__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: var(--space-3xl);
  flex-wrap: wrap;
  gap: var(--space-lg);
}
.services__subtitle {
  color: var(--text-secondary);
  max-width: 42ch;
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}
.service-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: var(--space-xl) var(--space-2xl);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  background: var(--brand);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--transition-base);
}
.service-card:hover {
  transform: translate(-4px, -4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-light);
}
.service-card:hover::before { transform: scaleY(1); }
.service-card__icon {
  width: 52px;
  height: 52px;
  background: color-mix(in oklab, var(--brand) 15%, var(--surface-1));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: var(--space-lg);
}
.service-card__name {
  font-family: 'Fraunces', serif;
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  line-height: 1.2;
}
.service-card__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: var(--space-lg);
}
.service-card__price {
  display: inline-block;
  background: color-mix(in oklab, var(--brand) 10%, var(--surface-1));
  color: var(--brand-dark);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid color-mix(in oklab, var(--brand) 25%, var(--surface-1));
}
@media (max-width: 700px) {
  .services-grid { grid-template-columns: 1fr; }
}

/* === ABOUT === */
.about {
  background: var(--surface-2);
  padding: var(--space-4xl) 0;
}
.about__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4xl);
  align-items: center;
}
.about .section-headline { color: var(--text-primary); }
.about__text {
  color: var(--text-secondary);
  font-size: var(--text-base);
  line-height: 1.7;
  margin-bottom: var(--space-xl);
}
.about__highlight {
  border-left: 3px solid var(--brand);
  padding-left: var(--space-lg);
  margin: var(--space-xl) 0;
}
.about__highlight p {
  font-family: 'Fraunces', serif;
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.5;
}
.about__contact {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}
.about__contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--text-secondary);
  font-size: var(--text-base);
}
.about__contact-item a {
  color: var(--brand-dark);
  font-weight: 600;
  transition: color var(--transition-fast);
}
.about__contact-item a:hover { color: var(--brand); }
.about__visual {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-3);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.about__pattern {
  position: absolute;
  inset: 0;
  opacity: 0.15;
}
.about__badge {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: var(--space-2xl);
}
.about__badge-number {
  font-family: 'Fraunces', serif;
  font-size: clamp(4rem, 10vw, 7rem);
  font-weight: 900;
  color: var(--brand);
  line-height: 1;
}
.about__badge-label {
  font-size: var(--text-lg);
  color: var(--text-on-dark);
  font-weight: 500;
}
@media (max-width: 860px) {
  .about__inner { grid-template-columns: 1fr; }
  .about__visual { display: none; }
}

/* === TESTIMONIALS === */
.testimonials {
  background: color-mix(in oklab, var(--brand) 6%, var(--surface-1));
  padding: var(--space-4xl) 0;
  border-top: 1px solid color-mix(in oklab, var(--brand) 15%, transparent);
  border-bottom: 1px solid color-mix(in oklab, var(--brand) 15%, transparent);
}
.testimonials .section-headline { color: var(--text-primary); }
.testimonials__header { text-align: center; margin-bottom: var(--space-3xl); }
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}
.testimonial-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: var(--space-xl);
  position: relative;
}
.testimonial-card__quote {
  font-size: 36px;
  color: var(--brand);
  font-family: 'Fraunces', serif;
  line-height: 1;
  margin-bottom: var(--space-md);
}
.testimonial-card__text {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: var(--space-xl);
  font-style: italic;
}
.testimonial-card__author {
  font-weight: 600;
  color: var(--text-primary);
  font-size: var(--text-sm);
}
.testimonial-card__stars {
  color: var(--brand);
  font-size: 14px;
  margin-bottom: var(--space-sm);
}
@media (max-width: 900px) {
  .testimonials-grid { grid-template-columns: 1fr; }
}

/* === CTA === */
.cta-section {
  background: var(--surface-3);
  padding: var(--space-4xl) 0;
  text-align: center;
}
.cta-section .section-headline {
  color: var(--text-on-dark);
  max-width: 18ch;
  margin: 0 auto var(--space-xl);
}
.cta-section__sub {
  color: var(--text-muted);
  font-size: var(--text-lg);
  max-width: 48ch;
  margin: 0 auto var(--space-2xl);
  line-height: 1.6;
}
.cta-section__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
  margin-bottom: var(--space-2xl);
}
.cta-section__phone {
  font-family: 'Fraunces', serif;
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--brand);
  transition: color var(--transition-fast);
}
.cta-section__phone:hover { color: var(--brand-light); }
.cta-section__email {
  color: var(--text-muted);
  font-size: var(--text-base);
  transition: color var(--transition-fast);
}
.cta-section__email:hover { color: var(--text-on-dark); }
.cta-section__note {
  color: oklch(0.50 0.02 68);
  font-size: var(--text-sm);
}

/* === FOOTER === */
.footer {
  background: var(--surface-4);
  padding: var(--space-2xl) 0;
  border-top: 1px solid oklch(0.22 0.015 68);
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}
.footer__brand {
  font-family: 'Fraunces', serif;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--brand);
}
.footer__info {
  font-size: var(--text-sm);
  color: oklch(0.50 0.02 68);
}
.footer__copy {
  font-size: var(--text-xs);
  color: oklch(0.42 0.015 68);
}

/* === UTILITY === */
.text-center { text-align: center; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-xl { margin-top: var(--space-xl); }
