/* Style-guide page + common UI patterns (aligned with SiP-3.0 styles.css). */

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

* {
  margin: 0;
}

body {
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 1rem;
  line-height: 1.6;
}

.ds-wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-section-y) var(--space-section-x);
}

.ds-title {
  margin-bottom: 0.35rem;
  font-family: var(--f-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ds-lede {
  max-width: var(--reading-max);
  margin-bottom: 2.5rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.ds-section {
  margin-bottom: var(--space-section-y);
  padding-bottom: var(--space-section-y);
  border-bottom: 1px solid var(--rule);
}

.ds-section:last-of-type {
  border-bottom: 0;
}

.ds-section h2 {
  margin-bottom: 1.25rem;
  font-family: var(--f-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.ds-sub {
  margin: 1.5rem 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink);
}

.typo-display {
  margin-bottom: 0.5rem;
  font-family: var(--f-display);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.1;
}

.typo-body {
  max-width: var(--reading-max);
  margin-bottom: 1rem;
}

.typo-mono {
  font-family: var(--f-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
}

.swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 1rem;
}

.swatch {
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  background: var(--surface);
}

.swatch-chip {
  height: 4.5rem;
}

.swatch-meta {
  padding: 0.65rem 0.75rem 0.75rem;
  font-family: var(--f-mono);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  line-height: 1.45;
  color: var(--muted);
}

.swatch-meta strong {
  display: block;
  margin-bottom: 0.2rem;
  font-family: var(--f-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink);
}

.component-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 2.25rem;
}

.btn {
  display: inline-block;
  padding: 0.8125rem 1.625rem;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--f-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.12s ease;
}

.btn:hover {
  opacity: 0.92;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.btn-secondary {
  border-color: var(--ink);
  background: transparent;
  color: var(--ink);
}

.btn-accent {
  border-color: var(--sip-red);
  background: var(--sip-red);
  color: var(--white);
}

.btn-yellow {
  border-color: var(--lego-yellow);
  background: var(--lego-yellow);
  color: var(--ink);
}

.tag {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  font-family: var(--f-mono);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.card-preview {
  max-width: 20rem;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.card-img {
  position: relative;
  display: flex;
  align-items: flex-end;
  height: 11.875rem;
  padding: 1.125rem;
  background: linear-gradient(135deg, #1a1714 0%, #3a3230 55%, #121210 100%);
}

.card-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 40%,
    rgba(26, 26, 26, 0.65) 100%
  );
}

.card-img-meta {
  position: relative;
  z-index: 1;
  font-family: var(--f-mono);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.card-body {
  padding: 1.25rem 1.35rem 1.5rem;
}

.card-body .eyebrow {
  margin-bottom: 0.4rem;
  font-size: 0.625rem;
}

.card-body h4 {
  margin-bottom: 0.5rem;
  font-family: var(--f-display);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.28;
}

.card-body p {
  font-size: 0.875rem;
  line-height: 1.62;
  color: var(--muted);
}

.login-label {
  display: block;
  margin-bottom: 0.45rem;
  font-family: var(--f-mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.login-input {
  width: 100%;
  max-width: 22rem;
  margin-bottom: 1rem;
  padding: 0.8125rem 1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  font-family: var(--f-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
}

.login-input:focus {
  outline: 2px solid rgba(218, 56, 36, 0.35);
  outline-offset: 2px;
}

.ds-ref {
  margin-top: 2rem;
}

.ds-ref p {
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.ds-ref a {
  color: var(--sip-red);
}

.ds-iframe {
  width: 100%;
  max-width: 100%;
  margin-bottom: 1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.ds-iframe--header {
  height: 28rem;
}

.ds-iframe--footer {
  height: 12rem;
}
