/* Solkari · design system foundation */

:root {
  color-scheme: light;
  --brand: #17483d;
  --brand-strong: #17483d;
  --brand-soft: #dce8df;
  --brand-soft-strong: #cbdccf;
  --canvas: #f4efe6;
  --surface: #fffefa;
  --surface-subtle: #f8f5ee;
  --surface-tinted: #edf3ec;
  --text: #202824;
  --text-muted: #657169;
  --text-soft: #748078;
  --border: #c8d1ca;
  --border-strong: #aebfaf;
  --accent: #d98a5f;
  --accent-soft: #f2dfd2;
  --danger: #97524b;
  --danger-soft: #f6eae6;
  --focus: #c8784e;
  --radius-control: 12px;
  --radius-card: 18px;
  --radius-sheet: 24px;
  --radius-round: 999px;
  --control-min: 44px;
  --shadow-soft: 0 12px 32px rgba(32, 90, 75, 0.09);
  --shadow-raised: 0 16px 40px rgba(32, 40, 36, 0.12);

  /* Compatibility aliases used by existing screens. */
  --green: var(--brand);
  --ink: var(--text);
  --paper: var(--canvas);
  --sage: var(--brand-soft);
  --line: var(--border);
  --apricot: var(--accent);
}

html {
  background: var(--canvas);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: clip;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font-instrument), ui-sans-serif, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

main,
#app,
.panel,
.card {
  min-width: 0;
}

html.landing-preview nav {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea,
.field {
  font-size: 16px;
}

button,
[role="button"],
summary,
label[for],
a {
  -webkit-tap-highlight-color: transparent;
}

button,
[role="button"],
summary {
  touch-action: manipulation;
}

.brand {
  min-height: var(--control-min);
}

footer button {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-min);
  padding: 8px 2px;
}

:where(button, a, input, select, textarea, summary, [role="button"]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 2px var(--surface);
}

/* Core controls */
.btn {
  min-height: 48px;
  border-radius: var(--radius-control);
  font-weight: 760;
  line-height: 1.2;
  transition: background-color 160ms ease, border-color 160ms ease,
    color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.btn:not(.secondary):not(.danger):not(:disabled):hover {
  filter: brightness(0.92);
}

.btn.secondary {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--brand);
}

.btn.secondary:not(:disabled):hover {
  border-color: var(--brand);
  background: var(--surface-tinted);
}

.btn.danger,
.danger.btn {
  border-color: rgba(151, 82, 75, 0.36);
  background: var(--surface);
  color: var(--danger);
}

.btn.danger:not(:disabled):hover,
.danger.btn:not(:disabled):hover {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.btn:not(:disabled):active,
.chip:not(:disabled):active,
.textbtn:not(:disabled):active {
  transform: translateY(1px);
}

.btn:disabled,
button:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.56;
}

.field,
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
  min-height: 48px;
  border-color: var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
}

.field::placeholder,
input::placeholder,
textarea::placeholder {
  color: #7b857e;
  opacity: 1;
}

.field:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
}

.chip {
  min-height: 40px;
  border-color: var(--border-strong);
  border-radius: var(--radius-round);
  background: var(--surface);
  color: var(--text);
  font-weight: 720;
}

.chip.active,
.chip[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.avatar,
.close,
.home-instruction-clear,
.home-instruction-editor-head button {
  width: var(--control-min);
  min-width: var(--control-min);
  height: var(--control-min);
  min-height: var(--control-min);
}

.avatar,
.close {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
}

.close {
  font-size: 25px;
  line-height: 1;
}

/* Surfaces */
.panel,
.action-card,
.empty,
.home-feedback,
.shopping-intent-entry,
.journey-profile-summary,
.journey-map-progress {
  border-color: var(--border);
  border-radius: var(--radius-card);
}

dialog {
  border-radius: var(--radius-sheet);
  box-shadow: var(--shadow-raised);
}

/* Readability and touch targets on compact, frequently used actions. */
.home-instruction-examples button,
.home-instruction-active .textbtn,
.shopping-intent-action,
.shopping-analysis-indicator .btn,
.shopping-search-all,
.shopping-search-result .btn,
.shopping-card-save,
.shopping-card-dismiss,
.shopping-combination-tabs button,
.shopping-style-actions .btn,
.shopping-style-actions .textbtn,
.journey-unlock-actions .textbtn {
  min-height: var(--control-min);
  font-size: 13px;
}

.home-instruction-examples button,
.shopping-intent-action,
.shopping-combination-tabs button {
  border-radius: var(--radius-control);
}

.home-instruction-add small,
.home-instruction-active small,
.home-instruction-editor > small,
.shopping-intent-help,
.shopping-intent-query,
.shopping-field-help,
.shopping-analysis-progress small,
.shopping-style-review-copy > small,
.first-run-guide small,
.first-run-primary small,
.first-run-secondary small,
.first-garment-path small,
.wardrobe-onboarding-card small,
.journey-map-item p {
  font-size: 12px;
  line-height: 1.45;
}

.shopping-intent-item > div > small,
.journey-map-item > small,
.journey-profile-heading small {
  font-size: 11px;
  line-height: 1.35;
}

/* Milestones may feel special, while the everyday UI remains calm. */
.journey-achievement-card,
.journey-unlock-card,
.first-garment-celebration {
  box-shadow: var(--shadow-soft);
}

.journey-unlock-icon,
.journey-achievement-card .wardrobe-onboarding-icon {
  background: var(--brand);
  color: #fff;
}

.journey-achievement-card {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border));
  background: linear-gradient(145deg, var(--accent-soft), var(--surface-tinted) 72%);
}

.journey-achievement-card .wardrobe-onboarding-icon {
  background: var(--accent);
  color: var(--brand-strong);
}

.journey-achievement-card .wardrobe-onboarding-bar span,
.journey-map-complete > span {
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

/* Today: clear hierarchy without making the daily decision feel heavy. */
.first-run-experience,
.first-garment-celebration,
.feature-gate,
.wardrobe-onboarding,
.first-today-guide,
.photo-picker,
.photo-guide,
.preference-card {
  border-radius: var(--radius-card);
}

.first-run-visual,
.outfitboard,
.builder-outfit-board,
.try-on-result-image {
  border-radius: var(--radius-card);
}

.first-run-guide article,
.first-run-guide article > span,
.first-run-cta,
.first-garment-primary,
.feature-gate-action,
.early-home-primary,
.journey-card-actions .btn,
.week-ai-submit,
.week-create-manual {
  border-radius: var(--radius-control);
}

.first-run-cta > span:first-child,
.first-garment-primary > span:first-child,
.feature-gate-action > span:first-child {
  border-radius: calc(var(--radius-control) - 2px);
}

.sync-card-icon svg,
.week-ai-choice-icon svg,
.week-look-search svg {
  width: 20px;
  height: 20px;
}

.home-idea-card > p.muted.small {
  font-size: 13px;
  line-height: 1.52;
}

.home-outfit-hint,
.home-feedback-actions small,
.home-quick-heading small,
.home-quick-action small {
  font-size: 12px;
  line-height: 1.42;
}

.home-quick-action em {
  font-size: 10px;
}

.home-look-actions .btn {
  min-height: 52px;
}

.try-on-entry {
  min-height: 68px;
}

.home-instruction-add > span:first-child svg,
.home-instruction-clear svg,
.home-instruction-editor-head button svg {
  width: 20px;
  height: 20px;
}

/* Wardrobe: adding and filtering belong to the page, never over the clothes. */
.pagehead:has(.wardrobe-add-action) {
  align-items: center;
}

.wardrobe-add-action {
  flex: 0 0 auto;
  min-height: 48px;
  margin: 0;
  padding: 10px 16px;
  border-radius: var(--radius-round);
}

.wardrobe-add-icon,
.wardrobe-add-icon svg {
  display: block;
  width: 19px;
  height: 19px;
}

.wardrobe-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 520px);
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--brand);
}

.wardrobe-search:focus-within {
  border-color: var(--brand);
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 2px var(--surface);
}

.wardrobe-search > span,
.wardrobe-search > span svg {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.wardrobe-search input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
}

.wardrobe-filter-strip .chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.wardrobe-filter-strip .chip svg {
  width: 16px;
  height: 16px;
}

.wardrobe-results-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 2px 1px 14px;
}

.wardrobe-results-summary b {
  color: var(--text);
  font-size: 14px;
}

.wardrobe-results-summary span {
  color: var(--text-soft);
  font-size: 12px;
  text-align: right;
}

.item-meta {
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.item-meta svg {
  width: 13px;
  height: 13px;
  color: var(--brand);
}

.item-meta i {
  font-style: normal;
}

.wardrobe-empty {
  grid-column: 1 / -1;
  padding: 38px 20px;
}

.wardrobe-empty b {
  display: block;
  font-family: var(--font-newsreader), Georgia, serif;
  color: var(--brand);
  font-size: 22px;
}

.wardrobe-empty p {
  margin: 8px auto 18px;
  color: var(--text-muted);
}

.wardrobe-empty .btn {
  margin: 0;
}

@media (max-width: 720px) {
  .chip {
    min-height: var(--control-min);
  }

  .home-instruction-add,
  .home-idea-context {
    min-height: var(--control-min);
  }

  .home-instruction-add b,
  .home-instruction-active b {
    font-size: 14px;
  }

  .shopping-intent-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .shopping-intent-form .btn {
    width: 100%;
  }

  .pagehead:has(.wardrobe-add-action) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }

  .wardrobe-add-action {
    align-self: center;
    padding-inline: 14px;
  }

  .wardrobe-controls-sticky,
  html.force-mobile .wardrobe-controls-sticky {
    position: relative;
    top: auto;
    z-index: auto;
    margin: 0 0 14px;
    padding: 0;
    border-bottom: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .wardrobe-results-summary {
    align-items: flex-start;
  }
}

.release-notice[hidden] {
  display: none;
}

html.release-notice-open {
  overflow: hidden;
}

.release-notice {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.release-notice-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(18, 44, 37, 0.46);
  backdrop-filter: blur(7px);
}

.release-notice-card {
  position: relative;
  width: min(100%, 510px);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  padding: 34px;
  border: 1px solid rgba(23, 72, 61, 0.2);
  border-top: 4px solid var(--apricot);
  border-radius: 28px;
  background: #fbf8f1;
  box-shadow: 0 28px 80px rgba(18, 44, 37, 0.3);
  color: var(--ink);
  animation: release-notice-in 0.46s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.release-notice-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--green);
  font: 400 26px/1 var(--font-instrument), sans-serif;
  place-items: center;
}

.release-notice-eyebrow {
  display: block;
  margin: 0 46px 12px 0;
  color: var(--green);
  font: 700 11px/1.3 var(--font-instrument), sans-serif;
  letter-spacing: 0.16em;
}

.release-notice-card h2 {
  max-width: 390px;
  margin: 0;
  color: var(--green);
  font: 560 clamp(30px, 6vw, 42px)/1.03 var(--font-newsreader), Georgia, serif;
  letter-spacing: -0.035em;
}

.release-notice-card > p {
  margin: 16px 0 24px;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.5;
}

.release-notice-list {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

.release-notice-list article {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid rgba(23, 72, 61, 0.13);
  border-radius: 16px;
  background: rgba(220, 232, 223, 0.42);
}

.release-notice-list i {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--apricot);
}

.release-notice-list span {
  display: grid;
  gap: 3px;
}

.release-notice-list b {
  color: var(--green);
  font-size: 15px;
}

.release-notice-list small {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
}

.release-notice-primary {
  min-height: 54px;
}

.release-notice-once {
  display: block;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

@keyframes release-notice-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 600px) {
  .release-notice {
    align-items: end;
    padding: 12px;
  }

  .release-notice-card {
    width: 100%;
    max-height: calc(100dvh - 24px);
    padding: 28px 20px 22px;
    border-radius: 24px;
  }

  .release-notice-card h2 {
    max-width: 320px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --border: #8a9c91;
    --border-strong: #60756a;
    --text-muted: #4e5b54;
  }

  .btn.secondary,
  .chip,
  .field,
  input,
  select,
  textarea {
    border-width: 2px;
  }
}
