/* ==========================================================================
   Kyrkobyn.se — riktning 1A "Redaktionell"
   Hex-deklarationen först är fallback för webbläsare utan oklch-stöd;
   den efterföljande oklch-raden vinner där den förstås.
   ========================================================================== */

:root {
  /* Färg */
  --paper:        #F8F3E9;
  --paper:        oklch(0.968 0.012 85);
  --ink:          #221E1A;
  --ink:          oklch(0.22 0.012 60);
  --accent:       #B4552F;
  --accent:       oklch(0.53 0.15 42);
  --body-strong:  #3E3830;
  --body-strong:  oklch(0.35 0.012 60);
  --body:         #4A443C;
  --body:         oklch(0.40 0.012 60);
  --body-muted:   #4F4941;
  --body-muted:   oklch(0.42 0.012 60);
  --label:        #625B52;
  --label:        oklch(0.50 0.012 60);
  --on-dark:      #D6D0C4;
  --on-dark:      oklch(0.85 0.012 85);
  --on-accent:    #F8F4EC;
  --on-accent:    oklch(0.97 0.01 90);

  --rule:         rgba(34, 30, 26, 0.16);
  --rule:         oklch(0.22 0.012 60 / 0.16);
  --rule-card:    rgba(34, 30, 26, 0.20);
  --rule-card:    oklch(0.22 0.012 60 / 0.20);
  --rule-soft:    rgba(34, 30, 26, 0.35);
  --rule-soft:    oklch(0.22 0.012 60 / 0.35);

  /* Typsnitt */
  --display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans:    'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;

  /* Mått */
  --wrap:  1180px;
  --pad-x: 56px;
  --pad-y: 72px;
}

/* --------------------------------------------------------------- Grund -- */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 150ms ease;
}

a:hover { opacity: 0.7; }

/* Synlig fokusring — saknades i prototypen, krav enligt handoff. */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1, h2, h3, p { margin: 0; }

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

/* Radie, skuggor och gradienter är medvetet frånvarande i hela designen. */

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

.section {
  border-top: 1px solid var(--rule);
}

.section > .wrap {
  padding-block: var(--pad-y);
  display: grid;
  grid-template-columns: 180px 1fr;
}

.section__label {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--label);
  padding-top: 10px;
}

/* Sticky header får inte täcka rubriken vid ankarhopp. */
[id] { scroll-margin-top: 90px; }

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

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.header > .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 22px;
}

.wordmark {
  font-family: var(--display);
  font-size: 26px;
  letter-spacing: 0.01em;
  line-height: 1;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Den fristående bokningslänken behövs bara när navigationen fälls ihop. */
.header__cta { display: none; }

.nav {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.nav__cta {
  color: var(--accent);
  border-bottom: 1.5px solid var(--accent);
}

/* Hamburgerknappen visas först under 700 px. */
.nav-toggle {
  display: none;
  appearance: none;
  background: none;
  border: 0;
  padding: 10px;
  margin: -10px -10px -10px 0;
  cursor: pointer;
  color: inherit;
}

.nav-toggle__bar {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 150ms ease, opacity 150ms ease;
}

.nav-toggle__bar + .nav-toggle__bar { margin-top: 5px; }

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

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

/* clip (inte hidden) håller den utfällda panelen nedan från att ge
   vågrät rullning, utan att göra hero till en egen rullningsyta. */
.hero { overflow-x: clip; }

.hero > .wrap {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  padding-inline: 0;
}

.hero__text {
  padding: 80px var(--pad-x) 72px;
}

.hero__eyebrow {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 28px;
}

.hero__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: 76px;
  line-height: 0.98;
  letter-spacing: -0.01em;
  margin-bottom: 26px;
  max-width: 15ch;
  text-wrap: balance;
}

.hero__lead {
  font-size: 19px;
  line-height: 1.55;
  max-width: 34ch;
  margin-bottom: 40px;
  color: var(--body-strong);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.hero__panel {
  position: relative;
  min-height: 420px;
  border-left: 1px solid var(--rule);
  background-image: repeating-linear-gradient(
    -45deg,
    oklch(0.53 0.15 42 / 0.16) 0 1.5px,
    transparent 1.5px 11px
  );
}

/* Designen är ritad i 1180 px, där panelen möter fönsterkanten. Bredare än så
   skulle den annars sluta mitt i luften medan linjerna går kant i kant, så den
   dras ut över den högra marginalen. */
@media (min-width: 1100px) {
  .hero__panel {
    margin-right: min(0px, calc((var(--wrap) - 100vw) / 2));
  }
}

.hero__panel-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 32px;
}

.note {
  background: var(--paper);
  padding: 22px 24px;
  max-width: 270px;
  border-left: 3px solid var(--accent);
}

.note__title {
  font-family: var(--display);
  font-size: 22px;
  line-height: 1.2;
  margin-bottom: 8px;
}

.note__meta {
  font-size: 13.5px;
  color: var(--body-muted);
}

/* -------------------------------------------------------------- Knappar -- */

.btn {
  display: inline-block;
  padding: 15px 26px;
  background: var(--ink);
  color: var(--paper);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
}

.btn--accent {
  background: var(--accent);
  color: var(--on-accent);
  padding: 16px 28px;
  font-size: 15.5px;
}

.btn-text {
  display: inline-block;
  padding: 15px 20px;
  font-size: 15px;
  line-height: 1.2;
  border-bottom: 1px solid var(--rule-soft);
}

.link-accent {
  display: inline-block;
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
}

/* Länk mitt i löpande text — får inte bryta radavståndet, därför inte
   inline-block som .link-accent. */
.link-inline {
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
}

/* ------------------------------------------------------------- LowCode -- */

.h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 44px;
  line-height: 1.08;
  margin-bottom: 22px;
  max-width: 20ch;
}

.section__body {
  font-size: 17px;
  line-height: 1.6;
  max-width: 62ch;
  margin-bottom: 44px;
  color: var(--body-strong);
}

.keywords {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
}

.keyword {
  border-top: 2px solid var(--ink);
  padding-top: 16px;
}

.keyword__title {
  font-family: var(--display);
  font-size: 24px;
  margin-bottom: 8px;
}

.keyword__body {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--body-muted);
}

/* -------------------------------------------------------------- Om oss -- */

.about {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  align-items: start;
}

.statement {
  font-family: var(--display);
  font-size: 34px;
  line-height: 1.24;
  margin-bottom: 20px;
  max-width: 24ch;
}

.about__body {
  font-size: 16.5px;
  line-height: 1.6;
  max-width: 52ch;
  color: var(--body);
}

.card {
  border: 1px solid var(--rule-card);
  padding: 26px;
}

.card__label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--label);
  margin-bottom: 14px;
}

.card__body {
  font-size: 16px;
  line-height: 1.7;
}

.card .link-accent {
  margin-top: 20px;
  font-size: 15px;
}

/* ----------------------------------------------------------- Produkter -- */

.products {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.product {
  padding: 34px 34px 34px 0;
}

.product + .product {
  border-left: 1px solid var(--rule-card);
  padding: 34px 0 34px 34px;
}

/* Med bara en produkt finns ingen kolumn att ställa den mot. Den får då
   hela fältet i stället för att lämna en tom halva efter sig. */
.products--single { grid-template-columns: 1fr; }
.products--single .product { padding: 0; }
/* Fältet och texten delar måttlinje, annars ser bandet ut som en platshållare. */
.products--single .product__mark,
.products--single .product__body { max-width: 62ch; }

.product__mark {
  height: 90px;
  margin-bottom: 24px;
  background-image: repeating-linear-gradient(
    90deg,
    oklch(0.22 0.012 60 / 0.18) 0 1px,
    transparent 1px 9px
  );
}

.product__mark--accent {
  background-image: repeating-linear-gradient(
    90deg,
    oklch(0.53 0.15 42 / 0.30) 0 1px,
    transparent 1px 9px
  );
}

.product__name {
  font-family: var(--display);
  font-weight: 400;
  font-size: 30px;
  margin-bottom: 12px;
}

.product__body {
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 20px;
  color: var(--body);
}

.product .link-accent { font-size: 14.5px; }

/* ---------------------------------------- Mindre utvecklingsuppdrag -- */

/* Kortare ingress än sektionsbrödtexten ovanför nyckelorden. */
.section__body--tight { margin-bottom: 36px; }

.works {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 36px;
  row-gap: 40px;
}

/* Hårlinje i stället för nyckelordens 2 px — de här står ett steg ned
   i hierarkin och ska inte konkurrera med LowCode- och AI-sektionerna. */
.work {
  border-top: 1px solid var(--rule-card);
  padding-top: 16px;
}

.work__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: 22px;
  margin-bottom: 8px;
}

.work__body {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--body-muted);
  margin-bottom: 14px;
  max-width: 46ch;
}

.work .link-accent { font-size: 14.5px; }

/* ------------------------------------------------------------- Kontakt -- */

.contact {
  background: var(--ink);
  color: var(--paper);
  border-top: 0;
}

.contact > .wrap {
  padding-block: var(--pad-y);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: end;
}

.contact__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: 52px;
  line-height: 1.05;
  margin-bottom: 18px;
  max-width: 16ch;
}

.contact__body {
  font-size: 17px;
  line-height: 1.6;
  max-width: 40ch;
  color: var(--on-dark);
}

.contact__aside {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: flex-start;
}

.contact__details {
  font-size: 16px;
  line-height: 1.7;
  color: var(--on-dark);
}

.contact__details a { border-bottom: 1px solid oklch(0.85 0.012 85 / 0.4); }

.contact a:focus-visible { outline-color: var(--on-dark); }

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

.footer > .wrap {
  padding-block: 24px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 13px;
  color: var(--label);
}

.footer a { border-bottom: 1px solid var(--rule); }

/* ==========================================================================
   Responsivt
   ========================================================================== */

/* -- 700–1099 px ---------------------------------------------------------- */
@media (max-width: 1099px) {
  :root { --pad-x: 40px; }

  .section > .wrap { grid-template-columns: 1fr; }
  .section__label { padding-top: 0; margin-bottom: 24px; }

  .hero > .wrap { grid-template-columns: 1fr; }
  .hero__text { padding: 64px var(--pad-x) 40px; }
  .hero__title { font-size: 60px; }

  .hero__panel {
    min-height: 260px;
    height: 260px;
    border-left: 0;
    border-top: 1px solid var(--rule);
  }
  .hero__panel-inner { padding: 24px var(--pad-x); }

  .keywords { grid-template-columns: 1fr; gap: 28px; }

  .about { grid-template-columns: 1fr; gap: 36px; }
  .card { max-width: 360px; }
}

/* -- Under 700 px --------------------------------------------------------- */
@media (max-width: 699px) {
  :root { --pad-x: 24px; --pad-y: 56px; }

  /* Navigationen fälls ihop till en meny; "Boka möte" ligger kvar utanför. */
  .nav-toggle { display: block; }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--pad-x) 20px;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
  }

  .nav[data-open="true"] { display: flex; }

  .nav a {
    padding: 14px 0;
    font-size: 16px;
    border-bottom: 1px solid var(--rule);
  }

  .nav__cta {
    border-bottom: 1px solid var(--rule);
    align-self: flex-start;
  }

  .header > .wrap { position: relative; padding-block: 18px; }

  /* Alltid synlig bokningslänk, oavsett menyns läge. */
  .header__cta {
    display: inline-block;
    font-size: 14px;
    color: var(--accent);
    border-bottom: 1.5px solid var(--accent);
  }

  /* Dubbletten i den utfällda menyn skulle bara upprepa den ovan. */
  .nav .nav__cta { display: none; }

  .hero__text { padding: 48px var(--pad-x) 36px; }
  .hero__title { font-size: 46px; max-width: none; }
  .hero__lead { font-size: 17px; max-width: none; margin-bottom: 32px; }

  .hero__actions { gap: 10px; }
  .btn, .btn--accent, .btn-text { display: block; text-align: center; }
  .btn-text { text-align: left; }

  .hero__panel { min-height: 200px; height: 200px; }

  .h2 { font-size: 32px; max-width: none; }
  .section__body { font-size: 16px; max-width: none; margin-bottom: 36px; }

  .statement { font-size: 27px; max-width: none; }
  .about__body { font-size: 16px; max-width: none; }
  .card { max-width: none; }

  .works { grid-template-columns: 1fr; row-gap: 32px; }

  .products { grid-template-columns: 1fr; }
  .product { padding: 30px 0; }
  .product + .product {
    border-left: 0;
    border-top: 1px solid var(--rule-card);
    padding: 30px 0;
  }
  .product__mark { height: 64px; margin-bottom: 20px; }
  .product__body { font-size: 16px; }

  .contact > .wrap { grid-template-columns: 1fr; gap: 36px; align-items: start; }
  .contact__title { font-size: 36px; max-width: none; }
  .contact__body { font-size: 16px; max-width: none; }

  .footer > .wrap { flex-direction: column; gap: 6px; }
}

/* Träffytor om minst 44 px på små skärmar. */
@media (max-width: 699px) {
  .btn, .btn--accent { padding-block: 15px; min-height: 44px; }
  .btn-text { padding: 13px 0; min-height: 44px; }
  .nav__cta, .header__cta { padding-block: 4px; }
}

/* --------------------------------------------------- Reducerad rörelse -- */
@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;
  }
}

/* ------------------------------------------------------------ Utskrift -- */
@media print {
  .header, .nav-toggle { position: static; }
  .hero__panel { display: none; }
  .contact { background: none; color: var(--ink); }
  .contact__body, .contact__details { color: var(--body); }
}
