/* ==========================================================================
   JEHO Consulting AB, main stylesheet
   Brand: #2A9048 (deep green) / #ADD138 (lime), sampled from the logo.
   ========================================================================== */

/* --- Design tokens ------------------------------------------------------- */

:root {
  color-scheme: light dark;

  /* Brand constants, sampled from the logo. Hue 137.6 drives both palettes. */
  --brand-green: #2a9048;
  --brand-lime: #add138;

  /* Type */
  --font-display: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    monospace;

  /* Rhythm */
  --page: 1160px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-y: clamp(4.5rem, 10vw, 8rem);
  --radius: 18px;
  --radius-sm: 10px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* Light: neutrals carry the brand hue rather than being flat grey. */
  --bg: #fafcfb;
  --bg-alt: #f1f6f3;
  --surface: #ffffff;
  --surface-2: #f7f9f7;
  --text: #0b110d;
  --text-soft: #3a4a3f;
  --text-muted: #5c7062;
  --border: rgba(11, 17, 13, 0.11);
  --border-strong: rgba(11, 17, 13, 0.2);

  --accent: #1f7d3c;
  --accent-hover: #17662f;
  --accent-ink: #ffffff;
  --accent-soft: rgba(42, 144, 72, 0.1);
  --glow-btn: rgba(31, 125, 60, 0.45);

  --shadow-sm: 0 1px 2px rgba(11, 17, 13, 0.05),
    0 4px 14px -6px rgba(11, 17, 13, 0.1);
  --shadow-lg: 0 1px 2px rgba(11, 17, 13, 0.04),
    0 24px 48px -24px rgba(11, 17, 13, 0.22);

  --logo-filter: none;
}

/* Dark: a green-black at the logo's own hue, not a neutral near-black.
   The ground itself carries the brand; green stays legible on top of it. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #080f0a;
    --bg-alt: #0c160f;
    --surface: #101b13;
    --surface-2: #16241a;
    --text: #edf2ef;
    --text-soft: #c3d0c7;
    --text-muted: #899f8f;
    --border: rgba(237, 242, 239, 0.12);
    --border-strong: rgba(237, 242, 239, 0.24);

    --accent: #46c06c;
    --accent-hover: #63d187;
    --accent-ink: #04170b;
    --accent-soft: rgba(70, 192, 108, 0.14);
    --glow-btn: rgba(70, 192, 108, 0.26);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 4px 14px -6px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 1px 2px rgba(0, 0, 0, 0.5), 0 24px 48px -24px rgba(0, 0, 0, 0.9);

    --logo-filter: brightness(1.18) saturate(1.1);
  }
}

/* Explicit toggle wins over the system preference, in both directions. */
:root[data-theme="dark"] {
  --bg: #080f0a;
  --bg-alt: #0c160f;
  --surface: #101b13;
  --surface-2: #16241a;
  --text: #edf2ef;
  --text-soft: #c3d0c7;
  --text-muted: #899f8f;
  --border: rgba(237, 242, 239, 0.12);
  --border-strong: rgba(237, 242, 239, 0.24);

  --accent: #46c06c;
  --accent-hover: #63d187;
  --accent-ink: #04170b;
  --accent-soft: rgba(70, 192, 108, 0.14);
  --glow-btn: rgba(70, 192, 108, 0.26);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 4px 14px -6px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 1px 2px rgba(0, 0, 0, 0.5), 0 24px 48px -24px rgba(0, 0, 0, 0.9);

  --logo-filter: brightness(1.18) saturate(1.1);
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

/* --- Primitives ---------------------------------------------------------- */

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

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

/* Anchor targets clear the sticky header. */
[id] { scroll-margin-top: 92px; }
#top { scroll-margin-top: 0; }

.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  translate: -50% -150%;
  z-index: 200;
  padding: 0.7rem 1.2rem;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 600;
  transition: translate 0.2s var(--ease);
}
.skip-link:focus-visible { translate: -50% 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-lime);
  box-shadow: 0 0 0 4px var(--accent-soft);
  flex: none;
}

.lede {
  font-size: clamp(1.05rem, 0.98rem + 0.4vw, 1.2rem);
  line-height: 1.7;
  color: var(--text-soft);
  max-width: 58ch;
}

/* Buttons */
.btn {
  font-family: var(--font-display);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.8rem 1.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease),
    color 0.2s var(--ease), transform 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 6px 18px -10px var(--glow-btn);
}
.btn--primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 12px 26px -12px var(--glow-btn);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.btn__arrow { transition: transform 0.2s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(3px); }

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

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg); /* fallback where color-mix is unsupported */
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.header.is-stuck {
  border-bottom-color: var(--border);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 72px;
}

.header__logo { flex: none; }
.header__logo img {
  width: 132px;
  height: auto;
  filter: var(--logo-filter);
  transition: opacity 0.2s var(--ease);
}
.header__logo:hover img { opacity: 0.78; }

.nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-inline-start: auto;
}

.nav__link {
  position: relative;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-soft);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav__link:hover,
.nav__link.is-active {
  color: var(--text);
  background: var(--surface-2);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: none;
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.theme-toggle:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

.nav-toggle { display: none; }

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

.hero {
  padding-block: clamp(4rem, 9vw, 7.5rem) clamp(4.5rem, 10vw, 8rem);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}

.hero__title {
  font-family: var(--font-display);
  margin-block: 1.4rem 1.5rem;
  font-size: clamp(2.5rem, 1.6rem + 4.3vw, 4.4rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 700;
  text-wrap: balance;
}

.hero__title em {
  font-style: normal;
  color: var(--accent);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.75rem;
  margin-top: 2.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}
.hero__meta span { display: inline-flex; align-items: center; gap: 0.5rem; }
.hero__meta svg { width: 14px; height: 14px; flex: none; color: var(--accent); }

/* Decorative node/line motif echoing the logo's pipeline glyph. */
.hero__figure { position: relative; }
.hero__figure svg { width: 100%; height: auto; overflow: visible; }

.node-line { stroke: var(--border-strong); stroke-width: 2; stroke-linecap: round; }
.node-line--lit { stroke: var(--accent); }
.node-ring { fill: none; stroke-width: 3.5; }
.node-ring--green { stroke: var(--brand-green); }
.node-ring--lime { stroke: var(--brand-lime); }
.node-dot { fill: var(--bg); }

.pulse {
  fill: var(--brand-lime);
  animation: pulse 3.2s var(--ease) infinite;
}
.pulse--2 { animation-delay: 1.05s; }
.pulse--3 { animation-delay: 2.1s; }

@keyframes pulse {
  0%, 100% { opacity: 0.25; r: 4; }
  50%      { opacity: 1; r: 6.5; }
}

/* --- Section headings ---------------------------------------------------- */

.section__head {
  max-width: 62ch;
  margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}
.section__title {
  font-family: var(--font-display);
  margin-block: 1rem 1rem;
  font-size: clamp(1.95rem, 1.5rem + 1.9vw, 2.9rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 700;
  text-wrap: balance;
}
/* With no lede under it, the title's bottom margin still counted toward the
   column height, so flex-end aligned the button 16px below the baseline. */
.section__title:last-child { margin-bottom: 0; }

.section__head--split {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  max-width: none;
}
.section__head--split > div { max-width: 62ch; }

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

.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.service {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(1.75rem, 3vw, 2.5rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease),
    border-color 0.3s var(--ease);
}
.service:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

/* The logo replaces the E in JEHO with a ring wired to a line. The card head
   quotes that glyph: a ringed icon with its lead running out to the edge. */
.service__head {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 1.35rem;
}

.service__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 50%;
  border: 3px solid var(--accent);
  background: var(--surface);
  color: var(--accent);
}
.service__icon svg { width: 21px; height: 21px; }

.service__lead {
  flex: 1;
  height: 3px;
  background: var(--border-strong);
  transition: background 0.45s var(--ease);
}
.service__lead::after {
  content: "";
  display: block;
  margin-inline-start: auto;
  width: 0;
  height: 100%;
  background: var(--brand-lime);
  transition: width 0.5s var(--ease);
}
.service:hover .service__lead::after { width: 100%; }

.service__title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-bottom: 0.7rem;
}

.service__body { color: var(--text-soft); font-size: 0.97rem; }
.service__body p + p { margin-top: 0.85rem; }

.service__label {
  margin-block: 1.75rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* No margin-top:auto here. The two cards differ a lot in length, and pinning
   the list to the bottom opened a gap under the shorter card's label. Let the
   content flow; the grid still equalises card height. */
.service__list li {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding-block: 0.4rem;
  font-size: 0.93rem;
  color: var(--text-soft);
  border-top: 1px solid var(--border);
}
.service__list li:first-child { border-top: 0; }
.service__list li::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  margin-top: 0.62rem;
  border-radius: 50%;
  background: var(--brand-lime);
}
.service__list i { font-style: normal; color: var(--text-muted); }

/* --- Blog ---------------------------------------------------------------- */

.posts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.5rem;
}

.post {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(1.5rem, 2.6vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease),
    border-color 0.3s var(--ease);
}
.post:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

.post__date {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.post__title {
  font-family: var(--font-display);
  margin-block: 0.85rem 0.7rem;
  font-size: 1.16rem;
  font-weight: 650;
  line-height: 1.32;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.post__title a { transition: color 0.2s var(--ease); }
.post__title a:hover { color: var(--accent); }

.post__excerpt {
  font-size: 0.94rem;
  color: var(--text-soft);
  /* Keep cards even when feed summaries vary in length. */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post__more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  /* auto, so every card's footer rule lines up regardless of excerpt length */
  margin-top: auto;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}
.post__more svg { width: 14px; height: 14px; transition: transform 0.2s var(--ease); }
.post:hover .post__more svg { transform: translateX(3px); }

/* The whole card is clickable; the title link supplies the accessible name. */
.post__link::after { content: ""; position: absolute; inset: 0; }

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

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.fact {
  display: flex;
  gap: 1.1rem;
  padding: 1.4rem clamp(1.35rem, 2.5vw, 1.85rem);
  background: var(--surface);
}
.fact__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}
.fact__icon svg { width: 18px; height: 18px; }

.fact__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.fact__value { font-size: 0.97rem; color: var(--text); line-height: 1.55; }
.fact__value a { transition: color 0.2s var(--ease); }
.fact__value a:hover { color: var(--accent); text-decoration: underline; }

.copyable { font-family: var(--font-mono); font-size: 0.92em; user-select: all; }

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

.footer {
  padding-block: 2.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.footer__inner {
  display: grid;
  gap: 1.5rem;
  font-size: 0.87rem;
  color: var(--text-muted);
}

.footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.footer__row + .footer__row {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.footer__logo img { width: 96px; filter: var(--logo-filter); opacity: 0.75; }
.footer a:hover { color: var(--accent); }

/* Postal address. Kept quiet: it is a postbox, not an office to visit.
   user-select: all so a single click grabs the whole string to paste. */
.footer__addr {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  user-select: all;
}

/* --- Scroll reveal ------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

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

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__figure { display: none; }
}

@media (max-width: 720px) {
  .nav {
    position: fixed;
    inset: 72px 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0.5rem var(--gutter) 1.25rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    /* Collapsed by default on small screens. */
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav__link {
    padding: 0.85rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
  }

  .nav-toggle {
    display: grid;
    place-items: center;
    order: 3;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    cursor: pointer;
  }
  .nav-toggle svg { width: 17px; height: 17px; }
  .nav-toggle .icon-close { display: none; }
  .nav-toggle[aria-expanded="true"] .icon-open { display: none; }
  .nav-toggle[aria-expanded="true"] .icon-close { display: block; }

  .header__actions { order: 2; margin-inline-start: auto; }
  .header__actions .btn { display: none; }
  .actions .btn { flex: 1 1 auto; }
}

/* --- Reduced motion ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* --- Print --------------------------------------------------------------- */

@media print {
  .header, .hero__figure, .theme-toggle, .nav-toggle { display: none !important; }
  body { background: #fff; color: #000; }
}
