/*
 * Min beredskap på webben: designen Mysig, med samma färger som appen (src/components/theme.ts)
 * och samma typsnitt (Fraunces för rubriker, Figtree för text). Ändras appens färger ändras de
 * här också. Landskapet överst ritas av landskap.js.
 */

@font-face {
  font-family: Fraunces;
  src: url('fonts/Fraunces_600SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: Figtree;
  src: url('fonts/Figtree_400Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Figtree;
  src: url('fonts/Figtree_600SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: Figtree;
  src: url('fonts/Figtree_700Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #f3eee4;
  --surface: #fbf8f2;
  --sunken: #eae1cf;
  --text: #22302a;
  --heading: #1f3d33;
  --muted: #5e6158;
  --border: #e4dbc9;
  --rule: #d8cdb8;
  --field: #ffffff;
  --field-border: #b5aa93;
  --accent: #1f3d33;
  --accent-text: #1f3d33;
  --on-accent: #f7f1e6;
  --forest: #1f3d33;
  --honey: #c8964a;
  --honey-text: #7a5a22;
  --honey-soft: #f1e4c8;
  --sage-soft: #e2e8dc;
  --danger-soft: #f4dcd2;
  --danger-text: #8e3f26;
  --hero-ink: #f7f1e6;
  --hero-muted: #dccfb3;
  --phone-shadow: 0 24px 48px rgba(31, 61, 51, 0.22), 0 4px 12px rgba(31, 61, 51, 0.12);
  --display: Fraunces, Georgia, serif;
  --radius-card: 22px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131915;
    --surface: #1c241f;
    --sunken: #26302a;
    --text: #eee7d8;
    --heading: #eee7d8;
    --muted: #a4a898;
    --border: #2c3630;
    --rule: #36413a;
    --field: #0c110e;
    --field-border: #5c665e;
    --accent: #d9a85b;
    --accent-text: #e3c48a;
    --on-accent: #241c0e;
    --honey: #d9a85b;
    --honey-text: #e3c48a;
    --honey-soft: #3a3222;
    --sage-soft: #233029;
    --danger-soft: #3d2820;
    --danger-text: #f2ae93;
    --phone-shadow: 0 24px 48px rgba(0, 0, 0, 0.55);
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    17px/1.55 Figtree,
    system-ui,
    -apple-system,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-text);
  text-underline-offset: 3px;
}

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

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 600;
  color: var(--heading);
  letter-spacing: -0.01em;
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
}

.narrow {
  max-width: 680px;
}

/* Sidhuvudet: landskapet fyller hela bredden, och texten ligger på himlen. */
.hero {
  position: relative;
  min-height: 0;
  color: var(--hero-ink);
  /* Om skriptet inte körs syns en himmel i skogens färg. */
  background: linear-gradient(180deg, #1f3d33 0%, #2c5546 60%, var(--bg) 100%);
  overflow: hidden;
}

.hero.short {
  min-height: clamp(400px, 52svh, 520px);
}

.landscape {
  position: absolute;
  /* Ett par pixlar under kanten, så att ingen rand av heron syns mellan bilden och sidan. */
  inset: 0 0 -2px 0;
}

.landscape svg {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-content {
  position: relative;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 21px;
  color: var(--hero-ink);
  text-decoration: none;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.round-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1.5px solid rgba(247, 241, 230, 0.45);
  color: var(--hero-ink);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  backdrop-filter: blur(6px);
  background: rgba(15, 33, 27, 0.25);
}

.round-button:hover {
  background: rgba(15, 33, 27, 0.4);
}

.wide {
  max-width: 1240px;
}

/*
 * Sidhuvudet på startsidan: till vänster huset med solen eller månen ovanför, till höger
 * rubriken med telefonen under, som står på sidans kant. landskap.js ritar huset och ljuset där
 * platserna [data-hus] och [data-sol] står. På mobil kommer texten först och huset under.
 */
.hero-grid {
  display: flex;
  flex-direction: column;
}

.house-spot {
  order: 2;
  height: 500px;
  width: 60%;
  padding-top: 16px;
}

.sun-spot {
  height: 110px;
}

.hero-phone {
  display: none;
}

.hero-text {
  text-align: center;
  padding-top: 40px;
}

@media (min-width: 900px) {
  .hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 32px;
  }

  /* Telefonen sticker ut under heron, så heron får inte klippa den. */
  .hero:not(.short) {
    overflow: visible;
    z-index: 1;
  }

  .landscape {
    overflow: hidden;
  }

  .house-spot {
    order: 0;
    width: auto;
    height: auto;
    padding-top: 8px;
  }

  .sun-spot {
    height: 130px;
  }

  .hero-main {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-text {
    padding-top: 16px;
  }

  .hero .title {
    font-size: clamp(48px, 5vw, 72px);
    white-space: nowrap;
  }

  /* Telefonen börjar i skogen och fortsätter ner i sidan, så att den håller ihop heron och sidan. */
  .hero-phone {
    display: block;
    width: clamp(240px, 22vw, 290px);
    margin-top: 32px;
    margin-bottom: -260px;
    border-radius: 40px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow:
      0 30px 60px rgba(0, 0, 0, 0.35),
      0 6px 16px rgba(0, 0, 0, 0.2);
  }

  .hero-phone img {
    width: 100%;
    height: auto;
  }
}

.kicker {
  margin: 0 0 6px;
  color: var(--hero-muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.title {
  margin: 0;
  color: var(--hero-ink);
  font-size: clamp(46px, 9vw, 84px);
  line-height: 1.02;
}

.lead {
  margin: 16px auto 26px;
  max-width: 30ch;
  color: var(--hero-ink);
  font-size: clamp(19px, 2.4vw, 23px);
  line-height: 1.4;
}

.short .hero-text {
  padding-top: clamp(28px, 6svh, 56px);
}

.short .title {
  font-size: clamp(40px, 7vw, 60px);
}

.short .kicker {
  margin-top: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 24px;
  border-radius: 999px;
  background: #d9a85b;
  color: #241c0e;
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.pill svg {
  width: 20px;
  height: 20px;
}

/* Röken från skorstenen och stjärnorna rör sig sakta; inget rör sig för den som valt bort rörelse. */
.rok {
  animation: rok 7s ease-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.rok-1 {
  animation-delay: -2.3s;
}
.rok-2 {
  animation-delay: -4.6s;
}

@keyframes rok {
  0% {
    transform: translate(0, 0) scale(0.6);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translate(26px, -90px) scale(1.6);
    opacity: 0;
  }
}

.blink {
  animation: blink 5s ease-in-out infinite alternate;
}

@keyframes blink {
  to {
    opacity: 0.2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rok,
  .blink {
    animation: none;
  }
  .rok-1,
  .rok-2 {
    display: none;
  }
}

/* Avsnitten under sidhuvudet */

.intro {
  max-width: 34ch;
  margin: 24px auto 0;
  text-align: center;
  font-size: clamp(19px, 2.2vw, 22px);
  line-height: 1.45;
}

/* På dator står introt till vänster om telefonen, som fortsätter ner från heron. */
@media (min-width: 900px) {
  .hero:not(.short) + main > .intro {
    width: calc(50% - 32px);
    max-width: none;
    min-height: 200px;
    margin: 56px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(26px, 3.2vw, 32px);
  margin: 80px 0 20px;
}

.section-title .badge {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--sage-soft);
  color: var(--accent-text);
}

.badge svg {
  width: 22px;
  height: 22px;
}

.features {
  display: grid;
  gap: 22px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.feature {
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
}

.feature-text {
  padding: 26px 24px 8px;
}

.label {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--honey-text);
}

.feature h3 {
  margin: 0 0 8px;
  font-size: 27px;
  line-height: 1.2;
}

.feature p {
  margin: 0 0 12px;
}

.feature-art {
  padding: 28px 24px 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.phone {
  width: min(260px, 70vw);
  border-radius: 34px 34px 0 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-bottom: 0;
  box-shadow: var(--phone-shadow);
  background: var(--surface);
  max-height: 440px;
}

.phone img {
  width: 100%;
  height: auto;
}

.tone-forest {
  background: linear-gradient(180deg, #2c5546 0%, #1f3d33 100%);
}
.tone-honey {
  background: var(--honey-soft);
}
.tone-sage {
  background: var(--sage-soft);
}
.tone-linen {
  background: var(--sunken);
}

@media (min-width: 820px) {
  .feature {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }
  .feature-text {
    padding: 44px;
    align-self: center;
  }
  .feature:nth-child(even) .feature-text {
    order: 2;
  }
  .feature-art {
    padding: 44px 44px 0;
  }
}

/* Mer i appen: små rutor med ikon, som kategorirutorna i appen. */
.tiles {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.tile {
  padding: 20px 20px 18px;
}

.tile .badge {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--honey-soft);
  color: var(--honey-text);
  margin-bottom: 12px;
}

.tile h3 {
  margin: 0 0 4px;
  font-size: 20px;
}

.tile p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

/* Listor ligger på botten mellan två linjer, som i appen. */
.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.checklist li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 4px;
  border-top: 1px solid var(--rule);
}

.checklist li:first-child {
  border-top: 0;
}

.check {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
}

.check svg {
  width: 16px;
  height: 16px;
}

/* Textsidorna: integritet och support */

.prose {
  padding-top: 8px;
  padding-bottom: 24px;
}

.prose .intro {
  margin: 32px 0 0;
  max-width: none;
  text-align: left;
}

.prose h2 {
  font-size: 24px;
  margin: 40px 0 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.prose h3 {
  font-size: 19px;
  margin: 26px 0 4px;
}

.prose p {
  margin: 0 0 12px;
}

.prose ul {
  margin: 0 0 12px;
  padding-left: 22px;
}

.prose li {
  margin-bottom: 6px;
}

.prose > .card {
  padding: 22px 24px 10px;
  margin-top: 16px;
}

.prose .card h2:first-child {
  margin-top: 0;
}

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

.faq details {
  border-bottom: 1px solid var(--rule);
  padding: 4px 4px;
}

.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  font-weight: 600;
  font-size: 18px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  font-size: 24px;
  color: var(--muted);
}

.faq details[open] summary::after {
  content: '–';
}

.faq details p {
  margin: 0 0 14px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 14px;
  line-height: 1.5;
}

footer {
  margin-top: 80px;
  padding: 32px 0 48px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 15px;
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 8px;
}

footer a {
  color: var(--muted);
}

/* Rapportformuläret: vita fält med tydlig kant, som inmatningsfälten i appen. */
.report-form {
  display: grid;
  gap: 18px;
  margin: 8px 0 20px;
}

.report-form .field {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 15px;
}

.report-form .field .muted {
  font-weight: 400;
}

.report-form input[type='text'],
.report-form input[type='email'],
.report-form textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--field-border);
  border-radius: 14px;
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-weight: 400;
}

.report-form textarea {
  resize: vertical;
  min-height: 130px;
}

.report-form input:focus-visible,
.report-form textarea:focus-visible,
.segmented input:focus-visible + span {
  outline: 3px solid var(--honey);
  outline-offset: 2px;
}

.segmented {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 4px;
  border: 0;
  border-radius: 999px;
  background: var(--sunken);
}

.segmented legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.segmented label {
  flex: 1;
  position: relative;
}

.segmented input {
  position: absolute;
  opacity: 0;
}

.segmented span {
  display: block;
  padding: 9px 6px;
  border-radius: 999px;
  text-align: center;
  font-weight: 600;
  font-size: 15px;
  color: var(--muted);
  cursor: pointer;
}

.segmented input:checked + span {
  background: var(--accent);
  color: var(--on-accent);
}

.button {
  justify-self: start;
  min-height: 50px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.button:disabled {
  opacity: 0.6;
  cursor: default;
}

.notice {
  margin: 0;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 600;
}

.notice.success {
  background: var(--sage-soft);
}

.notice.error {
  background: var(--danger-soft);
  color: var(--danger-text);
}

.report-form p {
  margin: 0;
}
