/* Homepage as touch stories. Without JavaScript the stories stack as normal sections. */

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

html,
body {
  margin: 0;
}

body.stories-page {
  min-width: 320px;
  background: #0b2119;
  color: #ffffff;
  font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", "Geeza Pro", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.skip-link {
  position: absolute;
  z-index: 100;
  top: -120px;
  inset-inline-start: 16px;
  padding: 10px 16px;
  border-radius: 10px;
  background: #f2c46b;
  color: #241602;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 16px;
}

/* ---------- Tones ---------- */

.tone-forest { background: #0b2119; }
.tone-mint { background: #e9f0ec; }
.tone-deep { background: #094b3a; }
.tone-paper { background: #f4f7f5; }
.tone-green { background: #0e7054; }
.tone-night { background: #07150f; }
.tone-sand { background: #f3e8d6; }

.story[data-tone="dark"] { color: #ffffff; }
.story[data-tone="light"] { color: #07150f; }

.stories[data-tone="dark"] { color: #ffffff; }
.stories[data-tone="light"] { color: #07150f; }

/* ---------- Stacked layout (no JavaScript) ---------- */

.stories-top,
.stories-zone,
.stories-arrow,
.stories-hint {
  display: none;
}

.story {
  position: relative;
  overflow: hidden;
  padding: 72px 24px;
}

.story-body {
  position: relative;
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.story-cta {
  max-width: 880px;
  margin: 28px auto 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---------- Story content ---------- */

.story-center {
  align-items: center;
  text-align: center;
}

.cover-portrait {
  position: relative;
  width: 200px;
  height: 200px;
  margin-bottom: 6px;
}

.cover-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.cover-ring {
  position: absolute;
  inset: -14px;
  border: 2px dashed #7fddb9;
  border-radius: 50%;
  animation: stories-ring 24s linear infinite;
}

@keyframes stories-ring {
  to { transform: rotate(360deg); }
}

.story-eyebrow {
  margin: 0;
  color: #7fddb9;
  font-size: 17px;
  font-weight: 600;
}

.story-name {
  margin: 0;
  font-size: 42px;
  font-weight: 800;
  line-height: 1.4;
}

.story-small {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 14px;
  font-weight: 600;
}

.story-center .story-small {
  justify-content: center;
}

.story[data-tone="dark"] .story-small { color: #cfe3da; }
.story[data-tone="light"] .story-small { color: #42564d; }

.story-rule {
  width: 56px;
  height: 5px;
  border-radius: 3px;
  background: #b98842;
}

.story-statement-text {
  margin: 0;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.65;
}

.story-chips {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.story-chips li {
  padding: 4px 12px;
  border: 1px solid #7e968a;
  border-radius: 999px;
  font-size: 14px;
  color: #10231c;
}

.story-badge {
  align-self: flex-start;
  padding: 6px 16px;
  border-radius: 999px;
  background: #f2c46b;
  color: #241602;
  font-size: 15px;
  font-weight: 700;
}

.story-quote {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.75;
}

.story-kicker {
  position: relative;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.story[data-tone="dark"] .story-kicker { color: #f2c46b; }
.story[data-tone="light"] .story-kicker { color: #8a5a12; }

.story-title {
  position: relative;
  margin: 0;
  font-size: 36px;
  font-weight: 800;
  line-height: 1.5;
}

.story-text {
  position: relative;
  margin: 0;
  font-size: 21px;
  line-height: 1.95;
}

.story[data-tone="dark"] .story-text { color: #e6f1ec; }
.story[data-tone="light"] .story-text { color: #10231c; }

.story-codes {
  margin: 6px 0 0;
  color: #7fddb9;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.area-ghost {
  position: absolute;
  top: -195px;
  inset-inline-end: -24px;
  font-size: 190px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.story[data-tone="dark"] .area-ghost { color: rgba(255, 255, 255, 0.14); }
.story[data-tone="light"] .area-ghost { color: rgba(14, 112, 84, 0.12); }

.quiz-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 240px;
}

.quiz-tiles span {
  height: 64px;
  border: 1px solid #2f5a48;
  border-radius: 16px;
  background: #10271e;
  color: #7fddb9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
}

.quiz-tiles .is-warm {
  color: #f2c46b;
}

.contact-brand {
  font-size: 30px;
}

.story-button {
  min-height: 56px;
  padding: 0 24px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
}

.story[data-tone="dark"] .story-button { background: #f2c46b; color: #241602; }
.story[data-tone="light"] .story-button { background: #0e7054; color: #ffffff; }
.story.tone-green .story-button { background: #ffffff; color: #07150f; }

a:focus-visible,
button:focus-visible {
  outline: 3px solid #f2c46b;
  outline-offset: 3px;
}

.story[data-tone="light"] a:focus-visible,
.stories[data-tone="light"] .stories-top a:focus-visible,
.stories[data-tone="light"] .stories-top button:focus-visible {
  outline-color: #0e7054;
}

/* ---------- Full-screen stories (JavaScript on) ---------- */

.stories-js body {
  overflow: hidden;
}

.stories-js .stories {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.stories-js .stories-top {
  position: absolute;
  z-index: 30;
  top: 0;
  inset-inline: 0;
  padding: calc(12px + env(safe-area-inset-top)) 14px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.stories-bars {
  display: flex;
  gap: 4px;
}

.stories-bar {
  flex: 1 1 0;
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.32);
}

.stories-bar-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: #ffffff;
  transform: scaleX(0);
  transform-origin: right center;
}

html[dir="ltr"] .stories-bar-fill {
  transform-origin: left center;
}

.stories[data-tone="light"] .stories-bar { background: rgba(7, 21, 15, 0.22); }
.stories[data-tone="light"] .stories-bar-fill { background: #07150f; }

.stories-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stories-brand {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  pointer-events: auto;
}

.stories-brand img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.stories-counter {
  font-weight: 500;
  opacity: 0.85;
}

.stories-actions {
  display: flex;
  gap: 6px;
  pointer-events: auto;
}

.stories-icon-button {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.stories[data-tone="light"] .stories-icon-button {
  background: rgba(7, 21, 15, 0.08);
}

.stories-icon-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.stories .icon-play { display: none; }
.stories.is-paused .icon-play { display: block; }
.stories.is-paused .icon-pause { display: none; }

.stories-js .story {
  position: absolute;
  inset: 0;
  padding: calc(116px + env(safe-area-inset-top)) 28px calc(170px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, transform 0.45s ease, visibility 0s linear 0.45s;
}

.stories-js .story.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.45s ease, transform 0.45s ease, visibility 0s;
}

html[dir="rtl"].stories-js .story.is-after { transform: translateX(-28px); }
html[dir="rtl"].stories-js .story.is-before { transform: translateX(28px); }
html[dir="ltr"].stories-js .story.is-after { transform: translateX(28px); }
html[dir="ltr"].stories-js .story.is-before { transform: translateX(-28px); }

.stories-js .story-body {
  width: 100%;
}

.stories-js .story-cta {
  position: absolute;
  z-index: 25;
  inset-inline: 20px;
  bottom: calc(22px + env(safe-area-inset-bottom));
  max-width: none;
  margin: 0;
}

.stories-js .stories-hint {
  display: block;
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
  text-align: center;
  opacity: 0.92;
}

.hint-pointer {
  display: none;
}

.stories-js .stories-zone {
  position: absolute;
  z-index: 20;
  top: calc(108px + env(safe-area-inset-top));
  bottom: calc(166px + env(safe-area-inset-bottom));
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.stories-zone-prev {
  inset-inline-start: 0;
  width: 34%;
}

.stories-zone-next {
  inset-inline-end: 0;
  width: 66%;
}

.stories-zone:focus-visible {
  outline-offset: -8px;
}

.stories-arrow {
  position: absolute;
  z-index: 26;
  top: 50%;
  width: 58px;
  height: 58px;
  margin-top: -29px;
  padding: 0;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.stories-arrow svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[dir="ltr"] .stories-arrow svg {
  transform: scaleX(-1);
}

.stories-arrow-prev { inset-inline-start: 28px; }
.stories-arrow-next { inset-inline-end: 28px; }

.stories-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

/* The assistant button sits at the bottom left on phones: keep the story buttons clear of it. */
@media (max-width: 768px) {
  .stories-js .story-cta {
    padding-left: 64px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .hint-touch { display: none; }
  .hint-pointer { display: inline; }
}

@media (min-width: 900px) and (hover: hover) {
  .stories-js .stories-arrow { display: flex; }
}

@media (max-height: 700px) {
  .cover-portrait { width: 150px; height: 150px; }
  .story-name { font-size: 34px; }
  .story-statement-text { font-size: 28px; }
  .story-quote { font-size: 25px; }
  .story-title { font-size: 30px; }
  .story-text { font-size: 18px; }
  .area-ghost { font-size: 150px; top: -160px; }
}

@media (min-width: 900px) {
  .stories-js .stories-top {
    padding-inline: 28px;
  }

  .stories-js .story {
    padding-inline: 120px;
    align-items: center;
  }

  .story-body {
    max-width: 880px;
  }

  .cover-portrait { width: 250px; height: 250px; }
  .story-name { font-size: 72px; line-height: 1.3; }
  .story-eyebrow { font-size: 20px; }
  .story-small { font-size: 16px; }
  .story-statement-text { font-size: 54px; line-height: 1.55; }
  .story-chips li { font-size: 16px; }
  .story-quote { font-size: 44px; line-height: 1.65; }
  .story-kicker { font-size: 17px; }
  .story-title { font-size: 56px; line-height: 1.4; }
  .story-text { font-size: 27px; line-height: 1.9; }
  .area-ghost { font-size: 260px; top: -285px; }
  .quiz-tiles { max-width: 330px; }
  .quiz-tiles span { height: 86px; font-size: 26px; }
  .contact-brand { font-size: 40px; }

  .stories-js .story-cta {
    left: 50%;
    right: auto;
    width: min(460px, calc(100% - 240px));
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cover-ring { animation: none; }

  .stories-js .story,
  .stories-js .story.is-active {
    transition: none;
    transform: none;
  }
}
