/* Bootstrap 5 is the sole framework; all custom presentation lives here. */
:root {
  color-scheme: dark;
  --space-indigo: #20243e;
  --ivory: #f2efe6;
  --muted: #b7bdcf;
  --accent: #a8c9c6;
  --rule: #444a64;
  --mono: Consolas, "SFMono-Regular", "Liberation Mono", monospace;
  --page-height: 100vh;
  --section-inset: clamp(18px, 4vh, 40px);
  --content-inset: clamp(12px, 2.5vh, 30px);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --bs-body-bg: var(--space-indigo);
  --bs-body-color: var(--ivory);
  --bs-body-font-family: "Segoe UI", Arial, sans-serif;
  --bs-link-color-rgb: 242, 239, 230;
  --bs-link-hover-color-rgb: 168, 201, 198;
}

/* One viewport and one scroll owner keep nested carousel snapping independent.
   Scrolling this element does not drive the document's mobile toolbar collapse. */
@supports (height: 100dvh) {
  :root {
    --page-height: 100dvh;
  }
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  -webkit-font-smoothing: antialiased;
}

.page-scroller {
  height: var(--page-height);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
}

.page-section {
  min-height: 100%;
  scroll-snap-align: start;
}

.section-shell {
  height: var(--page-height);
  min-height: min-content;
  display: flex;
  flex-direction: column;
}

.section-shell--inset {
  padding-top: var(--section-inset);
}

.section-heading, .section-footer {
  flex-shrink: 0;
}

.section-heading {
  gap: 20px;
}

.section-heading .eyebrow {
  margin: 0;
}

.section-content {
  flex: 1;
  padding-block: var(--content-inset);
}

.section-footer {
  border-top: 1px solid var(--rule);
  gap: 20px;
}

.section-footer a span {
  margin-left: 12px;
  color: var(--accent);
}

::selection {
  background: var(--accent);
  color: var(--space-indigo);
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

a:focus-visible, button:focus-visible, .apps-track:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
}

.page-width {
  width: calc(100% - clamp(40px, 12vw, 192px));
  max-width: 1320px;
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 24px;
  padding: 12px 20px;
  background: var(--ivory);
  color: var(--space-indigo);
  z-index: 10;
}

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

/* Shared typography and controls. */
h1 {
  margin: 24px 0 22px -4px;
  font-size: clamp(54px, 6.3vw, 94px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -5px;
}

h2 {
  font-size: clamp(38px, 4.5vw, 68px);
  line-height: 1.12;
  letter-spacing: -2.5px;
  font-weight: 400;
  margin-bottom: 28px;
}

h2 > span {
  color: var(--accent);
}

.eyebrow,
.section-coordinate,
.bottom-note,
.portrait-label,
.portrait figcaption,
.channel-label,
.site-footer,
.research-tags {
  font-family: var(--mono);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.icon-button {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: transparent;
  color: var(--ivory);
  border: 1px solid var(--rule);
  transition: background .2s ease, border-color .2s ease;
}

.icon-button:hover:not(:disabled) {
  background: #a8c9c60c;
  border-color: var(--accent);
}

.hero, .contact-content {
  --bs-gutter-x: 0;
}

.apps, .contact {
  box-shadow: inset 0 1px var(--rule);
}

/* Three in-flow rows keep the scroll cue at the viewport edge without clipping content. */
.landing {
  background-image: linear-gradient(#a8c9c608 1px, transparent 1px), linear-gradient(90deg, #a8c9c608 1px, transparent 1px);
  background-size: 80px 80px;
}

.site-header {
  min-height: 88px;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}

.wordmark {
  font-family: var(--mono);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -2px;
}

.wordmark span {
  color: var(--accent);
}

.site-header nav {
  gap: 32px;
}

.nav-link {
  padding: 12px 0;
  color: var(--ivory);
  font-size: 12px;
}

.nav-index {
  color: var(--muted);
  font-family: var(--mono);
  margin-right: 8px;
  font-size: 10px;
}

.nav-link:hover, .nav-link:focus {
  color: var(--accent);
}

.hero {
  flex: 1;
  padding-block: 36px;
}

.hero-copy {
  padding-right: 7%;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  flex-shrink: 0;
}

.name-period {
  color: var(--accent);
}

.hero-line {
  font-size: clamp(23px, 2.6vw, 37px);
  font-weight: 300;
  line-height: 1.35;
  letter-spacing: -.8px;
  margin-bottom: 24px;
}

.hero-line > span {
  color: var(--muted);
}

.intro {
  max-width: 455px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.85;
  margin-bottom: 27px;
}

.research-tags {
  gap: 10px 18px;
  font-size: 10px;
  color: var(--accent);
  margin: 0;
}

.research-tags li::before {
  content: '/';
  margin-right: 8px;
  color: var(--muted);
}

.portrait-column {
  padding-left: 25px;
}

.portrait {
  max-width: 370px;
  margin: 0 0 0 auto;
}

.portrait-label {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 1.5px;
  padding-bottom: 12px;
}

.portrait-frame {
  position: relative;
  border: 1px solid var(--rule);
  padding: 8px;
}

.portrait-frame::before, .portrait-frame::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  pointer-events: none;
}

.portrait-frame::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
}

.portrait-frame::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  max-height: 53vh;
  max-height: 53svh;
  object-fit: cover;
  object-position: center 24%;
  filter: saturate(.55);
}

.portrait figcaption {
  margin-top: 13px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .3px;
}

.crosshair {
  color: var(--accent);
  margin-right: 8px;
}

.landing-bottom {
  position: relative;
  min-height: 86px;
  border-top: 1px solid var(--rule);
  flex-shrink: 0;
}

.section-coordinate, .bottom-note {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 1px;
}

.scroll-cue {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 9px 14px;
  font-size: 10px;
  font-family: var(--mono);
}

.scroll-arrow {
  display: block;
  font-size: 26px;
  line-height: 1.15;
  color: var(--accent);
  transition: transform .2s ease;
}

.scroll-cue:hover .scroll-arrow {
  transform: translateY(4px);
}

/* Apps: a horizontal strip within the full-height vertical section. */
.apps {
  background: #1d223b;
}

.apps-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.apps-heading {
  flex-shrink: 0;
  gap: 20px;
  margin-bottom: 24px;
}

.apps-heading h2 {
  font-size: clamp(36px, 4vw, 60px);
  margin-bottom: 12px;
}

.apps-intro {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 0;
}

.carousel-controls {
  display: flex;
  align-items: center;
  gap: 18px;
}

.carousel-arrow:disabled {
  opacity: .3;
  cursor: default;
}

.carousel-position,
.app-card-top,
.carousel-hint,
.apps-footer,
.app-dialog-footer {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}

.apps-track {
  --card-width: 64%;
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 7px;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding: 7px;
  margin: -7px;
}

.apps-track::-webkit-scrollbar {
  display: none;
}

/* Let the browser choose the gesture axis: sideways changes apps, vertical changes sections. */
.apps-track, .app-open {
  touch-action: pan-x pan-y pinch-zoom;
}

.apps-track.is-navigating {
  scroll-snap-type: none;
}

.app-card {
  --card-inset: 24px;
  position: relative;
  flex: 0 0 var(--card-width);
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--rule);
  background: var(--space-indigo);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  transition: border-color .25s ease, background .25s ease, opacity .25s ease;
}

.app-card:last-child {
  scroll-snap-align: end;
}

.app-card.is-current {
  border-color: #a8c9c680;
  background: #252b46;
}

.app-card:not(.is-current) {
  opacity: .78;
}

.app-card:hover, .app-card:focus-within {
  border-color: var(--accent);
  opacity: 1;
}

.app-card-top {
  display: flex;
  justify-content: space-between;
  padding: 18px var(--card-inset) 0;
  letter-spacing: 1px;
}

.app-card-top > span:last-child {
  font-size: 18px;
  color: var(--accent);
  transition: transform .25s ease;
}

.app-card:hover .app-card-top > span:last-child {
  transform: translate(2px, -2px);
}

.app-preview {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 8px 24px;
}

.watch-preview {
  container-type: size;
}

.watch-preview watch-dial {
  width: min(100cqw, 100cqh);
  pointer-events: none;
  transition: transform .35s var(--ease-out);
}

.app-card-bottom {
  padding: 12px var(--card-inset) 18px;
}

.app-card h3 {
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -.4px;
}

.app-card-bottom p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.app-open {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.app-open:focus-visible {
  outline-offset: 3px;
}

.placeholder-preview {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  background-image: linear-gradient(#a8c9c606 1px, transparent 1px), linear-gradient(90deg, #a8c9c606 1px, transparent 1px);
  background-size: 40px 40px;
  margin: 14px 24px 0;
}

.placeholder-cross {
  font-family: var(--mono);
  font-size: 35px;
  color: var(--accent);
  font-weight: 300;
}

.placeholder-preview h3 {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 14px;
}

.carousel-hint {
  flex-shrink: 0;
  margin: 18px 0 0;
  font-size: 9px;
  letter-spacing: 1px;
}

.carousel-hint span {
  margin-inline: 12px;
  color: var(--accent);
}

.carousel-pagination {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.carousel-dot {
  width: 32px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  transition: width .3s var(--ease-out);
}

.carousel-dot::after {
  content: '';
  display: block;
  height: 2px;
  background: var(--rule);
  transition: background .2s ease;
}

.carousel-dot[aria-current="true"] {
  width: 64px;
}

.carousel-dot[aria-current="true"]::after, .carousel-dot:hover::after {
  background: var(--accent);
}

.apps-footer {
  padding-block: 23px;
}

/* Contact channels share their layout whether a link or a placeholder. */
.contact {
  background: #1a1e35;
}

.contact-content {
  align-content: center;
}

.contact-intro {
  color: var(--muted);
  max-width: 410px;
  font-size: 15px;
  line-height: 1.85;
  padding-right: 20px;
}

.contact-channels {
  padding-left: 45px;
  padding-top: 10px;
}

.contact-row {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding-block: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.channel-label {
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 1px;
}

.contact-value {
  font-size: clamp(19px, 2vw, 27px);
  overflow-wrap: anywhere;
}

.conversation-topics {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
  margin-top: 40px;
}

.conversation-topics .channel-label {
  display: block;
  margin-bottom: 12px;
}

.site-footer {
  min-height: 80px;
  padding-block: 20px;
  color: var(--muted);
  font-size: 9px;
}

/* A native modal keeps focus and keyboard navigation inside the active app. */
html.app-is-open .page-scroller {
  overflow: hidden;
  scroll-snap-type: none;
  scroll-behavior: auto;
}

.app-dialog {
  --expand-duration: 520;
  --dialog-inset: clamp(20px, 5vw, 80px);
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: var(--page-height);
  max-height: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--rule);
  color: var(--ivory);
  background: var(--space-indigo);
  transform-origin: top left;
  overflow: auto;
  overscroll-behavior: contain;
}

.app-dialog[open] {
  display: flex;
  flex-direction: column;
}

.app-dialog::backdrop {
  background: #111426b8;
}

.app-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 22px var(--dialog-inset);
  border-bottom: 1px solid var(--rule);
}

.app-dialog-header .eyebrow {
  font-size: 9px;
  margin-bottom: 8px;
}

.app-dialog-header h2 {
  font-size: 23px;
  margin: 0;
  letter-spacing: -.6px;
}

.app-close {
  font-size: 28px;
  line-height: 1;
}

.app-stage {
  flex: 1;
  min-height: 160px;
  display: grid;
  place-items: center;
  padding: 16px;
}

.app-stage watch-dial {
  width: min(80vw, calc(var(--page-height) - 220px));
  min-width: 140px;
  max-width: 760px;
}

.dialog-placeholder {
  text-align: center;
}

.dialog-placeholder p {
  font-family: var(--mono);
  font-size: clamp(20px, 3vw, 40px);
  color: var(--muted);
  margin-top: 20px;
}

.app-dialog-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px var(--dialog-inset);
  border-top: 1px solid var(--rule);
}

.app-dialog-footer p {
  margin: 0;
}

/* Responsive layout: width adjustments first, then compact viewport heights. */
@media (max-width: 991.98px) {
  .hero-copy {
    padding-right: 3%;
  }

  .portrait-column {
    padding-left: 20px;
  }

  h1 {
    letter-spacing: -3px;
  }

  .contact-channels {
    padding-left: 24px;
  }
}

@media (max-width: 767.98px) {
  .site-header {
    min-height: 70px;
  }

  .site-header nav {
    gap: 16px;
  }

  .nav-index {
    display: none;
  }

  .hero {
    padding-block: 25px;
    row-gap: 24px;
  }

  .hero-copy {
    padding-right: 0;
  }

  h1 {
    font-size: clamp(46px, 10vw, 66px);
    margin-block: 15px;
  }

  .hero-line {
    font-size: 23px;
    margin-bottom: 16px;
  }

  .intro {
    max-width: 100%;
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 18px;
  }

  .research-tags {
    gap: 8px 12px;
    font-size: 9px;
  }

  .portrait-column {
    padding-left: 0;
  }

  .portrait {
    width: 150px;
  }

  .portrait img {
    aspect-ratio: 1;
  }

  .portrait-label {
    font-size: 8px;
    padding-bottom: 6px;
  }

  .portrait figcaption {
    display: none;
  }

  .landing-bottom {
    min-height: 78px;
  }

  .bottom-note {
    display: none;
  }

  .section-coordinate {
    font-size: 8px;
  }

  .section-heading > .section-coordinate {
    display: none;
  }

  .footer-note {
    display: none;
  }

  .contact h2 {
    font-size: clamp(30px, 8vw, 38px);
    margin-bottom: 16px;
  }

  .contact-intro {
    font-size: 14px;
    line-height: 1.65;
    padding-right: 0;
    margin-bottom: 0;
  }

  .contact-channels {
    padding: 18px 0 0;
  }

  .contact-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-block: 18px;
  }

  .contact-value {
    font-size: 18px;
  }

  .conversation-topics {
    margin-top: 20px;
    margin-bottom: 0;
  }

  .conversation-topics .channel-label {
    margin-bottom: 6px;
  }

  .site-footer {
    min-height: 58px;
    padding-block: 14px;
  }

  .apps-track {
    --card-width: 87%;
    gap: 16px;
  }

  .app-card {
    --card-inset: 16px;
  }

  .apps-heading {
    margin-bottom: 20px;
  }

  .app-dialog-footer > span {
    display: none;
  }
}

@media (min-width: 768px) and (max-height: 700px) {
  .site-header {
    min-height: 68px;
  }

  .hero {
    padding-block: 24px;
  }

  h1 {
    margin-block: 16px;
    font-size: 64px;
  }

  .hero-line {
    font-size: 26px;
    margin-bottom: 16px;
  }

  .intro {
    font-size: 13px;
    margin-bottom: 18px;
  }

  .landing-bottom {
    min-height: 70px;
  }
}

@media screen and (max-height: 700px) {
  .contact h2 {
    font-size: 32px;
    margin-bottom: 14px;
  }

  .contact-row {
    padding-block: 12px;
    gap: 8px;
  }

  .contact-intro {
    font-size: 13px;
    line-height: 1.6;
  }

  .conversation-topics {
    margin-top: 14px;
    margin-bottom: 0;
  }

  .conversation-topics .channel-label {
    margin-bottom: 6px;
  }

  .site-footer {
    min-height: 54px;
    padding-block: 12px;
  }

  .apps-heading {
    gap: 12px;
    margin-bottom: 16px;
  }

  .apps-heading h2 {
    font-size: 32px;
    margin-bottom: 6px;
  }

  .apps-intro {
    font-size: 12px;
  }

  .carousel-hint {
    margin-top: 6px;
  }

  .carousel-pagination {
    margin-top: 8px;
  }

  .apps-footer {
    padding-block: 14px;
  }

  .app-card-top {
    padding-top: 10px;
  }

  .app-card-bottom {
    padding-block: 8px;
  }
}

@media screen and (max-height: 500px) {
  :root {
    --section-inset: 12px;
    --content-inset: 10px;
  }

  .apps-heading {
    margin-bottom: 12px;
  }

  .apps-intro, .carousel-hint {
    display: none;
  }

  .apps-heading h2 {
    margin: 0;
  }

  .app-card-top {
    padding-top: 6px;
  }

  .app-card-bottom p {
    display: none;
  }

  .app-card-bottom h3 {
    margin: 0;
  }

  .apps-footer {
    padding-block: 10px;
  }
}

/* Compact the hero only where its stacked content would exceed one screen. */
@media screen and (max-width: 767.98px) and (max-height: 700px), screen and (min-width: 768px) and (max-height: 500px) {
  .hero-line {
    font-size: 20px;
    margin-bottom: 12px;
  }

  .intro {
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 12px;
  }
}

@media screen and (max-width: 767.98px) and (max-height: 700px) {
  .site-header {
    min-height: 60px;
  }

  .hero {
    padding-block: 12px;
    row-gap: 12px;
  }

  .hero h1 {
    font-size: 42px;
    margin-block: 12px;
  }

  .portrait {
    width: 96px;
  }

  .landing-bottom {
    min-height: 68px;
  }
}

@media screen and (min-width: 768px) and (max-height: 500px) {
  .site-header {
    min-height: 48px;
  }

  .hero {
    padding-block: 6px;
  }

  .hero h1 {
    font-size: 46px;
    margin-block: 10px;
  }

  .hero .eyebrow {
    margin-bottom: 10px;
  }

  .landing-bottom {
    min-height: 50px;
  }

  .scroll-cue {
    flex-direction: row;
    gap: 12px;
  }
}

/* Optional motion. Keep all content visible when enhancement is unsupported. */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .app-card:hover .watch-preview watch-dial {
    transform: scale(1.025);
  }

  .carousel-arrow:active:not(:disabled) {
    transform: scale(.92);
  }
}

@media screen and (prefers-reduced-motion: no-preference) {
  .page-scroller {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
  }

  .page-section {
    scroll-snap-stop: always;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-copy, .portrait {
    animation: enter .65s ease-out both;
  }

  .portrait {
    animation-delay: .1s;
  }

  @keyframes enter {
    from {
      opacity: 0;
      transform: translateY(10px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* Progressive enhancement: unsupported browsers keep all content fully visible.
   The section owns the timeline so movement of its children cannot shift it. */
@supports (animation-timeline: view()) and (animation-range: entry 0% entry 100%) {
  @media screen and (min-width: 992px) and (min-height: 650px) and (prefers-reduced-motion: no-preference) {
    .contact {
      view-timeline-name: --contact-entry;
      view-timeline-axis: block;
    }

    .contact-content > div {
      animation: contact-arrive 1s linear both;
      animation-timeline: --contact-entry;
      animation-range: entry 0% entry 100%;
    }

    .contact-content > .contact-channels {
      animation-range: entry 12% entry 100%;
    }

    @keyframes contact-arrive {
      from {
        opacity: .65;
        transform: translateY(24px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Print restores document flow and exposes every app preview. */
@media print {
  :root {
    --ivory: #20243e;
    --muted: #444a64;
    --accent: #355d59;
    --rule: #ccc;
    --bs-body-bg: #fff;
    color-scheme: light;
  }

  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }

  .page-section {
    background: white;
  }

  html, body {
    height: auto;
    overflow: visible;
  }

  .page-scroller {
    height: auto;
    overflow: visible;
  }

  .page-section, .section-shell {
    height: auto;
    min-height: auto;
  }

  .site-header nav, .landing-bottom, .site-footer a {
    display: none !important;
  }

  .hero-copy {
    width: 65%;
  }

  .portrait-column {
    width: 35%;
  }

  .contact-content {
    padding-block: 30px;
  }

  .section-shell--inset {
    padding-top: 30px;
  }

  .apps-track {
    display: block;
    overflow: visible;
  }

  .apps .app-card {
    height: 300px;
    break-inside: avoid;
    margin-bottom: 20px;
    background: white;
    opacity: 1 !important;
  }

  .app-dialog, .carousel-controls, .carousel-pagination, .carousel-hint, .app-open {
    display: none !important;
  }
}
