/*
 * HyperKode website — page layouts and shared site chrome.
 * Author: Carlos Enrique Ortiz (CEO)
 * Copyright (c) 2026 HyperKode · https://hyperkode.com
 * License: Not specified; existing rights notices apply.
 */

/* Support and privacy pages. */
.support-page .intro {
  margin: 18px 0 24px;
}
.support-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 32px;
}
.support-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
}
.support-project {
  border-top: 1px solid var(--line);
  padding-top: 28px;
  scroll-margin-top: 24px;
  overflow-wrap: anywhere;
}
.support-project:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 8px;
}
.support-project h2 {
  font-size: clamp(24px, 5vw, 30px);
  line-height: 1.25;
  letter-spacing: -0.7px;
  margin: 10px 0 14px;
}
.support-project h3 {
  font-size: var(--text-card-title);
  line-height: 1.4;
  margin: 28px 0 10px;
}
.support-project p,
.support-project ul {
  color: var(--text-prose);
  margin: 0 0 14px;
}
.support-project ul {
  padding-left: 22px;
}
.support-project li + li {
  margin-top: 8px;
}
.support-project a,
.support-nav a {
  text-underline-offset: 4px;
}
.skip-link {
  position: absolute;
  top: 12px;
  left: 16px;
  z-index: 1;
  padding: 8px 12px;
  background: var(--surface-dialog);
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: translateY(0);
}

/* Long-form policy content shares the support page's branding. */
.privacy-policy {
  overflow-wrap: anywhere;
}
.privacy-policy h1 {
  font-size: clamp(32px, 7vw, 48px);
}
.privacy-policy h2 {
  margin: 32px 0 12px;
  font-size: var(--text-section-title);
  line-height: 1.35;
  letter-spacing: -0.4px;
  scroll-margin-top: 24px;
}
.privacy-policy h3 {
  margin: 24px 0 10px;
  font-size: var(--text-lead);
  line-height: 1.4;
}
.privacy-policy p,
.privacy-policy ul {
  color: var(--text-prose);
}
.privacy-policy ul {
  padding-left: 22px;
}
.privacy-policy li + li {
  margin-top: 8px;
}
.privacy-policy a {
  text-underline-offset: 4px;
}
.privacy-policy .meta {
  color: var(--muted);
  font-size: var(--text-small);
}
.privacy-policy .card {
  border: 1px solid var(--line);
  border-radius: var(--radius-media);
  padding: 4px 20px;
  background: var(--surface-inset);
}

/* Project screenshots use the same page width on desktop and mobile. */
.project-screenshot {
  margin: 24px 0 32px;
}
.project-screenshot a {
  display: block;
  border-radius: var(--radius-media);
}
.project-screenshot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-media);
}
.project-screenshot figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: var(--text-caption);
  line-height: 1.6;
}

/* Compact previews show the top of an authentic capture; detail pages keep it whole. */
.project-screenshot--preview {
  margin: 0;
}
.project-screenshot--preview img {
  height: 240px;
  object-fit: cover;
  object-position: top;
}

.project-screenshot--mobile {
  max-width: 390px;
  margin-inline: auto;
}

.watch-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 24px;
  max-width: 600px;
  margin: 24px auto 32px;
}
.watch-gallery .project-screenshot {
  margin: 0;
}

.architecture-diagram {
  margin: 24px 0 32px;
}
.architecture-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-media);
  background: var(--surface-inset);
}
.architecture-scroll:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 6px;
}
.architecture-scroll img {
  display: block;
  width: 100%;
  min-width: 680px;
  height: auto;
}
.architecture-diagram figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: var(--text-caption);
  line-height: 1.6;
}

.simplex-actions {
  margin-bottom: 24px;
}
.simplex-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--target-min);
  padding: 10px 18px;
  border: 1px solid var(--cyan);
  border-radius: var(--radius-control);
  color: var(--cyan);
  font-size: var(--text-control);
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
}
.simplex-button:hover {
  background: #8be9ff12;
  text-decoration: underline;
}

/* Shared chrome is server-independent and present even without JavaScript. */
.site-header {
  margin-bottom: 32px;
}
.site-header .intro {
  margin-bottom: 0;
}
.site-title {
  font-size: var(--text-display);
  font-weight: 720;
  letter-spacing: -2.2px;
  line-height: 1.1;
  background: var(--brand-gradient);
  background-clip: text;
  color: transparent;
  text-decoration: none;
}
@media (max-width: 750px) {
  .site-title {
    font-size: clamp(28px, 8.5vw, 38px);
  }
}
/* Preserve a page-level heading without duplicating the visible shared brand. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 20px;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
  color: var(--muted);
  text-decoration: none;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.page-content {
  min-width: 0;
}

/* Visual reference: examples reuse shared components; only its layout is local. */
.ui-reference section {
  margin-top: 40px;
}
.ui-reference > header > .section-label {
  margin-bottom: 12px;
}
.ui-reference p {
  color: var(--text-prose);
}
.ui-reference .section-label,
.ui-reference .ui-reference-note,
.ui-token-label {
  color: var(--muted);
}
.ui-reference-note {
  font-size: var(--text-small);
}
.ui-reference code {
  overflow-wrap: anywhere;
  font-size: var(--text-caption);
}
.ui-token-label code,
.ui-swatch code {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}
.ui-token-label {
  font-size: var(--text-caption);
}
.ui-type-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(0, 3fr);
  gap: 24px;
  align-items: baseline;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.ui-type-row p {
  margin: 0;
  overflow-wrap: anywhere;
}
.ui-type-display {
  line-height: 1.1;
  letter-spacing: -2.2px;
  font-weight: 720;
}
.ui-swatch-grid,
.ui-surface-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 16px;
  margin: 24px 0;
}
.ui-swatch {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-media);
  overflow: hidden;
}
.ui-swatch-color {
  height: 88px;
  border-bottom: 1px solid var(--border-strong);
}
.ui-swatch p {
  margin: 0;
  padding: 16px;
  font-size: var(--text-control);
}
.ui-example {
  padding: 24px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-card);
  background: var(--surface-card);
}
.ui-example > .ui-token-label:not(:first-child) {
  margin-top: 32px;
}
.ui-surface-grid h3 {
  font-size: var(--text-card-title);
  margin: 12px 0;
}
.ui-surface-grid .preview {
  padding: 24px;
}
.ui-icon-example {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: var(--text-small);
}
.ui-icon-example .icon {
  width: 37px;
  height: 37px;
  flex-shrink: 0;
  color: var(--cyan);
}
.ui-type-display {
  font-size: var(--text-display);
}
.ui-type-detail-title {
  font-size: var(--text-detail-title);
}
.ui-type-section-title {
  font-size: var(--text-section-title);
}
.ui-type-card-title {
  font-size: var(--text-card-title);
}
.ui-type-lead {
  font-size: var(--text-lead);
}
.ui-type-body {
  font-size: var(--text-body);
}
.ui-type-control {
  font-size: var(--text-control);
}
.ui-type-small {
  font-size: var(--text-small);
}
.ui-type-caption {
  font-size: var(--text-caption);
}
.ui-type-label {
  font-size: var(--text-label);
}
.ui-color-canvas {
  background: var(--canvas);
}
.ui-color-surface-preview {
  background: var(--surface-preview);
}
.ui-color-surface-dialog {
  background: var(--surface-dialog);
}
.ui-color-surface-inset {
  background: var(--surface-inset);
}
.ui-color-ink {
  background: var(--ink);
}
.ui-color-text-prose {
  background: var(--text-prose);
}
.ui-color-muted {
  background: var(--muted);
}
.ui-color-cyan {
  background: var(--cyan);
}
.ui-color-violet {
  background: var(--violet);
}
.ui-color-green {
  background: var(--green);
}
@media (max-width: 750px) {
  .ui-type-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .ui-type-display {
    font-size: var(--text-display-mobile);
  }
  .ui-example,
  .ui-surface-grid .preview {
    padding: 16px;
  }
}
