/*
 * Noodo host-page primitives shared by the demo hub, storefront mock, the
 * review form shell and the admin. Plain-CSS ports of the shop locator's
 * Tailwind components (locator/web/src/index.css: nd-btn, nd-btn-ghost,
 * nd-icon-btn, nd-input, nd-label, nd-card) using the Shopify theme's
 * scheme1 palette. Widgets are styled by /skins/<name>.css, not this file.
 */
@layer nd.reset, rv.kit;

:root {
  --nd-cream: #feffec;
  --nd-olive: #485626;
  --nd-olive-muted: #5a6834;
  --nd-olive-10: rgba(72, 86, 38, 0.1);
  --nd-olive-20: rgba(72, 86, 38, 0.2);
  --nd-olive-40: rgba(72, 86, 38, 0.4);
  --nd-red: #f11116;
  --nd-red-deep: #c01014;
  --nd-pink: #ff8de4;
  --nd-yellow: #feda00;
  --nd-yellow-soft: #feeb7f;
  --nd-yellow-wash: rgba(254, 218, 0, 0.3);
  --nd-blue: #004fd8;
  --nd-dark: #231f20;
  --nd-font-display: Prompt, Grogia, Impact, system-ui, sans-serif;
  --nd-font-body: neulis-neue, Inter, system-ui, sans-serif;
  --nd-radius-pill: 9999px;
  --nd-radius-card: 0.375rem;
  --nd-radius-media: 1rem;
  --nd-shadow-sm: 4px 4px 0 0 var(--nd-olive);
  --nd-shadow-lg: 8px 8px 0 0 var(--nd-olive);
  --nd-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Element resets sit in the lowest layer so they never beat widget skins. */
@layer nd.reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  html {
    -webkit-text-size-adjust: 100%;
  }

  body {
    margin: 0;
    background: var(--nd-cream);
    color: var(--nd-olive);
    font-family: var(--nd-font-body);
    font-size: 1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }

  h1,
  h2,
  h3,
  p {
    margin: 0;
  }

  a {
    color: inherit;
  }

  :focus-visible {
    outline: 2px dashed var(--nd-olive);
    outline-offset: 0.25rem;
  }

  ::selection {
    background: var(--nd-olive);
    color: var(--nd-cream);
  }
}

/* Author-level display rules must never resurrect hidden elements. */
[hidden] {
  display: none !important;
}

.nd-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.nd-skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
}
.nd-skip:focus {
  top: 1rem;
}

/* ------------------------------------------------------------- type */
.nd-display {
  font-family: var(--nd-font-display);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1;
  letter-spacing: -0.01em;
}
.nd-h1 {
  font-size: clamp(2.25rem, 1.4rem + 3.8vw, 4rem);
}
.nd-h2 {
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
}
.nd-h3 {
  font-family: var(--nd-font-display);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.nd-eyebrow {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--nd-olive-muted);
}
.nd-muted {
  color: var(--nd-olive-muted);
}
.nd-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--nd-olive);
}
.nd-link {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}
.nd-link:hover {
  text-decoration-style: wavy;
}

/* ---------------------------------------------------------- buttons */
.nd-btn,
.nd-btn-ghost,
.nd-btn-quiet,
.nd-icon-btn,
.nd-icon-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.75rem;
  padding: 0 1.25rem;
  border: 2px solid var(--nd-olive);
  border-radius: var(--nd-radius-pill);
  font-family: var(--nd-font-display);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--nd-shadow-sm);
  transition:
    transform 150ms var(--nd-ease),
    box-shadow 150ms var(--nd-ease),
    background-color 150ms var(--nd-ease);
}
.nd-btn,
.nd-icon-btn {
  background: var(--nd-red-deep);
  color: var(--nd-cream);
}
.nd-btn-ghost,
.nd-icon-btn-ghost {
  background: var(--nd-yellow);
  color: var(--nd-dark);
}
.nd-btn-quiet {
  background: var(--nd-cream);
  color: var(--nd-olive);
}
.nd-icon-btn,
.nd-icon-btn-ghost {
  width: 2.75rem;
  padding: 0;
  flex-shrink: 0;
}
:is(.nd-btn, .nd-btn-ghost, .nd-btn-quiet, .nd-icon-btn, .nd-icon-btn-ghost):is(:hover, :active):not(:disabled) {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 0 var(--nd-olive);
}
:is(.nd-btn, .nd-btn-ghost, .nd-btn-quiet, .nd-icon-btn, .nd-icon-btn-ghost):disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.nd-btn--sm {
  height: 2.25rem;
  padding: 0 0.95rem;
  font-size: 0.75rem;
}
.nd-btn--block {
  width: 100%;
}
.nd-btn svg,
.nd-icon-btn svg,
.nd-icon-btn-ghost svg,
.nd-btn-ghost svg,
.nd-btn-quiet svg {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}

/* ----------------------------------------------------------- fields */
.nd-input {
  display: block;
  width: 100%;
  height: 2.75rem;
  padding: 0 1rem;
  border: 2px solid var(--nd-olive);
  border-radius: var(--nd-radius-pill);
  background: var(--nd-cream);
  color: var(--nd-dark);
  font: inherit;
  font-size: 0.9375rem;
  outline-offset: 0.25rem;
  transition: background-color 150ms var(--nd-ease);
}
.nd-input::placeholder {
  color: rgba(72, 86, 38, 0.6);
}
.nd-input:focus {
  background: var(--nd-yellow-wash);
}
textarea.nd-input {
  height: auto;
  min-height: 7rem;
  padding: 0.75rem 1rem;
  border-radius: var(--nd-radius-media);
  line-height: 1.5;
  resize: vertical;
}
select.nd-input {
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23485626' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 1.1rem;
  cursor: pointer;
}

/* Checkbox + toggle switch */
.nd-check {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.9375rem;
}
.nd-check input[type='checkbox'] {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 1.375rem;
  height: 1.375rem;
  margin: 0;
  border: 2px solid var(--nd-olive);
  border-radius: 0.3rem;
  background: var(--nd-cream);
  cursor: pointer;
  flex-shrink: 0;
}
.nd-check input[type='checkbox']::after {
  content: '';
  width: 0.45rem;
  height: 0.75rem;
  border: solid var(--nd-cream);
  border-width: 0 3px 3px 0;
  transform: translate(0, -1px) rotate(45deg) scale(0);
  transition: transform 150ms var(--nd-ease);
}
.nd-check input[type='checkbox']:checked {
  background: var(--nd-olive);
}
.nd-check input[type='checkbox']:checked::after {
  transform: translate(0, -1px) rotate(45deg) scale(1);
}

.nd-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
}
.nd-switch__text {
  display: grid;
  gap: 0.1rem;
}
.nd-switch__title {
  font-weight: 700;
}
.nd-switch__hint {
  color: var(--nd-olive-muted);
  font-size: 0.8125rem;
}
.nd-switch input[type='checkbox'] {
  appearance: none;
  position: relative;
  width: 3.25rem;
  height: 1.875rem;
  margin: 0;
  border: 2px solid var(--nd-olive);
  border-radius: var(--nd-radius-pill);
  background: var(--nd-cream);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 150ms var(--nd-ease);
}
.nd-switch input[type='checkbox']::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--nd-olive);
  transition: transform 150ms var(--nd-ease), background-color 150ms var(--nd-ease);
}
.nd-switch input[type='checkbox']:checked {
  background: var(--nd-olive);
}
.nd-switch input[type='checkbox']:checked::after {
  transform: translateX(1.375rem);
  background: var(--nd-yellow);
}

/* ------------------------------------------------------------ cards */
.nd-card {
  border: 3px solid var(--nd-olive);
  border-radius: var(--nd-radius-card);
  background: var(--nd-cream);
  box-shadow: var(--nd-shadow-lg);
}
.nd-sticker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border: 2px solid var(--nd-olive);
  border-radius: var(--nd-radius-pill);
  background: var(--nd-pink);
  color: var(--nd-dark);
  font-family: var(--nd-font-display);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
}
.nd-sticker--yellow {
  background: var(--nd-yellow);
}
.nd-sticker--cream {
  background: var(--nd-cream);
  color: var(--nd-olive);
}
.nd-sticker--olive {
  background: var(--nd-olive);
  color: var(--nd-cream);
}
.nd-sticker--red {
  background: var(--nd-red-deep);
  color: var(--nd-cream);
}

/* ---------------------------------------------------- site chrome */
.nd-announce {
  padding: 0.55rem 1rem;
  background: var(--nd-olive);
  color: var(--nd-cream);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
}
.nd-header {
  border-bottom: 3px solid var(--nd-olive);
  background: var(--nd-cream);
}
.nd-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 76rem;
  margin: 0 auto;
  padding: 0.85rem clamp(1rem, 4vw, 2rem);
}
.nd-logo {
  display: inline-flex;
  align-items: center;
}
.nd-logo img {
  display: block;
  height: 2.25rem;
  width: auto;
}
.nd-header__nav {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.75rem);
  font-weight: 700;
  font-size: 0.9375rem;
}
.nd-header__nav a {
  text-decoration: none;
}
.nd-header__nav a:hover,
.nd-header__nav a[aria-current='page'] {
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}
.nd-footer {
  margin-top: clamp(3rem, 8vw, 6rem);
  border-top: 3px solid var(--nd-olive);
  background: var(--nd-olive);
  color: var(--nd-cream);
}
.nd-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 76rem;
  margin: 0 auto;
  padding: 1.75rem clamp(1rem, 4vw, 2rem);
  font-size: 0.8125rem;
}
.nd-container {
  width: 100%;
  max-width: 76rem;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}
.nd-stack > * + * {
  margin-top: var(--nd-stack, 1rem);
}

@media (max-width: 640px) {
  .nd-header__nav .nd-hide-sm {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }
}

/* ------------------------------------------- narrow task pages (form) */
.nd-task {
  display: grid;
  gap: 1.5rem;
  width: 100%;
  max-width: 36rem;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) clamp(1rem, 4vw, 1.5rem) 0;
}
.nd-task__card {
  display: grid;
  gap: 1.25rem;
  padding: clamp(1.5rem, 5vw, 2.5rem);
  margin: 0 8px 8px 0;
}
.nd-task__foot {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--nd-olive-muted);
}
.nd-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}
.nd-row > .nd-grow {
  flex: 1 1 14rem;
  min-width: 0;
}
