/* ==========================================================================
   Larix Oy — design tokens
   ========================================================================== */
:root {
  --forest-950: #0a1e14;
  --forest-900: #0f2a1c;
  --forest-800: #163826;
  --forest-700: #204a30;
  --leaf-600: #2f8a3e;
  --leaf-500: #47a24a;
  --leaf-400: #7cc47e;
  --leaf-300: #b7e0b8;

  --timber-800: #452c1a;
  --timber-600: #6b4226;
  --timber-500: #8a5a34;
  --timber-300: #c69a6d;
  --timber-200: #e3cbaa;

  --paper: #f4f7f0;
  --paper-dim: #e9efe4;
  --card: #ffffff;
  --line: #dbe4d5;

  --ink: #12211a;
  --ink-muted: #4c5c52;
  --ink-soft: #6f7d74;

  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
  --font-body: "Karla", "Segoe UI", system-ui, sans-serif;

  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 26px;
  --shadow-card: 0 1px 2px rgba(10, 30, 20, 0.06), 0 10px 24px -14px rgba(10, 30, 20, 0.25);
  --shadow-lift: 0 20px 45px -20px rgba(10, 30, 20, 0.45);
  --wrap: 1180px;
}

/* ==========================================================================
   Reset & base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0; text-wrap: balance; color: var(--forest-950); }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; }

.icon { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

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

.skip-link {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--forest-950); color: #fff; padding: 0.6rem 1rem;
  border-radius: var(--radius-s); z-index: 200; transition: top 0.2s ease;
}
.skip-link:focus { top: 1rem; }

:focus-visible { outline: 3px solid var(--leaf-500); outline-offset: 2px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }

/* Eyebrow labels */
.eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--leaf-600);
  margin: 0 0 0.6rem;
}
.section-forest .eyebrow,
.section-trust .eyebrow { color: var(--leaf-400); }
.section-timber .eyebrow { color: var(--timber-200); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--leaf-500); color: #0c2312; }
.btn-primary:hover { background: var(--leaf-400); }
.btn-ghost { border-color: rgba(255,255,255,0.55); color: inherit; }
.btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,0.08); }
.btn-dark { background: var(--forest-950); color: #fff; }
.btn-dark:hover { background: var(--forest-800); }

/* ==========================================================================
   Header / nav
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 30, 20, 0.92);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.header-inner {
  max-width: var(--wrap); margin-inline: auto; padding: 0.7rem 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: #fff; }
.brand-mark { width: 42px; height: 42px; border-radius: 50%; }
.brand-name { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; letter-spacing: 0.01em; }
.brand-name em { font-style: normal; color: var(--leaf-400); }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; background: none; border: none; cursor: pointer; border-radius: 8px;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: #fff; margin-inline: auto; transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-nav { display: flex; align-items: center; gap: 1.8rem; }
.site-nav a { color: rgba(255,255,255,0.88); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.site-nav a:hover { color: #fff; }
.site-nav .nav-cta {
  background: var(--leaf-500); color: #0c2312; padding: 0.55rem 1.15rem; border-radius: 999px;
}
.site-nav .nav-cta:hover { background: var(--leaf-400); }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--forest-950); flex-direction: column; align-items: stretch;
    padding: 0.5rem 20px 1.2rem; gap: 0; border-bottom: 1px solid rgba(255,255,255,0.08);
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 0.85rem 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
  .site-nav .nav-cta { margin-top: 0.8rem; text-align: center; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { background: var(--forest-950); color: #fff; padding-bottom: 3.5rem; }
.hero-media { background: var(--forest-950); border-bottom: 1px solid rgba(255,255,255,0.08); }
.hero-media img { width: 100%; height: auto; }

.hero-copy {
  max-width: var(--wrap); margin-inline: auto; padding: 2.6rem 20px 0;
  display: grid; gap: 1.3rem; max-width: 760px;
}
.hero-copy h1 { font-size: clamp(2rem, 4.2vw, 2.9rem); line-height: 1.12; color: #fff; }
.hero-copy .lead { font-size: 1.1rem; color: rgba(255,255,255,0.82); max-width: 56ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 0.4rem; }

/* Trust chip strip */
.stat-strip {
  background: var(--forest-900);
  border-top: 1px solid rgba(255,255,255,0.08);
}
.stat-strip .wrap {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem;
  padding-block: 1.8rem;
}
.stat-chip { display: flex; align-items: flex-start; gap: 0.8rem; color: #fff; }
.stat-chip .icon { width: 26px; height: 26px; flex: none; color: var(--leaf-400); margin-top: 0.15rem; }
.stat-chip strong { display: block; font-family: var(--font-display); font-size: 1.05rem; margin-bottom: 0.15rem; }
.stat-chip span { color: rgba(255,255,255,0.72); font-size: 0.92rem; }
@media (max-width: 760px) {
  .stat-strip .wrap { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding-block: 4.5rem; }
.section-forest { background: var(--forest-950); color: #fff; }
.section-forest h2, .section-forest h3 { color: #fff; }
.section-timber { background: var(--timber-800); color: var(--timber-200); }
.section-timber h2, .section-timber h3 { color: #fff; }
.section-trust { background: var(--forest-900); color: #fff; }
.section-trust h2 { color: #fff; }
.section-contact { background: var(--paper-dim); }

.section-head { max-width: 720px; margin-bottom: 2.4rem; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: 0.7rem; }
.section-lead { color: var(--ink-muted); font-size: 1.05rem; }
.section-forest .section-lead,
.section-trust .section-lead { color: rgba(255,255,255,0.78); }
.section-timber .section-lead { color: rgba(255,255,255,0.8); }

.subnav {
  display: flex; flex-wrap: wrap; gap: 0.6rem;
  margin-bottom: 3rem; padding-bottom: 1.6rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.subnav a {
  font-size: 0.86rem; font-weight: 700; text-decoration: none;
  color: rgba(255,255,255,0.75); border: 1px solid rgba(255,255,255,0.25);
  padding: 0.45rem 0.95rem; border-radius: 999px; transition: all 0.15s ease;
}
.subnav a:hover { color: #0c2312; background: var(--leaf-400); border-color: var(--leaf-400); }

.group-title {
  font-family: var(--font-display); font-size: 1.35rem; font-weight: 600;
  margin: 3rem 0 1.3rem; display: flex; align-items: center; gap: 0.7rem;
  scroll-margin-top: 90px;
}
.group-title:first-of-type { margin-top: 0; }
.group-title .icon { width: 22px; height: 22px; color: var(--leaf-400); flex: none; }
.section-timber .group-title .icon { color: var(--timber-200); }

/* ==========================================================================
   Cards
   ========================================================================== */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.card-grid-2 { grid-template-columns: repeat(2, 1fr); }
.card-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) {
  .card-grid, .card-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .card-grid, .card-grid-2, .card-grid-4 { grid-template-columns: 1fr; }
}

.card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-m);
  padding: 1.5rem;
  display: flex; flex-direction: column; gap: 0.7rem;
}
.card .icon-badge {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(124, 196, 126, 0.16); color: var(--leaf-400);
  flex: none;
}
.card .icon-badge .icon { width: 22px; height: 22px; }
.card h4 { font-size: 1.05rem; color: #fff; }
.card p { color: rgba(255,255,255,0.75); font-size: 0.94rem; }
.card ul { display: grid; gap: 0.4rem; margin-top: 0.2rem; }
.card ul li { color: rgba(255,255,255,0.75); font-size: 0.94rem; padding-left: 1.1rem; position: relative; }
.card ul li::before {
  content: ""; position: absolute; left: 0; top: 0.55em; width: 6px; height: 6px;
  border-radius: 50%; background: var(--leaf-400);
}

.section-timber .card { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.16); }
.section-timber .card .icon-badge { background: rgba(230, 203, 170, 0.18); color: var(--timber-200); }
.section-timber .card ul li::before { background: var(--timber-200); }
.section-timber .card p, .section-timber .card ul li { color: rgba(255,255,255,0.78); }

/* Wide info panel (suometsät, elinympäristöt) */
.panel-wide {
  display: grid; grid-template-columns: 44px 1fr; gap: 1rem;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-m); padding: 1.6rem; margin-bottom: 1.1rem;
}
.panel-wide .icon-badge { width: 44px; height: 44px; border-radius: 12px; background: rgba(124,196,126,0.16); color: var(--leaf-400); display:flex; align-items:center; justify-content:center; }
.panel-wide .icon-badge .icon { width: 24px; height: 24px; }
.panel-wide h4 { color: #fff; font-size: 1.1rem; margin-bottom: 0.35rem; }
.panel-wide p { color: rgba(255,255,255,0.78); }
@media (max-width: 560px) {
  .panel-wide { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Trust / credentials
   ========================================================================== */
.trust-stack { display: flex; flex-direction: column; gap: 2.4rem; }

.trust-copy { max-width: 62ch; }
.trust-copy p + p { margin-top: 1rem; color: rgba(255,255,255,0.8); }
.badge-row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.6rem; }
.badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2);
  padding: 0.55rem 1rem; border-radius: 999px; font-size: 0.88rem; font-weight: 700;
}
.badge .icon { width: 18px; height: 18px; color: var(--leaf-400); }

.credential-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; align-items: stretch; }
@media (max-width: 720px) { .credential-row { grid-template-columns: 1fr; } }
.credential-row .credential-card { height: 100%; display: flex; flex-direction: column; }
.credential-row .credential-card p { flex: 1; }

.credential-card {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--radius-l); padding: 2rem;
}
.credential-card .icon { width: 46px; height: 46px; color: var(--leaf-400); margin-bottom: 1rem; }
.credential-card h3 { color: #fff; font-size: 1.2rem; margin-bottom: 0.6rem; }
.credential-card p { color: rgba(255,255,255,0.78); font-size: 0.96rem; }
.credential-card .who { margin-top: 1.2rem; padding-top: 1.2rem; border-top: 1px solid rgba(255,255,255,0.16); font-weight: 700; color: #fff; }
.credential-card .who span { display: block; font-weight: 400; color: rgba(255,255,255,0.7); font-size: 0.88rem; margin-top: 0.15rem; }
.credential-card .credential-link { margin-top: 1.2rem; padding: 0.7rem 1.2rem; font-size: 0.88rem; cursor: pointer; }

/* Certificate viewer modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(8, 20, 14, 0.72);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal-box {
  background: var(--forest-950); color: #fff; border-radius: var(--radius-m);
  width: min(920px, 100%); height: min(85vh, 900px);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--shadow-lift);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.3rem; border-bottom: 1px solid rgba(255,255,255,0.12); flex: none;
}
.modal-head h3 { color: #fff; font-size: 1.05rem; }
.modal-actions { display: flex; align-items: center; gap: 0.7rem; }
.modal-actions .btn { padding: 0.5rem 1rem; font-size: 0.85rem; }
.modal-close {
  background: none; border: none; color: #fff; font-size: 1.7rem; line-height: 1;
  cursor: pointer; padding: 0.15rem 0.55rem; border-radius: 8px;
}
.modal-close:hover { background: rgba(255,255,255,0.12); }
.modal-box iframe { flex: 1; border: none; width: 100%; background: #fff; }
@media (max-width: 620px) {
  .modal-box { height: min(90vh, 900px); }
  .modal-head h3 { font-size: 0.95rem; }
}

/* ==========================================================================
   Contact
   ========================================================================== */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

.contact-list { display: grid; gap: 1.1rem; margin-top: 1.6rem; }
.contact-item { display: flex; align-items: flex-start; gap: 0.9rem; }
.contact-item .icon-badge {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--forest-950); color: var(--leaf-400);
}
.contact-item .icon-badge .icon { width: 20px; height: 20px; }
.contact-item strong { display: block; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.contact-item a, .contact-item span.value { font-size: 1.05rem; font-weight: 700; color: var(--forest-950); text-decoration: none; }
.contact-item a:hover { color: var(--leaf-600); }

.contact-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-l);
  padding: 2rem; box-shadow: var(--shadow-card);
}
.contact-card h3 { font-size: 1.25rem; margin-bottom: 0.6rem; }
.contact-card p { color: var(--ink-muted); margin-bottom: 1.4rem; }
.service-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.6rem; }
.service-tags span {
  font-size: 0.82rem; font-weight: 700; padding: 0.4rem 0.8rem; border-radius: 999px;
  background: var(--paper-dim); color: var(--forest-800); border: 1px solid var(--line);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--forest-950); color: rgba(255,255,255,0.7); padding-block: 2.6rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.4rem; align-items: center; }
.footer-brand { display: flex; align-items: center; gap: 0.6rem; color: #fff; }
.footer-brand img { width: 34px; height: 34px; border-radius: 50%; }
.footer-brand span { font-family: var(--font-display); font-weight: 600; }
.footer-links { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.footer-links a { text-decoration: none; color: rgba(255,255,255,0.7); font-size: 0.92rem; }
.footer-links a:hover { color: #fff; }
.footer-fine { width: 100%; margin-top: 1.6rem; padding-top: 1.4rem; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.82rem; color: rgba(255,255,255,0.5); }
