/* ==========================================================================
   Reglex — static site stylesheet
   Design tokens taken from the original WordPress build (Extendable theme).
   ========================================================================== */

/* --- Fonts (self-hosted variable fonts, no external CDN) ---------------- */

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/outfit-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/outfit-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Heebo';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/heebo-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Heebo';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/heebo-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Tokens ------------------------------------------------------------- */

:root {
  --blue: #2f65ac;          /* headings, links, brand accent */
  --blue-dark: #1d4478;
  --blue-deep: #14304f;
  --ink: #444444;           /* body copy */
  --ink-strong: #292929;
  --bg: #ffffff;
  --band: #e9e8e6;          /* About section background */
  --line: #dedddb;

  --font-head: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Heebo', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --wide: 80rem;            /* full section width */
  --text: 42rem;            /* readable text column */
  --gutter: clamp(1.5rem, 6vw, 2rem);
  --section-y: clamp(4rem, 9vw, 6rem);

  --radius: 4px;
  --shadow: 0 1px 2px rgba(20, 48, 79, 0.04), 0 8px 24px rgba(20, 48, 79, 0.06);
  --shadow-lift: 0 2px 4px rgba(20, 48, 79, 0.06), 0 16px 40px rgba(20, 48, 79, 0.1);
}

/* --- Reset -------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 9.5rem;   /* clears the sticky header (~134px) on desktop */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;        /* 18px, matching the original */
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 500;
  color: var(--blue);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
}

h1 { font-size: clamp(2.25rem, 1.5rem + 3vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.25rem); }
h3 { font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.25rem); line-height: 1.5; }

p { margin: 0; }

a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--blue-dark); }

/* Visible focus ring for keyboard users on every interactive element. */
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 2px;
}

.visually-hidden {
  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 — matches the original theme's "Liigu sisu juurde". */
.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -110%);
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--bg);
  color: var(--blue);
  box-shadow: var(--shadow-lift);
  border-radius: 0 0 var(--radius) var(--radius);
}
.skip-link:focus { transform: translate(-50%, 0); }

/* --- Layout helpers ----------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }
.section--band { background: var(--band); }

.section__head {
  text-align: center;
  margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  /* Solid white, not translucent: the logo PNG has an opaque white
     background, so any see-through header shows it as a white rectangle. */
  background: #fff;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.site-header.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: 0 1px 12px rgba(20, 48, 79, 0.05);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1rem;
}

.site-logo { display: block; flex-shrink: 0; }
.site-logo img { width: clamp(130px, 18vw, 175px); }

/* --- Navigation --------------------------------------------------------- */

.nav { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.25rem); }

.nav__list {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.25rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__link {
  font-size: 1rem;
  color: var(--ink);
  text-decoration: none;
  position: relative;
  padding-block: 0.25rem;
}
/* Underline grows from the left on hover. */
.nav__link::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav__link:hover { color: var(--blue); }
.nav__link:hover::after { transform: scaleX(1); }

/* Language switcher */
.lang {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
}
.lang a {
  color: var(--ink);
  text-decoration: none;
  padding: 0.15rem 0.1rem;
}
.lang a:hover { color: var(--blue); }
.lang [aria-current='true'] {
  color: var(--blue);
  font-weight: 500;
  border-bottom: 1.5px solid var(--blue);
}
.lang__sep { color: var(--line); }

/* Mobile menu button — hidden on desktop. */
.nav__toggle {
  display: none;
  width: 44px; height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-strong);
  cursor: pointer;
}
.nav__toggle:hover { border-color: var(--blue); color: var(--blue); }
.nav__toggle svg { display: block; }
.nav__toggle .icon-close { display: none; }
.nav__toggle[aria-expanded='true'] .icon-open { display: none; }
.nav__toggle[aria-expanded='true'] .icon-close { display: block; }

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

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: clamp(420px, 56vh, 560px);
  padding-block: clamp(3.5rem, 8vw, 5.5rem);
  /* Replaces the original's empty grey cover block. To use a photograph,
     add:  background-image: url('hero.jpg'); background-size: cover;
     and keep .hero::after as the darkening overlay. */
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 45%, var(--blue-deep) 100%);
  color: #fff;
  overflow: hidden;
}

/* Soft radial highlight so the gradient doesn't read as a flat block. */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60rem 30rem at 78% 12%, rgba(255, 255, 255, 0.14), transparent 60%),
    radial-gradient(45rem 28rem at 8% 92%, rgba(255, 255, 255, 0.08), transparent 62%);
}

.hero__inner { max-width: var(--text); }

.hero h1 { color: #fff; }

.hero__lead {
  margin-top: 1rem;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
}

/* --- Button ------------------------------------------------------------- */

.btn {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.875rem 1.625rem;
  background: #fcfcfc;
  color: #111;
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  border-radius: var(--radius);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.btn:hover {
  color: #111;
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}
.btn:active { transform: translateY(0); }

/* --- Services ----------------------------------------------------------- */

.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.card {
  padding: clamp(1.75rem, 3vw, 2.5rem);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(47, 101, 172, 0.35);
  box-shadow: var(--shadow-lift);
}

.card__icon { color: var(--blue); }
.card__icon svg { width: 48px; height: 48px; display: block; }

.card h3 { margin-top: 1.5rem; }

.card__list {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}
.card__list li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 1rem;
  line-height: 1.6;
}
.card__list li + li { margin-top: 0.75rem; }
/* Small square bullet in brand blue. */
.card__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px; height: 6px;
  background: var(--blue);
  border-radius: 1px;
}

/* --- About -------------------------------------------------------------- */

.prose {
  max-width: var(--text);
  margin-inline: auto;
}
.prose p + p { margin-top: 1.5rem; }

.about__social {
  display: flex;
  justify-content: center;
  margin-top: clamp(2rem, 4vw, 2.75rem);
}

/* LinkedIn pill link. */
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.15rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--blue);
  font-size: 1rem;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.social-link:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.social-link svg { width: 20px; height: 20px; flex-shrink: 0; }

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

.contact { text-align: center; }
.contact__rule {
  margin-top: 1rem;
  color: var(--ink);
}
.contact__note {
  max-width: 34rem;
  margin: 0.25rem auto 0;
}

.contact__details {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 2.5rem;
  margin-top: 2rem;
}
.contact__item {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--blue);
  font-size: 1.0625rem;
  text-decoration: none;
}
.contact__item:hover { text-decoration: underline; }
.contact__item svg { width: 19px; height: 19px; flex-shrink: 0; }

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

.site-footer { border-top: 1px solid var(--line); }

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 2rem;
}

.site-footer .site-logo img { width: clamp(120px, 16vw, 150px); }

.footer__social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  color: var(--ink-strong);
  border-radius: 50%;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.footer__social:hover { color: var(--blue); background: var(--band); }
.footer__social svg { width: 24px; height: 24px; }

/* --- Mobile ------------------------------------------------------------- */

@media (max-width: 860px) {
  html { scroll-padding-top: 7.5rem; }   /* header is shorter here */

  .nav__toggle { display: inline-flex; }

  /* Nav collapses into a panel under the header bar. */
  .nav {
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem var(--gutter) 1.5rem;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(20, 48, 79, 0.07);
  }
  .nav.is-open { display: flex; }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .nav__list li + li { border-top: 1px solid var(--line); }
  .nav__link {
    display: block;
    padding: 0.9rem 0;
    font-size: 1.0625rem;
  }
  .nav__link::after { display: none; }

  .lang {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
  }

  .site-footer__inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  body { font-size: 1.0625rem; }
  .btn { display: block; text-align: center; }
  .contact__details { flex-direction: column; align-items: center; gap: 0.85rem; }
}

/* --- Motion & print ----------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .site-header, .nav__toggle, .skip-link { display: none; }
  .hero { background: none; color: #000; }
  .hero h1, .hero__lead { color: #000; }
  .card { break-inside: avoid; box-shadow: none; }
}
