/* Unestål Mental Träning — landing page
   Layout lives in inline styles on the markup (design-tool output).
   This file holds resets, hover states, animations and responsive overrides. */

/* ---- Fonts, served from here rather than from Google ----

   These were <link>ed from fonts.googleapis.com, which sends every visitor's
   IP address to Google before the page has asked anyone anything. A German
   court found that a GDPR violation in 2022 and it has been the basis of
   claims since. It also sat badly beside the app, where Sentry runs in the EU
   region and the account id was taken out of crash reports on purpose: the
   product is careful with visitor data and the page advertising it was not.

   Self-hosting also removes two render-blocking round trips to a third party
   before any text can paint.

   Latin subset only — that covers å ä ö, which is the whole requirement for a
   Swedish page. Two of the four are variable, so one file covers every weight
   used: Manrope at 400 through 800, Cormorant Garamond at 400 and 500. The
   italic Cormorant is a separate static face because the hero sets it, and a
   browser asked for an italic it does not have will slant the upright one
   itself — which on a display serif looks like a mistake, because it is one.

   112 KB for all four. */

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/manrope-var-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('fonts/cormorant-garamond-var-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/cormorant-garamond-italic-500-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/jetbrains-mono-400-latin.woff2') format('woff2');
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #10294a;
  color: #eef2f7;
  font-family: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
/* `height: auto` is not optional here, it is the other half of width/height.

   Every <img> carries width and height attributes so the browser can reserve
   the right box before the file arrives, which is what stops the page jumping
   as it loads. The cost is that those attributes are also a presentational
   height: the moment `max-width` shrinks an image below its attribute width,
   the attribute height still applies at full value and the picture stretches.

   `height: auto` hands the height back to the aspect ratio. Elements that
   genuinely want a fixed height — the logo at 176px, the footer mark at 64px —
   set it inline, and an inline style beats this. */
img { max-width: 100%; height: auto; }
a { color: #f0c761; text-decoration: none; transition: color 0.15s ease, opacity 0.15s ease; }
a:hover { color: #f7dc9c; }
a.hg:hover { color: #f7dc9c !important; }
a.hw:hover { color: #eef2f7 !important; }
a.hop:hover { opacity: 0.86; }
:focus-visible { outline: 2px solid #f0c761; outline-offset: 3px; }

/* ---- Appfältet högst upp, på telefon ----

   Ersätter Apples Smart App Banner, som ritas av Safari och kräver ett riktigt
   App Store-id. Samma plats och samma jobb, men den här går att formge och
   fungerar innan appen är godkänd.

   Dolt som utgångsläge och påslaget först under 680 px: på en dator installerar
   man ingen telefonapp, och ett fastnitat fält högst upp vore bara brus.

   `position: sticky` och inte `fixed`, så fältet tar egen plats i flödet i
   stället för att lägga sig över hjältebilden. Inget behov av att kompensera
   med padding på body, och inget som kan glida isär om höjden ändras. */
.appbar { display: none; }

@media (max-width: 680px) {
  .appbar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 9px 16px;
    background: rgba(8, 22, 42, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(238, 242, 247, 0.12);
    text-decoration: none;
  }
  .appbar img {
    width: 40px;
    height: 40px;
    border-radius: 9px;
    flex: none;
  }
  /* Texten krymper, knappen gör det inte — samma regel som priset i appens
     listrader. Det som får plockas bort är undertexten, inte uppmaningen. */
  .appbar-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-width: 0;
  }
  .appbar-text strong {
    font-size: 14px;
    font-weight: 700;
    color: #eef2f7;
    line-height: 1.2;
  }
  .appbar-text small {
    font-size: 11.5px;
    color: rgba(238, 242, 247, 0.62);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .appbar-cta {
    flex: none;
    padding: 8px 17px;
    border-radius: 999px;
    background: #f0c761;
    color: #10294a;
    font-size: 13.5px;
    font-weight: 700;
  }
}

/* ---- "Snart på Google Play" ----

   Ours, deliberately, rather than Google's badge greyed out. The badge may
   only be used to link to a live store listing, and altering it — dimming,
   overlaying, adding words — is specifically not allowed. The real file is in
   badges/google-play-sv.png, waiting for the account.

   Sized to stand beside the App Store badge rather than to imitate it: same
   height, squarer corners, no logo. It should read as a note, not as a second
   button somebody will try to press.

   Not a <a> and not a <button>, because there is nothing to go to. A control
   that does nothing when tapped is worse than a sentence. */
.soon {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 52px;
  padding: 0 18px;
  border-radius: 9px;
  border: 1px solid rgba(238,242,247,0.2);
  background: rgba(238,242,247,0.05);
  font-size: 14px;
  font-weight: 600;
  color: rgba(238,242,247,0.74);
  white-space: nowrap;
}
.soon::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f0c761;
  flex: none;
}
/* The footer stacks its badges smaller. */
footer .soon { height: 44px; padding: 0 14px; font-size: 13px; }

@keyframes ueRise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes ueFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---- Tablet ---- */
@media (max-width: 1000px) {
  [style*="grid-template-columns: repeat(4, 1fr)"] { grid-template-columns: 1fr 1fr !important; }
  /* Footern. Strängen måste matcha inline-stilen exakt — ändrar du kolumnerna
     där måste du ändra dem här, annars försvinner beteendet tyst. */
  [style*="grid-template-columns: 1.7fr 1fr 1fr 1.1fr"] { grid-template-columns: 1fr 1fr !important; gap: 34px !important; }
  [style*="grid-template-columns: 1.25fr 1fr"],
  [style*="grid-template-columns: 1fr 1.25fr"],
  [style*="grid-template-columns: 1fr 0.9fr"],
  [style*="grid-template-columns: 1.1fr 0.9fr"],
  [style*="grid-template-columns: 1.02fr 0.98fr"] { grid-template-columns: 1fr !important; gap: 40px !important; }
  section[style*="padding: 104px"] { padding-top: 72px !important; padding-bottom: 72px !important; }
  /* Cards go full width at these breakpoints — keep the phone crops phone-sized
     so the visible fraction of each screenshot stays the same. */
  [style*="height: 330px"],
  [style*="height: 300px"],
  [style*="height: 360px"] {
    max-width: 340px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    height: auto !important;
    aspect-ratio: 0.62;
  }
}

/* ---- Phone ---- */
@media (max-width: 680px) {
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  section, div[style*="padding: 30px 34px"] { padding-left: 20px !important; padding-right: 20px !important; }
  [style*="padding: 56px 52px"] { padding: 34px 24px !important; }
  h1 { font-size: 40px !important; }
  [style*="margin-bottom: -56px"] { margin-bottom: 0 !important; }
  [style*="height: 330px"],
  [style*="height: 300px"],
  [style*="height: 360px"] { max-width: 300px !important; }
  footer { padding-left: 20px !important; padding-right: 20px !important; }
}

/* ---- Supportsidan ----

   Klasser, inte inline-stilar. index.html kom ur ett designverktyg och dess
   responsiva regler matchar exakta strängar i markupen; den konstruktionen är
   dokumenterad i README som en fälla och ska inte spridas till sidor som
   skrivs för hand. Här räcker vanliga klasser och en brytpunkt. */

.sup {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 22px 88px;
}

.sup-back {
  display: inline-block;
  font-size: 14px;
  color: rgba(238, 242, 247, 0.62);
  margin-bottom: 26px;
}
.sup-back:hover { color: #f0c761; }

.sup-head h1 {
  font-weight: 800;
  font-size: clamp(38px, 6vw, 56px);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 16px;
}
.sup-lead {
  font-size: 18px;
  line-height: 1.6;
  color: rgba(238, 242, 247, 0.72);
  margin: 0 0 8px;
  max-width: 56ch;
}

.sup h2 {
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.02em;
  margin: 56px 0 22px;
}

/* Fällbara frågor.

   <summary> ritas som list-item med en systempil. Den pilen ser olika ut i
   varje webbläsare, så den tas bort och ersätts av en egen chevron som vänder
   sig när blocket öppnas. Två rader behövs: `list-style` för Firefox och
   moderna Chromium, `::-webkit-details-marker` för äldre WebKit. */
.sup-q {
  margin-bottom: 10px;
  border-radius: 18px;
  background: rgba(238, 242, 247, 0.05);
  border: 1px solid rgba(238, 242, 247, 0.1);
}
.sup-q > summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  cursor: pointer;
  list-style: none;
  /* Hela raden är träffytan, inte bara texten. */
  border-radius: 18px;
}
.sup-q > summary::-webkit-details-marker { display: none; }
.sup-q > summary:hover { background: rgba(238, 242, 247, 0.03); }

/* Rubriken ligger i summary för att behålla dokumentets rubrikstruktur.
   Den ska inte bryta rad som ett block, därav margin noll. */
.sup-q > summary h3 {
  font-size: 16.5px;
  font-weight: 700;
  margin: 0;
  flex: 1;
  line-height: 1.35;
}

/* Chevron, ritad med två kanter i stället för en bild. */
.sup-q > summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin-right: 3px;
  border-right: 2px solid rgba(238, 242, 247, 0.55);
  border-bottom: 2px solid rgba(238, 242, 247, 0.55);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.18s ease;
}
.sup-q[open] > summary::after {
  transform: rotate(-135deg) translate(-3px, -3px);
}
.sup-q[open] > summary h3 { color: #f0c761; }

/* Svaret. Vänsterkanten linjerar med rubriken ovanför, inte med chevronen. */
.sup-q > p {
  padding: 0 22px;
  margin: 0 0 14px;
}
.sup-q > p:first-of-type { padding-top: 2px; }
.sup-q > p {
  font-size: 15.5px;
  line-height: 1.62;
  color: rgba(238, 242, 247, 0.7);
  margin: 0 0 10px;
}
.sup-q > p:last-of-type { margin-bottom: 18px; }
.sup-q b { color: rgba(238, 242, 247, 0.9); font-weight: 600; }

/* ---- Formuläret ---- */

.sup-form { display: flex; flex-direction: column; gap: 16px; }

.sup-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) {
  .sup-row { grid-template-columns: 1fr; }
}

.sup-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: rgba(238, 242, 247, 0.78);
}

.sup-form input,
.sup-form select,
.sup-form textarea {
  font: inherit;
  font-weight: 400;
  font-size: 15.5px;
  color: #eef2f7;
  background: rgba(8, 22, 42, 0.6);
  border: 1px solid rgba(238, 242, 247, 0.16);
  border-radius: 12px;
  padding: 12px 14px;
  width: 100%;
  /* Utan detta ritar iOS egna rundade fält med vit botten och sidans
     mörka text blir oläslig i dem. */
  -webkit-appearance: none;
  appearance: none;
}
.sup-form textarea { resize: vertical; line-height: 1.55; }
.sup-form select {
  /* Egen pil, eftersom appearance: none tar bort systemets. */
  background-image: linear-gradient(45deg, transparent 50%, rgba(238,242,247,0.6) 50%),
                    linear-gradient(135deg, rgba(238,242,247,0.6) 50%, transparent 50%);
  background-position: calc(100% - 20px) 22px, calc(100% - 14px) 22px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 40px;
}
.sup-form input::placeholder,
.sup-form textarea::placeholder { color: rgba(238, 242, 247, 0.38); }
.sup-form input:focus-visible,
.sup-form select:focus-visible,
.sup-form textarea:focus-visible {
  outline: 2px solid #f0c761;
  outline-offset: 2px;
  border-color: transparent;
}

/* Skräpfällan. `display: none` hoppas över av vissa robotar som just letar
   efter den; den här är osynlig utan att säga att den är det. */
.sup-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.sup-send {
  align-self: flex-start;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #10294a;
  background: #f0c761;
  border: none;
  border-radius: 999px;
  padding: 13px 30px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.sup-send:hover { opacity: 0.9; }
.sup-send:disabled { opacity: 0.55; cursor: default; }

.sup-note { font-size: 14px; line-height: 1.5; margin: 0; min-height: 1px; }
.sup-note-bad { color: #f0a3a3; }
.sup-note-bad a { color: #f0c761; text-decoration: underline; }

.sup-fine {
  font-size: 12.5px;
  line-height: 1.55;
  color: rgba(238, 242, 247, 0.5);
  margin: 4px 0 0;
  max-width: 60ch;
}
.sup-fine a { color: rgba(238, 242, 247, 0.7); text-decoration: underline; }

.sup-done { font-size: 18px; font-weight: 700; margin: 0 0 8px; }
.sup-done-sub {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(238, 242, 247, 0.7);
  margin: 0;
}

.sup-mail {
  font-size: 15px;
  color: rgba(238, 242, 247, 0.65);
  margin: 30px 0 0;
  padding-top: 22px;
  border-top: 1px solid rgba(238, 242, 247, 0.1);
}

/* ---- Footer på supportsidan ---- */

.sup-footer {
  border-top: 1px solid rgba(238, 242, 247, 0.1);
  background: rgba(8, 22, 42, 0.6);
  padding: 26px 22px;
}
.sup-footer-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  font-size: 12.5px;
  color: rgba(238, 242, 247, 0.6);
}
.sup-footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.sup-footer-links a { color: rgba(238, 242, 247, 0.68); }
.sup-footer-links a:hover { color: #f0c761; }
