/* Shared finishing layer for Norelyn pages. */

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 4px;
}

::selection {
  background: color-mix(in srgb, var(--accent, #1b4f4d) 24%, transparent);
}

/* Locale-aware system font stacks keep CJK pages from borrowing the wrong glyph set. */
html:lang(zh-Hant) body {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

html:lang(zh-Hans) body {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

html:lang(ja) body {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", sans-serif;
}

html:lang(ko) body {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}

html:lang(zh-Hant),
html:lang(zh-Hans),
html:lang(ja),
html:lang(ko) {
  line-break: strict;
  word-break: normal;
}

html:lang(de) .hero h1,
html:lang(fr) .hero h1,
html:lang(es) .hero h1,
html:lang(pt-BR) .hero h1,
html:lang(it) .hero h1 {
  letter-spacing: -0.035em;
}

.site-header {
  transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.site-header .brand {
  min-width: 0;
}

.site-header .brand img {
  flex: 0 0 auto;
}

.nav {
  gap: clamp(16px, 2.1vw, 28px);
}

.nav > a {
  position: relative;
  white-space: nowrap;
  transition: color .16s ease, opacity .16s ease;
}

.nav > a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -7px;
  height: 1px;
  background: currentColor;
  opacity: .55;
  transition: right .18s ease;
}

.nav > a:hover::after,
.nav > a:focus-visible::after {
  right: 0;
}

.menu-button {
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
}

.status,
.status.building,
.status.experimental,
.status.planned,
.status.connected {
  width: fit-content;
  min-height: 24px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  border: 1px solid color-mix(in srgb, currentColor 24%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 7%, transparent);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .035em;
}

.status.building { color: #5f6e93; }

body:not([data-page="naw"]) .hero {
  padding-top: clamp(64px, 7vw, 88px);
  padding-bottom: clamp(78px, 8vw, 104px);
}

body:not([data-page="naw"]) .hero h1 {
  text-wrap: balance;
}

body:not([data-page="naw"]) .hero-description,
body:not([data-page="naw"]) .lead {
  text-wrap: pretty;
}

.ecosystem-window,
.workspace-card,
.today-card {
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .hero-panel:hover .ecosystem-window,
  .workspace-card:hover,
  .today-card:hover {
    transform: translateY(-3px);
  }
}

.product-card,
.principle-grid article,
.tool-card,
.cap-grid article,
.arch-node {
  transition: transform .18s ease, border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.product-card > a,
.product-link,
.text-link,
.footer-links a,
.site-footer a {
  transition: color .16s ease, opacity .16s ease, transform .16s ease;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .product-card:hover,
  .principle-grid article:hover,
  .tool-card:hover,
  .cap-grid article:hover,
  .arch-node:hover {
    transform: translateY(-3px);
  }

  .product-card > a:hover,
  .product-link:hover,
  .text-link:hover {
    transform: translateX(2px);
  }
}

.flow-list article {
  transition: background-color .16s ease, padding-left .16s ease, padding-right .16s ease;
}

@media (hover: hover) {
  .flow-list article:hover {
    background: color-mix(in srgb, var(--surface, #fff) 46%, transparent);
  }
}

.button {
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .button:hover {
    transform: translateY(-1px);
  }

  .button:active {
    transform: translateY(0);
  }
}

.site-footer {
  margin-top: 0;
}

.site-footer a:hover {
  color: var(--ink, inherit);
}

.footer-columns a,
.footer-links a {
  width: fit-content;
}

body.subpage .menu-button {
  display: none;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 8px 0;
  font: inherit;
}

/* Give the lighter product pages a shared rhythm without flattening their identity. */
body[data-page="workspace"] .section-line,
body[data-page="edu"] .section-line {
  margin-bottom: 2px;
}

body[data-page="workspace"] .closing-card,
body[data-page="edu"] .closing-card {
  overflow: hidden;
  position: relative;
}

body[data-page="workspace"] .closing-card::after,
body[data-page="edu"] .closing-card::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -90px;
  top: -120px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  pointer-events: none;
}

/* NAW keeps its own visual language; only interaction details are shared. */
body[data-page="naw"] .nav > a::after {
  opacity: .38;
}

body[data-page="naw"] .site-footer a:hover {
  color: #dcebe5;
}

@media (max-width: 1080px) {
  .nav {
    gap: 16px;
  }
}

@media (max-width: 900px) {
  body.subpage .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  body.subpage .nav,
  body[data-page="home"] .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 18px 18px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 42px rgba(24, 43, 49, .07);
  }

  body.subpage .nav.open,
  body[data-page="home"] .nav.open {
    display: flex;
  }

  body.subpage .nav > a,
  body.subpage .nav a:not(.back-link),
  body[data-page="home"] .nav > a {
    display: block;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
  }

  .nav > a::after {
    display: none;
  }

  body.subpage .menu-button {
    display: block;
    justify-self: end;
  }

  body:not([data-page="naw"]) .hero {
    gap: 46px;
  }

  .site-footer .footer-columns {
    gap: 24px;
  }
}

@media (max-width: 680px) {
  body:not([data-page="naw"]) .hero {
    padding-top: 52px;
    padding-bottom: 76px;
  }

  body:not([data-page="naw"]) .hero h1 {
    line-height: 1.08;
  }

  .product-card,
  .principle-grid article,
  .tool-card {
    border-radius: 14px;
  }

  .product-card {
    min-height: 280px;
  }

  .product-card h3 {
    margin-top: 42px;
  }

  .flow-list article:hover {
    padding-left: 0;
    padding-right: 0;
  }

  .footer-main {
    gap: 42px !important;
  }

  .footer-columns {
    grid-template-columns: 1fr 1fr !important;
    gap: 30px 22px !important;
  }

  .footer-columns #contact,
  .footer-columns div:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 430px) {
  .site-header {
    min-height: 60px !important;
  }

  .site-header .brand {
    font-size: 13px;
    gap: 5px !important;
  }

  .site-header .brand img {
    width: 19px;
    height: 19px;
  }

  .brand-divider {
    margin-inline: 1px;
  }

  .brand-product {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero-actions {
    gap: 9px;
  }

  .button {
    min-height: 44px;
  }

  .workspace-card,
  .today-card,
  .ecosystem-window {
    border-radius: 15px;
  }

  .footer-columns {
    grid-template-columns: 1fr !important;
  }

  .footer-columns #contact,
  .footer-columns div:last-child {
    grid-column: auto;
  }

  .copyright {
    margin-top: 42px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
