/* agentroom landing — aligned with the gianlucamazza.it brand:
   dark-only, warm near-black surfaces, a single terracotta accent,
   Inter + JetBrains Mono. Fonts loaded via <link> in each HTML head. */
:root {
  color-scheme: dark;
  --bg: #0c0c0b;
  --bg-soft: #141413;
  --bg-strong: #1f1f1d;
  --card: #161615;
  --text: #f4f1ea;
  --muted: #a8a29a;
  --subtle: #8f8a82;
  --border: rgba(244, 241, 234, 0.09);
  --border-strong: rgba(244, 241, 234, 0.2);
  --accent: #b45f43;
  --accent-strong: #c9714f;
  --accent-soft: rgba(180, 95, 67, 0.14);
  --code-bg: #131312;
  --code-text: #f4f1ea;
  --hero-bg: #0a0a0a;
  --hero-text: #f4f1ea;
  --hero-muted: #a8a29a;
  --hero-line: rgba(244, 241, 234, 0.1);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.34);
  --radius: 8px;
  --radius-sm: 6px;
  --sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 4%, rgba(180, 95, 67, 0.1), transparent 32rem),
    radial-gradient(circle at 88% 22%, rgba(180, 95, 67, 0.05), transparent 28rem),
    linear-gradient(180deg, var(--bg) 0%, #0a0a09 100%);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

code {
  font-family: var(--mono);
  font-size: 0.92em;
}

svg {
  display: block;
}

.skip-link {
  position: absolute;
  top: 12px;
  left: 16px;
  z-index: 30;
  transform: translateY(-160%);
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

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

.site-header {
  position: relative;
  overflow: hidden;
  color: var(--hero-text);
  background:
    radial-gradient(circle at 22% 20%, rgba(180, 95, 67, 0.3), transparent 26rem),
    radial-gradient(circle at 80% 14%, rgba(201, 113, 79, 0.16), transparent 26rem),
    radial-gradient(circle at 58% 98%, rgba(180, 95, 67, 0.1), transparent 30rem),
    linear-gradient(135deg, #0a0a0a 0%, #0c0c0b 48%, #16130f 100%);
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 84%);
}

.top-nav,
.hero,
.container,
.container-wide {
  width: min(100% - 40px, 1120px);
  margin-inline: auto;
}

.top-nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0;
}

.brand,
.nav-links {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  color: var(--hero-text);
  font-weight: 760;
}

.brand:hover,
.nav-links a:hover {
  color: var(--hero-text);
}

.brand-mark {
  position: relative;
  width: 28px;
  height: 28px;
  border: 1px solid var(--hero-line);
  border-radius: 8px;
  background: rgba(240, 246, 252, 0.08);
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.brand-mark::before {
  top: 6px;
  width: 12px;
  height: 10px;
  border: 3px solid #c9714f;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
}

.brand-mark::after {
  bottom: 6px;
  width: 16px;
  height: 12px;
  border-radius: 3px;
  background: linear-gradient(135deg, #c9714f, #b45f43);
}

.nav-links {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 18px;
}

.nav-links a {
  color: var(--hero-muted);
  font-size: 0.92rem;
  font-weight: 650;
}

.nav-links a.active,
.nav-links a[aria-current="page"] {
  color: var(--hero-text);
  text-decoration: underline;
}

.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.72fr);
  align-items: center;
  gap: clamp(28px, 7vw, 88px);
  min-height: 680px;
  padding: clamp(54px, 8vw, 96px) 0 clamp(74px, 10vw, 120px);
}

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

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--accent-strong);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  line-height: 1.1;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(3.8rem, 9vw, 7.8rem);
  font-weight: 600;
  letter-spacing: -0.03em;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 560;
  letter-spacing: -0.02em;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.14rem;
  font-weight: 560;
  letter-spacing: -0.01em;
}

.tagline {
  max-width: 720px;
  margin-bottom: 14px;
  font-size: clamp(1.35rem, 2.4vw, 2.1rem);
  line-height: 1.25;
  font-weight: 680;
}

.subtitle {
  max-width: 650px;
  margin-bottom: 28px;
  color: var(--hero-muted);
  font-size: clamp(1rem, 1.8vw, 1.18rem);
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 780px;
  margin-bottom: 34px;
}

.hero-badges span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 11px;
  border: 1px solid rgba(180, 95, 67, 0.32);
  border-radius: 999px;
  color: #efd9d0;
  background: rgba(180, 95, 67, 0.12);
  font-size: 0.82rem;
  font-weight: 650;
}

.hero-actions,
.quickstart-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn,
.quickstart-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 760;
}

.btn:hover,
.quickstart-nav a:hover {
  text-decoration: none;
}

.btn-primary {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 14px 30px rgba(180, 95, 67, 0.34);
}

.btn-primary:hover {
  color: #ffffff;
  background: var(--accent-strong);
}

.btn-secondary {
  border: 1px solid var(--hero-line);
  color: var(--hero-text);
  background: rgba(240, 246, 252, 0.07);
}

.btn-secondary:hover {
  color: var(--hero-text);
  background: rgba(240, 246, 252, 0.12);
}

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

.lock-orbit {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 420px);
  aspect-ratio: 1;
  margin-inline: auto;
  border: 1px solid var(--hero-line);
  border-radius: 50%;
  background:
    linear-gradient(var(--hero-line), var(--hero-line)) 50% 50% / 1px 100% no-repeat,
    linear-gradient(90deg, var(--hero-line), var(--hero-line)) 50% 50% / 100% 1px no-repeat,
    radial-gradient(circle, rgba(180, 95, 67, 0.22), transparent 62%);
  box-shadow: inset 0 0 60px rgba(201, 113, 79, 0.1), 0 34px 72px rgba(0, 0, 0, 0.32);
}

.lock-orbit::before,
.lock-orbit::after {
  content: "";
  position: absolute;
  border: 1px solid var(--hero-line);
  border-radius: 50%;
}

.lock-orbit::before {
  inset: 42px;
}

.lock-orbit::after {
  inset: 86px;
  border-style: dashed;
}

.sealed-path {
  position: absolute;
  inset: 0;
  color: rgba(244, 241, 234, 0.5);
}

.lock-body {
  position: relative;
  z-index: 1;
  width: 122px;
  height: 96px;
  margin-top: 44px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  background: linear-gradient(135deg, #c9714f 0%, #b45f43 100%);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.lock-body::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 78px;
  width: 76px;
  height: 68px;
  transform: translateX(-50%);
  border: 16px solid #efd9d0;
  border-bottom: 0;
  border-radius: 48px 48px 0 0;
}

.keyhole {
  position: absolute;
  left: 50%;
  top: 36px;
  width: 18px;
  height: 34px;
  transform: translateX(-50%);
  border-radius: 999px 999px 6px 6px;
  background: rgba(5, 8, 13, 0.62);
}

.container {
  width: min(100% - 40px, 880px);
}

.container-wide {
  width: min(100% - 40px, 1120px);
}

.section {
  padding: clamp(58px, 8vw, 104px) 0;
  border-bottom: 1px solid var(--border);
}

.section-ruled {
  background:
    linear-gradient(180deg, rgba(180, 95, 67, 0.05), transparent 44%),
    var(--bg-soft);
}

.section-heading {
  max-width: 860px;
  margin-bottom: 30px;
}

.prose {
  max-width: 860px;
}

.prose p,
.muted,
.step-card p,
.journey-card p {
  color: var(--muted);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 0;
  margin: 0;
  list-style: none;
  counter-reset: steps;
}

.step-card,
.journey-card,
.quickstart-block {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  vertical-align: middle;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.step-card {
  min-height: 236px;
  padding: 24px;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 22px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-weight: 850;
}

.step-icon {
  position: absolute;
  top: 22px;
  right: 22px;
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--accent);
  background: var(--bg-soft);
}

.step-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.journey-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}

.journey-card {
  grid-column: span 3;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  overflow: hidden;
}

.journey-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #c9714f);
}

.journey-card-featured {
  grid-column: span 6;
}

.card-icon {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 800;
}

.journey-card .code-block {
  margin-top: auto;
}

.quickstart-nav {
  margin: 0 0 26px;
}

.quickstart-nav a {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.quickstart-block {
  padding: 22px;
  margin-top: 16px;
}

.quickstart-block .code-block {
  margin-bottom: 0;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  font-size: 0.94rem;
}

th {
  color: var(--text);
  background: var(--bg-strong);
  font-weight: 800;
}

td {
  color: var(--muted);
}

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

.pkg-table code {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  background: var(--bg-soft);
}

.diagram,
.code-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--code-bg);
  box-shadow: var(--shadow-soft);
}

.diagram {
  margin: 24px 0;
  padding: 22px;
  overflow-x: auto;
  color: var(--code-text);
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.5;
}

.code-block {
  position: relative;
  overflow: hidden;
  margin: 12px 0 24px;
}

.code-block pre {
  margin: 0;
  padding: 22px 78px 22px 22px;
  overflow-x: auto;
  color: var(--code-text);
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.62;
  tab-size: 2;
}

.copy-btn {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 1;
  min-width: 54px;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 5px;
  color: #efd9d0;
  background: rgba(255, 255, 255, 0.08);
  font: 600 0.76rem var(--sans);
  cursor: pointer;
}

.copy-btn:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.46);
  background: rgba(255, 255, 255, 0.13);
}

.copy-btn.copied {
  color: var(--accent-strong);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.security-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  margin: 24px 0 0;
  list-style: none;
}

.security-list li {
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: var(--card);
}

.security-list strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
}

.site-footer {
  padding: 42px 20px;
  color: var(--muted);
  text-align: center;
  background: var(--bg);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 20px;
  margin-bottom: 12px;
}

.footer-links a {
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--accent);
}

.site-footer p {
  margin-bottom: 0;
}

@media (hover: hover) {
  .btn,
  .step-card,
  .journey-card,
  .quickstart-nav a {
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
  }

  .btn:hover,
  .step-card:hover,
  .journey-card:hover,
  .quickstart-nav a:hover {
    transform: translateY(-2px);
  }

  .step-card:hover,
  .journey-card:hover,
  .quickstart-nav a:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
  }
}

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

  .hero-visual {
    min-height: 320px;
    max-width: 420px;
  }

  /* Keep the cross-page nav reachable on small screens: wrap it onto its own
     row of compact, tappable links instead of hiding it. */
  .top-nav {
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
    gap: 4px 6px;
  }

  .nav-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 8px;
  }

  /* Tablet: two-up cards (mobile drops to one column below 620px). */
  .steps,
  .security-list,
  .journey-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .journey-card,
  .journey-card-featured {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  .top-nav,
  .hero,
  .container,
  .container-wide {
    width: min(100% - 28px, 880px);
  }

  .top-nav {
    padding: 16px 0;
  }

  .hero {
    padding: 42px 0 62px;
  }

  .hero-visual {
    display: none;
  }

  /* Single column on phones. */
  .steps,
  .security-list,
  .journey-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2.6rem, 15vw, 4.5rem);
  }

  .hero-actions .btn,
  .quickstart-nav a {
    width: 100%;
  }

  .section {
    padding: 50px 0;
  }

  .step-card,
  .journey-card,
  .quickstart-block {
    padding: 18px;
  }

  .code-block pre {
    padding: 54px 16px 18px;
    font-size: 0.78rem;
  }

  th,
  td {
    padding: 11px 12px;
    font-size: 0.88rem;
  }

  .diagram {
    padding: 16px;
    font-size: 0.76rem;
  }
}

/* Comfortable tap targets on touch devices (WCAG 2.5.5). */
@media (pointer: coarse) {
  .btn,
  .quickstart-nav a,
  .nav-links a {
    min-height: 44px;
  }

  .copy-btn {
    min-height: 40px;
    padding: 8px 12px;
  }
}

/* Guard against horizontal overflow: code/tables scroll inside their cards
   rather than stretching the page on narrow screens. */
.code-block,
.code-block pre,
.table-wrap {
  min-width: 0;
}

.code-block pre,
.diagram,
.table-wrap {
  -webkit-overflow-scrolling: touch;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
