@layer tokens, base, components, application;

@layer tokens {
 :root {
  --hum-primary:#18181b;--hum-background:#fafafa;--hum-surface:#fff;
  --hum-text:#18181b;--hum-muted:#66666e;--hum-line:#e8e8ec;--hum-subtle:#f3f3f5;
  --hum-danger:#b42332;--hum-success:#24734a;--hum-warning:#825514;
  --hum-dangerSurface:#fff2f3;--hum-successSurface:#eff8f2;--hum-warningSurface:#fff8e9;
  --hum-onPrimary:#fff;--hum-focus:var(--hum-primary);
  --hum-body:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --hum-heading:var(--hum-body);--hum-mono:ui-monospace,SFMono-Regular,monospace;
  --hum-space-none:0px;--hum-space-xs:4px;--hum-space-sm:8px;--hum-space-md:16px;--hum-space-lg:24px;--hum-space-xl:32px;
  --hum-size-xs:12px;--hum-size-sm:14px;--hum-size-md:16px;--hum-size-lg:20px;--hum-size-xl:28px;--hum-size-xxl:40px;
  --hum-radius:20px;--hum-radius-control:10px;--hum-radius-field:12px;
  --hum-gap:20px;--hum-control-height:44px;--hum-field-height:48px;
  --hum-shadow:none;--hum-selected-shadow:0 1px 3px #0000000b;
  --hum-featured:linear-gradient(125deg,#09090b 0%,#17121f 46%,#391b55 76%,#60318a 100%);
  --hum-code-background:#1c2028;--hum-code-text:#e4e8f0;
  color-scheme:light;-webkit-text-size-adjust:100%;
 }
}

@layer base {
 *{box-sizing:border-box}
 body{margin:0;font-family:var(--hum-body);color:var(--hum-text);background:var(--hum-background);font-size:var(--hum-size-md);line-height:1.5;font-synthesis:none;-webkit-font-smoothing:antialiased}
 a{color:inherit;text-decoration:none}
 button,input,select,textarea{font:inherit}
 button{cursor:pointer}
 h1,h2,h3,h4,h5,h6{font-family:var(--hum-heading);color:var(--hum-text);text-wrap:balance}
 h1{font-size:clamp(44px,6vw,76px);font-weight:700;letter-spacing:-.045em;line-height:1.08;margin:24px 0}
 h2,h3{font-weight:600;letter-spacing:-.025em}
 p{line-height:1.65}
 :where(button,a,input,select,textarea,summary):focus-visible{outline:3px solid var(--hum-focus);outline-offset:3px}
 :where(button,input,select,textarea):disabled,button[aria-disabled=true]{opacity:.45;cursor:not-allowed}
 :where(input,select,textarea)[aria-invalid=true]:focus-visible{outline-color:var(--hum-danger)}
 @media(prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto;transition:none;animation:none}
 }
}

@layer components {
 /* Layout and typography */
 .stack{display:flex;flex-direction:column;align-items:flex-start;gap:var(--hum-gap);width:100%;min-width:0}
 .stack h2{font-size:24px;font-weight:600;letter-spacing:-.025em;margin:0}
 .stack p{color:var(--hum-muted);font-size:15px;margin:0;line-height:1.65}
 .actions{display:flex;flex-wrap:wrap;gap:10px;max-width:100%}
 .text-link{display:inline-flex;align-items:center;min-height:var(--hum-control-height);font-size:13px;color:var(--hum-primary);padding:12px}
 .text-link:hover{text-decoration:underline;text-underline-offset:3px}
 /* Quiet defaults; explicit prominence, semantic tone, then interaction state. */
 .button{
  --button-fill:transparent;--button-ink:var(--hum-primary);--button-line:var(--hum-line);--button-hover:var(--hum-subtle);
  display:inline-flex;align-items:center;justify-content:center;min-height:var(--hum-control-height);
  max-width:100%;padding:8px 14px;gap:8px;border:1px solid var(--button-line);
  border-radius:var(--hum-radius-control);background:var(--button-fill);color:var(--button-ink);
  font-size:14px;font-weight:500;line-height:1.4;text-align:center;overflow-wrap:anywhere;
 }
 .button-primary{--button-fill:var(--hum-primary);--button-ink:var(--hum-onPrimary);--button-line:transparent;--button-hover:color-mix(in srgb,var(--hum-primary),var(--hum-text) 12%);font-weight:600}
 .button-secondary{--button-fill:var(--hum-subtle);--button-line:transparent;--button-hover:color-mix(in srgb,var(--hum-subtle),var(--hum-text) 5%)}
 .button-quiet{--button-line:transparent;padding:8px 10px}
 .button[aria-pressed=true]{--button-fill:var(--hum-subtle);--button-line:var(--hum-primary);font-weight:600}
 .button:active:not(:disabled):not([aria-disabled=true]){background:var(--button-hover)}
 @media(hover:hover){
  .button:hover:not(:disabled):not([aria-disabled=true]){background:var(--button-hover)}
 }
 .segmented-control{display:inline-flex;flex-wrap:wrap;gap:2px;padding:3px;border-radius:11px;background:var(--hum-subtle)}
 .segmented-control .button{min-width:68px;border-radius:8px;padding:7px 12px;--button-ink:var(--hum-muted);--button-line:transparent}
 .segmented-control .button[aria-pressed=true]{--button-fill:var(--hum-surface);--button-ink:var(--hum-text);--button-hover:var(--hum-surface);box-shadow:var(--hum-selected-shadow)}
 /* Native controls; no universal textarea editor styling. */
 input:not([type=hidden]),select,textarea{display:block;width:100%;min-width:0;border:1px solid var(--hum-line);border-radius:var(--hum-radius-field);background:var(--hum-surface);padding:12px 14px;color:var(--hum-text);font-size:16px}
 input:not([type=hidden]),select{min-height:var(--hum-field-height);margin-top:8px}
 textarea{min-height:120px;resize:vertical}
 input[type=range]{padding:8px 0;background:transparent;min-height:var(--hum-control-height);accent-color:var(--hum-primary)}
 input:is([type=checkbox],[type=radio]){display:inline-block;width:var(--hum-control-height);height:var(--hum-control-height);margin:0;vertical-align:middle;accent-color:var(--hum-primary)}
 :is(input,select,textarea)[aria-invalid=true]{border-color:var(--hum-danger)}
 /* Feedback consumes semantic foreground/surface pairs in either theme. */
 .notice{width:100%;padding:14px 16px;background:var(--hum-subtle);color:var(--hum-text);border-radius:12px;line-height:1.6}
 .notice{border:1px solid var(--hum-line);font-size:13px;white-space:pre-wrap;overflow-wrap:anywhere;margin-bottom:20px}
 .notice.success{background:var(--hum-successSurface);color:var(--hum-success)}
 .notice.warning{background:var(--hum-warningSurface);color:var(--hum-warning)}
 .notice:is(.error,.danger){background:var(--hum-dangerSurface);color:var(--hum-danger);border:1px solid var(--hum-danger)}
 .source{background:var(--hum-code-background);color:var(--hum-code-text);margin:0;padding:28px;overflow:auto;font:13px/1.9 var(--hum-mono);tab-size:4}
 .source .hljs{color:var(--hum-code-text)}
 .source :is(.hljs-keyword,.hljs-selector-tag,.hljs-literal){color:#c6adff}
 .source :is(.hljs-string,.hljs-regexp,.hljs-template-tag){color:#b7d990}
 .source :is(.hljs-number,.hljs-symbol){color:#f3c58c}
 .source :is(.hljs-title,.hljs-built_in){color:#83d7df}
 .source :is(.hljs-type,.hljs-attr,.hljs-property){color:#f4d67b}
 .source :is(.hljs-comment,.hljs-quote){color:#a6b6aa;font-style:italic}
 .source :is(.hljs-subst,.hljs-params){color:var(--hum-code-text)}
 .source .hljs-meta{color:#b8c8ee}
 /* Featured surfaces own a local palette, never override the heading font.
    Default/quiet buttons stay subdued; primary actions opt into a white fill. */
 body[data-theme=calm] .marketing-surface{
  --hum-primary:#fff;--hum-onPrimary:#21112e;--hum-text:#fff;--hum-muted:#e4ddea;
  --hum-line:#766580;--hum-subtle:#34263f;--hum-surface:#291d33;--hum-focus:#fff;
  color:var(--hum-text);background:var(--hum-featured);border:0;border-radius:var(--hum-radius);
 }
 table{width:100%;border-collapse:collapse;text-align:left;font-size:14px}
 th,td{padding:14px 12px;border-bottom:1px solid var(--hum-line);overflow-wrap:anywhere}
 th{font-weight:600;color:var(--hum-muted)}
 @media(max-width:720px){
  .source{padding:20px;font-size:12px}
 }
}

@layer components {
 .hum-stack,.hum-row,.hum-grid{min-width:0}
 .hum-row{align-items:center}
 .hum-grid{display:grid;width:100%;gap:var(--hum-gap)}
 .hum-cols-1{grid-template-columns:minmax(0,1fr)}
 .hum-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}
 .hum-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}
 .hum-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}
 .hum-align-start{align-items:flex-start}.hum-align-center{align-items:center}
 .hum-align-end{align-items:flex-end}.hum-align-stretch{align-items:stretch}
 .hum-justify-start{justify-content:flex-start}.hum-justify-center{justify-content:center}
 .hum-justify-end{justify-content:flex-end}.hum-justify-between{justify-content:space-between}
 .hum-nowrap{flex-wrap:nowrap}
 .hum-card{min-width:0;border-radius:var(--hum-radius);background:var(--hum-surface)}
 .hum-card-subtle{background:var(--hum-subtle)}
 .hum-card-outlined{border:1px solid var(--hum-line)}
 .hum-text.hum-size-sm{font-size:var(--hum-size-sm)}
 .hum-text.hum-size-md{font-size:var(--hum-size-md)}
 .hum-text.hum-size-lg{font-size:var(--hum-size-lg)}
 .hum-heading.hum-size-sm{font-size:var(--hum-size-lg)}
 .hum-heading.hum-size-md{font-size:var(--hum-size-xl)}
 .hum-heading.hum-size-lg{font-size:var(--hum-size-xxl)}
 .hum-heading{margin:0}
 :is(.hum-text,.hum-span).hum-tone-neutral{color:var(--hum-text)}
 :is(.hum-text,.hum-span).hum-tone-success{color:var(--hum-success)}
 :is(.hum-text,.hum-span).hum-tone-warning{color:var(--hum-warning)}
 :is(.hum-text,.hum-span).hum-tone-danger{color:var(--hum-danger)}
 .hum-button.hum-tone-success{--hum-primary:var(--hum-success);--hum-subtle:var(--hum-successSurface);--hum-onPrimary:#fff}
 .hum-button.hum-tone-warning{--hum-primary:var(--hum-warning);--hum-subtle:var(--hum-warningSurface);--hum-onPrimary:#fff}
 .hum-button.hum-tone-danger{--hum-primary:var(--hum-danger);--hum-subtle:var(--hum-dangerSurface);--hum-onPrimary:#fff}
 .hum-button.hum-size-sm{font-size:12px;padding:6px 10px}
 .hum-button.hum-size-md{font-size:14px}
 .hum-button.hum-size-lg{font-size:16px;padding:12px 20px;min-height:48px}
 .hum-field{width:100%;min-width:0}
 .hum-label{display:block;font-size:14px;font-weight:500;color:var(--hum-text)}
 .hum-field textarea{margin-top:8px}
 .hum-field .hum-hint{margin:6px 0 0;font-size:13px;color:var(--hum-muted)}
 .hum-field .hum-field-error{margin:6px 0 0;font-size:13px;color:var(--hum-danger)}
 .hum-checkbox-label{display:flex;align-items:center;gap:8px;min-height:44px;cursor:pointer}
 .hum-checkbox-label input{flex-shrink:0}
 .hum-list{list-style:none;width:100%;margin:0;padding:0}
 .hum-list-item{display:flex;align-items:center;gap:16px;padding:16px 0;min-width:0}
 .hum-list-content{flex:1;min-width:0;overflow-wrap:anywhere}
 .hum-list-title{font-weight:500}
 .hum-description{font-size:14px;color:var(--hum-muted);line-height:1.65}
 .hum-list-divided>.hum-list-item+.hum-list-item{border-top:1px solid var(--hum-line)}
 .hum-list-actions{flex-shrink:0}
 .hum-empty{padding:var(--hum-space-lg);text-align:center;width:100%}
 .hum-empty h2{margin:0 0 8px}
 .hum-empty .actions{justify-content:center;margin-top:16px}
 .hum-code{width:100%;min-width:0}
 @media(max-width:720px){.hum-list-item{flex-wrap:wrap}.hum-list-actions{width:100%;flex-shrink:1}}
 .hum-gap-none{gap:var(--hum-space-none)}
 .hum-padding-none{padding:var(--hum-space-none)}
 .hum-gap-xs{gap:var(--hum-space-xs)}
 .hum-padding-xs{padding:var(--hum-space-xs)}
 .hum-gap-sm{gap:var(--hum-space-sm)}
 .hum-padding-sm{padding:var(--hum-space-sm)}
 .hum-gap-md{gap:var(--hum-space-md)}
 .hum-padding-md{padding:var(--hum-space-md)}
 .hum-gap-lg{gap:var(--hum-space-lg)}
 .hum-padding-lg{padding:var(--hum-space-lg)}
 .hum-gap-xl{gap:var(--hum-space-xl)}
 .hum-padding-xl{padding:var(--hum-space-xl)}
 @media(min-width:721px){
  .hum-cols-md-1{grid-template-columns:repeat(1,minmax(0,1fr))}
  .hum-cols-md-2{grid-template-columns:repeat(2,minmax(0,1fr))}
  .hum-cols-md-3{grid-template-columns:repeat(3,minmax(0,1fr))}
  .hum-cols-md-4{grid-template-columns:repeat(4,minmax(0,1fr))}
 }
 @media(min-width:1024px){
  .hum-cols-lg-1{grid-template-columns:repeat(1,minmax(0,1fr))}
  .hum-cols-lg-2{grid-template-columns:repeat(2,minmax(0,1fr))}
  .hum-cols-lg-3{grid-template-columns:repeat(3,minmax(0,1fr))}
  .hum-cols-lg-4{grid-template-columns:repeat(4,minmax(0,1fr))}
 }
}

@layer components {
 /* Marketing compositions inherit fonts and local featured-surface tokens. */
 .hum-marketing{width:100%;min-width:0;padding:var(--hum-space-xl);border-radius:var(--hum-radius);color:var(--hum-text);background:var(--hum-surface)}
 .hum-marketing-with-media{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,18rem),1fr));align-items:center;gap:var(--hum-space-xl)}
 .hum-marketing-copy{min-width:0}
 .hum-marketing .hum-marketing-title{margin:0;font-size:clamp(28px,4vw,48px);line-height:1.12;overflow-wrap:anywhere}
 .hum-hero{padding:clamp(24px,5vw,56px)}
 .hum-hero .hum-marketing-title{font-size:clamp(32px,5vw,64px)}
 .hum-marketing .hum-marketing-eyebrow{margin:0;font-size:12px;font-weight:600;letter-spacing:.09em;color:var(--hum-primary)}
 .hum-marketing-description{font-size:16px;line-height:1.7;color:var(--hum-muted);overflow-wrap:anywhere}
 .hum-marketing-description p{margin:0}
 .hum-marketing-media{min-width:0}
 .hum-marketing-media>.hum-image{border-radius:calc(var(--hum-radius) / 2)}
 body[data-theme=modern] .hum-marketing-featured{background:var(--hum-subtle);border:1px solid var(--hum-line)}
 .hum-pricing{display:flex;flex-direction:column;align-items:flex-start;gap:var(--hum-space-md);border:1px solid var(--hum-line);height:100%}
 .hum-pricing-title{font-size:24px}
 .hum-price{display:flex;flex-wrap:wrap;align-items:baseline;gap:8px}
 .hum-price-value{font-size:40px;font-weight:650;letter-spacing:-.04em;line-height:1.2}
 .hum-price-period,.hum-pricing-note{color:var(--hum-muted);font-size:14px}
 .hum-pricing-features{margin:0;padding-left:20px;line-height:1.8}
 .hum-pricing-actions{margin-top:auto;padding-top:8px}
 .hum-testimonial{margin:0;width:100%;padding:var(--hum-space-lg);border:1px solid var(--hum-line);border-radius:var(--hum-radius);background:var(--hum-surface)}
 .hum-testimonial blockquote{margin:0 0 20px;font-size:20px;line-height:1.6}
 .hum-testimonial figcaption{display:flex;align-items:center;gap:12px}
 .hum-testimonial-media{width:48px;flex-shrink:0}
 .hum-testimonial-attribution{font-weight:600}
 /* Media is native: no provider SDK or custom playback controls. */
 .hum-image{display:block;max-width:100%;width:100%;height:auto}
 .hum-image-cover{object-fit:cover}.hum-image-contain{object-fit:contain}
 .hum-media{display:block;width:100%;max-width:100%}
 .hum-video{aspect-ratio:16/9;object-fit:contain;background:var(--hum-subtle);border-radius:var(--hum-radius)}
 .hum-audio{min-height:54px}
 @media(max-width:720px){
  .hum-marketing{padding:24px}.hum-marketing-with-media{grid-template-columns:1fr;gap:24px}
  .hum-marketing .hum-marketing-title{font-size:28px}.hum-hero .hum-marketing-title{font-size:34px}
  .hum-price-value{font-size:34px}
 }
}

@layer components {
 .hum-gallery{width:100%;min-width:0}
 .hum-gallery-current{margin:0}
 .hum-gallery-current>.hum-image{border-radius:var(--hum-radius)}
 .hum-gallery-current figcaption{margin-top:8px;font-size:14px;color:var(--hum-muted)}
 .hum-gallery-navigation{margin-top:8px}
 .hum-gallery-navigation [role=status]{font-size:13px;color:var(--hum-muted)}
 .hum-gallery-thumbnails{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
 .hum-gallery-thumbnail{width:80px;padding:3px;border-radius:10px}
 .hum-gallery-thumbnail>.hum-image{height:54px;border-radius:6px;object-fit:cover}
 .hum-gallery-thumbnail[aria-pressed=true]{outline:2px solid var(--hum-primary);outline-offset:1px}
 .hum-visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
}

@layer components {
 .hum-icon{display:inline-block;width:20px;height:20px;flex:none;vertical-align:middle;color:inherit}
 .hum-icon.hum-size-sm{width:16px;height:16px}.hum-icon.hum-size-lg{width:24px;height:24px}
 .hum-icon.hum-tone-neutral{color:var(--hum-text)}.hum-icon.hum-tone-success{color:var(--hum-success)}
 .hum-icon.hum-tone-warning{color:var(--hum-warning)}.hum-icon.hum-tone-danger{color:var(--hum-danger)}
 .hum-button-icon-only{position:relative;min-width:44px;min-height:44px;padding:10px}
 .hum-button-icon-only.hum-size-sm{min-width:44px;min-height:44px;padding:10px}
 .hum-button-icon-only.hum-size-lg{min-width:48px;min-height:48px;padding:12px}
 .hum-button-tooltip{position:fixed;top:auto;bottom:8px;left:16px;z-index:1000;visibility:hidden;opacity:0;pointer-events:none;width:max-content;max-width:min(240px,calc(100vw - 32px));padding:8px 10px;border-radius:8px;background:var(--hum-text);color:var(--hum-background);font:12px/1.5 var(--hum-body);font-weight:400;text-align:left;white-space:normal;overflow-wrap:anywhere}
 .hum-button-tooltip.hum-tooltip-positioned{bottom:auto}
 .hum-button-icon-only:not([data-tooltip-dismissed]):focus-visible>.hum-button-tooltip{visibility:visible;opacity:1;pointer-events:auto}
 @media(hover:hover){.hum-button-icon-only:not([data-tooltip-dismissed]):hover>.hum-button-tooltip{visibility:visible;opacity:1;pointer-events:auto}}
}

@layer components {
 .hum-select{width:100%;min-width:0}
 .hum-select-compact{width:auto;max-width:100%}
 .hum-select-compact select{width:auto;max-width:100%;min-height:44px;margin-top:0;padding:8px 10px;border-color:transparent;background-color:transparent;color:var(--hum-muted);cursor:pointer}
 .hum-select-compact select:hover:not(:disabled){background-color:var(--hum-subtle)}
 .hum-select-compact select[aria-invalid=true]{border-color:var(--hum-danger)}
 .hum-select-warning select{color:var(--hum-warning)}
 .hum-select-success select{color:var(--hum-success)}
 .hum-select-danger select{color:var(--hum-danger)}
 .hum-select-hidden-label .hum-label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
}

@layer components {
 .hum-dialog{width:min(460px,calc(100% - 24px));max-height:calc(100dvh - 24px);overflow:auto;overscroll-behavior:contain;padding:24px;border:1px solid var(--hum-line);border-radius:20px;background:var(--hum-surface);color:var(--hum-text);box-shadow:0 20px 80px #0003}
 .hum-dialog-sm{width:min(360px,calc(100% - 24px))}
 .hum-dialog-lg{width:min(720px,calc(100% - 24px))}
 .hum-dialog::backdrop{background:#0006}
 .hum-dialog[open]{display:flex;flex-direction:column;gap:16px}
 .hum-dialog h2{margin:0;font-size:22px}
 .hum-dialog p{margin:0;font-size:14px}
 .hum-dialog-content{display:flex;flex-direction:column;gap:16px;min-width:0}
 .hum-dialog-actions{flex-shrink:0}
 @media(max-width:600px){.hum-dialog{padding:20px;max-width:calc(100% - 16px);max-height:calc(100dvh - 16px);border-radius:18px}}
}