/*
 * CN Sign Shop — site styles.
 *
 * Every value reads from a token in theme.css. Nothing hardcodes a color,
 * space, radius, or shadow, so both themes follow from the tokens.
 *
 * --brand-red appears exactly once, on .logo__mark. Everything interactive
 * uses --accent (the brand yellow). See docs/theme.md.
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: var(--space-4);
  top: var(--space-4);
  z-index: 10;
  padding: var(--space-2) var(--space-4);
  background: var(--accent);
  color: var(--accent-text);
  border-radius: var(--radius-md);
}

/* ---- Masthead ---- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

/* Real artwork, once static/img/logo.* exists. */
.logo__img {
  display: block;
  height: 2.75rem;
  width: auto;
}

/* CSS recreation of the CN.Sign mark: red script over a yellow diamond.
   The only place --brand-red and --brand-yellow are used. */
.logo__lockup {
  position: relative;
  display: inline-grid;
  place-items: center;
  min-width: 6.5rem;
  padding: var(--space-3) var(--space-4);
}

.logo__diamond {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 3.25rem;
  height: 3.25rem;
  background: var(--brand-yellow);
  border-radius: var(--radius-sm);
  transform: rotate(45deg) scale(1.35);
}

.logo__mark {
  position: relative;   /* above the diamond */
  color: var(--brand-red);
  font-weight: 800;
  font-size: 1.375rem;
  letter-spacing: -0.01em;
  /* The wordmark is large and bold, so its 3.74:1 against the diamond meets
     AA Large. Do not reuse this pairing for body text. */
}

.logo__mark em {
  font-style: italic;
}

.logo__tagline {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.nav__link {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
}

.nav__link:hover {
  background: var(--surface-raised);
  color: var(--text);
}

/* Underline as well as color, so the current tab is not signalled by hue alone. */
.nav__link--active {
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* ---- Layout ---- */

.page {
  flex: 1;
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
  padding: var(--space-6) var(--space-4);
}

.section + .section {
  margin-top: var(--space-8);
}

.section--narrow {
  max-width: 40rem;
}

.section__title {
  margin: 0 0 var(--space-3);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.section__lead {
  margin: 0 0 var(--space-5);
  color: var(--text-muted);
  font-size: 1.0625rem;
}

/* ---- Hero ---- */

.hero {
  padding: var(--space-8) var(--space-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.hero__title {
  margin: 0 0 var(--space-4);
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero__lead {
  margin: 0 auto var(--space-5);
  max-width: 34rem;
  color: var(--text-muted);
  font-size: 1.0625rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
  margin: 0;
}

/* ---- Buttons and links ---- */

.btn {
  display: inline-block;
  padding: var(--space-3) var(--space-5);
  background: var(--surface-raised);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  border-color: var(--accent);
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn--wide {
  width: 100%;
  padding: var(--space-4);
  font-size: 1.0625rem;
}

.link {
  color: var(--accent);
  font-weight: 600;
  text-underline-offset: 2px;
}

.link:hover {
  color: var(--accent-hover);
}

:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- Cards ---- */

.cards {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.card__title {
  margin: 0 0 var(--space-2);
  font-size: 1.125rem;
}

.card__body {
  margin: 0 0 var(--space-3);
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* ---- Products (sign options) ---- */

.product {
  padding: var(--space-5);
  margin-bottom: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  /* Anchor links from the home page land below the sticky-ish masthead. */
  scroll-margin-top: var(--space-5);
}

.product__title {
  margin: 0 0 var(--space-2);
  font-size: 1.375rem;
}

.product__blurb {
  margin: 0 0 var(--space-5);
  color: var(--text-muted);
}

.product__grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  margin-bottom: var(--space-5);
}

.product__label {
  margin: 0 0 var(--space-2);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.speclist {
  margin: 0;
  padding: 0;
  list-style: none;
}

.speclist__item {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}

.speclist__item:last-child {
  border-bottom: 0;
}

.speclist__name {
  font-weight: 600;
}

.speclist__note {
  display: block;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ---- Gallery ---- */

.gallery {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.gallery__item {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.gallery__img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* ---- Forms ---- */

.form {
  margin: 0;
}

.fieldset {
  margin: 0 0 var(--space-5);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.fieldset__legend {
  padding: 0 var(--space-2);
  font-weight: 700;
}

.fieldset__note {
  margin: 0 0 var(--space-4);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.field {
  margin-bottom: var(--space-4);
}

.field:last-child {
  margin-bottom: 0;
}

.field-row {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
}

.field__label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: 600;
  font-size: 0.9375rem;
}

.field__input {
  width: 100%;
  padding: var(--space-3);
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font: inherit;
}

.field__input:hover {
  border-color: var(--text-muted);
}

.field__input--short {
  max-width: 10rem;
}

.field__input--file {
  padding: var(--space-2);
}

/* Bad fields get a thicker border as well as a color, and always carry a
   text message below — never color alone. */
.field__input--bad {
  border-color: var(--err);
  border-width: 2px;
}

.field__hint {
  margin: var(--space-2) 0 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 400;
}

.field__error {
  margin: var(--space-2) 0 0;
  color: var(--err);
  font-size: 0.875rem;
  font-weight: 600;
}

.req {
  color: var(--err);
}

.choice {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  margin-bottom: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.choice:hover {
  background: var(--surface-raised);
}

/* Off-screen rather than display:none — some bots skip hidden inputs. */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---- Alerts and notices ---- */

.alert {
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--err);
  border-left: var(--space-1) solid var(--err);
  border-radius: var(--radius-md);
}

.alert--warn {
  border-color: var(--accent);
  border-left-color: var(--accent);
}

.alert__title {
  margin: 0 0 var(--space-2);
  font-weight: 700;
}

.alert__list {
  margin: 0;
  padding-left: var(--space-5);
}

.notice {
  padding: var(--space-4) var(--space-5);
  background: var(--accent-dim);
  border-radius: var(--radius-md);
  color: var(--text);
}

.notice--tight {
  padding: var(--space-3) var(--space-4);
  font-size: 0.9375rem;
}

.ref {
  font-family: var(--mono);
}

.error__code {
  margin: 0;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 0.875rem;
}

/* ---- Footer ---- */

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer__legal,
.footer__contact,
.footer__theme {
  margin: 0;
}

.theme-toggle {
  padding: var(--space-2) var(--space-4);
  background: var(--surface-raised);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--accent);
}
