/* Valley Revamp design system components. v1.0. Requires tokens.css and data-family. */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 400;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

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

h1,
.h1 {
  font-family: var(--font-display);
  font-size: var(--text-h1);
  font-weight: 560;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

h2,
.h2 {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  font-weight: 560;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h3,
.h3 {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: 560;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h4,
.h4 {
  font-family: var(--font-body);
  font-size: var(--text-h4);
  font-weight: 600;
  line-height: 1.3;
}

.display {
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: 560;
  line-height: 1;
  letter-spacing: -0.03em;
}

.lede {
  font-size: var(--text-body-lg);
  line-height: 1.55;
  color: var(--ink-muted);
  max-width: 42rem;
}

.small {
  font-size: var(--text-small);
  line-height: 1.5;
  letter-spacing: 0.005em;
}

.eyebrow {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-eyebrow);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

a {
  color: inherit;
}

a:hover {
  color: inherit;
}

.skip {
  position: absolute;
  left: var(--space-4);
  top: var(--space-4);
  z-index: 80;
  transform: translateY(-160%);
  background: var(--ink);
  color: var(--on-ink);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-button);
  text-decoration: none;
}

.skip:focus {
  transform: none;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.container {
  width: min(var(--container-default), calc(100% - (var(--gutter) * 2)));
  margin-inline: auto;
}

.container-wide {
  width: min(var(--container-wide), calc(100% - (var(--gutter) * 2)));
  margin-inline: auto;
}

.container-prose {
  width: min(var(--container-prose), calc(100% - (var(--gutter) * 2)));
  margin-inline: auto;
}

.section {
  padding-block: var(--space-8);
}

@media (min-width: 768px) {
  .section {
    padding-block: var(--space-9);
  }
}

@media (min-width: 1280px) {
  .section {
    padding-block: var(--space-10);
  }
}

.surface {
  background: var(--surface);
}

.surface-2 {
  background: var(--surface-2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--motion-fast) var(--ease-out),
    color var(--motion-fast) var(--ease-out),
    border-color var(--motion-fast) var(--ease-out),
    transform var(--motion-fast) var(--ease-out);
}

.btn-lg {
  min-height: 56px;
  padding: 0 28px;
}

.btn-sm {
  min-height: 40px;
  padding: 0 16px;
  font-size: var(--text-small);
}

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

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

.btn-secondary {
  border-color: var(--ink);
  background: transparent;
  color: var(--ink);
}

.btn-secondary:hover {
  background: var(--ink);
  color: var(--bg);
}

.btn-ghost {
  min-height: 48px;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.btn-ghost .arrow {
  display: inline-block;
  transition: transform var(--motion-fast) var(--ease-out);
}

.btn-ghost:hover .arrow {
  transform: translateX(4px);
}

.btn:active {
  transform: scale(0.98);
}

.btn[aria-disabled='true'],
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.link-underline {
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1px;
  transition: background-size var(--motion-fast) var(--ease-out);
}

.link-underline:hover,
.link-underline:focus-visible {
  background-size: 100% 1px;
}

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

.field span,
.field legend {
  font-size: var(--text-small);
  font-weight: 500;
  line-height: 1.4;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-input);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.4;
  box-shadow: none;
}

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

.field input:hover,
.field textarea:hover,
.field select:hover {
  border-color: color-mix(in srgb, var(--ink) 35%, var(--line));
}

.field.is-invalid input,
.field.is-invalid textarea,
.field.is-invalid select {
  border-color: var(--danger);
}

.form-note,
.form-error {
  font-size: var(--text-small);
  line-height: 1.5;
}

.form-error,
.field-error {
  color: var(--danger);
}

.field-error {
  display: block;
  margin: 0;
}

.check {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  font-size: var(--text-small);
  line-height: 1.5;
}

.check input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.device-browser {
  background: #fff;
  border-radius: var(--radius-image);
  box-shadow: var(--elev-3);
  border: 1px solid var(--stroke);
  overflow: hidden;
}

.device-chrome {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: 40px;
  padding: 0 var(--space-3);
  background: color-mix(in srgb, var(--bg) 70%, #fff);
  border-bottom: 1px solid var(--line);
}

.device-dots {
  display: flex;
  gap: 6px;
}

.device-dots i {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 18%, var(--bg));
}

.device-url {
  display: flex;
  flex: 1;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink-muted);
  font-size: 11px;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
}

.device-screen {
  background: #fff;
}

.device-phone {
  background: var(--ink);
  border-radius: 28px;
  padding: 10px;
  box-shadow: var(--elev-3);
  border: 1px solid var(--stroke);
}

.device-phone-screen {
  overflow: hidden;
  border-radius: 20px;
  background: #fff;
}

.device-notch {
  display: flex;
  justify-content: center;
  padding-top: 8px;
  background: inherit;
}

.device-notch i {
  display: block;
  width: 72px;
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 8%, #fff);
}

/* Stone Ledger patterns. Numbered rule rows, underline fields, and a flush thumb bar.
   The bar is a full-width hairline strip, not a floating centered capsule. */

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

.rule-row {
  display: grid;
  grid-template-columns: 3.25rem 1fr;
  gap: 12px 16px;
  align-items: baseline;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.rule-row:last-child {
  border-bottom: 1px solid var(--line);
}

.rule-index {
  font-family: var(--font-body);
  font-size: var(--text-micro, 0.75rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.rule-row h3 {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
}

.rule-row p {
  grid-column: 2;
  color: var(--ink-muted);
}

.field.underline-field input,
.field.underline-field textarea,
.field.underline-field select {
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  padding-inline: 0;
}

.thumb-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 8px 20px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.thumb-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--text-micro, 0.75rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

@media (min-width: 810px) {
  .thumb-nav {
    display: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .reveal.is-armed:not(.is-in) {
    opacity: 0;
    transform: translateY(12px);
  }

  .reveal.is-in {
    opacity: 1;
    transform: none;
    transition:
      opacity var(--motion-reveal) var(--ease-reveal),
      transform var(--motion-reveal) var(--ease-reveal);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal.is-armed {
    opacity: 1;
    transform: none;
  }
}
