/* The One — shared design system. Square corners, editorial scale, copper on ink. */

:root {
  --ink: #0a0907;
  --ink-soft: #13110e;
  --ink-raised: #191612;
  --paper: #f4eee2;
  --paper-bright: #fbf7ee;
  --paper-dim: #e9e0cf;
  --paper-deep: #ddd2bd;
  --copper: #b5622c;
  --copper-bright: #d98b50;
  --copper-deep: #8a4519;
  --text: #1a1611;
  --text-soft: #3f382e;
  --muted: #756b5d;
  --muted-light: #a89d8b;
  --line: rgba(26, 22, 17, 0.14);
  --line-strong: rgba(26, 22, 17, 0.26);
  --line-light: rgba(244, 238, 226, 0.14);
  --line-light-strong: rgba(244, 238, 226, 0.26);
  --serif: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial,
    sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", "Consolas", "Liberation Mono", monospace;
  --shell: clamp(12px, 1.6vw, 26px);
  --gutter: clamp(22px, 5vw, 84px);
  --ease: cubic-bezier(0.22, 0.68, 0.19, 1);
  --shadow: 0 30px 90px rgba(5, 4, 3, 0.45);
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

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

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

::selection {
  background: var(--copper);
  color: var(--paper-bright);
}

:focus-visible {
  outline: 2px solid var(--copper-bright);
  outline-offset: 3px;
}

/* ------------------------------------------------------------------ type */

.serif {
  font-family: var(--serif);
  font-weight: 400;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--copper);
}

.eyebrow::before {
  content: "";
  width: 1.9rem;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.eyebrow--plain::before {
  display: none;
}

.mono {
  font-family: var(--mono);
  font-variant-ligatures: none;
}

.muted {
  color: var(--muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--line);
  padding: 0.2rem 0.55rem;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
  white-space: nowrap;
}

.tag--copper {
  border-color: rgba(181, 98, 44, 0.4);
  color: var(--copper-deep);
}

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 2.7rem;
  padding: 0.72rem 1.35rem;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  line-height: 1;
  text-transform: uppercase;
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease),
    color 0.35s var(--ease), transform 0.35s var(--ease);
}

.btn:hover {
  background: var(--copper);
  border-color: var(--copper);
  color: var(--paper-bright);
}

.btn:active {
  transform: translateY(1px);
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

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

.btn--solid:hover {
  background: var(--copper);
  border-color: var(--copper);
}

.btn--copper {
  background: var(--copper);
  border-color: var(--copper);
  color: #fff;
}

.btn--copper:hover {
  background: var(--copper-deep);
  border-color: var(--copper-deep);
}

.btn--ghost-light {
  border-color: var(--line-light-strong);
  color: var(--paper);
}

.btn--ghost-light:hover {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}

.btn--small {
  min-height: 2.2rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.6rem;
}

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

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid var(--line);
  color: var(--text-soft);
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
    border-color 0.25s var(--ease);
}

.icon-btn:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.link-line {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.link-line::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

.link-line:hover::after {
  transform: scaleX(0.55);
}

/* ----------------------------------------------------------------- forms */

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.field > span,
.field-label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper-bright);
  color: var(--text);
  padding: 0.62rem 0.7rem;
  font-size: 0.86rem;
  line-height: 1.45;
  border-radius: 0;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--line-strong);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--copper);
  background: #fff;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23756b5d' stroke-width='1.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  padding-right: 1.9rem;
}

.textarea {
  resize: vertical;
  min-height: 8rem;
  font-family: var(--mono);
  font-size: 0.8rem;
}

.range {
  width: 100%;
  height: 1.4rem;
  background: transparent;
  appearance: none;
  cursor: pointer;
}

.range::-webkit-slider-runnable-track {
  height: 1px;
  background: var(--line-strong);
}

.range::-webkit-slider-thumb {
  appearance: none;
  width: 0.7rem;
  height: 0.7rem;
  margin-top: -0.32rem;
  background: var(--copper);
  border: 0;
  border-radius: 50%;
}

.range::-moz-range-track {
  height: 1px;
  background: var(--line-strong);
}

.range::-moz-range-thumb {
  width: 0.7rem;
  height: 0.7rem;
  background: var(--copper);
  border: 0;
  border-radius: 50%;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  cursor: pointer;
  font-size: 0.82rem;
  line-height: 1.4;
}

.check input {
  appearance: none;
  width: 0.9rem;
  height: 0.9rem;
  margin: 0.16rem 0 0;
  border: 1px solid var(--line-strong);
  background: var(--paper-bright);
  flex: none;
  display: grid;
  place-items: center;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.check input::after {
  content: "";
  width: 0.42rem;
  height: 0.24rem;
  border-left: 1.5px solid var(--paper-bright);
  border-bottom: 1.5px solid var(--paper-bright);
  transform: rotate(-45deg) scale(0);
  transition: transform 0.18s var(--ease);
}

.check input:checked {
  background: var(--copper);
  border-color: var(--copper);
}

.check input:checked::after {
  transform: rotate(-45deg) scale(1);
}

/* ---------------------------------------------------------------- dialog */

dialog {
  border: 0;
  padding: 0;
  margin: auto;
  background: transparent;
  color: var(--text);
  max-width: none;
  max-height: none;
}

dialog::backdrop {
  background: rgba(7, 6, 5, 0.68);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

dialog[open] .sheet {
  animation: sheet-in 0.45s var(--ease) both;
}

dialog[open]::backdrop {
  animation: fade-in 0.35s ease both;
}

.sheet {
  width: min(980px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  background: var(--paper-bright);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sheet--wide {
  width: min(1180px, calc(100vw - 2rem));
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.sheet-head .eyebrow {
  margin-bottom: 0.3rem;
}

.sheet-title {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  line-height: 1.05;
  font-weight: 400;
  letter-spacing: -0.015em;
}

.sheet-sub {
  margin-top: 0.35rem;
  font-size: 0.76rem;
  color: var(--muted);
}

.sheet-body {
  overflow: auto;
  padding: 1.5rem;
  overscroll-behavior: contain;
}

.sheet-body--flush {
  padding: 0;
}

.sheet-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.sheet-close {
  flex: none;
}

.sheet-note {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ----------------------------------------------------------------- toast */

.toast {
  position: fixed;
  z-index: 120;
  left: 50%;
  bottom: 1.6rem;
  transform: translate(-50%, 12px);
  max-width: min(30rem, calc(100vw - 2rem));
  padding: 0.7rem 1.05rem;
  background: var(--ink);
  border: 1px solid var(--line-light-strong);
  color: var(--paper);
  font-size: 0.78rem;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast--warn {
  border-color: rgba(217, 139, 80, 0.7);
  color: #f3c9a5;
}

/* --------------------------------------------------------------- motion */

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  45% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.reveal {
  opacity: 1;
  transform: none;
}

.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: var(--delay, 0s);
}

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

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

.skip {
  position: fixed;
  z-index: 200;
  top: 0.6rem;
  left: 0.6rem;
  padding: 0.6rem 1rem;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: translateY(-160%);
  transition: transform 0.25s var(--ease);
}

.skip:focus {
  transform: none;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
