/*
 * Layout families of the marketing pages (tools/site/layouts.py). Same tokens as marketing.css: flat surfaces (1px lines,
 * no shadows), the sand frame for product visuals, black pills, yellow only as a small highlight.
 */

/* ---------------------------------------------------------------- Heroes */

.ly-hero-split {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 64px 0 56px;
}

.ly-hero-split::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 520px;
  background-image: radial-gradient(rgba(17, 17, 17, 0.14) 1px, transparent 1.4px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 70% 100% at 20% 0, #000 10%, transparent 70%);
  mask-image: radial-gradient(ellipse 70% 100% at 20% 0, #000 10%, transparent 70%);
}

.ly-hero-split-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
  gap: 48px;
  align-items: center;
}

.ly-hero-copy h1 {
  margin: 0 0 20px;
  font-size: clamp(2.3rem, 4.4vw, 3.9rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.ly-hero-copy .mk-lead {
  margin: 0 0 28px;
  max-width: 34rem;
  font-size: 1.12rem;
}

.ly-hero-copy .mk-cta {
  justify-content: flex-start;
}

.ly-hero-copy .mk-note {
  margin-top: 20px;
}

.ly-hero-frame {
  margin: 0;
  padding: 28px;
  min-width: 0;
}

.ly-hero-frame .mk-app {
  margin: 0;
  border-bottom: 1px solid rgba(17, 17, 17, 0.15);
  border-radius: 12px;
}

.ly-hero-compact {
  padding: 72px 0 40px;
  text-align: center;
}

.ly-hero-compact h1 {
  margin: 0 auto 18px;
  max-width: 18ch;
  font-size: clamp(2.2rem, 4.8vw, 4rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.ly-hero-compact .mk-lead {
  margin: 0 auto 26px;
  max-width: 38rem;
}

.ly-facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 26px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.9rem;
}

.ly-facts li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ly-facts svg {
  width: 16px;
  height: 16px;
  color: #0e7a5a;
}

.ly-hero-left {
  padding: 72px 0 40px;
}

.ly-hero-left-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 48px;
  align-items: end;
}

.ly-hero-left h1 {
  margin: 0;
  font-size: clamp(2.4rem, 5.4vw, 4.6rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.ly-hero-left-side .mk-lead {
  margin: 0 0 22px;
  max-width: 30rem;
}

.ly-hero-left-side .mk-cta {
  justify-content: flex-start;
}

.ly-meta,
.ly-facts-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 24px;
  margin: 44px 0 0;
  padding-top: 24px;
  border-top: 1px solid #111;
}

.ly-meta dt,
.ly-facts-row dt {
  color: var(--muted);
  font-size: 0.85rem;
}

.ly-meta dd,
.ly-facts-row dd {
  margin: 4px 0 0;
  font-family: var(--font-head);
  font-size: 1.9rem;
  letter-spacing: -0.03em;
}

.ly-meta div,
.ly-facts-row div {
  display: flex;
  flex-direction: column-reverse;
}

.ly-hero-guide {
  padding: 40px 0 24px;
}

.ly-hero-guide h1 {
  margin: 28px 0 16px;
  max-width: 20ch;
  font-size: clamp(2.2rem, 4.8vw, 4rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.ly-hero-guide .mk-lead {
  margin: 0 0 24px;
  max-width: 40rem;
}

.ly-hero-guide .mk-cta {
  justify-content: flex-start;
}

.ly-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.ly-crumbs a {
  color: var(--muted);
}

.ly-crumbs [aria-current] {
  color: var(--ink);
}

/* ---------------------------------------------------------------- Services: vertical tabs, numbered rows */

.ly-vtabs {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 40px;
  margin-top: 40px;
  align-items: start;
}

.ly-vtabs > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ly-vt-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.ly-vt-list label {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 8px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.ly-vt-num {
  color: #9a988f;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  padding-top: 5px;
}

.ly-vt-text b {
  display: block;
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: #8a887f;
  transition: color 0.2s ease;
}

.ly-vt-list label:hover b {
  color: var(--ink);
}

.ly-vt-body {
  display: grid;
  max-height: 0;
  overflow: hidden;
  gap: 12px;
  color: var(--muted);
  opacity: 0;
  transition: max-height 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease, margin 0.3s ease;
}

.ly-vtabs:not(:has(input:checked)) .ly-vt-list label:first-child .ly-vt-body,
.ly-vtabs:has(input:nth-of-type(1):checked) .ly-vt-list label:nth-child(1) .ly-vt-body,
.ly-vtabs:has(input:nth-of-type(2):checked) .ly-vt-list label:nth-child(2) .ly-vt-body,
.ly-vtabs:has(input:nth-of-type(3):checked) .ly-vt-list label:nth-child(3) .ly-vt-body,
.ly-vtabs:has(input:nth-of-type(4):checked) .ly-vt-list label:nth-child(4) .ly-vt-body,
.ly-vtabs:has(input:nth-of-type(5):checked) .ly-vt-list label:nth-child(5) .ly-vt-body,
.ly-vtabs:has(input:nth-of-type(6):checked) .ly-vt-list label:nth-child(6) .ly-vt-body {
  max-height: 220px;
  margin-top: 10px;
  opacity: 1;
}

.ly-vtabs:has(input:nth-of-type(1):checked) .ly-vt-list label:nth-child(1) b,
.ly-vtabs:has(input:nth-of-type(2):checked) .ly-vt-list label:nth-child(2) b,
.ly-vtabs:has(input:nth-of-type(3):checked) .ly-vt-list label:nth-child(3) b,
.ly-vtabs:has(input:nth-of-type(4):checked) .ly-vt-list label:nth-child(4) b,
.ly-vtabs:has(input:nth-of-type(5):checked) .ly-vt-list label:nth-child(5) b,
.ly-vtabs:has(input:nth-of-type(6):checked) .ly-vt-list label:nth-child(6) b {
  color: var(--ink);
}

.ly-vt-panels {
  position: sticky;
  top: 96px;
}

.ly-vt-panel {
  display: none;
  min-height: 360px;
}

.ly-vtabs:not(:has(input:checked)) .ly-vt-panel:nth-child(1),
.ly-vtabs:has(input:nth-of-type(1):checked) .ly-vt-panel:nth-child(1),
.ly-vtabs:has(input:nth-of-type(2):checked) .ly-vt-panel:nth-child(2),
.ly-vtabs:has(input:nth-of-type(3):checked) .ly-vt-panel:nth-child(3),
.ly-vtabs:has(input:nth-of-type(4):checked) .ly-vt-panel:nth-child(4),
.ly-vtabs:has(input:nth-of-type(5):checked) .ly-vt-panel:nth-child(5),
.ly-vtabs:has(input:nth-of-type(6):checked) .ly-vt-panel:nth-child(6) {
  display: block;
  animation: ly-fade 0.4s ease;
}

@keyframes ly-fade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.ly-rows {
  display: grid;
  margin-top: 40px;
  border-top: 1px solid #111;
}

.ly-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1.2fr) 130px;
  gap: 24px;
  align-items: baseline;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.ly-row-num {
  color: #9a988f;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.85rem;
}

.ly-row h3 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: -0.025em;
}

.ly-row p {
  margin: 0;
  color: var(--muted);
}

/* ---------------------------------------------------------------- Features: tiles and before / after */

.ly-tiles {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  margin-top: 40px;
}

.ly-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px;
  border: 1px solid #111;
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
  min-width: 0;
}

.ly-w4 {
  grid-column: span 4;
}

.ly-w6 {
  grid-column: span 6;
}

.ly-w8 {
  grid-column: span 8;
}

.ly-w12 {
  grid-column: span 12;
}

.ly-tall {
  min-height: 460px;
}

.ly-tile small {
  display: block;
  margin-bottom: 14px;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ly-tile h3 {
  margin: 0 0 8px;
  font-size: 1.7rem;
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.ly-tile > p {
  margin: 0 0 16px;
  max-width: 34rem;
  opacity: 0.82;
}

.ly-tile .mk-more {
  margin-bottom: 18px;
}

.ly-tile-visual {
  margin-top: auto;
  padding-top: 8px;
  min-width: 0;
}

.ly-tone-y {
  background: var(--yellow);
}

.ly-tone-l {
  background: #dedbfa;
}

.ly-tone-g {
  background: #d3eadb;
}

.ly-tone-s {
  background: #dce4e8;
}

.ly-tone-r {
  background: #eedfd7;
}

.ly-tone-sand {
  background: var(--sand);
}

.ly-tone-k {
  background: #111;
  color: #fff;
}

.ly-tone-k .mk-more {
  color: #fff;
}

.ly-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 40px;
}

.ly-side {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.ly-side h3 {
  margin: 0 0 18px;
  font-size: 1.7rem;
  font-weight: 400;
  letter-spacing: -0.03em;
}

.ly-side ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ly-side li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.ly-side li svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.ly-before {
  background: var(--band);
  color: var(--muted);
}

.ly-after {
  border-color: #111;
}

.ly-after li svg {
  color: #0e7a5a;
}

/* ---------------------------------------------------------------- Developers and guides */

.ly-toc {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  padding-top: 24px;
  padding-bottom: 80px;
}

.ly-toc-nav {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 2px;
}

.ly-toc-nav a {
  padding: 8px 12px;
  margin: 0 -12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.ly-toc-nav a:hover {
  background: var(--soft);
  color: var(--ink);
}

.ly-toc-body {
  display: grid;
  gap: 72px;
  min-width: 0;
}

.ly-step {
  display: grid;
  gap: 20px;
  scroll-margin-top: 100px;
}

.ly-step-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ly-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #111;
  border-radius: 50%;
  font-family: var(--font-head);
  font-size: 1.2rem;
}

.ly-step-head h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 400;
  letter-spacing: -0.03em;
}

.ly-step-body {
  display: grid;
  gap: 18px;
  padding-left: 56px;
  min-width: 0;
}

.ly-step-body p {
  margin: 0;
  max-width: 44rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.ly-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.ly-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.ly-table caption {
  padding: 14px 18px;
  text-align: left;
  color: var(--muted);
}

.ly-table th,
.ly-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.ly-table thead th {
  background: var(--band);
  color: var(--muted);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ly-table tbody th {
  font-weight: 500;
}

.ly-table tr:last-child th,
.ly-table tr:last-child td {
  border-bottom: 0;
}

.ly-table code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--soft);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.85em;
}

.ly-checklist {
  padding: 28px;
  border: 1px solid #111;
  border-radius: 18px;
  background: var(--yellow);
}

.ly-checklist h3 {
  margin: 0 0 14px;
  font-size: 1.6rem;
  font-weight: 400;
}

.ly-checklist ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ly-checklist li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.ly-checklist svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.ly-del {
  display: block;
  color: #ff9b8f;
}

.ly-add {
  display: block;
  color: #8fe0b0;
}

/* ---------------------------------------------------------------- Catalog, list, help */

.ly-catalog {
  margin-top: 8px;
}

.ly-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.ly-chips input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ly-chips label {
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ly-chips label:hover {
  border-color: #111;
}

.ly-chips input:checked + label {
  border-color: #111;
  background: #111;
  color: #fff;
}

.ly-chips input:focus-visible + label {
  outline: 2px solid #111;
  outline-offset: 2px;
}

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

.ly-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.2s ease;
}

a.ly-card:hover {
  border-color: #111;
}

.ly-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ly-card h3 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: -0.025em;
}

.ly-card p {
  margin: 0 0 8px;
  color: var(--muted);
}

.ly-card .mk-more {
  margin-top: auto;
  font-size: 0.92rem;
}

.ly-card-tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--soft);
  color: #3d3d3a;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  font-style: normal;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ly-catalog:has(.ly-cf-1:checked) .ly-card:not(.ly-in-1),
.ly-catalog:has(.ly-cf-2:checked) .ly-card:not(.ly-in-2),
.ly-catalog:has(.ly-cf-3:checked) .ly-card:not(.ly-in-3),
.ly-catalog:has(.ly-cf-4:checked) .ly-card:not(.ly-in-4),
.ly-catalog:has(.ly-cf-5:checked) .ly-card:not(.ly-in-5),
.ly-catalog:has(.ly-cf-6:checked) .ly-card:not(.ly-in-6),
.ly-catalog:has(.ly-cf-7:checked) .ly-card:not(.ly-in-7),
.ly-catalog:has(.ly-cf-8:checked) .ly-card:not(.ly-in-8) {
  display: none;
}

.ly-timeline {
  display: grid;
  max-width: 920px;
  margin: 8px auto 0;
}

.ly-entry {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 32px;
  padding: 36px 0;
  border-top: 1px solid var(--line);
}

.ly-entry-date {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.82rem;
}

.ly-entry-body h3 {
  margin: 0 0 8px;
  font-size: 1.7rem;
  font-weight: 400;
  letter-spacing: -0.03em;
}

.ly-entry-body p {
  margin: 0 0 16px;
  color: var(--muted);
  max-width: 40rem;
}

.ly-entry-visual {
  padding: 20px;
  border-radius: 14px;
  background: var(--sand);
}

.ly-topics {
  display: grid;
  max-width: 920px;
  border-top: 1px solid #111;
}

.ly-topic {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.ly-topic b {
  display: block;
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.025em;
}

.ly-topic small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.95rem;
}

.ly-topic > svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ly-topic:hover > svg {
  transform: translateX(6px);
}

/* ---------------------------------------------------------------- Responsive */

@media (max-width: 1000px) {
  .ly-hero-split-grid,
  .ly-hero-left-grid,
  .ly-vtabs,
  .ly-compare {
    grid-template-columns: minmax(0, 1fr);
  }

  .ly-vt-panels {
    position: static;
  }

  .ly-w4,
  .ly-w6,
  .ly-w8 {
    grid-column: span 12;
  }

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

  .ly-toc {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .ly-toc-nav {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .ly-toc-nav .mk-label {
    flex: 0 0 100%;
  }

  .ly-toc-nav a {
    margin: 0;
    border: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .ly-hero-split,
  .ly-hero-compact,
  .ly-hero-left {
    padding-top: 40px;
  }

  .ly-cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .ly-row {
    grid-template-columns: 44px minmax(0, 1fr);
    row-gap: 8px;
  }

  .ly-row p,
  .ly-row .mk-more {
    grid-column: 2;
  }

  .ly-entry {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .ly-entry-date {
    flex-direction: row;
    align-items: center;
  }

  .ly-step-body {
    padding-left: 0;
  }

  .ly-meta,
  .ly-facts-row {
    grid-auto-flow: row;
    gap: 16px;
  }

  .ly-tall {
    min-height: 0;
  }

  .ly-hero-frame {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ly-vt-body,
  .ly-vt-text b,
  .ly-chips label,
  .ly-topic > svg,
  .ly-toc-nav a {
    transition: none;
  }

  .ly-vt-panel {
    animation: none !important;
  }
}
