/*
 * Mattgraphy Platform 2.1
 * Brand system: Mattgraphy lime + black, white and neutral grays only.
 */

:root {
  --brand: #d8ff1f;
  --brand-rgb: 216, 255, 31;
  --ink: #101010;
  --ink-soft: #171717;
  --charcoal: #2a2a29;
  --gray-900: #383735;
  --gray-700: #5f5e5a;
  --gray-600: #777570;
  --gray-500: #94928c;
  --gray-300: #cbc9c3;
  --gray-200: #e3e1dc;
  --gray-100: #eeece7;
  --paper: #f6f5f1;
  --paper-deep: #efede7;
  --white: #ffffff;
  --line: #dedcd6;
  --line-dark: #363635;
  --shadow-sm: 0 8px 24px rgba(16, 16, 16, 0.06);
  --shadow-md: 0 18px 50px rgba(16, 16, 16, 0.1);
  --shadow-lg: 0 28px 80px rgba(16, 16, 16, 0.16);
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 30px;
  --max: 1280px;
  --header-height: 82px;
  --sidebar-width: 248px;
  --transition: 180ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  max-width: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  max-width: 100%;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.nav-open,
body.sidebar-open {
  overflow: hidden;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

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

p,
h1,
h2,
h3,
h4,
h5,
h6,
ul,
ol,
blockquote {
  margin-top: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--ink);
  font-weight: 850;
  letter-spacing: -0.045em;
  line-height: 1.02;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

::selection {
  background: var(--brand);
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.shell {
  width: min(var(--max), calc(100% - 48px));
  margin-inline: auto;
}

.muted {
  color: var(--gray-600);
}

.small {
  font-size: 0.78rem;
}

.narrow {
  max-width: 860px;
}

.icon {
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  transform: translateY(-160%);
  border-radius: 999px;
  background: var(--brand);
  color: var(--ink);
  padding: 11px 16px;
  font-weight: 800;
  transition: transform var(--transition);
}

.skip-link:focus {
  transform: translateY(0);
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: max-content;
  font-weight: 900;
  letter-spacing: -0.035em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 11px;
  background: var(--brand);
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
  line-height: 1;
  transform: rotate(-4deg);
}

.brand-name {
  font-size: 16px;
}

/* Buttons and links */
.button,
.icon-button,
.link-button,
.chip {
  border: 0;
  appearance: none;
  cursor: pointer;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  padding: 11px 18px;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  transition: transform var(--transition), background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

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

.button.large {
  min-height: 52px;
  padding: 15px 22px;
  font-size: 1rem;
}

.button.small {
  min-height: 38px;
  padding: 9px 14px;
  font-size: 0.8rem;
}

.button.ghost {
  border-color: var(--gray-300);
  background: transparent;
  color: var(--ink);
}

.button.ghost:hover {
  border-color: var(--ink);
  background: var(--white);
}

.button.ghost-light {
  border-color: rgba(255, 255, 255, 0.45);
  background: transparent;
  color: var(--white);
}

.button.ghost-light:hover {
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: none;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: max-content;
  font-weight: 800;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.text-link:hover {
  text-decoration: underline;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  padding: 0;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.icon-button:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.icon-button.danger {
  border-style: dashed;
}

.link-button {
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  text-align: left;
}

/* Public navigation */
.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  border-bottom: 1px solid rgba(16, 16, 16, 0.07);
  background: rgba(246, 245, 241, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  gap: 24px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 0.9rem;
  font-weight: 730;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links > a {
  position: relative;
  padding-block: 8px;
}

.nav-links > a::after {
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 2px;
  background: var(--brand);
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.nav-links > a:hover::after,
.nav-links > a:focus-visible::after {
  transform: scaleX(1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.nav-toggle,
.nav-mobile-head,
.nav-backdrop {
  display: none;
}

/* Shared labels */
.eyebrow {
  display: block;
  color: var(--gray-700);
  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: 0.17em;
  line-height: 1.3;
  text-transform: uppercase;
}

/* Homepage */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  align-items: center;
  min-height: min(760px, calc(100vh - var(--header-height)));
  gap: clamp(36px, 6vw, 88px);
  padding-block: 72px;
}

.hero-copy {
  min-width: 0;
}

.hero h1 {
  max-width: 880px;
  margin: 17px 0 25px;
  font-size: clamp(3.65rem, 7.2vw, 6.9rem);
  line-height: 0.91;
}

.hero h1 em {
  color: var(--gray-600);
  font-style: normal;
}

.hero-copy > p {
  max-width: 720px;
  color: var(--gray-700);
  font-size: clamp(1.08rem, 1.55vw, 1.3rem);
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 18px;
  margin-top: 28px;
}

.hero-orbit {
  position: relative;
  min-height: 500px;
  isolation: isolate;
}

.orbit-center {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: clamp(128px, 12vw, 166px);
  height: clamp(128px, 12vw, 166px);
  border-radius: 42px;
  background: var(--brand);
  box-shadow: var(--shadow-lg);
  font-size: clamp(3.5rem, 6vw, 4.8rem);
  font-weight: 950;
  transform: translate(-50%, -50%) rotate(-8deg);
}

.orbit-card {
  position: absolute;
  z-index: 2;
  width: min(240px, 44%);
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--white);
  box-shadow: var(--shadow-md);
  padding: 20px;
}

.orbit-card small {
  display: block;
  color: var(--gray-600);
  font-size: 0.67rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.orbit-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.18rem;
  line-height: 1.18;
}

.orbit-card.one {
  top: 5%;
  left: 1%;
  transform: rotate(-5deg);
}

.orbit-card.two {
  top: 25%;
  right: 0;
  transform: rotate(5deg);
}

.orbit-card.three {
  bottom: 5%;
  left: 9%;
  transform: rotate(3deg);
}

.choice-section {
  background: var(--ink);
  color: var(--white);
  padding: clamp(72px, 8vw, 112px) 0;
}

.choice-section h2,
.section-head h2,
.cta h2,
.learn-band h2 {
  margin: 12px 0 0;
  font-size: clamp(2.5rem, 5vw, 4.75rem);
  line-height: 0.98;
}

.choice-section h2,
.learn-band h2,
.cta h2 {
  color: inherit;
}

.choice-section .eyebrow,
.learn-band .eyebrow {
  color: var(--gray-500);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 42px;
}

.choice-grid > a {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 278px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  padding: 24px;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.choice-grid > a:hover {
  border-color: var(--brand);
  background: rgba(var(--brand-rgb), 0.06);
  transform: translateY(-3px);
}

.choice-grid > a > span {
  color: var(--gray-500);
  font-size: 0.72rem;
  font-weight: 800;
}

.choice-grid > a > strong {
  margin-top: auto;
  font-size: 1.55rem;
  line-height: 1.05;
}

.choice-grid > a > p {
  min-height: 52px;
  margin: 12px 0 18px;
  color: var(--gray-500);
  font-size: 0.92rem;
}

.choice-grid > a > .icon {
  align-self: flex-end;
  width: 22px;
  height: 22px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-top: clamp(70px, 8vw, 104px);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding-top: 30px;
}

.project-card {
  display: block;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.project-card:hover {
  border-color: var(--gray-900);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.project-art {
  position: relative;
  height: clamp(320px, 38vw, 520px);
  overflow: hidden;
  background-color: var(--paper-deep);
  background-position: center;
  background-size: cover;
}

.project-art > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 520ms ease;
}

.project-card:hover .project-art > img {
  transform: scale(1.025);
}

.project-art-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--gray-900);
  font-size: clamp(4rem, 9vw, 8rem);
  font-weight: 900;
  letter-spacing: -0.08em;
}

.project-art::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(16, 16, 16, 0.03), rgba(16, 16, 16, 0.35));
  content: "";
}

.project-type {
  position: absolute;
  z-index: 1;
  top: 18px;
  left: 18px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(16, 16, 16, 0.7);
  color: var(--white);
  padding: 8px 12px;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.project-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 20px;
  padding: 24px;
}

.project-meta h3 {
  margin-bottom: 8px;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
}

.project-meta p {
  margin-bottom: 0;
  color: var(--gray-600);
}

.project-meta > .icon {
  width: 24px;
  height: 24px;
  margin-top: 4px;
}

.split-feature {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(40px, 8vw, 120px);
  padding-block: clamp(90px, 10vw, 140px);
}

.statement h2 {
  margin: 14px 0 0;
  font-size: clamp(2.6rem, 5vw, 4.8rem);
}

.service-list {
  border-top: 1px solid var(--line);
}

.service-list > a {
  display: grid;
  grid-template-columns: minmax(160px, 0.45fr) minmax(0, 1fr);
  gap: 22px;
  border-bottom: 1px solid var(--line);
  padding: 18px 4px;
  transition: padding var(--transition), background var(--transition);
}

.service-list > a:hover {
  background: rgba(var(--brand-rgb), 0.12);
  padding-inline: 12px;
}

.service-list > a > span {
  color: var(--gray-600);
  font-size: 0.9rem;
}

.learn-band {
  background: var(--ink);
  color: var(--white);
  padding: clamp(76px, 9vw, 124px) 0;
}

.learn-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: start;
  gap: clamp(50px, 8vw, 120px);
}

.learn-grid > div:first-child > p {
  max-width: 560px;
  color: var(--gray-500);
  font-size: 1.05rem;
}

.term-cloud {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.term-cloud > a {
  display: block;
  min-width: 0;
  border: 1px solid var(--line-dark);
  border-radius: 15px;
  padding: 16px;
  transition: border-color var(--transition), background var(--transition);
}

.term-cloud > a:hover {
  border-color: var(--brand);
  background: rgba(var(--brand-rgb), 0.06);
}

.term-cloud strong,
.term-cloud span {
  display: block;
}

.term-cloud span {
  margin-top: 7px;
  color: var(--gray-500);
  font-size: 0.82rem;
}

.cta {
  padding-block: clamp(90px, 11vw, 150px);
  text-align: center;
}

.cta .button {
  margin-top: 25px;
}

/* Footer */
.site-footer {
  background: var(--ink);
  color: var(--white);
  padding: 64px 0 26px;
}

.site-footer .brand-mark {
  color: var(--ink);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 0.7fr 0.8fr;
  gap: 48px;
}

.footer-grid > div:not(.footer-brand) {
  display: grid;
  align-content: start;
  gap: 10px;
}

.footer-grid strong {
  margin-bottom: 4px;
}

.footer-grid a:not(.brand) {
  color: var(--gray-300);
}

.footer-grid a:not(.brand):hover {
  color: var(--brand);
}

.footer-brand p {
  max-width: 440px;
  margin-top: 18px;
  color: var(--gray-500);
}

.legal {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line-dark);
  margin-top: 56px;
  padding-top: 22px;
  color: var(--gray-500);
  font-size: 0.75rem;
}

/* Public interior pages */
.page-intro {
  max-width: var(--max);
  padding-top: clamp(72px, 9vw, 124px);
  padding-bottom: clamp(48px, 6vw, 76px);
}

.page-intro h1 {
  max-width: 1080px;
  margin: 15px 0 22px;
  font-size: clamp(3.4rem, 7vw, 6.2rem);
  line-height: 0.94;
  overflow-wrap: anywhere;
}

.page-intro > p {
  max-width: 800px;
  color: var(--gray-700);
  font-size: clamp(1.05rem, 1.7vw, 1.28rem);
}

.service-section {
  padding-bottom: 56px;
}

.service-section .section-head {
  padding-top: 30px;
}

.service-section .section-head h2 {
  font-size: clamp(2.2rem, 4.2vw, 4rem);
}

.service-cards,
.solution-grid,
.dictionary-grid,
.insight-grid,
.learn-links,
.service-order-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.service-cards > a,
.solution-grid > article,
.dictionary-grid > a,
.insight-grid > a,
.learn-links > a,
.service-order-grid > article {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 244px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  padding: 25px;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.service-cards > a:hover,
.solution-grid > article:hover,
.dictionary-grid > a:hover,
.insight-grid > a:hover,
.learn-links > a:hover,
.service-order-grid > article:hover {
  border-color: var(--ink);
  box-shadow: var(--shadow-sm);
  transform: translateY(-3px);
}

.service-cards h3,
.dictionary-grid strong,
.insight-grid h2,
.learn-links h2 {
  margin: 8px 0 12px;
  font-size: clamp(1.4rem, 2vw, 1.75rem);
  line-height: 1.05;
}

.service-cards p,
.solution-grid p,
.dictionary-grid p,
.insight-grid p,
.learn-links p,
.service-order-grid p {
  color: var(--gray-600);
}

.service-cards > a > .icon {
  width: 24px;
  height: 24px;
  margin-top: auto;
  align-self: flex-end;
}

.solution-grid {
  padding-bottom: 96px;
}

.solution-grid > article h2 {
  margin: 13px 0;
  font-size: clamp(1.8rem, 2.8vw, 2.55rem);
}

.solution-grid .text-link {
  margin-top: auto;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 8px;
}

.chip {
  border: 1px solid var(--gray-300);
  border-radius: 999px;
  background: transparent;
  padding: 9px 14px;
  font-size: 0.78rem;
  font-weight: 800;
  transition: background var(--transition), border-color var(--transition);
}

.chip:hover,
.chip.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.project-hero {
  padding-top: clamp(66px, 8vw, 110px);
}

.project-hero h1 {
  max-width: 1080px;
  margin: 14px 0 17px;
  font-size: clamp(3.4rem, 8vw, 7.2rem);
}

.project-hero > p {
  max-width: 820px;
  color: var(--gray-700);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
}

.project-hero > img {
  width: 100%;
  max-height: 760px;
  margin-top: 46px;
  border-radius: var(--radius-lg);
  object-fit: cover;
}

.case-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.45fr);
  gap: clamp(42px, 7vw, 86px);
  padding-block: clamp(62px, 8vw, 104px);
}

.case-grid > aside {
  align-self: start;
  border-left: 1px solid var(--line);
  padding-left: 28px;
}

.case-grid > aside .button {
  margin-top: 24px;
}

.prose {
  min-width: 0;
  color: var(--charcoal);
  font-size: clamp(1.02rem, 1.4vw, 1.15rem);
  line-height: 1.75;
}

.prose > *:first-child {
  margin-top: 0;
}

.prose h2,
.prose h3,
.prose h4 {
  margin-top: 1.8em;
  color: var(--ink);
}

.prose h2 {
  font-size: clamp(2rem, 3.5vw, 3rem);
}

.prose h3 {
  font-size: clamp(1.45rem, 2.3vw, 2rem);
}

.prose a:not(.button):not(.glossary-term) {
  text-decoration: underline;
  text-decoration-color: var(--brand);
  text-decoration-thickness: 3px;
  text-underline-offset: 3px;
}

.prose blockquote {
  border-left: 5px solid var(--brand);
  margin-inline: 0;
  padding: 14px 0 14px 24px;
  color: var(--gray-700);
  font-size: 1.2em;
}

.service-pill {
  display: block;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  font-weight: 760;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding-bottom: 100px;
}

.gallery-grid img {
  width: 100%;
  height: clamp(360px, 42vw, 560px);
  border-radius: var(--radius);
  object-fit: cover;
}

.dictionary-grid {
  padding-bottom: 100px;
}

.dictionary-grid > a {
  min-height: 220px;
}

.dictionary-grid > a > strong,
.dictionary-grid > a > span,
.dictionary-grid > a > p {
  position: static;
  z-index: auto;
  width: auto;
  max-width: none;
  transform: none;
}

.dictionary-grid > a > span {
  order: -1;
  margin-bottom: 12px;
  color: var(--gray-600);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dictionary-grid > a > strong {
  display: block;
}

.dictionary-grid > a > p {
  margin-bottom: 0;
}

.related-link {
  display: block;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.related-link strong,
.related-link small {
  display: block;
}

.related-link small {
  margin-top: 5px;
  color: var(--gray-600);
  line-height: 1.45;
}

.related-service-title {
  margin-top: 30px;
}

.inline-cta {
  margin-top: 42px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--white);
  padding: 28px;
}

.inline-cta h3 {
  margin-top: 0;
  color: var(--white);
}

.learn-links,
.insight-grid {
  padding-bottom: 100px;
}

.insight-grid > a h2 {
  margin: 10px 0 14px;
}

.insight-grid > a .text-link {
  margin-top: auto;
}

.article {
  max-width: 850px;
  padding-bottom: 110px;
}

.article > h1 {
  margin: 14px 0 20px;
  font-size: clamp(3rem, 7vw, 6rem);
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: clamp(42px, 7vw, 90px);
  padding-bottom: 100px;
}

.principles {
  display: grid;
  gap: 12px;
}

.principles > article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  padding: 22px;
}

.price {
  display: inline-flex;
  border-radius: 999px;
  background: var(--brand);
  color: var(--ink);
  margin-top: 20px;
  padding: 9px 14px;
  font-size: 0.85rem;
  font-weight: 850;
}

/* Glossary: single controlled popover, never pseudo-element cards */
.glossary-term {
  border-bottom: 2px dotted var(--brand);
  color: inherit;
  cursor: help;
  text-decoration: none !important;
  text-underline-offset: 4px;
}

.glossary-term:hover,
.glossary-term:focus-visible {
  background: rgba(var(--brand-rgb), 0.22);
}

.glossary-popover {
  position: fixed;
  z-index: 500;
  top: 0;
  left: 0;
  width: min(340px, calc(100vw - 24px));
  max-height: min(420px, calc(100vh - 24px));
  overflow: auto;
  border: 1px solid var(--line-dark);
  border-radius: 16px;
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  padding: 18px;
  pointer-events: none;
  transform: translate3d(-9999px, -9999px, 0) scale(0.97);
  transition: opacity var(--transition), transform var(--transition);
}

.glossary-popover.is-open {
  opacity: 1;
  pointer-events: auto;
}

.glossary-popover > strong {
  display: block;
  max-width: calc(100% - 32px);
  color: var(--brand);
  font-size: 1rem;
}

.glossary-popover > p {
  margin: 9px 0 14px;
  color: var(--gray-200);
  font-size: 0.86rem;
  line-height: 1.5;
}

.glossary-popover-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 800;
}

.glossary-popover-link:hover {
  color: var(--brand);
}

.glossary-popover-close {
  position: absolute;
  top: 9px;
  right: 9px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: var(--charcoal);
  color: var(--white);
  cursor: pointer;
}

.glossary-popover-close .icon {
  width: 16px;
  height: 16px;
}

/* Forms */
.form-shell {
  padding-bottom: 100px;
}

.form-grid,
.editor-form .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 7px;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 800;
}

.field > span:first-child {
  display: block;
}

.required-mark {
  color: var(--gray-600);
  margin-left: 3px;
}

.field input,
.field textarea,
.field select,
.status-form select,
.media-upload input[type="text"],
.media-upload input[type="file"] {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--gray-300);
  border-radius: 14px;
  outline: none;
  background: var(--white);
  color: var(--ink);
  padding: 13px 14px;
  font-weight: 500;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.field textarea {
  min-height: 170px;
  resize: vertical;
  line-height: 1.55;
}

.field input:hover,
.field textarea:hover,
.field select:hover,
.status-form select:hover {
  border-color: var(--gray-700);
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.status-form select:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(var(--brand-rgb), 0.35);
}

.field small {
  color: var(--gray-600);
  font-size: 0.75rem;
  font-weight: 500;
}

.select-wrap {
  position: relative;
  display: block;
}

.select-wrap select,
.status-form select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 46px;
}

.select-wrap > .icon {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 18px;
  height: 18px;
  color: var(--gray-700);
  pointer-events: none;
  transform: translateY(-50%) rotate(90deg);
}

.check {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 9px;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  padding: 12px 14px;
  font-size: 0.85rem;
  font-weight: 700;
}

.check input {
  width: 18px !important;
  height: 18px;
  min-height: 0 !important;
  accent-color: var(--ink);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.form-error {
  border-left: 5px solid var(--brand);
  border-radius: 12px;
  background: var(--ink);
  color: var(--white);
  margin-bottom: 18px;
  padding: 13px 15px;
}

.success-page {
  min-height: 62vh;
  padding-block: 100px;
}

.success-page h1 {
  margin: 15px 0;
  font-size: clamp(3rem, 7vw, 6rem);
}

.login-shell {
  display: grid;
  place-items: center;
  min-height: calc(100vh - var(--header-height));
  padding: 48px 20px 90px;
}

.login-card {
  width: min(500px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-md);
  padding: clamp(28px, 6vw, 50px);
}

.login-card h1 {
  margin: 12px 0;
  font-size: clamp(2.6rem, 7vw, 4.6rem);
}

.login-card form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

/* Application shell */
.app-body {
  background: var(--paper);
}

.app-sidebar {
  position: fixed;
  z-index: 220;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  overflow-y: auto;
  background: var(--ink);
  color: var(--white);
  padding: 20px 16px;
}

.app-sidebar .brand {
  color: var(--white);
}

.app-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 22px;
}

.app-sidebar-close {
  display: none;
  border-color: var(--line-dark);
  background: var(--charcoal);
  color: var(--white);
}

.app-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.app-nav-item {
  display: flex;
  align-items: center;
  min-height: 43px;
  border-radius: 11px;
  color: var(--gray-300);
  padding: 10px 12px;
  font-size: 0.84rem;
  font-weight: 720;
  transition: background var(--transition), color var(--transition), padding var(--transition);
}

.app-nav-item:hover {
  background: var(--charcoal);
  color: var(--white);
  padding-left: 15px;
}

.app-nav-item.active {
  background: var(--brand);
  color: var(--ink);
}

.app-sidebar-bottom {
  display: grid;
  gap: 12px;
  margin-top: auto;
  border-top: 1px solid var(--line-dark);
  padding: 18px 10px 6px;
  color: var(--gray-500);
  font-size: 0.78rem;
}

.app-sidebar-bottom > a {
  display: flex;
  align-items: center;
  gap: 9px;
}

.app-sidebar-bottom .icon {
  width: 16px;
  height: 16px;
}

.app-sidebar-bottom a:hover,
.app-sidebar-bottom button:hover {
  color: var(--brand);
}

.app-backdrop {
  display: none;
}

.app-main {
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.app-topbar {
  position: sticky;
  z-index: 80;
  top: 0;
  display: flex;
  align-items: center;
  min-height: 92px;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 245, 241, 0.94);
  padding: 14px clamp(18px, 3vw, 38px);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.app-menu {
  display: none;
  margin-right: 12px;
}

.app-title {
  min-width: 0;
}

.app-title h1 {
  margin: 3px 0 0;
  font-size: clamp(1.35rem, 2.3vw, 1.85rem);
  overflow-wrap: anywhere;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
}

.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--ink);
  font-weight: 900;
}

.app-content {
  width: 100%;
  max-width: 1660px;
  margin-inline: auto;
  padding: clamp(22px, 3vw, 38px);
}

.toast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line-dark);
  border-left: 5px solid var(--brand);
  border-radius: 14px;
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
  padding: 13px 14px;
}

.toast > button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: var(--charcoal);
  color: var(--white);
  cursor: pointer;
}

.toast .icon {
  width: 17px;
  height: 17px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  padding: 20px;
}

.metric > span,
.metric > small {
  display: block;
  color: var(--gray-600);
  font-size: 0.73rem;
}

.metric > strong {
  display: block;
  margin: 8px 0 4px;
  font-size: clamp(1.8rem, 3vw, 2.55rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.dashboard-welcome,
.client-welcome {
  margin-bottom: 22px;
}

.dashboard-welcome h2,
.client-welcome h2 {
  margin: 5px 0;
  font-size: clamp(2rem, 4vw, 3.1rem);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  padding: 20px;
}

.panel.span-2 {
  grid-column: span 2;
}

.panel-head,
.resource-head,
.ticket-head,
.website-hero,
.project-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.panel-head h2,
.resource-head h2 {
  margin: 0;
}

.resource-head {
  margin-bottom: 20px;
}

.resource-head h2 {
  margin-top: 4px;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.activity-line,
.activity-row,
.billing-row,
.transaction-row,
.integration-row,
.invoice-mini {
  display: grid;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.activity-line {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

.activity-row,
.transaction-row,
.integration-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.billing-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.invoice-mini {
  grid-template-columns: minmax(0, 1fr) auto auto auto;
}

.activity-line:last-child,
.activity-row:last-child,
.billing-row:last-child,
.transaction-row:last-child,
.integration-row:last-child,
.invoice-mini:last-child {
  border-bottom: 0;
}

.activity-line span,
.activity-line small,
.activity-row span,
.activity-row small,
.billing-row span,
.billing-row small,
.transaction-row span,
.transaction-row small,
.integration-row span,
.integration-row small,
.invoice-mini span,
.invoice-mini small {
  color: var(--gray-600);
}

.activity-dot {
  width: 9px;
  height: 9px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--brand);
}

.empty-panel {
  display: grid;
  place-items: center;
  min-height: 260px;
  border: 1px dashed var(--gray-300);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
  padding: 32px;
  text-align: center;
}

.empty-panel h2 {
  max-width: 680px;
  margin: 12px 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.empty-panel p {
  max-width: 620px;
  color: var(--gray-600);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--paper-deep);
  color: var(--gray-700);
  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

td {
  font-size: 0.86rem;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: rgba(var(--brand-rgb), 0.08);
}

.table-empty {
  padding-block: 34px;
  text-align: center;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.row-actions form {
  margin: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: max-content;
  max-width: 100%;
  border: 1px solid var(--gray-300);
  border-radius: 999px;
  background: var(--paper);
  color: var(--gray-900);
  padding: 5px 9px;
  font-size: 0.67rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gray-500);
}

.status-active .badge-dot,
.status-online .badge-dot,
.status-paid .badge-dot,
.status-completed .badge-dot,
.status-done .badge-dot,
.status-published .badge-dot,
.status-won .badge-dot {
  background: var(--brand);
  box-shadow: 0 0 0 2px var(--ink);
}

.status-urgent,
.status-past_due,
.status-suspended,
.status-failed,
.status-offline,
.status-canceled,
.status-closed {
  border-style: dashed;
  background: var(--gray-100);
}

.yes {
  font-weight: 850;
}

.progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--gray-200);
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(16, 16, 16, 0.15);
}

.progress.mini {
  min-width: 90px;
  height: 7px;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(245px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.task-kanban {
  grid-template-columns: repeat(6, minmax(240px, 1fr));
}

.kanban > section {
  min-width: 0;
  min-height: 390px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper-deep);
  padding: 12px;
  scroll-snap-align: start;
}

.kanban > section > h3 {
  margin: 3px 4px 13px;
  color: var(--gray-700);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kanban-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--white);
  margin-bottom: 9px;
  padding: 14px;
  transition: border-color var(--transition), transform var(--transition);
}

.kanban-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}

.kanban-card strong,
.kanban-card small,
.kanban-card > span {
  display: block;
}

.kanban-card small {
  margin: 5px 0 12px;
  color: var(--gray-600);
}

.kanban-card .badge {
  margin-top: 10px;
}

.kanban-card .due {
  margin-top: 9px;
  color: var(--gray-600);
  font-size: 0.72rem;
}

.priority-urgent,
.priority-high {
  border-left: 4px solid var(--ink);
}

.create-grid,
.content-hub {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.create-grid > a,
.content-hub > a {
  display: flex;
  flex-direction: column;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  padding: 22px;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.create-grid > a:hover,
.content-hub > a:hover {
  border-color: var(--ink);
  box-shadow: var(--shadow-sm);
  transform: translateY(-3px);
}

.create-grid h2,
.content-hub h2 {
  margin: 12px 0;
  font-size: 1.65rem;
}

.create-grid p,
.content-hub p {
  color: var(--gray-600);
}

.create-grid .icon {
  margin-top: auto;
}

.editor-form {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  padding: clamp(18px, 3vw, 28px);
}

.permission-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}

.permission-grid legend {
  padding: 0 7px;
  font-size: 0.8rem;
  font-weight: 850;
}

.secret-key {
  overflow-x: auto;
  border: 1px solid var(--line-dark);
  border-radius: 12px;
  background: var(--ink);
  color: var(--brand);
  margin: 14px 0;
  padding: 14px;
}

.secret-key code {
  user-select: all;
}

.client-access {
  max-width: 1050px;
  margin-top: 16px;
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 12px;
  margin-top: 18px;
}

.inline-form .button {
  min-height: 50px;
}

.ticket-thread {
  display: grid;
  gap: 12px;
}

.message {
  max-width: 900px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--white);
  padding: 17px;
}

.message.internal {
  border-style: dashed;
  background: var(--paper-deep);
}

.message strong,
.message small {
  display: block;
}

.message small {
  margin-top: 3px;
  color: var(--gray-600);
}

.message p {
  margin: 14px 0 0;
}

.reply-box {
  max-width: 900px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  margin-top: 16px;
  padding: 18px;
}

.status-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.finance-links,
.stack-actions,
.billing-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.finance-links {
  margin-bottom: 20px;
}

.finance-links > a {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  padding: 11px 14px;
  font-size: 0.82rem;
  font-weight: 780;
}

.billing-toolbar {
  justify-content: flex-end;
  margin-bottom: 12px;
}

.inline-action-form {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.inline-action-form .button {
  margin: 0;
}

.client-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.client-project-card,
.website-card {
  min-width: 0;
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  padding: 22px;
}

.client-project-card h2,
.website-card h2 {
  margin: 20px 0 7px;
  font-size: 1.65rem;
}

.client-project-card .progress {
  margin: 40px 0 10px;
}

.website-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
}

.website-row strong,
.website-row small {
  display: block;
}

.website-row small {
  color: var(--gray-600);
}

.site-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--gray-300);
}

.site-dot.online {
  background: var(--brand);
}

.site-dot.suspended,
.site-dot.offline,
.site-dot.past_due {
  border-style: dashed;
  background: var(--gray-500);
}

.website-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 42px;
}

.website-stats > div {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.website-stats span {
  color: var(--gray-600);
  font-size: 0.65rem;
}

.website-stats strong {
  display: block;
  margin-top: 3px;
  font-size: 1.2rem;
}

.health-big {
  display: flex;
  align-items: center;
  gap: 18px;
}

.progress-ring {
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  flex: 0 0 132px;
  border: 10px solid var(--brand);
  border-radius: 50%;
  background: var(--white);
  text-align: center;
}

.progress-ring strong {
  display: block;
  font-size: 1.8rem;
  line-height: 1;
}

.progress-ring span {
  color: var(--gray-600);
  font-size: 0.67rem;
}

.health-line,
.task-line,
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.task-line strong,
.task-line small,
.file-row strong,
.file-row small {
  display: block;
}

.task-line small,
.file-row small {
  color: var(--gray-600);
}

.service-order-grid > article > strong {
  margin-top: auto;
  padding: 16px 0;
  font-size: 1.4rem;
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.file-grid > a {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--white);
  padding: 16px;
}

.file-grid > a:hover {
  border-color: var(--ink);
}

.file-grid strong,
.file-grid small {
  display: block;
}

.file-grid small {
  margin-top: 5px;
  color: var(--gray-600);
}

.notification-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(240px, 1.6fr) auto;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.notification-row span,
.notification-row small {
  color: var(--gray-600);
}

.media-upload {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  align-items: end;
  gap: 12px;
}

.media-upload input[type="file"] {
  border-style: dashed;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.media-grid > article {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
}

.media-grid img {
  width: 100%;
  height: 180px;
  background: var(--gray-100);
  object-fit: cover;
}

.media-grid article > div {
  padding: 12px;
}

.media-grid strong,
.media-grid small {
  display: block;
}

.media-grid small {
  margin: 3px 0 9px;
  color: var(--gray-600);
}

.media-url-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.media-grid input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--off-white);
  padding: 8px;
  color: var(--gray-700);
  font-size: 0.7rem;
}

.media-url-row .button {
  min-height: 34px;
  padding-inline: 11px;
}

.upload-box {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 16px;
}

/* Error page */
.error-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 20px;
}

.error-card {
  width: min(680px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-md);
  padding: clamp(28px, 6vw, 58px);
}

.error-card .brand-mark {
  margin-bottom: 24px;
}

.error-card h1 {
  margin: 13px 0;
  font-size: clamp(2.7rem, 7vw, 5rem);
}

.error-card p {
  color: var(--gray-600);
  font-size: 1.05rem;
}

/* Responsive */
@media (max-width: 1120px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-copy {
    max-width: 900px;
  }

  .hero-orbit {
    min-height: 420px;
  }

  .choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-cards,
  .solution-grid,
  .dictionary-grid,
  .insight-grid,
  .learn-links,
  .service-order-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-sidebar {
    width: min(360px, 88vw);
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-105%);
    transition: transform var(--transition), visibility 0s linear 180ms;
  }

  .app-sidebar.is-open {
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
    transition-delay: 0s;
  }

  .app-sidebar-close {
    display: inline-grid;
  }

  .app-backdrop {
    position: fixed;
    z-index: 210;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    display: block;
    border: 0;
    background: rgba(16, 16, 16, 0.58);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
  }

  .app-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .app-main {
    margin-left: 0;
  }

  .app-menu {
    display: inline-grid;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel.span-2 {
    grid-column: span 2;
  }

  .create-grid,
  .content-hub,
  .client-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .media-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  :root {
    --header-height: 72px;
  }

  .site-header {
    background: var(--paper);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .nav-toggle {
    display: inline-grid;
  }

  .nav {
    position: fixed;
    z-index: 320;
    top: 0;
    right: 0;
    bottom: auto;
    display: flex;
    height: 100dvh;
    max-height: 100dvh;
    flex-direction: column;
    align-items: stretch;
    width: min(430px, 92vw);
    overflow-y: auto;
    background: var(--paper);
    box-shadow: var(--shadow-lg);
    padding: 18px;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(105%);
    transition: transform var(--transition), visibility 0s linear 180ms;
  }

  .nav.is-open {
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
    transition-delay: 0s;
  }

  .nav-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    padding-bottom: 18px;
  }

  .nav-links {
    display: grid;
    gap: 0;
    margin-top: 24px;
  }

  .nav-links > a {
    border-bottom: 1px solid var(--line);
    padding: 15px 2px;
    font-size: 1.1rem;
  }

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

  .nav-actions {
    display: grid;
    margin-top: auto;
    padding-top: 28px;
  }

  .nav-actions .button {
    width: 100%;
  }

  .nav-backdrop {
    position: fixed;
    z-index: 310;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(16, 16, 16, 0.58);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
  }

  .nav-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .split-feature,
  .learn-grid,
  .case-grid,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .case-grid > aside {
    border-top: 1px solid var(--line);
    border-left: 0;
    padding-top: 28px;
    padding-left: 0;
  }

  .inline-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inline-form .button {
    width: max-content;
  }

  .media-upload {
    grid-template-columns: 1fr 1fr;
  }

  .media-upload .button {
    grid-column: 1 / -1;
    width: max-content;
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(var(--max), calc(100% - 24px));
  }

  .brand-name {
    font-size: 14px;
  }

  .hero {
    gap: 24px;
    padding-block: 48px 54px;
  }

  .hero h1 {
    font-size: clamp(3.05rem, 16vw, 4.8rem);
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions .button,
  .hero-actions .text-link {
    width: 100%;
  }

  .hero-actions .text-link {
    justify-content: center;
    min-height: 44px;
  }

  .hero-orbit {
    min-height: 330px;
  }

  .orbit-card {
    width: 48%;
    padding: 14px;
  }

  .orbit-card strong {
    font-size: 0.95rem;
  }

  .orbit-center {
    width: 108px;
    height: 108px;
    border-radius: 29px;
    font-size: 3rem;
  }

  .choice-grid,
  .projects-grid,
  .service-cards,
  .solution-grid,
  .dictionary-grid,
  .insight-grid,
  .learn-links,
  .service-order-grid,
  .term-cloud,
  .footer-grid,
  .form-grid,
  .editor-form .form-grid,
  .permission-grid,
  .metric-grid,
  .dashboard-grid,
  .client-card-grid,
  .create-grid,
  .content-hub,
  .file-grid,
  .media-grid {
    grid-template-columns: 1fr;
  }

  .choice-grid > a {
    min-height: 230px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-art {
    height: 330px;
  }

  .service-list > a {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .page-intro {
    padding-top: 58px;
    padding-bottom: 42px;
  }

  .page-intro h1 {
    font-size: clamp(2.8rem, 14vw, 4.15rem);
  }

  .project-hero h1 {
    font-size: clamp(3rem, 15vw, 4.8rem);
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid img {
    height: 350px;
  }

  .legal {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .glossary-popover {
    top: auto !important;
    right: 12px !important;
    bottom: 12px !important;
    left: 12px !important;
    width: auto;
    max-height: min(50vh, 380px);
    border-radius: 18px;
    transform: translate3d(0, 120%, 0);
  }

  .glossary-popover.is-open {
    transform: translate3d(0, 0, 0);
  }

  .app-topbar {
    min-height: 78px;
    padding: 10px 12px;
  }

  .app-content {
    padding: 16px 12px 30px;
  }

  .app-title .small {
    display: none;
  }

  .app-title h1 {
    margin: 0;
    font-size: 1.08rem;
  }

  .top-create {
    display: none;
  }

  .top-actions {
    gap: 6px;
  }

  .avatar {
    width: 38px;
    height: 38px;
  }

  .panel.span-2 {
    grid-column: auto;
  }

  .panel-head,
  .resource-head,
  .ticket-head,
  .website-hero,
  .project-detail-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .resource-head .button,
  .ticket-head .button {
    width: 100%;
  }

  .kanban,
  .task-kanban {
    grid-template-columns: repeat(6, minmax(82vw, 1fr));
  }

  .activity-line,
  .activity-row,
  .billing-row,
  .transaction-row,
  .integration-row,
  .invoice-mini,
  .notification-row {
    grid-template-columns: 1fr;
  }

  .inline-form,
  .media-upload {
    grid-template-columns: 1fr;
  }

  .inline-form .button,
  .media-upload .button {
    width: 100%;
  }

  .upload-box,
  .status-form,
  .health-big {
    align-items: stretch;
    flex-direction: column;
  }

  .website-stats {
    grid-template-columns: 1fr;
  }

  .progress-ring {
    width: 118px;
    height: 118px;
    flex-basis: 118px;
  }
}

@media (max-width: 420px) {
  .nav-wrap {
    gap: 12px;
  }

  .brand-mark {
    width: 33px;
    height: 33px;
    flex-basis: 33px;
  }

  .hero h1 {
    font-size: 3rem;
  }

  .orbit-card {
    width: 52%;
  }

  .orbit-card.two {
    top: 31%;
  }

  .project-art {
    height: 290px;
  }

  .button.large {
    padding-inline: 17px;
  }

  .app-menu,
  .top-actions .icon-button {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }
}

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

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

@media print {
  .site-header,
  .site-footer,
  .app-sidebar,
  .app-topbar,
  .button,
  .icon-button,
  .nav-backdrop,
  .app-backdrop,
  .glossary-popover {
    display: none !important;
  }

  body,
  .app-body {
    background: var(--white);
  }

  .app-main {
    margin: 0;
  }

  .app-content,
  .shell {
    width: 100%;
    max-width: none;
    padding: 0;
  }
}

/* v2.1 form and connector refinements */
.field-full {
  grid-column: 1 / -1;
}

.hp-field {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.secret-key {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.secret-key code {
  min-width: 0;
  overflow-wrap: anywhere;
}

.secret-key .button {
  flex: 0 0 auto;
}

@media (max-width: 680px) {
  .secret-key {
    align-items: stretch;
    flex-direction: column;
  }

  .secret-key .button {
    width: 100%;
  }
}

.secret-key .button.ghost {
  border-color: var(--gray-500);
  background: transparent;
  color: var(--white);
}

.secret-key .button.ghost:hover,
.secret-key .button.ghost:focus-visible {
  border-color: var(--brand);
  background: var(--charcoal);
  color: var(--brand);
}
