/* Pawfolio — shared foundations */
:root {
  --paper: #f5f0e6;
  --paper-deep: #ebe3d5;
  --cream: #fffaf2;
  --white: #ffffff;
  --ink: #252119;
  --ink-soft: #413b31;
  --muted: #6d6457;
  --muted-light: #746b5e;
  --line: rgba(54, 44, 31, 0.13);
  --line-strong: rgba(54, 44, 31, 0.22);
  --accent: #b34c27;
  --accent-deep: #91361a;
  --accent-soft: #f2ddce;
  --sage: #586b54;
  --sage-soft: #dfe6d9;
  --gold: #d9a441;
  --danger: #b8453d;
  --danger-soft: #f7e2df;
  --success: #3f765a;
  --success-soft: #e0eee5;
  --serif: "Iowan Old Style", "Palatino Linotype", "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  --sans: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-xl: 40px;
  --shadow-sm: 0 5px 18px -12px rgba(58, 43, 26, 0.38);
  --shadow-md: 0 20px 50px -30px rgba(58, 43, 26, 0.48);
  --shadow-lg: 0 34px 80px -38px rgba(42, 30, 18, 0.55);
  --ease: cubic-bezier(0.22, 0.75, 0.25, 1);
}

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

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

body {
  margin: 0;
  min-width: 320px;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

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

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

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

button {
  cursor: pointer;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

::selection {
  color: var(--cream);
  background: var(--accent);
}

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

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 3000;
  padding: 12px 18px;
  color: var(--cream);
  background: var(--ink);
  border-radius: 999px;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--fill {
  fill: currentColor;
  stroke: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 21px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.01em;
  transition:
    transform 0.2s var(--ease),
    background 0.2s var(--ease),
    border-color 0.2s var(--ease),
    color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

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

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.btn--primary {
  color: #fff9f1;
  background: var(--accent);
  box-shadow: 0 15px 30px -18px rgba(164, 70, 37, 0.9);
}

.btn--primary:hover {
  background: var(--accent-deep);
  box-shadow: 0 18px 34px -18px rgba(157, 63, 33, 0.95);
}

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

.btn--ink:hover {
  background: #3b3429;
}

.btn--quiet {
  color: var(--ink-soft);
  background: transparent;
  border-color: var(--line-strong);
}

.btn--quiet:hover {
  background: rgba(255, 250, 242, 0.7);
  border-color: var(--ink-soft);
}

.btn--text {
  min-height: 38px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
}

.btn--text:hover {
  color: var(--ink);
}

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

.btn--danger:hover {
  background: #9f332c;
}

.btn--sm {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--ink-soft);
  background: rgba(255, 250, 242, 0.78);
  border: 1px solid var(--line);
  border-radius: 50%;
  transition:
    background 0.2s var(--ease),
    color 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.icon-button:hover {
  color: var(--ink);
  background: var(--cream);
  transform: rotate(3deg);
}

/* Form pieces shared with the studio */
.field {
  display: grid;
  gap: 8px;
}

.field > label,
.field-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.field-hint {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  transition:
    border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease),
    background 0.2s var(--ease);
}

.input,
.select {
  height: 46px;
  padding: 0 14px;
}

.textarea {
  min-height: 118px;
  padding: 12px 14px;
  line-height: 1.65;
  resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted-light);
}

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

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(196, 93, 55, 0.11);
}

/* Toast */
.toast-region {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 5000;
  display: grid;
  gap: 8px;
  width: min(92vw, 440px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 16px;
  color: var(--cream);
  background: rgba(37, 33, 25, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  font-size: 13.5px;
  line-height: 1.55;
  animation: toast-in 0.28s var(--ease) both;
}

.toast::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-top: 5px;
  background: var(--sage-soft);
  border-radius: 50%;
}

.toast--error::before {
  background: #f0a8a0;
}

.toast--leaving {
  animation: toast-out 0.25s var(--ease) both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

/* Pawfolio wordmark */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.wordmark__mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  color: var(--cream);
  background: var(--ink);
  border-radius: 14px 14px 14px 5px;
}

.wordmark__mark .icon {
  width: 23px;
  height: 23px;
}

.wordmark__copy {
  display: grid;
  gap: 1px;
  line-height: 1.1;
}

.wordmark__copy strong {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.wordmark__copy span {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.19em;
  color: var(--muted);
}

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