* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  font-family: "Avenir Next", "Gill Sans", "Trebuchet MS", sans-serif;
}

html {
  min-width: 320px;
  background: var(--of-color-paper);
}

body {
  margin: 0;
  background: var(--of-color-paper);
  color: var(--of-color-ink);
  font-size: 15px;
  line-height: 1.5;
}

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

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--of-color-blue);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  min-height: var(--of-touch-target);
  padding: 10px 16px;
  transform: translateY(-180%);
  border: 1px solid var(--of-color-ink);
  border-radius: var(--of-radius-pill);
  background: var(--of-color-acid);
  font-weight: 800;
  transition: transform var(--of-motion-fast) ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-frame {
  display: grid;
  min-height: 100vh;
  grid-template-areas:
    "header header"
    "sidebar main";
  grid-template-columns: 238px minmax(0, 1fr);
  grid-template-rows: 72px minmax(0, 1fr);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-area: header;
  grid-template-columns: 238px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 72px;
  padding: 0 28px;
  border-bottom: 1px solid var(--of-color-line);
  background: color-mix(in srgb, var(--of-color-paper) 94%, transparent);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  width: max-content;
  min-height: var(--of-touch-target);
  align-items: center;
  gap: 9px;
  font-family: Menlo, Monaco, "Courier New", monospace;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
}

.brand-mark path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 5;
}

.brand-mark circle {
  fill: var(--of-color-acid);
}

.header-context {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--of-color-muted);
  font-size: 12px;
  font-weight: 700;
}

.privacy-dot {
  width: 8px;
  height: 8px;
  border: 1px solid var(--of-color-ink);
  border-radius: 50%;
  background: var(--of-color-mint);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--of-color-mint) 35%, transparent);
}

.icon-button {
  display: inline-grid;
  min-width: var(--of-touch-target);
  min-height: var(--of-touch-target);
  place-items: center;
  border: 1px solid var(--of-color-line);
  border-radius: 50%;
  background: var(--of-color-surface);
  cursor: pointer;
}

.mobile-menu-button {
  display: none;
}

.app-sidebar {
  position: sticky;
  top: 72px;
  display: flex;
  height: calc(100vh - 72px);
  flex-direction: column;
  grid-area: sidebar;
  justify-content: space-between;
  padding: 28px 20px 22px;
  border-right: 1px solid var(--of-color-line);
  background: var(--of-color-surface);
}

.primary-navigation,
.secondary-navigation {
  display: grid;
  gap: 4px;
}

.primary-navigation a,
.secondary-navigation a {
  display: grid;
  min-height: 48px;
  grid-template-columns: 30px 1fr;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--of-radius-md);
  color: var(--of-color-muted);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  transition: background var(--of-motion-fast) ease, color var(--of-motion-fast) ease;
}

.primary-navigation a:hover,
.secondary-navigation a:hover {
  background: var(--of-color-paper);
  color: var(--of-color-ink);
}

.primary-navigation a[aria-current="page"],
.secondary-navigation a[aria-current="page"] {
  background: var(--of-color-acid);
  color: var(--of-color-ink);
}

.primary-navigation a > span:first-child,
.secondary-navigation a > span:first-child {
  font-size: 20px;
  font-weight: 500;
}

.public-home-link {
  border-top: 1px solid var(--of-color-line);
  border-radius: 0 !important;
}

.app-main {
  min-width: 0;
  grid-area: main;
  padding: clamp(24px, 4vw, 58px);
}

.page-shell {
  width: min(100%, 1260px);
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.page-header h1,
.section-title,
.auth-copy h1,
.empty-state h2,
.editorial-card h2 {
  margin: 0;
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  font-weight: 500;
  letter-spacing: -.04em;
}

.page-header h1 {
  font-size: clamp(34px, 4vw, 58px);
  line-height: .98;
}

.page-header p,
.section-lede {
  max-width: 620px;
  margin: 10px 0 0;
  color: var(--of-color-muted);
}

.eyebrow {
  margin: 0 0 10px !important;
  color: var(--of-color-muted);
  font-family: Menlo, Monaco, "Courier New", monospace;
  font-size: var(--of-type-eyebrow-size);
  font-weight: 800;
  letter-spacing: var(--of-type-eyebrow-tracking);
  line-height: var(--of-type-eyebrow-leading);
  text-transform: uppercase;
}

.primary-button,
.secondary-button,
.quiet-button,
.provider-button,
.category-chip {
  display: inline-flex;
  min-height: var(--of-touch-target);
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--of-color-ink);
  border-radius: var(--of-radius-pill);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  background: var(--of-color-ink);
  color: var(--of-color-white);
}

.primary-button:hover {
  background: var(--of-color-acid);
  color: var(--of-color-ink);
}

.secondary-button,
.provider-button {
  background: var(--of-color-surface);
}

.quiet-button {
  border-color: var(--of-color-line);
  background: transparent;
}

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

.loading-state,
.empty-state,
.error-state {
  display: grid;
  min-height: 320px;
  place-items: center;
  align-content: center;
  padding: 36px;
  border: 1px dashed var(--of-color-line);
  border-radius: var(--of-radius-xl);
  background: var(--of-color-surface);
  text-align: center;
}

.loading-mark {
  width: 38px;
  height: 38px;
  border: 3px solid var(--of-color-soft);
  border-top-color: var(--of-color-ink);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.error-state {
  border-style: solid;
  border-color: color-mix(in srgb, var(--of-color-danger) 35%, var(--of-color-line));
}

.error-state strong {
  color: var(--of-color-danger);
}

.category-rail {
  display: flex;
  gap: 10px;
  margin: 0 0 26px;
  padding: 2px 2px 8px;
  overflow-x: auto;
  list-style: none;
  scrollbar-width: thin;
}

.category-chip {
  min-width: max-content;
  border-color: var(--of-color-line);
  background: var(--of-color-surface);
  font-size: 12px;
}

.category-chip[aria-pressed="true"] {
  border-color: var(--of-color-ink);
  background: var(--of-color-acid);
}

.category-icon {
  display: inline-grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 50%;
  background: var(--of-color-soft);
}

.wardrobe-grid,
.look-grid,
.trip-grid,
.community-grid,
.settings-grid,
.stat-grid {
  display: grid;
  gap: 18px;
}

.wardrobe-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.garment-tile,
.look-tile,
.trip-card,
.panel,
.community-card,
.setting-card,
.stat-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--of-color-line);
  border-radius: var(--of-radius-lg);
  background: var(--of-color-surface);
}

.garment-tile {
  display: flex;
  min-height: 300px;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  transition: transform var(--of-motion-fast) ease, box-shadow var(--of-motion-fast) ease;
}

.garment-tile:hover,
.look-tile:hover {
  box-shadow: 0 10px 28px rgb(29 29 26 / 9%);
  transform: translateY(-3px);
}

.garment-image,
.look-image {
  position: relative;
  display: grid;
  overflow: hidden;
  place-items: center;
  background:
    linear-gradient(45deg, rgb(29 29 26 / 4%) 25%, transparent 25%),
    linear-gradient(-45deg, rgb(29 29 26 / 4%) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgb(29 29 26 / 4%) 75%),
    linear-gradient(-45deg, transparent 75%, rgb(29 29 26 / 4%) 75%),
    var(--of-color-paper);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.garment-image {
  aspect-ratio: 4 / 5;
}

.garment-image img,
.look-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.image-fallback {
  display: grid;
  width: 90px;
  height: 90px;
  place-items: center;
  border-radius: 50%;
  background: var(--of-color-soft);
  font-family: Georgia, serif;
  font-size: 32px;
}

.garment-meta,
.look-meta,
.trip-card,
.community-card,
.setting-card,
.stat-card,
.panel {
  padding: 18px;
}

.garment-meta h2,
.look-meta h2,
.trip-card h2,
.community-card h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -.025em;
}

.garment-meta p,
.look-meta p,
.trip-card p,
.community-card p,
.setting-card p,
.stat-card p {
  margin: 5px 0 0;
  color: var(--of-color-muted);
  font-size: 12px;
}

.tile-badge,
.status-badge {
  display: inline-flex;
  width: max-content;
  min-height: 26px;
  align-items: center;
  padding: 4px 9px;
  border-radius: var(--of-radius-pill);
  background: var(--of-color-acid);
  font-family: Menlo, Monaco, monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tile-badge {
  position: absolute;
  top: 12px;
  left: 12px;
}

.look-grid,
.trip-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.look-tile {
  color: inherit;
  text-decoration: none;
  transition: transform var(--of-motion-fast) ease, box-shadow var(--of-motion-fast) ease;
}

.look-image {
  min-height: 210px;
}

.look-stack {
  position: relative;
  width: 160px;
  height: 130px;
}

.look-stack span {
  position: absolute;
  width: 84px;
  height: 108px;
  border: 1px solid var(--of-color-ink);
  border-radius: 18px;
  background: var(--of-color-surface);
}

.look-stack span:nth-child(1) { left: 0; transform: rotate(-12deg); }
.look-stack span:nth-child(2) { left: 38px; top: 7px; background: var(--of-color-blue); }
.look-stack span:nth-child(3) { right: 0; transform: rotate(12deg); background: var(--of-color-peach); }

.card-actions,
.form-actions,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.card-actions {
  margin-top: 16px;
}

.trip-dates {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  color: var(--of-color-muted);
  font-size: 12px;
}

.packing-list {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.packing-list label {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--of-radius-sm);
  background: var(--of-color-paper);
}

.packing-list input {
  width: 20px;
  height: 20px;
  accent-color: var(--of-color-ink);
}

.panel {
  margin-bottom: 18px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .72fr);
  gap: 20px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field--full {
  grid-column: 1 / -1;
}

.field label,
fieldset legend {
  font-size: 12px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea,
.slug-form input {
  width: 100%;
  min-height: var(--of-touch-target);
  padding: 10px 12px;
  border: 1px solid var(--of-color-line);
  border-radius: var(--of-radius-sm);
  background: var(--of-color-paper);
}

.field textarea {
  min-height: 130px;
  resize: vertical;
}

.field small {
  color: var(--of-color-muted);
}

.upload-preview {
  display: grid;
  min-height: 360px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed var(--of-color-line);
  border-radius: var(--of-radius-lg);
  background: var(--of-color-paper);
}

.upload-preview img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
}

.consent-note,
.truth-note {
  padding: 14px 16px;
  border-left: 4px solid var(--of-color-mint);
  border-radius: 0 var(--of-radius-sm) var(--of-radius-sm) 0;
  background: color-mix(in srgb, var(--of-color-mint) 22%, var(--of-color-surface));
  color: var(--of-color-muted);
  font-size: 12px;
}

.truth-note--warning {
  border-left-color: var(--of-color-peach);
  background: color-mix(in srgb, var(--of-color-peach) 20%, var(--of-color-surface));
}

.stylist-response {
  margin-top: 20px;
  padding: 22px;
  border-radius: var(--of-radius-lg);
  background: var(--of-color-lilac);
}

.stylist-response h2 {
  margin: 0 0 8px;
  font-family: Georgia, serif;
  font-weight: 500;
}

.community-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
  padding: clamp(26px, 5vw, 60px);
  border: 1px solid var(--of-color-ink);
  border-radius: var(--of-radius-xl);
  background: var(--of-color-acid);
}

.community-hero::after {
  position: absolute;
  top: -80px;
  right: -70px;
  width: 260px;
  height: 260px;
  border: 1px solid var(--of-color-ink);
  border-radius: 50%;
  content: "";
}

.community-hero h1 {
  max-width: 760px;
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(40px, 6vw, 82px);
  font-weight: 500;
  letter-spacing: -.05em;
  line-height: .94;
}

.community-hero p {
  max-width: 620px;
  margin: 20px 0 0;
}

.community-grid {
  grid-template-columns: repeat(3, 1fr);
}

.community-art {
  display: grid;
  min-height: 200px;
  margin: -18px -18px 18px;
  place-items: center;
  background: var(--of-color-blue);
  font-family: Georgia, serif;
  font-size: 54px;
}

.community-card:nth-child(2) .community-art { background: var(--of-color-peach); }
.community-card:nth-child(3) .community-art { background: var(--of-color-lilac); }

.slug-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 18px;
}

.auth-layout {
  display: grid;
  min-height: calc(100vh - 190px);
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: clamp(30px, 7vw, 100px);
}

.auth-copy h1 {
  font-size: clamp(50px, 7vw, 104px);
  line-height: .88;
}

.auth-copy h1 em {
  font-weight: inherit;
  text-decoration: underline;
  text-decoration-color: var(--of-color-acid);
  text-decoration-thickness: .18em;
  text-underline-offset: -.08em;
}

.auth-card {
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid var(--of-color-ink);
  border-radius: var(--of-radius-xl);
  background: var(--of-color-surface);
  box-shadow: 14px 16px 0 var(--of-color-acid);
}

.auth-card h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 30px;
  font-weight: 500;
}

.provider-stack {
  display: grid;
  gap: 12px;
  margin: 24px 0;
}

.provider-button {
  width: 100%;
  border-radius: var(--of-radius-md);
}

.provider-slot {
  display: grid;
  min-height: 44px;
  place-items: center;
}

.auth-status {
  min-height: 24px;
  color: var(--of-color-muted);
  font-size: 12px;
}

.privacy-list {
  display: grid;
  gap: 9px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
}

.privacy-list li::before {
  margin-right: 8px;
  content: "✓";
  font-weight: 900;
}

.settings-grid,
.stat-grid {
  grid-template-columns: repeat(3, 1fr);
}

.setting-card h2,
.stat-card strong {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 500;
}

.stat-card strong {
  display: block;
  font-size: 40px;
}

.language-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--of-color-line);
  border-radius: var(--of-radius-pill);
  background: var(--of-color-paper);
}

.language-switch button {
  min-width: 54px;
  min-height: 36px;
  border: 0;
  border-radius: var(--of-radius-pill);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.language-switch button[aria-pressed="true"] {
  background: var(--of-color-acid);
}

.toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: grid;
  max-width: min(390px, calc(100vw - 44px));
  gap: 8px;
}

.toast {
  padding: 13px 16px;
  border: 1px solid var(--of-color-ink);
  border-radius: var(--of-radius-md);
  background: var(--of-color-ink);
  color: var(--of-color-white);
  box-shadow: 0 10px 30px rgb(0 0 0 / 18%);
}

.toast--error {
  background: var(--of-color-danger);
}

.mobile-tab-bar {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 980px) {
  .app-frame {
    grid-template-areas: "header" "main";
    grid-template-columns: minmax(0, 1fr);
  }

  .app-header {
    grid-template-columns: 1fr auto auto;
    padding-inline: 18px;
  }

  .mobile-menu-button {
    display: inline-grid;
    margin-left: 12px;
  }

  .app-sidebar {
    position: fixed;
    inset: 72px 0 0 auto;
    z-index: 45;
    width: min(310px, 88vw);
    height: calc(100vh - 72px);
    transform: translateX(105%);
    box-shadow: -12px 0 40px rgb(0 0 0 / 12%);
    transition: transform var(--of-motion-base) ease;
  }

  .app-sidebar[data-open="true"] {
    transform: translateX(0);
  }

  .two-column,
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .community-grid,
  .settings-grid,
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .app-frame {
    grid-template-rows: 64px minmax(0, 1fr);
  }

  .app-header {
    min-height: 64px;
  }

  .header-context {
    display: none;
  }

  .mobile-menu-button {
    display: inline-grid;
  }

  .app-sidebar {
    top: 64px;
    display: flex;
    height: calc(100vh - 64px);
  }

  .app-main {
    padding: 22px 16px 98px;
  }

  .mobile-tab-bar {
    position: fixed;
    right: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 7px;
    border: 1px solid var(--of-color-line);
    border-radius: 24px;
    background: color-mix(in srgb, var(--of-color-surface) 94%, transparent);
    box-shadow: 0 10px 34px rgb(0 0 0 / 14%);
    backdrop-filter: blur(16px);
  }

  .mobile-tab-bar a {
    display: grid;
    min-width: 0;
    min-height: 52px;
    place-items: center;
    align-content: center;
    border-radius: 18px;
    color: var(--of-color-muted);
    text-decoration: none;
  }

  .mobile-tab-bar a[aria-current="page"] {
    background: var(--of-color-acid);
    color: var(--of-color-ink);
  }

  .mobile-tab-bar a > span {
    font-size: 18px;
  }

  .mobile-tab-bar small {
    max-width: 100%;
    overflow: hidden;
    font-size: 9px;
    font-weight: 800;
    text-overflow: ellipsis;
  }

  .page-header {
    align-items: start;
    flex-direction: column;
    margin-bottom: 24px;
  }

  .page-header h1 {
    font-size: 40px;
  }

  .wardrobe-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .garment-tile {
    min-height: 0;
  }

  .garment-meta {
    padding: 12px;
  }

  .garment-meta h2 {
    font-size: 16px;
  }

  .look-grid,
  .trip-grid,
  .community-grid,
  .settings-grid,
  .stat-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .auth-copy h1 {
    font-size: 54px;
  }

  .auth-card {
    box-shadow: 8px 10px 0 var(--of-color-acid);
  }

  .slug-form {
    grid-template-columns: 1fr;
  }
}

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