/* The Grainline — shared stylesheet */

:root {
  --bg: #f6efe3;
  --bg-soft: #faf5ec;
  --bg-card: #ffffff;
  --ink: #28241e;
  --muted: #6f6659;
  --accent: #7a2a2a;
  --gold: #a48560;
  --hairline: #e0d5c0;
  --hairline-strong: #c9bca0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'kern' 1, 'liga' 1;
}

.container { max-width: 1120px; margin: 0 auto; padding: 0 32px; }
.container-narrow { max-width: 720px; margin: 0 auto; padding: 0 32px; }

/* Typography utilities */
.serif { font-family: 'Cormorant Garamond', 'Garamond', serif; }
.eyebrow {
  font-family: 'Cormorant Garamond', 'Garamond', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 16px;
  color: var(--gold);
  letter-spacing: 0.04em;
  margin-bottom: 18px;
}

em, .italic { font-family: 'Cormorant Garamond', 'Garamond', serif; font-style: italic; }

/* Header */
header.masthead {
  padding: 36px 0 24px;
  border-bottom: 1px solid var(--hairline);
  background: var(--bg);
}
.masthead-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1120px; margin: 0 auto; padding: 0 32px;
}
.logo {
  font-family: 'Cormorant Garamond', 'Garamond', serif;
  font-weight: 400; font-size: 22px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink); text-decoration: none;
}
.masthead-nav {
  font-family: 'Cormorant Garamond', 'Garamond', serif;
  font-style: italic; font-size: 15px;
  color: var(--muted);
}
.masthead-nav a { color: inherit; text-decoration: none; margin-left: 24px; }
.masthead-nav a:hover { color: var(--accent); }

/* Page intro */
.page-intro { padding: 80px 0 40px; text-align: center; }
.page-intro h1 {
  font-family: 'Cormorant Garamond', 'Garamond', serif;
  font-weight: 400;
  font-size: clamp(42px, 5.5vw, 64px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin-bottom: 20px;
}
.page-intro h1 em {
  font-style: italic; color: var(--accent); font-weight: 500;
}
.page-intro p {
  font-size: 17px; color: var(--muted);
  max-width: 560px; margin: 0 auto; font-weight: 300;
}

/* Form */
.form {
  max-width: 720px; margin: 40px auto 120px;
  padding: 0 32px;
}
.form-section {
  padding: 48px 0;
  border-top: 1px solid var(--hairline);
}
.form-section:first-of-type { border-top: none; }
.form-section-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 32px; flex-wrap: wrap; gap: 8px;
}
.form-section h2 {
  font-family: 'Cormorant Garamond', 'Garamond', serif;
  font-weight: 400;
  font-size: 28px; letter-spacing: -0.01em;
}
.form-section .hint {
  font-style: italic; font-size: 14px;
  color: var(--muted); font-family: 'Cormorant Garamond', serif;
}

.field-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 24px 32px;
}
.field { display: flex; flex-direction: column; }
.field label {
  font-size: 13px; color: var(--muted);
  letter-spacing: 0.05em; text-transform: uppercase;
  margin-bottom: 10px; font-weight: 400;
}
.field input, .field select {
  padding: 12px 2px; font-size: 18px;
  background: transparent; border: none;
  border-bottom: 1px solid var(--hairline-strong);
  font-family: 'Cormorant Garamond', 'Garamond', serif;
  font-weight: 400; color: var(--ink);
  transition: border-color 0.2s;
  appearance: none;
}
.field input:focus, .field select:focus {
  outline: none; border-bottom-color: var(--accent);
}
.field input::placeholder, .field textarea::placeholder { color: var(--hairline-strong); font-style: italic; }
.field textarea {
  padding: 12px 14px; font-size: 17px;
  background: var(--bg-soft);
  border: 1px solid var(--hairline-strong);
  font-family: 'Cormorant Garamond', 'Garamond', serif;
  font-weight: 400; color: var(--ink);
  width: 100%; resize: vertical;
  transition: border-color 0.2s;
}
.field textarea:focus { outline: none; border-color: var(--accent); }

/* Inspiration gallery + uploader */
.image-gallery {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  margin-bottom: 20px;
}
.image-card {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--hairline);
}
.image-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-delete {
  position: absolute; top: 6px; right: 6px;
  margin: 0;
}
.image-delete button {
  width: 26px; height: 26px; border-radius: 50%;
  border: none; background: rgba(40, 36, 30, 0.7);
  color: var(--bg); font-size: 18px; line-height: 1;
  cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.image-delete button:hover { background: var(--accent); }

.image-analysis {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 10px 12px;
  background: linear-gradient(to top, rgba(40,36,30,0.88), rgba(40,36,30,0));
  color: var(--bg);
  opacity: 0; transition: opacity 0.2s;
  font-size: 12px;
}
.image-card:hover .image-analysis { opacity: 1; }
.image-analysis-summary {
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-size: 14px; line-height: 1.3; margin-bottom: 6px;
}
.image-analysis-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.image-analysis-tags span {
  font-size: 10px; letter-spacing: 0.04em;
  padding: 2px 6px; background: rgba(255,255,255,0.15);
  text-transform: lowercase;
}

.uploader {
  display: flex; flex-direction: column; gap: 14px;
  max-width: 640px;
}
.uploader-drop {
  display: flex; align-items: center; justify-content: center;
  min-height: 120px; padding: 24px;
  border: 1.5px dashed var(--hairline-strong);
  background: var(--bg-soft);
  cursor: pointer; transition: all 0.2s;
  text-align: center;
}
.uploader-drop:hover { border-color: var(--accent); background: var(--bg); }
.uploader-drop input { display: none; }
.uploader-text strong {
  display: block; font-weight: 500; margin-bottom: 4px;
  font-family: 'Cormorant Garamond', serif; font-size: 22px;
}
.uploader-text span {
  font-size: 13px; color: var(--muted); font-style: italic;
  font-family: 'Cormorant Garamond', serif;
}

.btn-secondary {
  background: transparent; color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-secondary:hover { background: var(--accent); color: var(--bg); }

/* Tile grid — vibes + silhouettes */
.tile-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.tile-grid--small { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }

.tile {
  position: relative;
  display: flex; align-items: flex-end;
  min-height: 160px; padding: 20px;
  border-radius: 2px;
  cursor: pointer; user-select: none;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  background: var(--bg-soft);
  border: 1px solid var(--hairline);
}
.tile-grid--small .tile { min-height: 110px; }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(40,36,30,0.08); }

.tile-content { position: relative; z-index: 2; }
.tile-title { font-size: 22px; font-weight: 500; line-height: 1.1; color: var(--ink); }
.tile-desc {
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-size: 14px; color: var(--muted); margin-top: 4px;
}

.tile-check {
  position: absolute; top: 14px; right: 14px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,0.85);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--accent);
  opacity: 0; transform: scale(0.8);
  transition: all 0.2s; z-index: 3;
}
.tile:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent), 0 6px 20px rgba(90,26,43,0.15);
}
.tile:has(input:checked) .tile-check { opacity: 1; transform: scale(1); }

/* Vibe-specific palettes (gradient backgrounds that evoke the vibe) */
.tile--vibe { color: var(--ink); }
.tile--minimalist { background: linear-gradient(145deg, #f5f2ed 0%, #e8e3d8 100%); }
.tile--classic    { background: linear-gradient(145deg, #f0e9dc 0%, #d4c5a8 100%); }
.tile--elegant    { background: linear-gradient(145deg, #efe8dc 0%, #c9b98f 100%); }
.tile--romantic   { background: linear-gradient(145deg, #f4e4e0 0%, #e8c8c8 100%); }
.tile--edgy       { background: linear-gradient(145deg, #3a3230 0%, #1a1a1a 100%); color: var(--bg); }
.tile--edgy .tile-title { color: var(--bg); }
.tile--edgy .tile-desc { color: #c9bca0; }
.tile--bohemian   { background: linear-gradient(145deg, #d9c8a8 0%, #a07848 100%); }
.tile--preppy     { background: linear-gradient(145deg, #e0e8ea 0%, #8aa4b4 100%); }
.tile--sporty     { background: linear-gradient(145deg, #e8ece8 0%, #a8b8a8 100%); }
.tile--trendy     { background: linear-gradient(145deg, #f0e0d8 0%, #d88a6a 100%); }
.tile--vintage    { background: linear-gradient(145deg, #e8d8c0 0%, #8a6048 100%); }

.tile--silhouette { background: var(--bg-soft); }
.tile--silhouette .tile-title { font-size: 18px; }

/* Color swatches */
.swatch-grid {
  display: grid; gap: 20px 14px;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
}
.swatch {
  display: flex; flex-direction: column; align-items: center;
  cursor: pointer; user-select: none; gap: 8px;
}
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch-circle {
  width: 56px; height: 56px; border-radius: 50%;
  border: 1px solid var(--hairline-strong);
  transition: all 0.2s;
  box-shadow: inset 0 0 0 0 var(--bg);
}
.swatch:hover .swatch-circle { transform: scale(1.05); }
.swatch:has(input:checked) .swatch-circle {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}
.swatch--avoid:has(input:checked) .swatch-circle {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink);
  position: relative;
}
.swatch--avoid:has(input:checked) .swatch-circle::after {
  content: ''; position: absolute;
  top: 50%; left: -6px; right: -6px; height: 2px;
  background: var(--ink); transform: rotate(-45deg);
}
.swatch-label {
  font-size: 13px; color: var(--muted);
  letter-spacing: 0.02em;
}
.field .unit {
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-size: 14px; color: var(--muted);
  margin-left: 8px;
}

/* Pill buttons — for occasions and styles */
.pills {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.pill {
  display: inline-block;
  padding: 10px 20px;
  border: 1px solid var(--hairline-strong);
  border-radius: 100px;
  font-size: 14px; font-weight: 400;
  color: var(--ink); background: transparent;
  cursor: pointer; transition: all 0.2s;
  font-family: inherit;
  user-select: none;
}
.pill:hover { border-color: var(--ink); }
input[type="radio"].pill-input,
input[type="checkbox"].pill-input { display: none; }
input[type="radio"].pill-input:checked + label.pill,
input[type="checkbox"].pill-input:checked + label.pill {
  background: var(--ink); color: var(--bg); border-color: var(--ink);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 18px 48px;
  font-size: 15px; font-weight: 400;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic; letter-spacing: 0.03em;
  background: var(--ink); color: var(--bg);
  border: none; border-radius: 100px;
  cursor: pointer; text-decoration: none;
  transition: background 0.2s;
}
.btn:hover { background: var(--accent); }
.btn-ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--bg); }

.form-actions {
  text-align: center; padding: 48px 0 0;
}

/* Recommendations page */
.greeting { padding: 70px 0 40px; text-align: center; border-bottom: 1px solid var(--hairline); }
.greeting h1 {
  font-family: 'Cormorant Garamond', serif; font-weight: 400;
  font-size: clamp(36px, 4.5vw, 52px);
  letter-spacing: -0.015em; margin-bottom: 12px;
}
.greeting h1 em { font-style: italic; color: var(--accent); font-weight: 500; }
.greeting p { font-size: 16px; color: var(--muted); font-weight: 300; }

.filter-chip {
  display: inline-block; margin: 12px 4px 0;
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-size: 15px; color: var(--gold);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 48px 32px;
  padding: 60px 0 120px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(40, 36, 30, 0.08);
}
.card-image {
  aspect-ratio: 3/4;
  background: linear-gradient(135deg, var(--bg-soft), var(--bg));
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.card-image-placeholder {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 22px;
  color: var(--gold);
  text-align: center;
  padding: 24px;
  line-height: 1.3;
}
.card-body {
  padding: 24px 24px 28px;
  display: flex; flex-direction: column; gap: 8px;
  flex: 1;
}
.card-brand {
  font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--muted);
  font-weight: 500;
}
.card-name {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400; font-size: 22px;
  line-height: 1.25; letter-spacing: -0.01em;
  min-height: 2.4em;
}
.card-size {
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px; color: var(--ink);
  margin: 10px 0 2px;
}
.card-size strong { font-weight: 500; }
.card-size em { color: var(--accent); font-style: italic; }
.card-fit-note {
  font-size: 13px; color: var(--muted);
  font-style: italic; font-family: 'Cormorant Garamond', serif;
}
.card-price {
  font-family: 'Cormorant Garamond', serif; font-size: 20px;
  margin-top: auto; padding-top: 18px;
}
.card-price .sale { color: var(--accent); font-weight: 500; }
.card-price .strike {
  color: var(--muted); text-decoration: line-through;
  font-size: 15px; margin-left: 8px;
}
.card-cta {
  margin-top: 14px;
  display: block; text-align: center;
  padding: 12px; background: transparent;
  border: 1px solid var(--ink); border-radius: 100px;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic; font-size: 14px;
  color: var(--ink); text-decoration: none;
  transition: all 0.2s;
}
.card-cta:hover { background: var(--ink); color: var(--bg); }
.card-unavailable {
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px; font-style: italic;
  color: var(--accent); margin-top: 10px;
}

.empty-state {
  padding: 120px 32px; text-align: center;
}
.empty-state h2 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400; font-size: 32px;
  margin-bottom: 16px;
}
.empty-state p { color: var(--muted); max-width: 480px; margin: 0 auto 32px; }

.error-banner {
  max-width: 720px; margin: 24px auto 0; padding: 16px 24px;
  background: #f2e3e3; border: 1px solid #d8b8b8;
  color: var(--accent); border-radius: 4px;
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  text-align: center;
}

footer.site-footer {
  padding: 40px 0; border-top: 1px solid var(--hairline);
  background: var(--bg-soft); font-size: 13px; color: var(--muted);
}
.site-footer-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 32px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}

@media (max-width: 600px) {
  .page-intro { padding: 50px 0 20px; }
  .form { margin: 20px auto 80px; }
  .form-section { padding: 36px 0; }
  .product-grid { padding: 40px 0 80px; gap: 32px 16px; }
}
