/* ============================================
   PIRATE ROAST COFFEE - Stylesheet
   ============================================ */

:root {
  /* Deep maritime palette */
  --abyss: #0d0a08;
  --depths: #1a1410;
  --dark-sea: #241c15;
  --parchment: #f4ead5;
  --parchment-warm: #e8d9b8;
  --parchment-dark: #d4c19a;
  --gold: #c9a84c;
  --gold-bright: #e0c068;
  --gold-dim: #9a7e3a;
  --copper: #b87333;
  --crimson: #8b2a2a;
  --crimson-bright: #a83838;
  --ink: #2a2018;
  --ink-light: #4a3d30;
  --cream: #faf6ed;
  --text-muted: #8a7d68;
  --text-dark-muted: #6b5e4d;

  /* Fonts */
  --font-display: 'Cinzel', 'Playfair Display', serif;
  --font-title: "Old English Text MT", "UnifrakturMaguntia", serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-body: 'Lora', Georgia, serif;

  /* Spacing */
  --section-pad: 100px;
  --container-max: 1200px;
}

/* ========== RESET ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--parchment);
  background:
    radial-gradient(ellipse 90% 80% at 50% 35%, rgba(20, 12, 6, 0.12) 0%, rgba(10, 6, 3, 0.3) 60%, rgba(5, 3, 1, 0.45) 100%),
    url('parchment-bg.jpg') center center / cover no-repeat fixed,
    #1a1410;
  line-height: 1.7;
  overflow-x: hidden;
  background-attachment: fixed;
}

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

a { color: var(--gold-bright); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold); }

/* ========== CONTAINER ========== */
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 760px; }

/* ========== HERO ========== */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: transparent;
  overflow: hidden;
}

/* Animated star/canvas texture */
#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(201, 168, 76, 0.4), transparent),
    radial-gradient(1px 1px at 60% 70%, rgba(201, 168, 76, 0.3), transparent),
    radial-gradient(1px 1px at 80% 20%, rgba(201, 168, 76, 0.35), transparent),
    radial-gradient(1px 1px at 30% 80%, rgba(201, 168, 76, 0.25), transparent),
    radial-gradient(1px 1px at 90% 50%, rgba(201, 168, 76, 0.3), transparent),
    radial-gradient(2px 2px at 45% 45%, rgba(201, 168, 76, 0.2), transparent),
    radial-gradient(1px 1px at 15% 60%, rgba(201, 168, 76, 0.3), transparent),
    radial-gradient(1px 1px at 75% 85%, rgba(201, 168, 76, 0.2), transparent);
  background-size: 100% 100%;
  opacity: 0.6;
  animation: drift 120s linear infinite;
}

@keyframes drift {
  from { transform: translateY(0); }
  to { transform: translateY(-100px); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center bottom, rgba(184, 115, 51, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 24px;
  max-width: 700px;
}

.hero-emblem {
  width: 130px;
  height: 130px;
  margin: 0 auto 28px;
  opacity: 0;
  animation: fadeInUp 1.2s ease 0.2s forwards;
}

.hero-logo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(201, 168, 76, 0.2);
}

.hero-title {
  font-family: var(--font-title);
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #291111;
  line-height: 1.1;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.8);
  opacity: 0;
  animation: fadeInUp 1.2s ease 0.4s forwards;
}

.hero-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  color: var(--parchment);
  margin-top: 18px;
  letter-spacing: 0.01em;
  opacity: 0;
  animation: fadeInUp 1.2s ease 0.6s forwards;
}

.hero-cta {
  display: inline-block;
  margin-top: 40px;
  padding: 14px 40px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--abyss);
  background: var(--gold-bright);
  border: 2px solid var(--gold-bright);
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeInUp 1.2s ease 0.8s forwards;
}

.hero-cta:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--abyss);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  z-index: 1;
  line-height: 0;
}

.hero-wave svg {
  width: 100%;
  height: 80px;
}

/* ========== SECTION SHARED ========== */
section { padding: var(--section-pad) 0; }

.section-label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #291111;
  margin-bottom: 16px;
}

/* Old English headings get slightly larger line-height for readability */
h2, .hero-title {
  line-height: 1.25;
}



h2 {
  font-family: var(--font-title);
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 400;
  color: #291111;
  line-height: 1.25;
  margin-bottom: 24px;
}

#treasury h2 { text-align: center; }

.section-sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--parchment);
  text-align: center;
  margin-bottom: 50px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ========== STORY ========== */
#story {
  background: transparent;
  text-align: left;
}

#story .container.narrow {
  margin-left: 9%;
  margin-right: auto;
}

#story .section-label,
#story h2 {
  text-align: left;
}

#story p {
  color: var(--parchment);
  font-size: 1.08rem;
  margin-bottom: 20px;
}

/* ========== PRODUCTS ========== */
#treasury {
  background: transparent;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
  margin-top: 20px;
}

.product-card {
  background: var(--dark-sea);
  border: 1px solid rgba(201, 168, 76, 0.15);
  border-radius: 2px;
  overflow: hidden;
  transition: border-color 0.2s;
  position: relative;
}

.product-card:hover {
  border-color: rgba(201, 168, 76, 0.4);
}

.product-image {
  height: 200px;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(201, 168, 76, 0.1);
}

.product-info {
  padding: 24px;
}

.product-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--parchment);
  margin-bottom: 8px;
}

.product-roast {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 3px 10px;
  border: 1px solid rgba(201, 168, 76, 0.3);
  border-radius: 2px;
  margin-bottom: 12px;
}

.product-desc {
  font-size: 0.92rem;
  color: var(--parchment);
  line-height: 1.6;
}

.product-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--crimson);
  color: var(--parchment);
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 2px;
  z-index: 2;
}

.product-tag.new { background: var(--copper); }

/* ========== ORDER FORM ========== */
#order {
  background: transparent;
}

.order-box {
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
  background: rgba(150, 110, 70, 0.22);
  border: 1px solid rgba(184, 115, 51, 0.3);
  border-radius: 2px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  padding: 52px 44px;
}

#order .section-label { color: #291111; }
#order h2 { color: #291111; text-align: center; }
#order .section-sub { color: var(--parchment-dark); }

.order-form { margin-top: 36px; text-align: left; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.form-row.three {
  grid-template-columns: 2fr 1fr 1fr;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin-bottom: 8px;
}

.required { color: var(--crimson-bright); }
.optional { color: var(--text-muted); font-weight: 400; }

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--parchment-dark);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: 2px;
  transition: border-color 0.2s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(201, 168, 76, 0.35);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(0, 0, 0, 0.35);
}

.form-group textarea { resize: vertical; }

/* Order items */
.order-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.order-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(13, 10, 8, 0.6);
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: 2px;
  transition: border-color 0.2s, background 0.2s;
}

.order-item:hover {
  border-color: rgba(184, 115, 51, 0.55);
  background: rgba(13, 10, 8, 0.7);
}

.order-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--copper);
  cursor: pointer;
  flex-shrink: 0;
}

.order-item-label {
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--parchment-dark);
  cursor: pointer;
}

.order-item-roast {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--copper);
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(201, 168, 76, 0.3);
  background: rgba(0, 0, 0, 0.3);
  border-radius: 2px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--parchment-warm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  user-select: none;
}

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

.qty-display {
  min-width: 24px;
  text-align: center;
  font-weight: 600;
  color: var(--parchment-dark);
}

/* Submit */
.submit-btn {
  display: block;
  width: 100%;
  padding: 16px;
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--parchment);
  background: var(--crimson);
  border: 2px solid var(--crimson-bright);
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s;
}

.submit-btn:hover {
  background: var(--crimson-bright);
}

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

.form-note {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 18px;
  font-style: italic;
}

/* Success / Error */
.form-success {
  text-align: center;
  padding: 40px 20px;
}

.success-mark {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--copper);
  margin-bottom: 16px;
}

.form-success h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--parchment);
  margin-bottom: 12px;
}

.form-success p {
  color: var(--text-muted);
}

.form-error h3 {
  font-family: var(--font-display);
  color: var(--crimson-bright);
  margin-bottom: 8px;
}

.form-error p {
  color: var(--text-muted);
}

/* ========== FOOTER ========== */
footer {
  background: transparent;
  border-top: 1px solid rgba(201, 168, 76, 0.1);
  padding: 60px 0 30px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--parchment);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-logo-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(201, 168, 76, 0.2);
}

.footer-content p {
  color: var(--parchment);
  font-size: 0.9rem;
}

.footer-link {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  display: inline-block;
  margin-top: 8px;
}

.footer-bottom {
  border-top: 1px solid rgba(201, 168, 76, 0.08);
  padding-top: 24px;
  text-align: center;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: var(--parchment);
  letter-spacing: 0.03em;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  :root { --section-pad: 60px; }

  .scroll-frame { margin: 0 auto; transform: rotate(-0.3deg); }
  .order-parchment { padding: 36px 24px 40px; margin: 0 auto; }
  .scroll-roller::before, .scroll-roller::after { width: 24px; height: 28px; top: -3px; }
  .scroll-roller::before { left: -13px; }
  .scroll-roller::after { right: -13px; }
  #story .container.narrow { margin-left: 0; }
  #story { text-align: left; }

  .form-row,
  .form-row.three {
    grid-template-columns: 1fr;
    gap: 0;
    margin-bottom: 0;
  }

  .order-box { padding: 36px 26px; }

  .hero-emblem { width: 100px; height: 100px; margin-bottom: 18px; }

  .footer-content { flex-direction: column; gap: 24px; }

  .order-item {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .order-parchment { padding: 28px 18px; }
  .order-box { padding: 28px 18px; }
  .hero-cta { padding: 12px 28px; font-size: 0.85rem; }
  .submit-btn { font-size: 0.9rem; padding: 14px; }
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero-emblem,
  .hero-title,
  .hero-tagline,
  .hero-cta {
    opacity: 1;
    animation: none;
  }

  #hero::before { animation: none; }
}
