:root {
  --page: #07110f;
  --panel: #0c1916;
  --panel-deep: #050b0a;
  --ink: #edf5ef;
  --muted: #9eaea5;
  --faint: #718078;
  --line: rgba(230, 249, 238, 0.14);
  --mint: #71f5bd;
  --cyan: #70dcff;
  --lime: #d6ff67;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 12%, rgba(113, 245, 189, 0.09), transparent 30rem),
    radial-gradient(circle at 88% 30%, rgba(112, 220, 255, 0.07), transparent 28rem), var(--page);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

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

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 8px 13px;
  border-radius: 5px;
  color: #07110f;
  background: var(--mint);
  font-weight: 750;
  transform: translateY(-180%);
}

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

.site-header,
.intro,
.boundary,
.demo-stage,
.explanation {
  width: min(calc(100% - 40px), 1420px);
  margin-inline: auto;
}

.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 68px;
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
}

.brand-logo {
  display: block;
  width: 164px;
  height: auto;
}

.site-header p {
  margin: 0;
  color: var(--muted);
}

.site-header strong,
.footer-demo-note {
  color: var(--mint);
}

.back-link {
  justify-self: end;
  color: var(--muted);
  font-weight: 650;
}

.back-link:hover,
.site-map-nav a:hover {
  color: var(--mint);
}

.intro {
  padding: clamp(62px, 8vw, 112px) 0 clamp(38px, 5vw, 64px);
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--mint);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 720;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intro h1,
.explanation h2 {
  margin: 0;
  letter-spacing: -0.055em;
  line-height: 1.02;
}

.intro h1 {
  font-size: clamp(2.8rem, 6vw, 5.8rem);
  font-weight: 650;
}

.intro > p:last-child {
  max-width: 760px;
  margin: 24px auto 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.14rem);
  line-height: 1.7;
}

.boundary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(12, 25, 22, 0.78);
}

.boundary > div {
  min-width: 0;
  padding: 20px 23px;
  border-right: 1px solid var(--line);
}

.boundary > div:last-child {
  border-right: 0;
}

.boundary span,
.boundary strong,
.boundary small {
  display: block;
}

.boundary span {
  margin-bottom: 6px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.61rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.boundary strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.boundary small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.demo-stage {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(260px, 0.72fr) minmax(300px, 1fr);
  align-items: stretch;
  gap: clamp(16px, 2vw, 28px);
}

.chat-client,
.mailbox {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(12, 25, 22, 0.92);
  box-shadow: 0 24px 68px rgba(0, 0, 0, 0.24);
}

.client-heading,
.mailbox > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 23px;
  border-bottom: 1px solid var(--line);
}

.client-heading span,
.mailbox > header > span {
  display: block;
  margin-bottom: 5px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.client-heading h2,
.mailbox h2 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.035em;
}

.client-heading small {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid rgba(113, 245, 189, 0.25);
  border-radius: 100px;
  color: var(--mint);
  font-family: var(--mono);
  font-size: 0.62rem;
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 390px;
  max-height: 390px;
  margin: 0;
  padding: 20px;
  overflow-y: auto;
  list-style: none;
}

.message-list:empty::before {
  margin: auto;
  color: var(--faint);
  font-size: 0.78rem;
  content: "No messages yet";
}

.message {
  display: grid;
  align-self: flex-start;
  gap: 3px;
  max-width: 84%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px 13px 13px;
  background: var(--panel-deep);
}

.message.is-own {
  align-self: flex-end;
  border-color: rgba(113, 245, 189, 0.23);
  border-radius: 13px 4px 13px 13px;
  background: rgba(113, 245, 189, 0.08);
}

.message strong {
  color: var(--mint);
  font-size: 0.63rem;
}

.message span {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.86rem;
}

.chat-client form {
  padding: 17px;
  border-top: 1px solid var(--line);
}

.chat-client label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.chat-client form > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.chat-client input {
  min-width: 0;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel-deep);
}

.chat-client input::placeholder {
  color: var(--faint);
}

.chat-client button {
  min-width: 66px;
  border: 0;
  border-radius: 8px;
  color: #07110f;
  background: var(--mint);
  font-weight: 760;
  cursor: pointer;
}

.chat-client button:hover {
  background: #98f8ce;
}

.mailbox {
  display: flex;
  flex-direction: column;
  background: #050b0a;
}

.mailbox > header {
  display: block;
}

#mailbox-status {
  display: block;
  margin-top: 11px;
  color: var(--mint);
  font-size: 0.67rem;
  line-height: 1.45;
}

#mailbox-status[data-safe="false"] {
  color: #ff9278;
}

.envelope {
  margin: 14px;
  overflow: hidden;
  border: 1px dashed rgba(214, 255, 103, 0.28);
  border-radius: 9px;
  background: rgba(214, 255, 103, 0.025);
}

.envelope strong {
  display: block;
  padding: 10px 11px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  color: var(--lime);
  font-family: var(--mono);
  font-size: 0.57rem;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.envelope pre {
  min-height: 260px;
  max-height: 340px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  color: #aebbb4;
  font-family: var(--mono);
  font-size: 0.56rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.mailbox > p {
  margin: auto 16px 17px;
  color: var(--faint);
  font-size: 0.66rem;
  line-height: 1.5;
}

.explanation {
  display: grid;
  grid-template-columns: minmax(200px, 0.55fr) minmax(260px, 0.72fr) minmax(360px, 1.3fr);
  gap: clamp(28px, 5vw, 74px);
  margin-top: clamp(72px, 9vw, 124px);
  padding: clamp(48px, 7vw, 82px) 0;
  border-top: 1px solid var(--line);
}

.explanation .eyebrow,
.explanation h2,
.explanation > p:last-child {
  margin-bottom: 0;
}

.explanation h2 {
  font-size: clamp(1.7rem, 3vw, 2.7rem);
}

.explanation > p:last-child {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.72;
}

.site-map-footer {
  width: 100%;
  margin-top: 32px;
  padding: clamp(48px, 7vw, 76px) max(20px, calc((100% - 1420px) / 2)) 22px;
  color: #f6f7f2;
  background: #030706;
}

.site-map-footer-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(52px, 9vw, 130px);
}

.site-map-brand {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
}

.site-map-brand .brand-logo {
  width: 172px;
}

.site-map-brand p {
  max-width: 290px;
  margin: 22px 0 25px;
  color: var(--muted);
  font-size: 0.86rem;
}

.footer-demo-note {
  font-size: 0.76rem;
  font-weight: 720;
}

.site-map-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 5vw, 70px);
}

.site-map-nav section {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 9px;
}

.site-map-nav h2 {
  margin: 0 0 9px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.site-map-nav a {
  color: #c4cec9;
  font-size: 0.81rem;
  font-weight: 650;
}

.site-map-bottom {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: clamp(48px, 7vw, 78px);
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.62rem;
}

@media (max-width: 1040px) {
  .demo-stage {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mailbox {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .site-map-footer-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }
}

@media (max-width: 720px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .site-header p {
    display: none;
  }

  .brand-logo {
    width: 138px;
  }

  .boundary,
  .demo-stage,
  .explanation,
  .site-map-nav {
    grid-template-columns: 1fr;
  }

  .boundary > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .boundary > div:last-child {
    border-bottom: 0;
  }

  .mailbox {
    grid-column: auto;
    grid-row: auto;
  }

  .message-list {
    min-height: 300px;
    max-height: 300px;
  }

  .site-map-bottom {
    align-items: flex-start;
    flex-direction: column;
  }
}

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