/* studio:layered */
@layer theme, base, components, utilities;
@layer components {
/*
 * Component recipes for this web style (docs/web-kits/DESIGN.md §1.3).
 * Rules: only var(--ws-*) values (no raw hex), every :hover / :focus-visible / :active rule is mirrored by
 * .is-hover / .is-focus / .is-active so the gallery can show states, motion only inside prefers-reduced-motion.
 * Replace these neutral template recipes with what the references show (shape, weight, borders, shadows, density).
 */

/* ---------- base ---------- */
.ws-root {
  background: var(--ws-color-background);
  color: var(--ws-color-foreground);
  font-family: var(--ws-font-body);
  font-size: var(--ws-text-base);
  line-height: var(--ws-leading-normal);
  -webkit-font-smoothing: antialiased;
}
.ws-root :where(h1, h2, h3, h4) {
  font-family: var(--ws-font-heading);
  font-weight: var(--ws-font-weight-bold);
  line-height: var(--ws-leading-tight);
  letter-spacing: var(--ws-tracking-tight);
  text-wrap: balance;
  margin: 0;
}
.ws-root :where(p) {
  text-wrap: pretty;
}
.ws-eyebrow {
  font-size: var(--ws-text-sm);
  font-weight: var(--ws-font-weight-semibold);
  letter-spacing: var(--ws-tracking-wide);
  text-transform: uppercase;
  color: var(--ws-color-primary);
}

/* ---------- button ---------- */
.ws-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 44px;
  padding: 0.65em 1.25em;
  border: 1px solid transparent;
  border-radius: var(--ws-radius-md);
  font-family: var(--ws-font-body);
  font-size: var(--ws-text-base);
  font-weight: var(--ws-font-weight-semibold);
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.ws-btn:focus-visible,
.ws-btn.is-focus {
  outline: 2px solid var(--ws-color-ring);
  outline-offset: 2px;
}
.ws-btn-primary {
  background: var(--ws-color-primary);
  color: var(--ws-color-primary-foreground);
  box-shadow: var(--ws-shadow-sm);
}
.ws-btn-primary:hover,
.ws-btn-primary.is-hover {
  background: color-mix(in oklab, var(--ws-color-primary) 88%, var(--ws-color-foreground));
}
.ws-btn-primary:active,
.ws-btn-primary.is-active {
  background: color-mix(in oklab, var(--ws-color-primary) 80%, var(--ws-color-foreground));
}
.ws-btn-secondary {
  background: var(--ws-color-background);
  color: var(--ws-color-foreground);
  border-color: var(--ws-color-border);
}
.ws-btn-secondary:hover,
.ws-btn-secondary.is-hover {
  background: var(--ws-color-surface);
}
.ws-btn-ghost {
  background: transparent;
  color: var(--ws-color-foreground);
}
.ws-btn-ghost:hover,
.ws-btn-ghost.is-hover {
  background: var(--ws-color-muted);
}
.ws-btn:disabled,
.ws-btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}
.ws-btn-sm {
  min-height: 36px;
  padding: 0.45em 0.9em;
  font-size: var(--ws-text-sm);
}
.ws-btn-lg {
  min-height: 52px;
  padding: 0.8em 1.6em;
  font-size: var(--ws-text-lg);
}

/* ---------- form ---------- */
.ws-field {
  display: grid;
  gap: 0.4rem;
}
.ws-label {
  font-size: var(--ws-text-sm);
  font-weight: var(--ws-font-weight-medium);
}
.ws-input {
  width: 100%;
  min-height: 44px;
  padding: 0.6em 0.85em;
  background: var(--ws-color-background);
  color: var(--ws-color-foreground);
  border: 1px solid var(--ws-color-border);
  border-radius: var(--ws-radius-md);
  font: inherit;
}
.ws-input::placeholder {
  color: var(--ws-color-muted-foreground);
}
.ws-input:focus-visible,
.ws-input.is-focus {
  outline: 2px solid var(--ws-color-ring);
  outline-offset: 1px;
  border-color: var(--ws-color-ring);
}
.ws-help {
  font-size: var(--ws-text-sm);
  color: var(--ws-color-muted-foreground);
}
.ws-field.is-error .ws-input {
  border-color: var(--ws-color-danger);
}
.ws-field.is-error .ws-help {
  color: var(--ws-color-danger);
}

/* ---------- card / badge ---------- */
.ws-card {
  background: var(--ws-color-surface);
  color: var(--ws-color-surface-foreground);
  border: 1px solid var(--ws-color-border);
  border-radius: var(--ws-radius-lg);
  padding: clamp(1.25rem, 1rem + 1vw, 1.75rem);
}
.ws-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.2em 0.65em;
  border-radius: var(--ws-radius-full);
  background: color-mix(in oklab, var(--ws-color-primary) 12%, var(--ws-color-background));
  color: var(--ws-color-primary);
  font-size: var(--ws-text-xs);
  font-weight: var(--ws-font-weight-semibold);
}

/* ---------- nav ---------- */
.ws-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.85rem var(--ws-space-gutter);
  background: color-mix(in oklab, var(--ws-color-background) 88%, transparent);
  border-bottom: 1px solid var(--ws-color-border);
  backdrop-filter: saturate(1.4) blur(10px);
}
.ws-nav a {
  color: var(--ws-color-muted-foreground);
  text-decoration: none;
  font-size: var(--ws-text-sm);
  font-weight: var(--ws-font-weight-medium);
}
.ws-nav a:hover,
.ws-nav a.is-hover,
.ws-nav a[aria-current="page"] {
  color: var(--ws-color-foreground);
}

/* ---------- hero / feature ---------- */
.ws-hero {
  display: grid;
  gap: 1.25rem;
  padding-block: var(--ws-space-section);
}
.ws-hero h1 {
  font-size: var(--ws-text-5xl);
}
.ws-hero p {
  font-size: var(--ws-text-xl);
  color: var(--ws-color-muted-foreground);
  max-width: 40rem;
}
.ws-feature {
  display: grid;
  gap: 0.6rem;
}
.ws-feature .ws-icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--ws-radius-md);
  background: color-mix(in oklab, var(--ws-color-primary) 12%, var(--ws-color-background));
  color: var(--ws-color-primary);
}
.ws-feature h3 {
  font-size: var(--ws-text-lg);
}
.ws-feature p {
  color: var(--ws-color-muted-foreground);
  margin: 0;
}

/* ---------- pricing / testimonial / faq ---------- */
.ws-pricing {
  display: grid;
  gap: 1rem;
  align-content: start;
  background: var(--ws-color-background);
  border: 1px solid var(--ws-color-border);
  border-radius: var(--ws-radius-lg);
  padding: 1.75rem;
}
.ws-pricing.is-featured {
  border-color: var(--ws-color-primary);
  box-shadow: var(--ws-shadow-lg);
}
.ws-pricing .ws-price {
  font-family: var(--ws-font-heading);
  font-size: var(--ws-text-4xl);
  font-weight: var(--ws-font-weight-bold);
  line-height: 1;
}
.ws-testimonial {
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: var(--ws-radius-lg);
  background: var(--ws-color-surface);
}
.ws-testimonial blockquote {
  margin: 0;
  font-size: var(--ws-text-lg);
}
.ws-testimonial figcaption {
  font-size: var(--ws-text-sm);
  color: var(--ws-color-muted-foreground);
}
.ws-faq {
  border-bottom: 1px solid var(--ws-color-border);
  padding-block: 1rem;
}
.ws-faq summary {
  cursor: pointer;
  font-weight: var(--ws-font-weight-semibold);
  list-style-position: outside;
}
.ws-faq p {
  color: var(--ws-color-muted-foreground);
  margin: 0.6rem 0 0;
}

/* ---------- footer ---------- */
.ws-footer {
  padding: 3rem var(--ws-space-gutter);
  border-top: 1px solid var(--ws-color-border);
  color: var(--ws-color-muted-foreground);
  font-size: var(--ws-text-sm);
}
.ws-footer a {
  color: inherit;
}

/* ---------- toast / notification ---------- */
.ws-toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 0.75rem;
  max-width: 24rem;
  padding: 0.9rem 1rem;
  background: var(--ws-color-background);
  color: var(--ws-color-foreground);
  border: 1px solid var(--ws-color-border);
  border-radius: var(--ws-radius-md);
  box-shadow: var(--ws-shadow-lg);
  font-size: var(--ws-text-sm);
}
.ws-toast.is-success {
  border-left: 3px solid var(--ws-color-success);
}
.ws-toast.is-error {
  border-left: 3px solid var(--ws-color-danger);
}

/* ---------- chat ---------- */
.ws-chat {
  display: grid;
  gap: 0.6rem;
  padding: 1rem;
  background: var(--ws-color-surface);
  border: 1px solid var(--ws-color-border);
  border-radius: var(--ws-radius-lg);
}
.ws-bubble {
  justify-self: start;
  max-width: 80%;
  padding: 0.6rem 0.9rem;
  background: var(--ws-color-background);
  border: 1px solid var(--ws-color-border);
  border-radius: var(--ws-radius-lg) var(--ws-radius-lg) var(--ws-radius-lg) var(--ws-radius-sm);
  font-size: var(--ws-text-sm);
}
.ws-bubble.is-me {
  justify-self: end;
  background: var(--ws-color-primary);
  color: var(--ws-color-primary-foreground);
  border-color: transparent;
  border-radius: var(--ws-radius-lg) var(--ws-radius-lg) var(--ws-radius-sm) var(--ws-radius-lg);
}
.ws-composer {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.4rem;
}

/* ---------- modal / tabs ---------- */
.ws-modal {
  width: min(28rem, 100%);
  padding: 1.5rem;
  background: var(--ws-color-background);
  color: var(--ws-color-foreground);
  border: 1px solid var(--ws-color-border);
  border-radius: var(--ws-radius-xl);
  box-shadow: var(--ws-shadow-lg);
}
.ws-tabs {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--ws-color-muted);
  border-radius: var(--ws-radius-md);
}
.ws-tab {
  padding: 0.45rem 0.9rem;
  border: 0;
  border-radius: calc(var(--ws-radius-md) - 2px);
  background: transparent;
  color: var(--ws-color-muted-foreground);
  font: inherit;
  font-size: var(--ws-text-sm);
  font-weight: var(--ws-font-weight-medium);
  cursor: pointer;
}
.ws-tab[aria-selected="true"] {
  background: var(--ws-color-background);
  color: var(--ws-color-foreground);
  box-shadow: var(--ws-shadow-sm);
}
.ws-tab:focus-visible,
.ws-tab.is-focus {
  outline: 2px solid var(--ws-color-ring);
  outline-offset: 1px;
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .ws-btn,
  .ws-input,
  .ws-nav a,
  .ws-tab {
    transition:
      background-color var(--ws-duration-base) var(--ws-ease-out),
      color var(--ws-duration-base) var(--ws-ease-out),
      border-color var(--ws-duration-base) var(--ws-ease-out),
      box-shadow var(--ws-duration-base) var(--ws-ease-out);
  }
}
}
