/* about-accordion-1 — D1/T1/M1 Get to know us (flat CSS; nesting reverted) */

.about-accordion-1 {
  background: var(--color-bg);
  padding: 2.5rem var(--page-gutter) 3.25rem;
  color: var(--color-ink);
}

.about-accordion-1__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

.about-accordion-1__title {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  /* D1: dark indigo script (#000038), large handwriting-style title */
  color: #000038;
  font-size: clamp(2.35rem, 16cqi, 6rem);
  line-height: 0.92;
  font-weight: 700;
}

.about-accordion-1__title.script-title {
  margin-right: -1.2em;
  font-size: calc(var(--text-script) * 1.5);
  line-height: 1.1;
}

.about-accordion-1__title-line {
  display: block;
}

.about-accordion-1__list {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

@container page (max-width: 767px) {
  .about-accordion-1 {
    padding: 1.5rem var(--page-gutter) 2rem;
  }

  .about-accordion-1__title {
    font-size: clamp(2.1rem, 14cqi, 3rem);
    margin-right: 0;
  }

  .about-acc__head {
    font-size: clamp(0.88rem, 3.6cqi, 1rem);
  }
}

@container page (min-width: 768px) {
  .about-accordion-1__title {
    align-items: center;
    text-align: center;
  }
}

@container page (min-width: 1100px) {
  .about-accordion-1__inner {
    grid-template-columns: minmax(8.5rem, 0.2fr) minmax(0, 1fr);
    gap: clamp(1.25rem, 3vw, 2.75rem);
    align-items: start;
  }

  .about-accordion-1__title {
    align-items: flex-start;
    text-align: left;
    font-size: clamp(4.25rem, 8cqi, 6.25rem);
    position: sticky;
    top: calc(var(--editor-status-height, 0px) + 1.25rem + 25px);
  }
}

.about-acc {
  border: 0;
  overflow: visible;
}

.about-acc__head {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  padding: 0.75rem 0.15rem;
  cursor: pointer;
  font-weight: 700;
  font-size: clamp(0.95rem, 2.2cqi, 1.05rem);
  color: #2a3558;
}

.about-acc__head > span:not(.about-timeline__nav) {
  order: 2;
  flex: 1 1 auto;
  min-width: 0;
}

.about-acc__chev {
  order: 1;
  flex: 0 0 auto;
  width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
  border-radius: 0.28rem;
  font-size: 1.25rem;
  line-height: 1;
  color: #2a3558;
  margin-inline: 0;
  transition: transform 0.35s ease, background 0.35s ease, color 0.35s ease;
}

.about-timeline__nav {
  order: 3;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.05rem;
  margin-left: auto;
  color: #3a3a48;
}

.about-timeline__edge {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.85rem;
  line-height: 1;
  width: 1.85rem;
  height: 1.85rem;
  display: none;
  place-items: center;
  opacity: 0;
  transition: opacity 0.6s;
  pointer-events: none;
  user-select: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.about-timeline__edge.is-visible {
  opacity: 0.5;
  pointer-events: auto;
}

.about-timeline__edge.is-visible:hover,
.about-timeline__edge.is-visible:focus-visible {
  opacity: 1;
}

/* Height + fade via grid 0fr→1fr (works with radio :has switching) */
.about-acc__body {
  display: grid;
  grid-template-rows: 0fr;
  padding: 0 0 0 2.15rem;
  color: var(--color-ink-muted, #4a5068);
  transition: grid-template-rows 0.4s ease, padding 0.4s ease;
}

.about-acc__body > * {
  min-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.about-acc__body > p {
  margin: 0;
  max-width: 42rem;
  font-size: 0.95rem;
  line-height: 1.25;
}

.about-acc:has(input:checked) .about-acc__body {
  grid-template-rows: 1fr;
  padding-top: 0.1rem;
  padding-bottom: 1rem;
}

.about-acc:has(input:checked) .about-acc__body > * {
  overflow: visible;
  opacity: 1;
  transition: opacity 0.35s ease 0.08s;
}

.about-acc:has(input:checked) .about-acc__chev {
  transform: rotate(180deg);
  background: #fff;
  color: #111;
}

@container page (min-width: 768px) {
  .about-acc__body {
    padding-left: 2.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .about-acc__body,
  .about-acc__body > *,
  .about-acc__chev,
  .about-timeline__edge,
  .about-timeline__text {
    transition: none;
  }
}

.about-timeline {
  --tl-line: #b8b8c4;
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
}

.about-timeline__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem 0;
  align-items: start;
  position: relative;
  color: var(--color-blue);
}

.about-timeline__item[data-c="blue"] { color: var(--color-blue); --tl-accent: var(--color-blue); }
.about-timeline__item[data-c="green"] { color: var(--color-green); --tl-accent: var(--color-green); }
.about-timeline__item[data-c="yellow"] { color: var(--color-yellow); --tl-accent: var(--color-yellow); }
.about-timeline__item[data-c="orange"] { color: var(--color-orange); --tl-accent: var(--color-orange); }
.about-timeline__item[data-c="red"] { color: var(--color-red); --tl-accent: var(--color-red); }

.about-timeline__item:not(:last-child) .about-timeline__marker::after {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% - 1px);
  width: 2px;
  height: calc(1.25rem + 2px);
  background: var(--tl-line);
  transform: translateX(-50%);
}

.about-timeline__marker {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  z-index: 1;
  color: inherit;
}

.about-timeline__shell {
  position: relative;
  min-width: 0;
  overflow: visible;
  /* Extra space to the viewport’s right edge (gutter + centering slack). */
  --tl-bleed-right: calc(
    var(--page-gutter)
    + max(0px, (100cqw - var(--page-max) - 2 * var(--page-gutter)) / 2)
  );
}

.about-timeline__scroller {
  min-width: 0;
}

.about-timeline__text {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  padding-left: 0.7rem;
  /* Accent from year; text color set separately (not currentColor) */
  border-left: 2px solid var(--tl-accent, currentColor);
  color: #3a3a48;
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  line-height: 1.45;
  text-wrap: balance;
  transition: opacity 0.6s;
}

.about-timeline__year {
  display: grid;
  place-items: center;
}

.about-timeline__year > .flow-shape__bg {
  background: currentColor;
}

.about-timeline__year > .flow-shape__content {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 0.55em 0.7em;
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: #fff;
  line-height: 1;
}

.about-timeline__year--wide {
  display: none;
}

.about-timeline__year--tall {
  width: 3.4rem;
  aspect-ratio: 1 / 2.6;
  min-height: 5.5rem;
}

.about-timeline__year--tall > .flow-shape__content {
  padding: 0.75em 0.35em;
  font-size: 1.05rem;
}

@container page (min-width: 1100px) {
  /* Desktop: years in a row, texts alternating above/below (same as before). */
  .about-timeline {
    --tl-n: 5;
    --tl-gap: 0.85rem;
    display: grid;
    /* Exactly N year columns — no trailing gutter (that caused scroll overshoot). */
    grid-template-columns: repeat(var(--tl-n), minmax(0, 1fr));
    grid-template-rows: minmax(4.5rem, auto) auto minmax(4.5rem, auto);
    column-gap: var(--tl-gap);
    row-gap: 0.85rem;
    align-items: stretch;
    padding: 0.35rem 0 0.15rem;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    overflow: visible;
  }

  /* Column count from .about-acc__body[data-tl-n] */
  .about-acc__body[data-tl-n="4"] .about-timeline { --tl-n: 4; width: 100%; }
  .about-acc__body[data-tl-n="5"] .about-timeline { --tl-n: 5; width: 100%; }
  /*
   * >5 years: shell bleeds to the screen’s right edge; year size stays based on
   * the content column (100% − bleed), so extra viewport space reveals more years.
   */
  .about-acc__body[data-tl-n="6"] .about-timeline__shell,
  .about-acc__body[data-tl-n="7"] .about-timeline__shell,
  .about-acc__body[data-tl-n="8"] .about-timeline__shell,
  .about-acc__body[data-tl-n="9"] .about-timeline__shell,
  .about-acc__body[data-tl-n="10"] .about-timeline__shell {
    width: calc(100% + var(--tl-bleed-right));
  }

  .about-acc__body[data-tl-n="6"] .about-timeline { --tl-n: 6; width: calc((100% - var(--tl-bleed-right)) * 6 / 5); }
  .about-acc__body[data-tl-n="7"] .about-timeline { --tl-n: 7; width: calc((100% - var(--tl-bleed-right)) * 7 / 5); }
  .about-acc__body[data-tl-n="8"] .about-timeline { --tl-n: 8; width: calc((100% - var(--tl-bleed-right)) * 8 / 5); }
  .about-acc__body[data-tl-n="9"] .about-timeline { --tl-n: 9; width: calc((100% - var(--tl-bleed-right)) * 9 / 5); }
  .about-acc__body[data-tl-n="10"] .about-timeline { --tl-n: 10; width: calc((100% - var(--tl-bleed-right)) * 10 / 5); }

  /*
   * >5 years: scroll when years still exceed the (bled) scroller.
   */
  .about-acc:has(input:checked) .about-acc__body[data-tl-n="6"] .about-timeline__scroller,
  .about-acc:has(input:checked) .about-acc__body[data-tl-n="7"] .about-timeline__scroller,
  .about-acc:has(input:checked) .about-acc__body[data-tl-n="8"] .about-timeline__scroller,
  .about-acc:has(input:checked) .about-acc__body[data-tl-n="9"] .about-timeline__scroller,
  .about-acc:has(input:checked) .about-acc__body[data-tl-n="10"] .about-timeline__scroller {
    overflow-x: auto;
    overflow-y: hidden;
    /* proximity + end-align on last year avoids mandatory snap past the final year */
    scroll-snap-type: x proximity;
    scroll-padding-inline: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .about-acc:has(input:checked) .about-acc__body[data-tl-n="6"] .about-timeline__scroller::-webkit-scrollbar,
  .about-acc:has(input:checked) .about-acc__body[data-tl-n="7"] .about-timeline__scroller::-webkit-scrollbar,
  .about-acc:has(input:checked) .about-acc__body[data-tl-n="8"] .about-timeline__scroller::-webkit-scrollbar,
  .about-acc:has(input:checked) .about-acc__body[data-tl-n="9"] .about-timeline__scroller::-webkit-scrollbar,
  .about-acc:has(input:checked) .about-acc__body[data-tl-n="10"] .about-timeline__scroller::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }

  .about-acc:has(input:checked) .about-acc__body[data-tl-n="6"] .about-timeline,
  .about-acc:has(input:checked) .about-acc__body[data-tl-n="7"] .about-timeline,
  .about-acc:has(input:checked) .about-acc__body[data-tl-n="8"] .about-timeline,
  .about-acc:has(input:checked) .about-acc__body[data-tl-n="9"] .about-timeline,
  .about-acc:has(input:checked) .about-acc__body[data-tl-n="10"] .about-timeline {
    overflow: visible;
  }

  .about-timeline::before {
    content: "";
    grid-column: 1 / span var(--tl-n);
    grid-row: 2;
    align-self: center;
    height: 3px;
    margin-inline: 10%;
    width: auto;
    background: var(--tl-line);
    z-index: 0;
    pointer-events: none;
  }

  .about-timeline__item {
    display: contents;
  }

  .about-timeline__item:nth-child(1) > .about-timeline__marker { grid-column: 1; }
  .about-timeline__item:nth-child(2) > .about-timeline__marker { grid-column: 2; }
  .about-timeline__item:nth-child(3) > .about-timeline__marker { grid-column: 3; }
  .about-timeline__item:nth-child(4) > .about-timeline__marker { grid-column: 4; }
  .about-timeline__item:nth-child(5) > .about-timeline__marker { grid-column: 5; }
  .about-timeline__item:nth-child(6) > .about-timeline__marker { grid-column: 6; }
  .about-timeline__item:nth-child(7) > .about-timeline__marker { grid-column: 7; }
  .about-timeline__item:nth-child(8) > .about-timeline__marker { grid-column: 8; }
  .about-timeline__item:nth-child(9) > .about-timeline__marker { grid-column: 9; }
  .about-timeline__item:nth-child(10) > .about-timeline__marker { grid-column: 10; }

  .about-timeline__item:nth-child(1) > .about-timeline__text { grid-column: 1 / span 2; }
  .about-timeline__item:nth-child(2) > .about-timeline__text { grid-column: 2 / span 2; }
  .about-timeline__item:nth-child(3) > .about-timeline__text { grid-column: 3 / span 2; }
  .about-timeline__item:nth-child(4) > .about-timeline__text { grid-column: 4 / span 2; }
  .about-timeline__item:nth-child(5) > .about-timeline__text { grid-column: 5 / span 2; }
  .about-timeline__item:nth-child(6) > .about-timeline__text { grid-column: 6 / span 2; }
  .about-timeline__item:nth-child(7) > .about-timeline__text { grid-column: 7 / span 2; }
  .about-timeline__item:nth-child(8) > .about-timeline__text { grid-column: 8 / span 2; }
  .about-timeline__item:nth-child(9) > .about-timeline__text { grid-column: 9 / span 2; }
  .about-timeline__item:nth-child(10) > .about-timeline__text { grid-column: 10 / span 2; }

  /* Last text must not create an implicit extra column (scroll past last year). */
  .about-timeline__item:last-child > .about-timeline__text {
    grid-column: var(--tl-n) / span 1;
  }

  .about-timeline__item[data-side="below"] .about-timeline__marker::before {
    top: calc(100% - 3px);
    border-top: 10px solid currentColor;
  }

  .about-timeline__item[data-side="below"] .about-timeline__text {
    grid-row: 3;
    align-self: start;
    padding-top: 0.15rem;
  }

  .about-timeline__item[data-side="above"] .about-timeline__marker::before {
    bottom: calc(100% - 3px);
    border-bottom: 10px solid currentColor;
  }

  .about-timeline__item[data-side="above"] .about-timeline__text {
    grid-row: 1;
    align-self: end;
    padding-bottom: 0.15rem;
  }

  .about-timeline__marker {
    grid-row: 2;
    justify-self: stretch;
    align-self: center;
    width: 100%;
    max-width: none;
    scroll-snap-align: start;
    scroll-snap-stop: normal;
  }

  .about-timeline__item:last-child > .about-timeline__marker {
    scroll-snap-align: end;
  }

  .about-timeline__marker::before {
    content: "";
    position: absolute;
    left: 0.7rem;
    z-index: 2;
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    pointer-events: none;
  }

  .about-timeline__marker::after {
    display: none;
  }

  .about-timeline__text {
    margin: 0;
    padding-left: 0.75rem;
    border-left: 2px solid var(--tl-accent, currentColor);
    border-top: 0;
    border-bottom: 0;
    justify-self: stretch;
    width: auto;
    max-width: none;
  }

  .about-timeline__year--tall {
    display: none;
  }

  .about-timeline__year--wide {
    display: grid;
    width: 100%;
    aspect-ratio: 3.4 / 1;
    min-height: 3.1rem;
  }

  .about-timeline__year--wide > .flow-shape__content {
    padding: 0.7em 0.85em;
    font-size: clamp(0.9rem, 2cqi, 1.1rem);
    color: #fff;
  }
}

@container page (min-width: 1100px) {
  .about-timeline {
    --tl-gap: 1rem;
  }

  .about-timeline__year--wide {
    aspect-ratio: 3.6 / 1;
    min-height: 3.25rem;
  }

  .about-timeline__year--wide > .flow-shape__content {
    padding: 0.8em 0.95em 1.15em 0.95em;
    font-size: clamp(0.95rem, 1.8cqi, 1.15rem);
  }
}

html[data-theme="dark"] .about-accordion-1__title {
  color: #7b8fe8;
}

html[data-theme="dark"] .about-acc__head {
  color: #9aa6c8;
}

html[data-theme="dark"] .about-acc__body {
  color: #a8aec0;
}

html[data-theme="dark"] .about-timeline {
  --tl-line: #4a4a58;
}

html[data-theme="dark"] .about-timeline__text {
  color: #c5c5d0;
}

html[data-theme="dark"] .about-acc:has(input:checked) .about-acc__chev {
  background: #fff;
  color: #111;
}

html[data-theme="dark"] .about-timeline__nav {
  color: #c5c5d0;
}
