/* The closing surface carries the same rails and measured type as the entry. */
html.hann-story-active #end-section {
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  visibility: hidden;
}
/* The exiting source frame and the native paper share the same scroll colour. */
html.hann-frame-transfer-active[data-hann-extra-mode='home'],
html.hann-frame-transfer-active[data-hann-extra-mode='home'] body {
  background-color: var(--hann-footer-background, #fff);
}
/* UI/controls stay above the frame; its duplicate paper cannot cut the contour. */
html.hann-frame-transfer-active[data-hann-extra-mode='home'] #footer-bg {
  background-color: transparent;
}
html.hann-frame-transfer-active[data-hann-extra-mode='home'] #footer-section {
  color: var(--hann-footer-ink, #000);
}
#footer-middle {
  row-gap: clamp(48px, 5vw, 128px);
  padding-top: 32px;
  border-top: 1px solid var(--hann-line, #dcdde5);
}
/* Keep the received paper surface; scrolling foreground leaves below the fixed header. */
#footer-middle[data-hann-footer-reading='true'],
#footer-bottom[data-hann-footer-reading='true'] {
  clip-path: inset(var(--hann-footer-reading-inset, 0px) 0 0 0);
  -webkit-clip-path: inset(var(--hann-footer-reading-inset, 0px) 0 0 0);
}
/* Each destination has a complete, easily reached row. */
#footer-contact-socials {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  gap: 24px clamp(24px, 3vw, 56px);
  padding-bottom: clamp(24px, 3vw, 64px);
}
#footer-contact-socials .footer-socials-line-wrapper {
  width: 100%;
  max-width: 100%;
  margin: 0;
}
#footer-contact-socials .footer-socials-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 60px;
  padding: 20px 0;
  border-top: 1px solid var(--hann-line, #dcdde5);
  text-decoration: none;
  color: inherit;
  font-family: var(--hann-display-font, sans-serif);
  font-weight: var(--hann-display-weight, 500);
  font-size: clamp(24px, 2vw, 48px);
  line-height: 1.1;
  letter-spacing: var(--hann-display-tracking, -0.04em);
}
#footer-contact-socials .footer-socials-text {
  transform: none;
  transition: none;
}
#footer-contact-socials .footer-socials-line-svg {
  position: static !important;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  order: 1;
  transform: none;
  transition: transform 150ms;
}
#footer-contact-socials .footer-socials-line:hover .footer-socials-line-svg {
  transform: translate3d(2px, -2px, 0);
}
#footer-contact-address {
  font-family: var(--hann-ui-font, sans-serif);
  font-size: clamp(18px, 1.35vw, 32px);
  line-height: 1.5;
  letter-spacing: -0.02em;
}
#footer-contact-address:hover .footer-address-line-wrapper {
  transform: none;
}
#footer-contact-enquires,
#footer-contact-business {
  display: none !important;
}
/* The native up button must fit inside the row that receives the header clip. */
#footer-bottom {
  min-height: 3.75em;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--hann-line, #dcdde5);
}
#footer-bottom-up {
  bottom: 0;
  border: 0;
  padding: 0;
  font: inherit;
}
html[data-hann-extra-mode='home'] #footer-section,
html[data-hann-extra-mode='projects'] #footer-section {
  padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
}
#scroll-nav-section[hidden] {
  display: none;
}
/* The native reveal wrapper clips its line box; Inter Tight's y extends .068em below a 1em line. */
#footer-newsletter-header {
  font-family: var(--hann-display-font, sans-serif);
  font-size: clamp(56px, 7.8vw, 176px);
  line-height: 1.2;
  letter-spacing: var(--hann-display-tracking, -0.04em);
}
#footer-newsletter-input {
  height: auto;
  margin-top: 24px;
  max-width: none;
}
#footer-newsletter-bg {
  display: none;
}
#footer-newsletter-feedback-message {
  margin: 0;
}
.hann-terminal-action {
  display: inline-flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  min-height: 48px;
  width: auto !important;
  padding: 8px 0 !important;
  background: none !important;
  border-radius: 0 !important;
  border-bottom: 1px solid currentColor;
  font-family: var(--hann-ui-font, sans-serif);
  font-size: clamp(20px, 1.6vw, 40px);
  line-height: 1.4;
  text-decoration: none;
}
.hann-terminal-action svg {
  width: 1em;
  height: 1em;
}
/* Before launch the app slot keeps its type and underline but is not a link. */
.hann-app-status {
  margin: 0;
  cursor: default;
}
.hann-footer-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px 48px;
}
/* The received Next Page row lives in the existing footer and follows real input. */
#hann-footer-products-link {
  display: none;
  grid-column: 9 / span 3;
  grid-row: 1;
  justify-self: end;
  align-items: center;
  flex: 0 1 300px;
  width: min(100%, 300px);
  min-width: 200px;
  max-width: 300px;
  min-height: 48px;
  padding: 8px 0;
  color: inherit;
  font: clamp(12px, 0.9vw, 24px)/1.4 var(--hann-mono-font, monospace);
  text-transform: uppercase;
  text-decoration: none;
}
html[data-hann-extra-mode='home'] #footer-bottom-labs {
  grid-column: 7 / span 2;
}
html[data-hann-extra-mode='home'] #footer-bottom-tagline {
  display: none;
}
html[data-hann-extra-mode='home'] #hann-footer-products-link {
  display: flex;
}
.hann-footer-next-text {
  white-space: nowrap;
}
.hann-footer-next-bar {
  position: relative;
  flex-grow: 1;
  height: 1px;
  margin: 0 1em;
}
.hann-footer-next-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0.18;
}
.hann-footer-next-bar-inner {
  display: block;
  width: 100%;
  height: 100%;
  background: currentColor;
  transform: scaleX(var(--hann-footer-progress, 0));
  transform-origin: 0 0;
}
.hann-footer-next-arrow {
  width: 1.2em;
  height: 1.2em;
  flex-shrink: 0;
}
.hann-footer-next-arrow svg {
  display: block;
  width: 100%;
  height: 100%;
}
.hann-footer-actions a:focus-visible,
#hann-footer-products-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 6px;
}
@media (max-width: 1000px) {
  html[data-hann-extra-mode='home'] #footer-bottom-copyright {
    min-height: 3.75em;
    align-content: center;
  }
  html[data-hann-extra-mode='home'] #footer-bottom-labs {
    grid-column: 1 / span 6;
  }
  #hann-footer-products-link {
    grid-column: 1 / span 6;
    grid-row: 2;
  }
}
@media (max-width: 812px) {
  #footer-contact-socials {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-bottom: 24px;
  }
  #footer-contact-socials .footer-socials-line {
    min-height: 64px;
    padding: 20px 0;
    font-size: 24px;
    gap: 12px;
  }
  #footer-contact-socials .footer-socials-line-svg {
    width: 20px;
    height: 20px;
  }
  #footer-newsletter-header {
    font-size: 56px;
  }
  #footer-middle {
    row-gap: 40px;
    padding-top: 24px;
  }
  html[data-hann-extra-mode='home'] #footer-section,
  html[data-hann-extra-mode='projects'] #footer-section {
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
  .hann-footer-actions {
    gap: 16px 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #footer-contact-socials .footer-socials-line-svg {
    transition: none;
  }
}

/* Both slots belong to the native persistent extras; only the current route reveals them. */
#hann-home-footer-frame,
#hann-projects-ending-frame,
#hann-projects-ending-actions {
  display: none;
}
/* Park the existing closing frame beside the Home brand; app/social rows can grow. */
html[data-hann-extra-mode='home'] #hann-home-footer-frame {
  display: block;
  grid-column: 8 / span 5;
  grid-row: 1;
  align-self: start;
  width: 100%;
  aspect-ratio: var(--hann-source-frame-aspect, 1914000 / 1078974);
}
html[data-hann-extra-mode='home'] #footer-top {
  flex-grow: 0;
}
html[data-hann-extra-mode='home'] #footer-middle-contact {
  grid-row: 1;
}
html[data-hann-extra-mode='home'] #footer-middle-newsletter {
  grid-column: 1 / -1;
  grid-row: 2;
}
html[data-hann-extra-mode='home'] #footer-contact-socials {
  grid-row: 3;
}
@media (max-width: 1000px) {
  html[data-hann-extra-mode='home'] #hann-home-footer-frame {
    grid-column: 4 / span 3;
  }
  html[data-hann-extra-mode='home'] #footer-middle-contact {
    grid-column: 1 / span 3;
    grid-template-columns: minmax(0, 1fr);
    row-gap: 24px;
  }
  html[data-hann-extra-mode='home'] #footer-contact-address {
    grid-column: 1;
  }
}

/* Retain the received 2.5H reveal/hold before the ending's natural reading height. */
html[data-hann-extra-mode='projects'] #end-section {
  color: var(--hann-graphite, #151828);
  display: block;
  height: auto;
  min-height: calc(var(--vh, 1vh) * 350);
  padding: 0 0 calc(var(--vh, 1vh) * 250);
}
html[data-hann-extra-mode='projects'] #end-section-outer {
  position: relative;
  height: auto;
  min-height: calc(var(--vh, 1vh) * 100);
}
html[data-hann-extra-mode='projects'] #end-section-outer:has([data-hann-ending-layout='sequence']) {
  height: calc(var(--vh, 1vh) * 100);
}
html[data-hann-extra-mode='projects'] #end-section-inner {
  position: relative;
  height: auto;
}
html[data-hann-extra-mode='projects'] #end-section-content {
  position: relative;
  left: auto;
  top: auto;
  transform: none !important;
  margin: auto;
  box-sizing: border-box;
  width: min(100%, 1600px);
  padding: clamp(112px, 7vw, 240px) var(--base-padding-x, 32px) 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
html[data-hann-extra-mode='projects'] #end-section-subtitle {
  width: auto;
  max-width: 36em;
  font-size: clamp(16px, 1.2vw, 28px);
  line-height: 1.4;
}
html[data-hann-extra-mode='projects'] #end-section-title {
  --font-size: clamp(44px, 5vw, 128px);
  margin: 16px auto 0;
  max-width: 100%;
}
html[data-hann-extra-mode='projects'] #end-section-subtitle,
html[data-hann-extra-mode='projects'] #end-section-title {
  clip-path: inset(var(--hann-ending-reading-inset, 0px) 0 0 0);
  -webkit-clip-path: inset(var(--hann-ending-reading-inset, 0px) 0 0 0);
}
html[data-hann-extra-mode='projects'] #end-section-content-crosses,
html[data-hann-extra-mode='projects'] #end-bottom {
  display: none;
}
#hann-projects-ending-frame {
  position: relative;
  top: var(--hann-projects-ending-frame-y, 0px);
  width: min(100%, var(--hann-projects-ending-frame-width, 100%));
  height: auto;
  aspect-ratio: 1914000 / 1078974;
  margin-top: 40px;
  flex-shrink: 0;
}
#hann-projects-ending-actions {
  flex-direction: column;
  align-items: center;
  gap: 24px;
  margin-top: 40px;
  color: var(--hann-graphite, #151828);
}
html[data-hann-extra-mode='projects'] #hann-projects-ending-frame {
  display: block;
}
html[data-hann-extra-mode='projects'] #hann-projects-ending-actions {
  display: flex;
}
#hann-projects-ending-actions .hann-terminal-action {
  font-size: clamp(20px, 1.6vw, 40px);
  min-height: 48px;
}
.hann-projects-ending-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 32px;
  font-family: var(--hann-ui-font, sans-serif);
  font-size: clamp(16px, 1.15vw, 28px);
}
.hann-projects-ending-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: inherit;
  text-underline-offset: 4px;
}
@media (max-width: 812px) {
  html[data-hann-extra-mode='projects'] #end-section-content {
    padding: 112px 24px 48px;
  }
  html[data-hann-extra-mode='projects'] .hann-ending-tagline-part {
    display: block;
  }
  html[data-hann-extra-mode='projects'] #end-section-title {
    --font-size: 40px;
    margin-top: 16px;
  }
  #hann-projects-ending-frame {
    margin-top: 24px;
  }
  #hann-projects-ending-actions {
    margin-top: 24px;
    gap: 12px;
  }
  .hann-projects-ending-links {
    gap: 8px 24px;
  }
}
@media (max-height: 450px) {
  html[data-hann-extra-mode='projects'] #end-section-content {
    padding-top: 88px;
  }
  html[data-hann-extra-mode='projects'] #end-section-title {
    --font-size: 36px;
  }
}
