/* secondmay.se. Färger, typsnitt och mått kommer från varumärkesprofilen för Second May;
   alla färgvärden skrivs bara i :root och de två mörka blocken.
   Layout: ett femkolumnsraster. Hjälten tar tre kolumner för texten och två för dagbladet. */

@font-face { font-family: "Outfit"; src: url("fonts/Outfit.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/JetBrainsMono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --surface: #F6F9FC;
  --surface-raised: #FFFFFF;
  --sno: #EAF3FA;
  --line: #C9D6E2;
  --line-strong: #74889E;
  --ink: #16324F;
  --ink-muted: #4A5D73;
  --glaciar: #5FB3E0;
  --accent-text: #2B6F99;
  --on-glaciar: #0E2238;
  --deep: #0E2238;
  --on-deep: #EAF3FA;
  --on-deep-muted: #A9BFD4;
  --focus: #2B6F99;

  /* Ritblad i sin egen identitet */
  --rb-grafit: #22313A;
  --rb-text: #FFFFFF;
  --rb-muted: #C3CDD3;
  --rb-line: #3A4D58;
  --rb-orange-text: #F6955A;
  --rb-on-orange: #22313A;
  --rb-orange-hover: #F9AE80;

  --font: "Outfit", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --step--1: 0.875rem;
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --step-2: clamp(1.6rem, 1.3rem + 1.4vw, 2.4rem);
  --step-3: clamp(2.3rem, 1.6rem + 3.2vw, 4.4rem);

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px;
  --space-8: 32px; --space-12: 48px; --space-16: 64px; --space-24: 96px;
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 14px;
  --max: 74rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #0E2238; --surface-raised: #16324F; --sno: #234A70; --line: #2A4866; --line-strong: #6A88A6;
    --ink: #EAF3FA; --ink-muted: #A9BFD4; --accent-text: #7CC4EA; --deep: #0A1A2B; --focus: #7CC4EA;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --surface: #0E2238; --surface-raised: #16324F; --sno: #234A70; --line: #2A4866; --line-strong: #6A88A6;
  --ink: #EAF3FA; --ink-muted: #A9BFD4; --accent-text: #7CC4EA; --deep: #0A1A2B; --focus: #7CC4EA;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--surface); color: var(--ink);
  font-family: var(--font); font-size: var(--step-0); line-height: 1.62; font-weight: 400;
  font-feature-settings: "kern";
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-weight: 600; text-wrap: balance; margin: 0; }
p { margin: 0; }
a { color: var(--accent-text); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

.wrap {
  width: 100%; max-width: calc(var(--max) + 2 * var(--space-8)); margin-inline: auto;
  padding-left: max(var(--space-6), env(safe-area-inset-left, 0px));
  padding-right: max(var(--space-6), env(safe-area-inset-right, 0px));
}
.label {
  font-family: var(--mono); font-size: 0.75rem; line-height: 1.4; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted);
}

/* Sidhuvud */
.top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); padding-block: var(--space-6); }
.brand img { width: 168px; height: auto; }
.top nav { display: flex; gap: var(--space-6); font-size: var(--step--1); }
.top nav a { color: var(--ink); text-decoration: none; }
.top nav a:hover { color: var(--accent-text); }

/* Knappar */
.button {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 0.7em 1.15em; border-radius: var(--radius-md);
  background: var(--ink); color: var(--surface); text-decoration: none; font-weight: 600; font-size: var(--step--1);
}
.button:hover { background: var(--accent-text); color: var(--surface-raised); text-decoration: none; }
.link { font-weight: 600; font-size: var(--step--1); }

/* Hjälte */
.hero {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-8);
  align-items: center; padding-block: var(--space-12) var(--space-24);
}
.hero-text { grid-column: 1 / span 3; display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; }
.hero h1 { font-size: var(--step-3); line-height: 1.02; letter-spacing: -0.03em; max-width: 14ch; }
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--ink-muted); max-width: 36ch; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-6); padding-top: var(--space-2); }

/* Plattorna: varumärkets formspråk, rundade plattor och ett prickraster */
.hero-art { grid-column: 4 / span 2; justify-self: end; width: min(100%, 26rem); }
.hero-art svg { display: block; width: 100%; height: auto; overflow: visible; }
.t-ink { fill: var(--ink); }
.t-gla { fill: var(--glaciar); }
.t-sno { fill: var(--sno); stroke: var(--line); stroke-width: 1; }
.dot-c { fill: var(--surface); }
.dot-b { fill: var(--surface); }
.b1, .b2 { animation: bloom 0.6s ease-out both; }
.b1 { animation-delay: 0.5s; }
.b2 { animation-delay: 0.85s; }
@keyframes bloom { from { fill: var(--surface); } to { fill: var(--glaciar); } }

/* Ritblad */
.product { background: var(--rb-grafit); color: var(--rb-text); padding-block: var(--space-24); }
.product .label { color: var(--rb-muted); }
.product-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-8); }
.product-intro { grid-column: 1 / span 2; display: flex; flex-direction: column; gap: var(--space-6); }
.product-intro h2 img { width: 232px; }
.product-claim { text-wrap: balance; font-size: var(--step-2); line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; }
.product-body { grid-column: 3 / span 3; display: flex; flex-direction: column; gap: var(--space-6); max-width: 38rem; min-width: 0; }
.product-body > p:not(:last-child) { color: var(--rb-muted); }
.product-body > p:first-child { color: var(--rb-text); font-size: var(--step-1); line-height: 1.5; }
.facts { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--rb-line); border-bottom: 1px solid var(--rb-line); }
.facts div { padding: var(--space-4) var(--space-4) var(--space-4) 0; display: flex; flex-direction: column; gap: var(--space-1); }
.facts div + div { padding-left: var(--space-4); border-left: 1px solid var(--rb-line); }
.facts dt { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rb-muted); }
.facts dd { margin: 0; font-weight: 600; }
.facts a { color: var(--rb-orange-text); }
.button-ritblad { background: var(--rb-orange-text); color: var(--rb-on-orange); align-self: flex-start; }
.button-ritblad:hover { background: var(--rb-orange-hover); color: var(--rb-on-orange); }
.product :focus-visible { outline-color: var(--rb-orange-text); }

/* Principer */
.principles { padding-block: var(--space-24); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-8); }
.section-head { grid-column: 1 / span 2; display: flex; flex-direction: column; gap: var(--space-4); }
.section-head h2, .contact h2 { font-size: var(--step-2); line-height: 1.12; letter-spacing: -0.02em; }
.principle-list { grid-column: 3 / span 3; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.principle-list li {
  display: grid; grid-template-columns: 1.25rem minmax(0, 1fr); column-gap: var(--space-4); row-gap: var(--space-2);
  padding-block: var(--space-6); border-top: 1px solid var(--line);
}
.principle-list li:last-child { border-bottom: 1px solid var(--line); }
.principle-list li::before { content: ""; grid-row: 1; width: 12px; height: 12px; margin-top: 0.5em; border-radius: 50%; background: var(--glaciar); }
.principle-list h3 { font-size: var(--step-1); line-height: 1.3; }
.principle-list p { grid-column: 2; color: var(--ink-muted); max-width: 52ch; }

/* Kontakt */
.contact { background: var(--sno); padding-block: var(--space-24); }
.contact-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-8); align-items: end; }
.contact-grid > div:first-child { grid-column: 1 / span 3; display: flex; flex-direction: column; gap: var(--space-4); }
.contact-grid > div:first-child p:not(.label) { color: var(--ink-muted); max-width: 44ch; }
.mail { grid-column: 4 / span 2; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); min-width: 0; }
.mail-address { font-family: var(--mono); font-size: var(--step-1); font-weight: 600; overflow-wrap: anywhere; color: var(--ink); }
.mail-address:hover { color: var(--accent-text); }

/* Sidfot */
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-6); padding-block: var(--space-8); font-size: var(--step--1); color: var(--ink-muted); }
.foot-mark { width: 28px; }
.foot-note { margin-left: auto; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.04em; }

/* Smalt */
@media (max-width: 56rem) {
  .hero, .product-grid, .principles, .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-text, .hero-art, .product-intro, .product-body, .section-head, .principle-list,
  .contact-grid > div:first-child, .mail { grid-column: 1; }
  .hero-art { justify-self: start; width: min(100%, 22rem); margin-top: var(--space-4); }
  .hero { padding-block: var(--space-8) var(--space-16); }
  .product, .principles, .contact { padding-block: var(--space-16); }
}
@media (max-width: 34rem) {
  .top { flex-wrap: wrap; }
  .top nav { gap: var(--space-4); }
  .brand img { width: 140px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--rb-line); }
  .foot-note { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .b1, .b2 { animation: none; fill: var(--glaciar); }
}
