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

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100dvh;
  font-size: 17px;
  line-height: 1.55;
}

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

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

button {
  cursor: pointer;
}

h1,
h2,
h3,
.brand-name,
.display {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.03em;
  text-transform: none;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 50;
  background: var(--color-surface);
  color: var(--color-text);
  padding: 10px 14px;
  border-radius: var(--radius-control);
}

.skip-link:focus {
  top: 16px;
}

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

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

.icon {
  display: inline-block;
  vertical-align: -0.125em;
  flex: none;
}

.brand-lockup {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  min-height: 48px;
}

.brand-lockup-text {
  grid-template-columns: 1fr;
  gap: 2px;
  align-content: center;
}

.brand-mark {
  width: 46px;
  height: 46px;
}

.brand-text {
  display: grid;
  gap: 1px;
}

.brand-wordmark,
.brand-name {
  display: block;
  font-family: var(--font-heading);
  font-size: 28px;
  font-style: italic;
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: #ef7a3d;
}

.brand-sub {
  display: block;
  margin-top: 2px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.btn {
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--radius-control);
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition:
    background-color var(--motion-micro) var(--ease-spring),
    color var(--motion-micro) var(--ease-spring),
    border-color var(--motion-micro) var(--ease-spring),
    transform var(--motion-micro) var(--ease-spring),
    box-shadow var(--motion-micro) var(--ease-spring);
}

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

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

.btn-gold {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: none;
}

.btn-gold:hover {
  background: var(--color-accent-deep);
  box-shadow: var(--shadow-soft);
}

.btn-navy {
  background: var(--color-secondary);
  color: #fff;
  border-color: var(--color-secondary);
  font-weight: 700;
}

.btn-navy:hover {
  background: #2a3038;
  box-shadow: var(--shadow-soft);
}

.btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.5);
}

.btn-line {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-line);
}

.btn-line:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: var(--shadow-soft);
}

.round-btn {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-secondary);
  text-decoration: none;
  transition:
    transform var(--motion-micro) var(--ease-spring),
    background-color var(--motion-micro) var(--ease-spring),
    box-shadow var(--motion-micro) var(--ease-spring);
}

.round-btn:hover {
  transform: translateY(-2px);
  background: #d4af5c;
  box-shadow: 0 10px 16px rgba(201, 162, 74, 0.28);
}

.field {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-tight);
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 400;
  font-size: 16px;
  transition:
    border-color var(--motion-micro) var(--ease-spring),
    box-shadow var(--motion-micro) var(--ease-spring);
}

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

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: #b7c2cd;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(23, 50, 71, 0.12);
}

.sheet {
  width: min(520px, calc(100% - 32px));
  max-width: calc(100% - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius-shell);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-card);
}

.sheet::backdrop {
  background: rgba(15, 34, 51, 0.55);
}

.sheet[open] {
  animation: sheet-in var(--motion-panel) var(--ease-spring);
}

.sheet-body {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.sheet-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.sheet-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 34px;
  line-height: 1.05;
}

.sheet-close {
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-pill);
  background: var(--color-bg);
  color: var(--color-text);
}

.state-panel {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 28px 24px;
  border-radius: var(--radius-inset);
  background:
    linear-gradient(180deg, rgba(23, 50, 71, 0.04), transparent 48%),
    var(--color-surface);
  border: 1px solid var(--color-line);
}

.state-panel h3 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.state-panel p {
  max-width: 42ch;
  color: var(--color-text-muted);
}

.skeleton {
  background: linear-gradient(90deg, #dfe5eb 0%, #f4f7fa 48%, #dfe5eb 100%);
  background-size: 200% 100%;
  animation: sheen 1.1s linear infinite;
  border-radius: var(--radius-tight);
}

.hub-shell {
  display: grid;
  gap: 18px;
  width: min(640px, calc(100% - 32px));
  margin: 12vh auto;
  padding: 32px;
  background: var(--color-surface);
  border-radius: var(--radius-shell);
  box-shadow: var(--shadow-card);
}

.hub-shell h1 {
  margin: 0;
  font-size: clamp(40px, 7vw, 64px);
  line-height: 0.98;
}

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

@keyframes sheen {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .sheet {
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    max-height: 84dvh;
    margin: 0;
    overflow: auto;
    border-radius: var(--radius-shell) var(--radius-shell) 0 0;
  }
}

@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;
  }
}
