/* Cylentium components. Plain CSS on top of tokens.css. Prefix: cy- */

body { margin: 0; background: var(--surface); color: var(--ink); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
[data-theme] { color: var(--ink); }
.cy-demo { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; padding: var(--space-6); }

/* Focus: one ring everywhere. */
:where(a, button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Label: the section label. A square mark, then mono caps. */
.cy-label { display: inline-flex; align-items: center; gap: var(--space-2); margin: 0; font-family: var(--font-sans); font-size: 11px; line-height: 16px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-subtle); }
.cy-label::before { content: ""; width: 8px; height: 8px; flex: none; background: var(--ink); }
.cy-label--plain::before { display: none; }
.cy-label--exposure { color: var(--exposure); }
.cy-label--exposure::before { background: var(--exposure); }

/* Button: primary, secondary, quiet. One facet-s cut, bottom-right. */
.cy-btn { --cy-cut: var(--facet-s); --cy-btn-fill: var(--surface); position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-3); min-height: 48px; padding: 0 var(--space-6); box-sizing: border-box; border: 0; border-radius: 0; font-family: var(--font-sans); font-size: 13px; line-height: 1; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; white-space: nowrap; cursor: pointer; clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cy-cut)), calc(100% - var(--cy-cut)) 100%, 0 100%); transition: background-color .16s linear, color .16s linear; }
.cy-btn--primary { background: var(--action); color: var(--on-action); }
.cy-btn--primary:hover { background: var(--action-hover); }
.cy-btn--secondary { background: var(--line-strong); color: var(--ink); }
.cy-btn--secondary::before { content: ""; position: absolute; inset: 1px; z-index: -1; background: var(--cy-btn-fill); clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cy-cut) + 0.41px), calc(100% - var(--cy-cut) + 0.41px) 100%, 0 100%); transition: background-color .16s linear; }
.cy-btn--secondary:hover { background: var(--ink); }
.cy-btn--quiet { min-height: 44px; padding: 0; background: transparent; color: var(--ink); clip-path: none; }
.cy-btn--quiet:hover { color: var(--ink-muted); }
.cy-btn:focus-visible { clip-path: none; }
.cy-btn__icon { width: 16px; height: 16px; flex: none; transition: transform .16s linear; }
.cy-btn:hover .cy-btn__icon { transform: translateX(3px); }

/* Tag: mono caps chip for standards and states. */
.cy-tag { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px; box-sizing: border-box; border: 1px solid var(--line); border-radius: var(--radius-1); font-family: var(--font-sans); font-size: 11px; line-height: 1; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; color: var(--ink-muted); }
.cy-tag__dot { width: 6px; height: 6px; flex: none; background: currentColor; }
.cy-tag--solid { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.cy-tag--exposure { border-color: var(--exposure); color: var(--exposure); }
.cy-tag--live .cy-tag__dot { border-radius: var(--radius-full); animation: cy-blink 1.6s steps(1, end) infinite; }
@keyframes cy-blink { 50% { opacity: .25; } }

/* Readout: proof-band numeral over a hairline. */
.cy-readout { position: relative; display: flex; flex-direction: column; gap: var(--space-3); margin: 0; padding-top: var(--space-4); border-top: 1px solid var(--line); }
.cy-readout::before { content: ""; position: absolute; top: -1px; left: 0; width: var(--space-6); height: 1px; background: var(--ink); }
.cy-readout__value { margin: 0; font-family: var(--font-display); font-size: clamp(44px, 4.8vw, 64px); line-height: 1; font-weight: 400; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--ink); }
.cy-readout__caption { margin: 0; max-width: 26ch; font-size: 14px; line-height: 1.5; color: var(--ink-muted); }

/* Facet card: 1px frame, one facet-m cut at the top-right. */
.cy-card { --cy-cut: var(--facet-m); position: relative; display: block; box-sizing: border-box; padding: 1px; background: var(--line); text-decoration: none; color: inherit; clip-path: polygon(0 0, calc(100% - var(--cy-cut)) 0, 100% var(--cy-cut), 100% 100%, 0 100%); transition: background-color .16s linear; }
.cy-card__body { box-sizing: border-box; height: 100%; display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-8); background: var(--surface-raised); clip-path: polygon(0 0, calc(100% - var(--cy-cut) + 0.41px) 0, 100% calc(var(--cy-cut) - 0.41px), 100% 100%, 0 100%); }
a.cy-card:hover { background: var(--line-strong); }
.cy-card__meta { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.cy-card__icon { width: 24px; height: 24px; color: var(--ink); }
.cy-card__title { margin: 0; font-family: var(--font-display); font-size: 22px; line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); text-wrap: balance; }
.cy-card__text { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink-muted); }

/* Spec list: mono keys, plain values. */
.cy-spec { display: grid; grid-template-columns: minmax(0, 12rem) minmax(0, 1fr); margin: 0; border-top: 1px solid var(--line); }
.cy-spec dt, .cy-spec dd { margin: 0; padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
.cy-spec dt { padding-right: var(--space-4); font-family: var(--font-sans); font-size: 11px; line-height: 22px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-subtle); }
.cy-spec dd { font-size: 15px; line-height: 22px; color: var(--ink); }
@media (max-width: 560px) {
  .cy-spec { grid-template-columns: minmax(0, 1fr); }
  .cy-spec dt { padding-bottom: 0; border-bottom: 0; }
}

/* Field: label, control, help. */
.cy-field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.cy-field__label { font-family: var(--font-sans); font-size: 11px; line-height: 16px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted); }
.cy-field__help { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink-subtle); }
.cy-input, .cy-select, .cy-textarea { width: 100%; min-height: 48px; box-sizing: border-box; padding: 0 var(--space-4); border: 1px solid var(--line-strong); border-radius: var(--radius-1); background: var(--surface-sunken); color: var(--ink); font-family: var(--font-sans); font-size: 16px; line-height: 1.4; transition: border-color .16s linear; }
.cy-input::placeholder, .cy-textarea::placeholder { color: var(--ink-subtle); }
.cy-input:hover, .cy-select:hover, .cy-textarea:hover { border-color: var(--ink-muted); }
.cy-input:focus-visible, .cy-select:focus-visible, .cy-textarea:focus-visible { border-color: var(--ink); }
.cy-textarea { min-height: 136px; padding: var(--space-3) var(--space-4); resize: vertical; line-height: 1.55; }
.cy-select { appearance: none; -webkit-appearance: none; padding-right: 44px; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--ink-subtle) 50%), linear-gradient(135deg, var(--ink-subtle) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; }
.cy-check { display: flex; align-items: flex-start; gap: var(--space-3); font-size: 14px; line-height: 1.5; color: var(--ink-muted); cursor: pointer; }
.cy-check input { appearance: none; -webkit-appearance: none; display: grid; place-content: center; flex: none; width: 20px; height: 20px; margin: 1px 0 0; border: 1px solid var(--line-strong); border-radius: var(--radius-1); background: var(--surface-sunken); cursor: pointer; }
.cy-check input::before { content: ""; width: 10px; height: 10px; background: var(--ink); transform: scale(0); transition: transform .16s linear; }
.cy-check input:checked::before { transform: scale(1); }

/* Link: inline text link. */
.cy-link { display: inline-flex; align-items: center; gap: var(--space-2); padding-bottom: 2px; border-bottom: 1px solid var(--line-strong); color: var(--ink); font-weight: 500; text-decoration: none; transition: border-color .16s linear; }
.cy-link:hover { border-color: var(--ink); }

/* Plus-grid backdrop: registration crosses at a 32px pitch. */
.cy-plusgrid { position: relative; isolation: isolate; }
.cy-plusgrid::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--line); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpath d='M16.5 12v9M12 16.5h9' stroke='%23000' stroke-width='1'/%3E%3C/svg%3E") 0 0 / 32px 32px repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpath d='M16.5 12v9M12 16.5h9' stroke='%23000' stroke-width='1'/%3E%3C/svg%3E") 0 0 / 32px 32px repeat; }

@media (prefers-reduced-motion: reduce) {
  .cy-tag--live .cy-tag__dot { animation: none; }
  .cy-btn, .cy-btn__icon, .cy-card, .cy-link, .cy-check input::before { transition: none; }
}
