/* ============================================================================
   InnoJiit Oy — Rakennuttamis- ja valvontapalvelut
   Teema: teräksinen sininen + tumma navy + vaalea pohja
   ============================================================================ */

:root {
  --c-bg:        #F0F4F8;
  --c-surface:   #FFFFFF;
  --c-surface-2: #E8EFF6;
  --c-text:      #3D4A56;
  --c-heading:   #141D26;
  --c-muted:     #637080;
  --c-border:    #D6E2ED;
  --c-primary:   #35587a;
  --c-primary-2: #264466;
  --c-on-primary:#FFFFFF;
  --c-dark:      #182736;
  --c-on-dark:   #CDD8E3;

  --grad: var(--c-primary);

  --r-sm: 4px;
  --r:    6px;
  --r-lg: 10px;
  --r-pill: 6px;

  --shadow-sm: 0 1px 3px rgba(20,29,38,.07);
  --shadow:    0 14px 36px -16px rgba(20,29,38,.22);
  --shadow-lg: 0 28px 64px -22px rgba(20,29,38,.30);

  --font-display: 'Plus Jakarta Sans', 'Plus Jakarta Sans Fallback', system-ui, -apple-system, sans-serif;
  --font-body:    'Plus Jakarta Sans', 'Plus Jakarta Sans Fallback', system-ui, -apple-system, sans-serif;

  --container: 1180px;
  --pad-x: clamp(18px, 5vw, 40px);
  --gap: clamp(18px, 2.4vw, 26px);
  --section-y: clamp(60px, 8vw, 108px);
}

/* ===========================  RESET / BASE  ============================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; overflow-x: clip;
  background: var(--c-bg); color: var(--c-text);
  font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.62;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--c-heading); line-height: 1.1; letter-spacing: -.02em; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2.2rem, 5.2vw, 3.8rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); font-weight: 800; }
h3 { font-size: clamp(1.1rem, 1.8vw, 1.35rem); font-weight: 700; }
p { margin: 0 0 1rem; max-width: 66ch; }
:focus-visible { outline: 3px solid var(--c-primary); outline-offset: 2px; }

.skip-link { position: absolute; left: -9999px; top: 10px; z-index: 200; background: var(--c-primary); color: var(--c-on-primary); padding: 10px 18px; font-weight: 700; border-radius: var(--r); }
.skip-link:focus { left: 14px; }

/* ===========================  LAYOUT  ============================ */
.wrap { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--pad-x); }
.section { padding-block: var(--section-y); }
.section--tint { background: var(--c-surface-2); }
.section--dark { background: var(--c-dark); color: var(--c-on-dark); }
.section--dark h1, .section--dark h2, .section--dark h3 { color: #fff; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-body); font-weight: 700; font-size: .78rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--c-primary); margin-bottom: 16px;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--c-primary); }
.section--dark .eyebrow { color: var(--c-on-dark); }
.section--dark .eyebrow::before { background: var(--c-on-dark); }
.lead { font-size: clamp(1.05rem, 1.5vw, 1.22rem); color: var(--c-muted); }
.sec-head { max-width: 840px; margin-bottom: clamp(34px, 5vw, 56px); }
.sec-head .lead { max-width: 60ch; }
.sec-head--center { margin-inline: auto; text-align: center; max-width: 880px; }
.sec-head--center .eyebrow { justify-content: center; }
.sec-head--center .lead { margin-inline: auto; }

/* ===========================  PAINIKKEET  ============================ */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border-radius: var(--r-pill);
  font-family: var(--font-body); font-weight: 700; font-size: .96rem; letter-spacing: -.01em;
  border: 1.5px solid transparent; transition: transform .16s ease, background .2s, box-shadow .2s, color .2s, border-color .2s;
  min-height: 50px;
}
.btn-primary {
  background: var(--c-primary); color: var(--c-on-primary); border-color: var(--c-primary);
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--c-primary) 70%, transparent);
}
.btn-ghost { background: transparent; color: var(--c-heading); border-color: var(--c-border); }
.btn-ghost.on-dark { color: #fff; border-color: rgba(255,255,255,.4); }
.btn .arr { transition: transform .2s; font-weight: 700; }
@media (hover: hover) {
  .btn-primary:hover { background: var(--c-primary-2); border-color: var(--c-primary-2); transform: translateY(-2px); box-shadow: 0 16px 30px -10px color-mix(in srgb, var(--c-primary) 75%, transparent); }
  .btn-ghost:hover { border-color: var(--c-heading); background: var(--c-heading); color: var(--c-surface); }
  .btn-ghost.on-dark:hover { background: #fff; color: var(--c-dark); border-color: #fff; }
  .btn:hover .arr { transform: translateX(4px); }
}
.btn-primary:active { transform: translateY(0); }
.tlink { color: var(--c-primary); font-weight: 700; font-size: .92rem; display: inline-flex; gap: 7px; align-items: center; }
@media (hover: hover) { .tlink:hover .arr { transform: translateX(4px); } }

/* ===========================  HERO  ============================ */
.hero { position: relative; min-height: clamp(480px, 68vh, 640px); display: flex; align-items: center; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; transform-origin: 55% 45%; animation: heroZoom 26s ease-in-out infinite alternate; }
@keyframes heroZoom { from { transform: scale(1.01); } to { transform: scale(1.09); } }
.hero-overlay { position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(12,18,26,.42) 0%, rgba(12,18,26,.58) 45%, rgba(12,18,26,.84) 100%); }
.hero-inner { position: relative; z-index: 2; padding-block: clamp(48px, 7vw, 84px); color: #fff; text-align: center; max-width: 880px; margin-inline: auto; }
.hero-inner .eyebrow { color: rgba(255,255,255,.75); justify-content: center; }
.hero-inner .eyebrow::before { background: rgba(255,255,255,.5); }
.hero-inner h1 { color: #fff; max-width: 22ch; margin-inline: auto; letter-spacing: -.025em; }
.hero-inner h1 .accent { color: #a8d4ee; }
.hero-sub { font-size: clamp(1.06rem, 1.5vw, 1.28rem); color: rgba(255,255,255,.88); max-width: 56ch; margin-inline: auto; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; justify-content: center; }
.hero-meta { display: flex; gap: 0; margin-top: 38px; flex-wrap: wrap; justify-content: center; border-top: 1px solid rgba(255,255,255,.22); }
.hero-meta .m { padding: 18px 28px 0 0; margin-right: 28px; border-right: 1px solid rgba(255,255,255,.22); }
.hero-meta .m:last-child { border-right: 0; padding-right: 0; margin-right: 0; }
.hero-meta .m b { font-family: var(--font-display); font-weight: 800; font-size: 1.8rem; color: #fff; display: block; line-height: 1; letter-spacing: -.02em; }
.hero-meta .m span { font-size: .82rem; color: rgba(255,255,255,.72); }

/* ===========================  TRUST  ============================ */
.trust { background: var(--c-surface); border-bottom: 1px solid var(--c-border); }
.trust-in { display: flex; align-items: center; gap: clamp(18px, 4vw, 50px); padding-block: 22px; flex-wrap: wrap; justify-content: center; }
.trust-in .t { display: flex; align-items: center; gap: 10px; color: var(--c-text); font-weight: 600; font-size: .95rem; }
.trust-in .t svg { color: var(--c-primary); flex: none; }

/* ===========================  PALVELUT  ============================ */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); padding: 32px 28px;
  transition: transform .2s ease, box-shadow .26s ease, border-color .2s; position: relative;
  display: flex; flex-direction: column; }
.card h3 { margin: 0 0 8px; }
.card p { color: var(--c-muted); margin-bottom: 18px; font-size: .97rem; }
.card .ico { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 20px;
  background: color-mix(in srgb, var(--c-primary) 12%, var(--c-surface)); color: var(--c-primary); border-radius: var(--r); }
.card .tlink { justify-content: flex-start; margin-top: auto; }
@media (hover: hover) { .card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--c-primary) 35%, var(--c-border)); } }
@media (max-width: 860px) { .cards { grid-template-columns: 1fr; } }

/* ===========================  MEISTÄ + LUVUT  ============================ */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 5vw, 64px); align-items: center; }
.about-media img { width: 100%; aspect-ratio: 5/4; object-fit: cover; border-radius: var(--r-lg); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 30px; }
.stat b { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.9rem, 4vw, 2.7rem); color: var(--c-heading); display: block; line-height: 1; letter-spacing: -.02em; }
.stat span { font-size: .86rem; color: var(--c-muted); }

/* ===========================  PROSESSI  ============================ */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: var(--gap); counter-reset: step; }
.step { position: relative; padding-top: 22px; border-top: 2px solid var(--c-border); }
.step::before { content: counter(step); counter-increment: step;
  font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; color: var(--c-primary);
  width: 38px; height: 38px; display: grid; place-items: center; line-height: 1; margin-bottom: 14px;
  background: color-mix(in srgb, var(--c-primary) 12%, var(--c-surface)); border-radius: var(--r); }
.step h3 { font-size: 1.15rem; margin-bottom: 8px; }
.step p { color: var(--c-muted); font-size: .95rem; }

/* ===========================  CTA  ============================ */
.cta-band { position: relative; overflow: hidden; padding: clamp(40px, 6vw, 76px); background: var(--c-dark); color: var(--c-on-dark); border-radius: var(--r-lg); }
.cta-band::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(80% 150% at 100% 0%, color-mix(in srgb, var(--c-primary) 30%, transparent), transparent 60%); }
.cta-band > * { position: relative; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.8); }
.cta-band .hero-cta { margin-top: 26px; }

/* ===========================  YHTEYS + LOMAKE  ============================ */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(30px, 5vw, 60px); }
.contact-info .row { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--c-border); }
.contact-info .row svg { color: var(--c-primary); flex: none; margin-top: 3px; }
.contact-info .row b { display: block; font-size: .95rem; }
.contact-info .row span { color: var(--c-muted); }
.contact-info .map { margin-top: 22px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--c-border); }
.contact-info .map iframe { width: 100%; height: 220px; border: 0; display: block; }

.form { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); padding: clamp(24px, 4vw, 38px); }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 7px; }
.field input, .field textarea { width: 100%; padding: 14px 15px; border: 1.5px solid var(--c-border); border-radius: var(--r); background: var(--c-bg); color: var(--c-text); font: inherit; font-size: 16px; transition: border-color .16s, box-shadow .16s; }
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-primary) 18%, transparent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: .85rem; color: var(--c-muted); margin-top: 4px; }
.form-msg { margin-top: 14px; font-weight: 600; display: none; }
.form-msg.ok { display: block; color: #1f9d55; }
.form-msg.err { display: block; color: #d64545; }

/* ===========================  REFERENSSIKORIT  ============================ */
.ref-category { margin-bottom: clamp(56px, 8vw, 96px); }
.ref-category-head { display: flex; align-items: center; gap: 18px; margin-bottom: 32px; padding-bottom: 16px; border-bottom: 2px solid var(--c-primary); }
.ref-category-head h2 { margin: 0; font-size: clamp(1.5rem, 2.8vw, 2.2rem); }
.ref-count { background: color-mix(in srgb, var(--c-primary) 12%, transparent); color: var(--c-primary);
  font-weight: 700; font-size: .8rem; padding: 4px 12px; border-radius: 20px; white-space: nowrap; }

.ref-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.ref-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, box-shadow .22s; }
@media (hover: hover) { .ref-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); } }
.ref-card .ref-img { overflow: hidden; aspect-ratio: 3/2; flex: none; }
.ref-card .ref-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
@media (hover: hover) { .ref-card:hover .ref-img img { transform: scale(1.04); } }
.ref-card--noimg { background: var(--c-surface-2); }
.ref-card--noimg .ref-icon { aspect-ratio: 3/2; flex: none; display: grid; place-items: center; background: color-mix(in srgb, var(--c-primary) 8%, var(--c-surface-2)); color: color-mix(in srgb, var(--c-primary) 50%, var(--c-border)); }
.ref-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.ref-year { display: inline-block; font-size: .76rem; font-weight: 700; letter-spacing: .08em; color: var(--c-primary); background: color-mix(in srgb, var(--c-primary) 10%, transparent); padding: 3px 10px; border-radius: 20px; margin-bottom: 10px; }
.ref-body h3 { font-size: 1.0rem; margin-bottom: 3px; color: var(--c-heading); line-height: 1.3; }
.ref-loc { font-size: .84rem; color: var(--c-muted); margin-bottom: 10px; }
.ref-work { font-size: .90rem; color: var(--c-text); margin-bottom: 12px; max-width: 100%; line-height: 1.5; }
.ref-tilaaja { font-size: .82rem; color: var(--c-muted); margin-top: auto; padding-top: 12px; border-top: 1px solid var(--c-border); }
.ref-tilaaja strong { color: var(--c-text); }

/* Ankkurinavigaatio referenssit-sivulla */
.ref-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 48px; }
.ref-tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 40px;
  border: 1.5px solid var(--c-border); background: var(--c-surface); color: var(--c-text);
  font-weight: 600; font-size: .9rem; transition: border-color .16s, background .16s, color .16s; }
@media (hover: hover) { .ref-tab:hover { border-color: var(--c-primary); color: var(--c-primary); background: color-mix(in srgb, var(--c-primary) 6%, var(--c-surface)); } }
.ref-tab.active { border-color: var(--c-primary); background: var(--c-primary); color: #fff; }

/* ===========================  HENKILÖKORTIT  ============================ */
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--gap); }
.team-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); padding: 28px; }
.team-card h3 { font-size: 1.1rem; margin-bottom: 4px; }
.team-card .role { font-size: .88rem; color: var(--c-primary); font-weight: 700; margin-bottom: 14px; }
.team-card .contact-row { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--c-muted); margin-bottom: 6px; }
.team-card .contact-row svg { color: var(--c-primary); flex: none; }
.team-card .contact-row a { color: var(--c-heading); font-weight: 600; }

/* ===========================  REVEAL POIS  ============================ */
.reveal, html.js .reveal { opacity: 1 !important; transform: none !important; }

/* ===========================  RESPONSIIVISUUS  ============================ */
@media (max-width: 960px) { .ref-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) {
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .ref-grid { grid-template-columns: 1fr; }
  body { font-size: 1rem; }
  .hero { min-height: 0; }
  .hero-inner { padding-block: 44px; }
  .stats { gap: 14px; }
  .hero-meta .m { border-right: 0; padding-right: 0; margin-right: 20px; }
  .btn { width: 100%; justify-content: center; }
  .hero-cta .btn, .cta-band .btn { width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  html.js .reveal, .reveal { opacity: 1 !important; transform: none !important; }
}
