@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url("fonts/fraunces-variable.woff2") format("woff2");
}

@font-face {
  font-family: "Work Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/work-sans-variable.woff2") format("woff2");
}

:root {
  --bg: #15100c;
  --panel: #201a13;
  --panel-border: #3c3122;
  --text: #f5ede0;
  --muted: #ab9c86;
  --accent: #cf9a4c;
  --accent-2: #b3562f;
  --success: #7fa66a;
  --danger: #e2604a;
  --radius: 16px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Work Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: radial-gradient(1200px 600px at 15% -10%, rgba(207, 154, 76, 0.16) 0%, transparent 60%),
    radial-gradient(1000px 550px at 100% 0%, rgba(179, 86, 47, 0.14) 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  padding: 40px 0 20px;
  border-bottom: 1px solid var(--panel-border);
  margin-bottom: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  color: var(--accent);
  flex-shrink: 0;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.tagline {
  color: var(--muted);
  margin: 10px 0 0;
  max-width: 46ch;
}

.steps {
  display: flex;
  gap: 8px;
  margin: 24px 0;
  flex-wrap: wrap;
}

.step-dot {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.step-dot.active {
  color: #1b140c;
  font-weight: 700;
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: 0 18px 40px -26px rgba(0, 0, 0, 0.7);
}

.panel h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  text-wrap: balance;
  margin-top: 0;
  margin-bottom: 6px;
}

.muted {
  color: var(--muted);
}

textarea,
input[type="text"] {
  width: 100%;
  background: #120e0a;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  color: var(--text);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
}

textarea:focus,
input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

label {
  display: block;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: var(--muted);
}

label input,
label textarea {
  margin-top: 6px;
  color: var(--text);
}

button {
  font-family: inherit;
  font-size: 0.95rem;
  border-radius: 10px;
  padding: 12px 20px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.08s ease, opacity 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

button:active {
  transform: scale(0.98);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1b140c;
  font-weight: 700;
  margin-top: 16px;
  box-shadow: 0 10px 24px -12px rgba(207, 154, 76, 0.6);
}

.primary:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.ghost {
  background: transparent;
  border-color: var(--panel-border);
  color: var(--text);
}

.ghost:hover:not(:disabled) {
  border-color: var(--accent);
}

.nav-row {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

.status-banner {
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(207, 154, 76, 0.15);
  border: 1px solid var(--accent);
  margin-bottom: 16px;
}

.status-banner.error {
  background: rgba(226, 96, 74, 0.12);
  border-color: var(--danger);
}

.status-banner.success {
  background: rgba(127, 166, 106, 0.12);
  border-color: var(--success);
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 16px;
}

@media (min-width: 560px) {
  .image-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.image-option {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 3px solid transparent;
  cursor: pointer;
  background: #120e0a;
  aspect-ratio: 1 / 1;
  transition: box-shadow 0.15s ease;
}

.image-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-option.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(207, 154, 76, 0.25);
}

.image-skeleton {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background: linear-gradient(90deg, #201a13 25%, #2b2318 37%, #201a13 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

.frame-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.frame-card {
  border: 2px solid var(--panel-border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  background: #120e0a;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.frame-card:hover {
  box-shadow: 0 8px 20px -12px rgba(0, 0, 0, 0.6);
}

.frame-card.selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(207, 154, 76, 0.14), rgba(179, 86, 47, 0.1));
  box-shadow: 0 0 0 3px rgba(207, 154, 76, 0.18);
}

.frame-card h3 {
  font-family: var(--font-display);
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.frame-card .frame-meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.frame-card .frame-price {
  font-weight: 700;
  color: var(--accent-2);
}

.order-review {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.frame-preview-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-height: 210px;
  justify-content: center;
  margin-bottom: 8px;
}

.frame-border {
  --frame-image: conic-gradient(from 45deg, #1a1a1a, #1a1a1a);
  --frame-width: 16px;
  --mat-color: #fff;
  --aspect: 4 / 5;
  display: inline-block;
  border-style: solid;
  border-width: var(--frame-width);
  border-image: var(--frame-image) 1;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), inset 0 2px 1px rgba(255, 255, 255, 0.22),
    inset 0 -2px 1px rgba(0, 0, 0, 0.4), inset 2px 0 1px rgba(255, 255, 255, 0.1),
    inset -2px 0 1px rgba(0, 0, 0, 0.25);
}

.frame-mat {
  background: var(--mat-color);
  padding: 12px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.18);
}

.frame-mat img {
  display: block;
  width: 220px;
  max-width: 40vw;
  aspect-ratio: var(--aspect);
  object-fit: cover;
  border-radius: 1px;
}

@media (max-width: 480px) {
  .frame-mat img {
    width: 160px;
    max-width: 55vw;
  }
}

/* Each frame's border-image is a conic-gradient: because a conic-gradient
   sweeps angularly around a center point, using it as a border-image makes
   each of the 4 sides sample a different angular slice, so the corners meet
   at a natural 45-degree miter — the same visual cue a real mitered wood
   frame has — instead of a flat color wrapped uniformly around a box. */
.frame-border[data-frame-id="classic-black-8x10"] {
  --frame-image: conic-gradient(from 45deg, #050505, #2e2b27 12%, #0a0a0a 25%, #302c26 38%, #050505 50%, #2e2b27 62%, #0a0a0a 75%, #302c26 88%, #050505);
  --frame-width: 16px;
  --mat-color: #f7f5ef;
  --aspect: 8 / 10;
}

.frame-border[data-frame-id="modern-white-11x14"] {
  --frame-image: conic-gradient(from 45deg, #f2f2ee, #ffffff 12%, #e2e2dc 25%, #fafaf6 38%, #dcdcd6 50%, #ffffff 62%, #e2e2dc 75%, #fafaf6 88%, #f2f2ee);
  --frame-width: 14px;
  --mat-color: #eceff1;
  --aspect: 11 / 14;
}

.frame-border[data-frame-id="walnut-wood-11x14"] {
  --frame-image: conic-gradient(from 45deg, #3c2213, #8a5a34 12%, #5c3a20 25%, #7a4a26 38%, #2c1a0e 50%, #8a5a34 62%, #5c3a20 75%, #7a4a26 88%, #3c2213);
  --frame-width: 20px;
  --mat-color: #f4ede1;
  --aspect: 11 / 14;
}

.frame-border[data-frame-id="premium-metal-16x20"] {
  --frame-image: conic-gradient(from 45deg, #d4d4d4, #f4f4f4 8%, #9c9c9c 16%, #e8e8e8 24%, #b0b0b0 32%, #f4f4f4 40%, #9c9c9c 48%, #e0e0e0 56%, #a8a8a8 64%, #f4f4f4 72%, #9c9c9c 80%, #e8e8e8 88%, #d4d4d4);
  --frame-width: 10px;
  --mat-color: #f5f5f5;
  --aspect: 16 / 20;
}

.frame-border[data-frame-id="gold-ornate-16x20"] {
  --frame-image: conic-gradient(from 45deg, #8a6a1a, #f6e27a 12%, #b8860b 25%, #f9e79f 38%, #7a5a12 50%, #f6e27a 62%, #b8860b 75%, #f9e79f 88%, #8a6a1a);
  --frame-width: 26px;
  --mat-color: #fbf4e3;
  --aspect: 16 / 20;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), inset 0 3px 1px rgba(255, 255, 255, 0.35),
    inset 0 -3px 1px rgba(0, 0, 0, 0.4), inset 3px 0 1px rgba(255, 255, 255, 0.18),
    inset -3px 0 1px rgba(0, 0, 0, 0.3);
}

.cost-breakdown {
  flex: 1;
  min-width: 220px;
  background: #120e0a;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 14px 16px;
}

.cost-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--muted);
  padding: 3px 0;
}

.cost-line.total {
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
  border-top: 1px solid var(--panel-border);
  margin-top: 6px;
  padding-top: 8px;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.plan-card {
  display: block;
  width: 100%;
  text-align: left;
  border: 2px solid var(--panel-border);
  border-radius: 12px;
  padding: 18px;
  cursor: pointer;
  background: #120e0a;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.plan-card:hover {
  box-shadow: 0 8px 20px -12px rgba(0, 0, 0, 0.6);
}

.plan-card.selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(207, 154, 76, 0.14), rgba(179, 86, 47, 0.1));
  box-shadow: 0 0 0 3px rgba(207, 154, 76, 0.18);
}

.plan-card h3 {
  font-family: var(--font-display);
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.plan-card p {
  margin: 0;
}

input[type="number"] {
  width: 100%;
  background: #120e0a;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  color: var(--text);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  margin-top: 6px;
}

input[type="number"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.image-selector-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.image-selector-row button {
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  border: 1px solid var(--panel-border);
  background: transparent;
  color: var(--text);
  font-weight: 600;
}

.image-selector-row button.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #120e0a;
}

.site-footer {
  text-align: center;
  color: var(--muted);
  padding: 30px 0 50px;
  font-size: 0.85rem;
}
