/* Hallmark · genre: editorial · design-system: design.md · designed-as-app
 * Shared chrome: N6 masthead · Ft5 statement · CTA voice · form states
 * pre-emit critique: P5 H5 E5 S5 R5 V4
 */

/* Tokens load separately: <link href="/tokens.css"> before this file */

/* ── Foundations ── */
html {
  overflow-x: clip;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  overflow-x: clip;
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: var(--leading-body);
  color: var(--color-ink);
  background: var(--color-paper);
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 400;
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-tight);
  color: var(--color-ink);
  overflow-wrap: anywhere;
  min-width: 0;
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.skip-nav {
  position: absolute;
  top: -100%;
  left: var(--space-sm);
  z-index: 9999;
  padding: var(--space-2xs) var(--space-sm);
  background: var(--color-ink);
  color: var(--color-paper-on-ink);
  font-size: var(--text-sm);
  text-decoration: none;
  border-radius: 0 0 var(--radius-xs) var(--radius-xs);
}

.skip-nav:focus {
  top: 0;
}

/* ── Layout helpers ── */
.hm-container {
  width: min(100% - var(--space-lg) * 2, var(--content-width));
  margin-inline: auto;
}

.hm-container--wide {
  width: min(100% - var(--space-lg) * 2, var(--content-wide));
  margin-inline: auto;
}

.hm-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-accent);
}

.hm-label--muted {
  color: var(--color-ink-2);
}

/* ── N6 Masthead ── */
.hm-masthead {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: color-mix(in oklch, var(--color-paper) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: var(--rule);
}

.hm-masthead--over-photo {
  position: absolute;
  inset: 0 0 auto 0;
  background: linear-gradient(
    to bottom,
    oklch(16% 0.01 60 / 0.55),
    oklch(16% 0.01 60 / 0)
  );
  border-bottom: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.hm-masthead--over-photo .hm-brand-name,
.hm-masthead--over-photo .hm-brand-sub,
.hm-masthead--over-photo .hm-nav-link {
  color: var(--color-paper-on-ink);
}

.hm-masthead--over-photo .hm-brand-sub,
.hm-masthead--over-photo .hm-nav-link {
  color: color-mix(in oklch, var(--color-paper-on-ink) 72%, transparent);
}

.hm-masthead--over-photo .hm-nav-link:hover,
.hm-masthead--over-photo .hm-nav-link[aria-current="page"] {
  color: var(--color-paper-on-ink);
}

.hm-masthead--over-photo .hm-btn--ghost {
  color: var(--color-paper-on-ink);
  border-color: color-mix(in oklch, var(--color-paper-on-ink) 45%, transparent);
}

.hm-masthead--over-photo .hm-btn--ghost:hover {
  background: color-mix(in oklch, var(--color-paper-on-ink) 10%, transparent);
  border-color: var(--color-paper-on-ink);
}

.hm-masthead__inner {
  width: min(100% - var(--space-lg) * 2, var(--content-wide));
  margin-inline: auto;
  min-height: var(--nav-height);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-sm);
}

.hm-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  text-decoration: none;
  min-width: 0;
  justify-self: start;
}

.hm-brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-paper);
  flex-shrink: 0;
  box-shadow: 0 0 0 1px oklch(18% 0.012 60 / 0.08);
}

.hm-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hm-brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.hm-brand-name {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-ink);
  white-space: nowrap;
}

.hm-brand-sub {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-ink-2);
  white-space: nowrap;
}

.hm-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  justify-self: center;
}

.hm-nav-link {
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  color: var(--color-ink-2);
  white-space: nowrap;
  transition: color var(--dur-short) var(--ease-out);
}

.hm-nav-link:hover,
.hm-nav-link[aria-current="page"] {
  color: var(--color-ink);
}

.hm-masthead__cta {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.hm-nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-xs);
  padding: var(--space-2xs);
  color: var(--color-ink);
  cursor: pointer;
}

.hm-masthead--over-photo .hm-nav-toggle {
  color: var(--color-paper-on-ink);
  border-color: color-mix(in oklch, var(--color-paper-on-ink) 40%, transparent);
}

/* ── Buttons ── */
.hm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  padding: 0.7rem 1.35rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background var(--dur-short) var(--ease-out),
    border-color var(--dur-short) var(--ease-out),
    color var(--dur-short) var(--ease-out),
    transform var(--dur-short) var(--ease-out),
    opacity var(--dur-short) var(--ease-out);
}

.hm-btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.hm-btn:active:not(:disabled) {
  transform: translateY(1px);
}

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

.hm-btn--primary {
  background: var(--color-ink);
  color: var(--color-paper-on-ink);
  border-color: var(--color-ink);
}

.hm-btn--primary:hover:not(:disabled) {
  background: color-mix(in oklch, var(--color-ink) 88%, var(--color-accent));
}

.hm-btn--ghost {
  background: transparent;
  color: var(--color-ink);
  border-color: var(--color-rule-strong);
}

.hm-btn--ghost:hover:not(:disabled) {
  border-color: var(--color-ink);
}

.hm-btn--accent {
  background: var(--color-accent);
  color: var(--color-accent-ink);
  border-color: var(--color-accent);
}

.hm-btn--accent:hover:not(:disabled) {
  filter: brightness(1.05);
}

.hm-btn--on-ink {
  background: var(--color-paper-on-ink);
  color: var(--color-ink);
  border-color: var(--color-paper-on-ink);
}

.hm-btn--on-ink:hover:not(:disabled) {
  background: color-mix(in oklch, var(--color-paper-on-ink) 90%, var(--color-accent));
}

.hm-btn--sm {
  padding: 0.5rem 0.9rem;
  font-size: var(--text-xs);
}

.hm-btn--block {
  width: 100%;
}

/* ── Forms ── */
.hm-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  margin-bottom: var(--space-md);
}

.hm-field label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-ink-2);
}

.hm-field input,
.hm-field textarea,
.hm-field select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  font-family: var(--font-body);
  font-size: var(--text-md);
  color: var(--color-ink);
  background: var(--color-paper);
  border: 1px solid var(--color-rule-strong);
  border-radius: var(--radius-sm);
  transition: border-color var(--dur-short) var(--ease-out);
}

.hm-field textarea {
  min-height: 8rem;
  resize: vertical;
  line-height: var(--leading-body);
}

.hm-field input:hover,
.hm-field textarea:hover,
.hm-field select:hover {
  border-color: var(--color-ink-3);
}

.hm-field input:focus-visible,
.hm-field textarea:focus-visible,
.hm-field select:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 1px;
  border-color: var(--color-focus);
}

.hm-field input:disabled,
.hm-field textarea:disabled,
.hm-field select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Workbench dark form surfaces */
.hm-workbench .hm-field input,
.hm-workbench .hm-field textarea,
.hm-workbench .hm-field select {
  background: var(--color-ink-band);
  color: var(--color-paper-on-ink);
  border-color: var(--color-rule-on-ink);
}

.hm-workbench .hm-field label {
  color: var(--color-muted-on-ink);
}

/* ── Status ── */
.hm-status {
  display: none;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--space-md);
  border: 1px solid transparent;
}

.hm-status.is-visible {
  display: block;
}

.hm-status--loading {
  background: color-mix(in oklch, var(--color-focus) 12%, transparent);
  color: var(--color-focus);
  border-color: color-mix(in oklch, var(--color-focus) 30%, transparent);
}

.hm-status--success {
  background: color-mix(in oklch, var(--color-success) 12%, transparent);
  color: var(--color-success);
  border-color: color-mix(in oklch, var(--color-success) 30%, transparent);
}

.hm-status--error {
  background: color-mix(in oklch, var(--color-danger) 12%, transparent);
  color: var(--color-danger);
  border-color: color-mix(in oklch, var(--color-danger) 30%, transparent);
}

.hm-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid color-mix(in oklch, currentColor 30%, transparent);
  border-top-color: currentColor;
  border-radius: var(--radius-pill);
  animation: hm-spin 0.75s linear infinite;
  vertical-align: -0.15em;
  margin-right: var(--space-2xs);
}

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

/* ── Panels / cards ── */
.hm-panel {
  background: var(--color-paper);
  border: var(--rule);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

.hm-panel--raised {
  background: var(--color-paper-2);
}

.hm-workbench .hm-panel {
  background: var(--color-ink-band-2);
  border-color: var(--color-rule-on-ink);
  color: var(--color-paper-on-ink);
}

.hm-workbench .hm-panel h2,
.hm-workbench .hm-panel h3 {
  color: var(--color-paper-on-ink);
}

/* ── Ft5 Statement footer ── */
.hm-footer {
  background: var(--color-ink-band);
  color: var(--color-paper-on-ink);
  padding: var(--space-2xl) 0 var(--space-xl);
  margin-top: var(--space-3xl);
}

.hm-footer__inner {
  width: min(100% - var(--space-lg) * 2, var(--content-width));
  margin-inline: auto;
  display: grid;
  gap: var(--space-xl);
}

.hm-footer__statement {
  max-width: 36rem;
}

.hm-footer__brand {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.hm-footer__brand img {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  background: var(--color-paper);
}

.hm-footer__name {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hm-footer__tagline {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-style: normal;
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-display);
  color: var(--color-paper-on-ink);
  margin-bottom: var(--space-sm);
}

.hm-footer__credit {
  font-size: var(--text-sm);
  color: var(--color-muted-on-ink);
  line-height: var(--leading-body);
}

.hm-footer__credit a {
  color: var(--color-paper-on-ink);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.hm-footer__credit a:hover {
  color: var(--color-accent);
}

.hm-footer__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-rule-on-ink);
}

.hm-footer__col-title {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-muted-on-ink);
  margin: 0 0 var(--space-sm);
}

.hm-footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}

.hm-footer__links a {
  font-size: var(--text-sm);
  color: var(--color-muted-on-ink);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur-short) var(--ease-out);
}

.hm-footer__links a:hover {
  color: var(--color-paper-on-ink);
}

.hm-footer__base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-sm);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-rule-on-ink);
  font-size: var(--text-xs);
  color: var(--color-muted-on-ink);
}

/* ── Section heads ── */
.hm-section {
  padding: var(--space-2xl) 0;
}

.hm-section__head {
  max-width: 36rem;
  margin-bottom: var(--space-xl);
}

.hm-section__head h2 {
  font-size: var(--text-display-s);
  margin: var(--space-2xs) 0 var(--space-sm);
}

.hm-section__head p {
  color: var(--color-ink-2);
  font-size: var(--text-lg);
}

/* ── Media frames ── */
.hm-frame {
  position: relative;
  overflow: hidden;
  background: var(--color-paper-2);
  border: var(--rule);
  border-radius: var(--radius-sm);
  min-width: 0;
}

.hm-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .hm-masthead__inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .hm-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-sm);
    background: var(--color-paper);
    border-bottom: var(--rule);
    box-shadow: var(--shadow-soft);
  }

  .hm-masthead.is-open .hm-nav {
    display: flex;
  }

  .hm-masthead--over-photo.is-open .hm-nav {
    background: var(--color-ink-band);
  }

  .hm-nav-link {
    padding: var(--space-xs) var(--space-sm);
  }

  .hm-nav-toggle {
    display: inline-flex;
  }

  .hm-masthead__cta .hm-btn {
    display: none;
  }

  .hm-footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 540px) {
  .hm-brand-sub {
    display: none;
  }

  .hm-footer__grid {
    grid-template-columns: 1fr;
  }

  .hm-container,
  .hm-container--wide,
  .hm-masthead__inner,
  .hm-footer__inner {
    width: min(100% - var(--space-md) * 2, var(--content-width));
  }
}

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