/* ==========================================================================
   Resilient Finland Oy: site stylesheet
   Editorial design ("Pohjoinen", 2026-10): serif headlines, rules instead of boxes.
   Plain CSS, no build step. Fonts are self-hosted (assets/fonts), no CDN.
   ========================================================================== */

@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("../fonts/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #13110f;
  --bg-alt: #1a1714;
  --rule: #2e2a25;
  --rule-strong: #4a443c;
  --text: #efe9df;
  --text-dim: #b3ab9f;
  --text-faint: #857d71;
  --red: #dc0400;
  --red-hover: #f01a0f;
  --red-text: #ff5a47;
  --max-width: 1160px;
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans: "Schibsted Grotesk", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Typography ---------- */

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  overflow-wrap: break-word;
}
h1 { font-size: clamp(2.3rem, 5vw, 4.2rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); }
h3 { font-size: 1.55rem; line-height: 1.15; }
p { margin: 0 0 1em; color: var(--text-dim); }
.lede { font-size: 1.2rem; line-height: 1.55; color: var(--text-dim); }

/* Small uppercase label with a short red rule in front. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 28px;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--red);
}

/* The page files use .mono for small labels; here it is the sans, uppercase. */
.mono { font-family: var(--font-sans); font-weight: 600; letter-spacing: 0.12em !important; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 2px;
  font-weight: 600;
  font-size: 0.98rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-hover); }
.btn-secondary {
  padding-left: 4px;
  padding-right: 4px;
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}
.btn-secondary:hover { text-decoration-color: var(--red); }

.btn-row { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; }

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
  position: relative;
  z-index: 20;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}
.logo { display: flex; align-items: center; }
.logo-img { height: 36px; width: auto; display: block; }

nav.main-nav {
  display: flex;
  align-items: center;
  gap: 34px;
}
nav.main-nav a {
  font-size: 0.95rem;
  color: var(--text-dim);
  font-weight: 500;
  position: relative;
  padding: 4px 0;
}
nav.main-nav a:hover, nav.main-nav a[aria-current="page"] { color: var(--text); }
nav.main-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--red);
}
nav.main-nav a.lang-switch {
  font-size: 0.85rem;
  color: var(--text-faint);
  padding: 4px 0 4px 26px;
  border-left: 1px solid var(--rule-strong);
}
nav.main-nav a.lang-switch:hover { color: var(--text); }

.header-actions { display: flex; align-items: center; gap: 18px; }
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  background: transparent;
  color: var(--text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle svg { width: 18px; height: 18px; }

/* ---------- Hero ---------- */

.hero {
  padding: 120px 0 112px;
  border-bottom: 1px solid var(--rule);
}
/* The hero's inner div is also .container: keep the full container width so it
   lines up with the logo and the sections below, and limit the text instead. */
.container.hero-inner { max-width: var(--max-width); }
.hero h1 { max-width: 12em; margin-bottom: 36px; }
.hero .lede { max-width: 34em; margin-bottom: 44px; }

/* ---------- Sections ---------- */

section { padding: 104px 0; }
section.tight { padding: 80px 0 96px; }
.section-head { max-width: 760px; margin-bottom: 56px; }
.section-head h2 { margin-bottom: 14px; }

.alt-bg { background: var(--bg-alt); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }

/* ---------- Pillars: three ruled columns, no boxes ---------- */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule-strong);
}
.card {
  padding: 36px 36px 8px;
  border-left: 1px solid var(--rule);
}
.card:first-child { border-left: none; padding-left: 0; }
.card:last-child { padding-right: 0; }
.card-icon { display: none; }
.card .step-index {
  display: block;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--red-text);
  margin-bottom: 26px;
}
.card h3 { margin-bottom: 14px; }
.card p { margin: 0; font-size: 1rem; }

/* ---------- About / two-col ---------- */

.two-col {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 88px;
  align-items: start;
}
.two-col h2 { margin-bottom: 24px; }
/* Technology list as a ruled spec list. */
.stack-list { display: grid; border-top: 1px solid var(--rule-strong); }
.pill {
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 1rem;
  color: var(--text);
}

/* ---------- CTA band ---------- */

.cta-band { border-top: 1px solid var(--rule); }
.cta-band .container { position: relative; }
.cta-band h2 {
  max-width: 20em;
  font-size: clamp(1.9rem, 3.8vw, 3.1rem);
  margin-bottom: 40px;
}

/* ---------- Services page: ruled rows ---------- */

.services-list { border-top: 1px solid var(--rule-strong); }
.service-card {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 56px;
  padding: 44px 0;
  border-bottom: 1px solid var(--rule);
}
.service-card-head h3 { margin-bottom: 12px; }
.service-card-head .subtitle {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.service-card ul {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}
.service-card ul li {
  padding: 9px 0 9px 26px;
  border-top: 1px solid var(--rule);
  font-size: 0.98rem;
  color: var(--text);
  position: relative;
}
.service-card ul li:empty { display: none; }
.service-card ul li::before {
  content: "\2013";
  position: absolute;
  left: 0;
  color: var(--red-text);
}
.services-closing {
  margin-top: 48px;
  max-width: 40em;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.45;
  color: var(--text-dim);
}

/* ---------- Contact page ---------- */

.contact-card { max-width: 760px; border-top: 1px solid var(--rule-strong); }
.contact-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  align-items: baseline;
  gap: 24px;
  padding: 26px 0;
  border-bottom: 1px solid var(--rule);
}
.contact-row .label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.contact-row .value {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.15s ease;
}
.contact-row .value:hover { text-decoration-color: var(--red); }
.contact-note { margin-top: 28px; color: var(--text-faint); }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 64px 0 40px;
}
.site-footer .container {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}
.footer-brand { max-width: 360px; }
.footer-brand .logo { margin-bottom: 18px; }
.footer-brand p { font-size: 0.95rem; }
.footer-col h4 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  margin: 0 0 16px;
}
.footer-col a, .footer-col p {
  display: block;
  font-size: 0.95rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  max-width: var(--max-width);
  margin: 48px auto 0;
  padding: 22px 28px 0;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--text-faint);
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .grid-3 { grid-template-columns: 1fr; }
  .card, .card:first-child, .card:last-child {
    padding: 28px 0;
    border-left: none;
    border-bottom: 1px solid var(--rule);
  }
  .card .step-index { margin-bottom: 14px; }
  .two-col { grid-template-columns: 1fr; gap: 40px; }
  .service-card { grid-template-columns: 1fr; gap: 12px; padding: 36px 0; }
  .site-footer .container { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  section { padding: 72px 0; }
  section.tight { padding: 56px 0 72px; }
  .hero { padding: 72px 0 72px; }
}

@media (max-width: 640px) {
  .container { padding: 0 20px; }
  .site-header .container { height: 68px; }
  .logo-img { height: 30px; }
  .footer-bottom { padding: 22px 20px 0; }
  .nav-toggle { display: flex; }
  nav.main-nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    padding: 4px 20px 16px;
    display: none;
  }
  nav.main-nav.is-open { display: flex; }
  nav.main-nav a { padding: 14px 0; border-bottom: 1px solid var(--rule); }
  nav.main-nav a[aria-current="page"]::after { display: none; }
  nav.main-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--red); padding-left: 14px; }
  nav.main-nav a.lang-switch { border-left: none; padding: 14px 0; border-bottom: none; }
  /* Long Finnish compounds need hyphenation on narrow screens only. */
  h1, h2, h3 { hyphens: auto; }
  .contact-row { grid-template-columns: 1fr; gap: 6px; }
  .lede { font-size: 1.1rem; }
}
