:root {
  --bg: #f6f5ef;
  --paper: #fffefa;
  --ink: #11130f;
  --muted: #666a61;
  --line: rgba(17, 19, 15, 0.14);
  --line-strong: rgba(17, 19, 15, 0.34);
  --green: #2f7a4f;
  --green-soft: #dcefe3;
  --amber: #a06f2d;
  --black: #151713;
  --mono: "IBM Plex Mono", monospace;
  --sans: "Inter", system-ui, sans-serif;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(17, 19, 15, 0.045) 1px, transparent 1px) 0 0 / 38px 38px,
    linear-gradient(0deg, rgba(17, 19, 15, 0.035) 1px, transparent 1px) 0 0 / 38px 38px,
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
}

#flow-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: 0.14;
  pointer-events: none;
}

main,
.footer {
  position: relative;
  z-index: 1;
}

.topbar {
  position: fixed;
  z-index: 60;
  top: 16px;
  left: clamp(14px, 4vw, 48px);
  right: clamp(14px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 60px;
  padding: 10px 12px 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 254, 250, 0.9);
  backdrop-filter: blur(18px);
  box-shadow: 0 16px 44px rgba(17, 19, 15, 0.1);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 34px;
  border-radius: 999px;
  background: var(--black);
  color: var(--green-soft);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0;
}

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

.nav-links a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

.nav-links a:hover {
  background: var(--green-soft);
}

.nav-toggle {
  display: none;
}

section {
  scroll-margin-top: 104px;
}

.hero {
  position: relative;
  min-height: 100dvh;
  display: grid;
  align-content: end;
  gap: clamp(22px, 4vw, 42px);
  padding: 118px clamp(20px, 6vw, 92px) 42px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(246, 245, 239, 0.96) 0%, rgba(246, 245, 239, 0.84) 42%, rgba(246, 245, 239, 0.3) 100%),
    linear-gradient(180deg, rgba(246, 245, 239, 0.08), var(--bg)),
    url("./hedera-protocol-hero-gemini.png") center right / cover no-repeat;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: -1;
  height: 42%;
  background: linear-gradient(180deg, transparent, var(--bg));
}

.hero-inner {
  width: min(100%, 860px);
  min-width: 0;
  max-width: 860px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

h1,
h2,
h3,
p,
strong,
span {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 15ch;
  font-size: clamp(50px, 6.6vw, 92px);
  line-height: 0.94;
}

h2 {
  max-width: 13ch;
  font-size: clamp(38px, 5.4vw, 76px);
  line-height: 0.98;
}

h3 {
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.05;
}

.lede,
.section-copy p {
  max-width: 720px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.42;
}

.lede {
  margin: 26px 0 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
}

.button.primary {
  background: var(--ink);
  color: var(--paper);
}

.button.secondary {
  background: rgba(255, 254, 250, 0.76);
}

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

.hero-command {
  width: min(100%, 940px);
  min-width: 0;
  max-width: 940px;
  border: 1px solid rgba(255, 254, 250, 0.16);
  border-radius: var(--radius);
  background: rgba(17, 19, 15, 0.92);
  box-shadow: 0 26px 80px rgba(17, 19, 15, 0.22);
}

.hero-command pre {
  margin: 0;
  padding: clamp(18px, 3vw, 30px);
  overflow-x: auto;
}

.hero-command code {
  color: #e6efe8;
  font-family: var(--mono);
  font-size: clamp(13px, 1.4vw, 16px);
  line-height: 1.62;
}

.signal-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-block: 1px solid var(--line-strong);
  background: rgba(255, 254, 250, 0.66);
}

.signal-row div {
  min-height: 132px;
  padding: 28px clamp(20px, 5vw, 54px);
  border-right: 1px solid var(--line);
}

.signal-row div:last-child {
  border-right: 0;
}

.signal-row span,
.response-panel span,
.contract-table span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.signal-row strong {
  font-size: clamp(22px, 2.8vw, 34px);
  line-height: 1.02;
}

.section {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(320px, 1fr);
  gap: clamp(28px, 6vw, 80px);
  align-items: start;
  padding: clamp(82px, 10vw, 136px) clamp(20px, 6vw, 92px);
  border-bottom: 1px solid var(--line-strong);
}

.section-head {
  grid-column: 1 / -1;
}

.endpoint-section,
.server-section {
  background: rgba(255, 254, 250, 0.48);
}

.response-panel,
.contract-table {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
}

.response-panel div,
.contract-table div {
  display: grid;
  grid-template-columns: minmax(150px, 0.42fr) 1fr;
  gap: 18px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.response-panel div:last-child,
.contract-table div:last-child {
  border-bottom: 0;
}

.response-panel strong,
.contract-table strong {
  font-family: var(--mono);
  font-size: clamp(14px, 1.4vw, 16px);
}

.steps {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.steps article {
  min-height: 292px;
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
}

.steps article:first-child {
  background: var(--black);
  color: var(--paper);
}

.steps article:first-child p {
  color: rgba(255, 254, 250, 0.74);
}

.steps article span {
  display: block;
  margin-bottom: 50px;
  color: var(--green);
  font-family: var(--mono);
  font-weight: 700;
}

.steps p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.44;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(20px, 6vw, 92px);
  background: var(--black);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 13px;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 460ms cubic-bezier(0.16, 1, 0.3, 1), transform 460ms cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 860px) {
  .topbar {
    top: 10px;
    left: 10px;
    right: 10px;
    border-radius: 22px;
  }

  .nav-toggle {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 40px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: transparent;
  }

  .nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 3px 0;
    background: var(--ink);
    transition: transform 180ms ease;
  }

  body.nav-open {
    overflow: hidden;
  }

  body.nav-open .nav-toggle span:first-child {
    transform: translateY(4px) rotate(45deg);
  }

  body.nav-open .nav-toggle span:last-child {
    transform: translateY(-4px) rotate(-45deg);
  }

  .nav-links {
    position: fixed;
    inset: 82px 10px auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    border: 1px solid var(--line-strong);
    border-radius: 20px;
    background: var(--paper);
    box-shadow: 0 20px 64px rgba(17, 19, 15, 0.18);
  }

  body.nav-open .nav-links {
    display: flex;
  }

  .nav-links a {
    min-height: 50px;
  }

  .hero {
    min-height: auto;
    padding: 112px 24px 40px;
  }

  .hero::before {
    background:
      linear-gradient(180deg, rgba(246, 245, 239, 0.96), rgba(246, 245, 239, 0.82)),
      url("./hedera-protocol-hero-gemini.png") center / cover no-repeat;
  }

  h1,
  h2 {
    max-width: none;
  }

  h1 {
    font-size: clamp(38px, 10.6vw, 46px);
    line-height: 0.98;
  }

  h2 {
    font-size: clamp(34px, 10vw, 46px);
  }

  .lede,
  .section-copy p {
    font-size: 17px;
  }

  .signal-row,
  .section,
  .steps {
    grid-template-columns: 1fr;
  }

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

  .signal-row div:last-child {
    border-bottom: 0;
  }

  .response-panel div,
  .contract-table div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .steps article {
    min-height: 0;
  }

  .footer {
    flex-direction: column;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}
