/* Shallow AI orientation under Modellen.
   Down from the machine, before Vågorna. Nothing there was removed.
   Pappret: the 2017 title. Right adds T:et i ChatGPT.
   Tokens: Right shows Hej as one token, then superintelligens
   as three, then a row of numbers under each.
   Läser: rest is "Två saker". Right brings the three fil
   sentences. Right lights skålen, then motorvägen, then skrivbordet.
   Skriver: the sentence arrives one token at a time.
   Hallucination: Troligt, then Sant in the same voice, then ≠,
   then the line to keep.
   Kontext: an empty window. Right fills it. Right adds the line.
   Kärnan: the two lines. Right adds what is built around them.
   Vikter: a still field of numbers. Right freezes the sentence.
   Vinter 2022: text, then tools, then image sound video, then agents.
   Skapande: the pale wave and the closing line.
   One more Right opens the old Vågorna slide. */

html.talk .mode-orient .orient-stage {
  position: absolute;
  left: 5vw;
  right: 5vw;
  top: 11%;
  bottom: 23%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

html.talk .orient-line {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
  color: #fff;
  text-shadow: var(--title-shadow);
}

/* ——— Pappret ——— */

html.talk .mode-paper .face-inner {
  opacity: 0;
  transition: opacity 0.45s ease;
}

html.talk .mode-paper.is-heading .face-inner {
  opacity: 1;
}

html.talk .mode-paper .kicker {
  font-size: clamp(0.85rem, 1.6vw, 1.15rem);
  letter-spacing: 0.14em;
}

/* ——— Tokens ——— */

html.talk .token-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(1.4rem, 4vw, 3.2rem);
}

html.talk .token-group {
  display: flex;
  gap: 0.5rem;
}

html.talk .token {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  min-width: 5.2rem;
  padding: 0.55rem 0.75rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.32);
}

html.talk .token.is-one {
  opacity: 0;
}

html.talk .token.is-part {
  display: none;
}

html.talk .token b {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3.2vw, 2.7rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1;
  color: #fff;
  text-shadow: var(--title-shadow);
}

html.talk .token-nums {
  font-family: var(--mono);
  font-size: clamp(0.62rem, 1.1vw, 0.78rem);
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.35;
  text-align: center;
  color: rgba(255, 255, 255, 0.62);
  opacity: 0;
}

html.talk .mode-tokens.is-chips .token.is-one {
  opacity: 1;
}

html.talk .mode-tokens.is-split .token.is-part {
  display: flex;
}

html.talk .mode-tokens.is-numbers .token-nums {
  opacity: 1;
}

/* ——— Läser ——— */

html.talk .read-hinge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin: 0;
  padding: 0 3vw 4rem;
  font-family: var(--serif);
  font-size: 5rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  line-height: 1.12;
  text-transform: uppercase;
  color: #fff;
  text-shadow: var(--title-shadow);
}

html.talk .mode-read.is-satt .read-hinge {
  opacity: 0;
  visibility: hidden;
}

html.talk .mode-read .read-list,
html.talk .mode-read h1 {
  opacity: 0;
}

html.talk .mode-read.is-satt .read-list,
html.talk .mode-read.is-satt h1 {
  opacity: 1;
}

html.talk .read-list {
  width: max-content;
  max-width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: max-content max-content max-content;
  column-gap: 0.7rem;
  row-gap: 1.15rem;
  justify-content: center;
  align-items: baseline;
}

html.talk .read {
  display: contents;
  font-family: var(--serif);
  font-size: clamp(1.45rem, 2.8vw, 2.35rem);
  letter-spacing: 0.03em;
  line-height: 1.15;
  color: rgba(255, 255, 255, 0.84);
}

html.talk .read-before,
html.talk .read-tok,
html.talk .read-after {
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
}

html.talk .read-before {
  justify-self: end;
}

html.talk .read-tok {
  color: #fff;
  text-shadow: var(--title-shadow);
}

html.talk .read-end,
html.talk .read em {
  font-style: normal;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.42);
  text-shadow: none;
}

html.talk .mode-read.is-skal .read.is-skal em,
html.talk .mode-read.is-motor .read.is-motor em,
html.talk .mode-read.is-bord .read.is-bord em {
  color: #fff;
  text-shadow: var(--title-shadow);
}

html.talk .mode-read h1 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.06em;
  font-size: min(3.15rem, 4.4vw);
}

html.talk .mode-read h1 span {
  display: block;
}

/* ——— Skriver ——— */

html.talk .guess {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin: 0;
}

html.talk .guess .tok {
  display: none;
  padding: 0.4rem 0.7rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.32);
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3.4vw, 2.8rem);
  letter-spacing: 0.03em;
  line-height: 1;
  color: #fff;
  text-shadow: var(--title-shadow);
}

html.talk .mode-write.is-stad .tok-stad,
html.talk .mode-write.is-verb .tok-verb,
html.talk .mode-write.is-prep .tok-prep,
html.talk .mode-write.is-land .tok-land {
  display: inline-block;
}

html.talk .guess .caret {
  display: inline-block;
  width: 2px;
  height: 0.82em;
  margin-left: 0.08em;
  background: #fff;
  box-shadow: var(--title-shadow);
  vertical-align: -0.05em;
  opacity: 0;
}

html.talk .guess .caret.is-wait {
  width: 2px;
  height: 2.4rem;
  margin: 0;
}

html.talk .mode-write:not(.is-stad) .caret.is-wait,
html.talk .mode-write.is-stad:not(.is-verb) .tok-stad .caret,
html.talk .mode-write.is-verb:not(.is-prep) .tok-verb .caret,
html.talk .mode-write.is-prep:not(.is-land) .tok-prep .caret,
html.talk .mode-write.is-land .tok-land .caret {
  opacity: 1;
  animation: orient-caret 1.05s steps(1, end) infinite;
}

html.talk .mode-write h1 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.06em;
  font-size: min(3.15rem, 4.4vw);
}

html.talk .mode-write h1 span {
  display: block;
}

@keyframes orient-caret {
  0%, 45% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ——— Hallucination ——— */

html.talk .hallu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

html.talk .hallu p {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3rem, 7vw, 5.4rem);
  font-weight: 400;
  letter-spacing: 0.1em;
  line-height: 1.05;
  text-transform: uppercase;
  color: #fff;
  text-shadow: var(--title-shadow);
}

html.talk .hallu-true,
html.talk .hallu-neq,
html.talk .hallu-check {
  display: none;
}

html.talk .hallu p.hallu-neq {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  letter-spacing: 0;
  text-shadow: none;
  color: rgba(255, 255, 255, 0.8);
}

html.talk .hallu p.hallu-check {
  margin-top: 0.9rem;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  letter-spacing: 0.08em;
  line-height: 1.2;
  white-space: nowrap;
}

html.talk .mode-hallu.is-sant .hallu-true,
html.talk .mode-hallu.is-klyfta .hallu-neq,
html.talk .mode-hallu.is-kolla .hallu-check {
  display: block;
}

/* ——— Kontext ——— */

html.talk .mem {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: min(40rem, 100%);
}

html.talk .mem-aside,
html.talk .mem-better {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

html.talk .mem-window {
  width: 100%;
  min-height: 13.5rem;
  padding: 1.8rem 2rem;
  border: 1px solid rgba(255, 255, 255, 0.42);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.4rem;
}

html.talk .mem-window p {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  letter-spacing: 0.02em;
  line-height: 1.25;
  color: #fff;
  opacity: 0;
}

html.talk .mode-context.is-fyll .mem-window p {
  opacity: 1;
}

html.talk .mem-better {
  display: none;
  color: #fff;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.2vw, 1.6rem);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-shadow: var(--title-shadow);
}

html.talk .mode-context.is-battre .mem-better {
  display: block;
}

/* ——— Kärnan ——— */

html.talk .mode-core h1 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12em;
  font-size: min(3.2rem, 4.6vw);
}

html.talk .mode-core h1 span {
  display: block;
}

html.talk .core-around {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16.5rem;
  text-align: center;
  font-size: clamp(1.15rem, 2.2vw, 1.65rem);
  opacity: 0;
}

html.talk .mode-core.is-runt .core-around {
  opacity: 1;
}

/* ——— Vikter ——— */

html.talk .weight-field {
  position: absolute;
  left: 8vw;
  right: 8vw;
  top: 14%;
  bottom: 28%;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  align-content: center;
  justify-items: center;
  gap: 0.85rem 0.4rem;
  font-family: var(--mono);
  font-size: clamp(0.68rem, 1.15vw, 0.86rem);
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.4);
}

html.talk .weight-freeze {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 11.2rem;
  text-align: center;
  font-size: clamp(1.2rem, 2.3vw, 1.8rem);
  opacity: 0;
}

html.talk .mode-weights.is-frusen .weight-freeze {
  opacity: 1;
}

html.talk .mode-weights.is-frusen .weight-field {
  color: rgba(255, 255, 255, 0.22);
}

/* ——— Vinter 2022 ——— */

html.talk .since {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

html.talk .since li {
  display: none;
  font-family: var(--serif);
  font-size: clamp(1.45rem, 3vw, 2.45rem);
  letter-spacing: 0.12em;
  line-height: 1.15;
  text-transform: uppercase;
  color: #fff;
  text-shadow: var(--title-shadow);
}

html.talk .since i {
  font-style: normal;
  padding: 0 0.45em;
}

html.talk .mode-since.is-text .since-text,
html.talk .mode-since.is-verktyg .since-verktyg,
html.talk .mode-since.is-modal .since-modal,
html.talk .mode-since.is-agenter .since-agenter {
  display: block;
}

/* ——— Skapande ——— */

html.talk .rise-wave {
  position: absolute;
  left: 0;
  right: 0;
  top: 36%;
  width: 100%;
  height: 24vh;
  overflow: visible;
}

html.talk .rise-wave path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
}

html.talk .mode-rise h1 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.08em;
  font-size: min(3.4rem, 5vw);
}

html.talk .mode-rise h1 span {
  display: block;
}

@media (max-width: 860px) {
  html.talk .read-hinge,
  html.talk .mode-orient h1 {
    font-size: min(2.4rem, 9vw);
  }

  html.talk .read-list {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.9rem;
  }

  html.talk .read {
    display: block;
    text-align: center;
  }

  html.talk .hallu p.hallu-check {
    white-space: normal;
    text-align: center;
  }

  html.talk .token-row,
  html.talk .guess {
    flex-wrap: wrap;
  }

  html.talk .weight-field {
    grid-template-columns: repeat(4, 1fr);
  }

  html.talk .core-around,
  html.talk .weight-freeze {
    bottom: 9.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.talk .mode-paper .face-inner {
    transition: none;
  }

  html.talk .guess .caret,
  html.talk .mode-write:not(.is-stad) .caret.is-wait,
  html.talk .mode-write.is-stad:not(.is-verb) .tok-stad .caret,
  html.talk .mode-write.is-verb:not(.is-prep) .tok-verb .caret,
  html.talk .mode-write.is-prep:not(.is-land) .tok-prep .caret,
  html.talk .mode-write.is-land .tok-land .caret {
    animation: none;
  }
}
