/* ==========================================================================
   DEVINE BARBER SHOP — Design tokens
   Palette: warm charcoal ink, cream paper, brass gold, deep burgundy, steel
   Type: Fraunces (display) / Work Sans (body) / Space Mono (ticket/price data)
   Signature: "The Ticket Book" — services read like barbershop receipt stubs,
   a rotating barber-pole stripe marks section breaks, animated snip mascot.
   ========================================================================== */

:root {
  --ink: #15110d;
  --ink-soft: #221b15;
  --paper: #f4ecda;
  --paper-dim: #e7dcc2;
  --gold: #c8a35f;
  --gold-deep: #96742f;
  --burgundy: #6d2a2a;
  --burgundy-bright: #8c3a34;
  --steel: #948c7c;
  --steel-line: rgba(200, 163, 95, 0.25);

  --font-display: "Fraunces", "Iowan Old Style", serif;
  --font-body: "Work Sans", "Segoe UI", sans-serif;
  --font-mono: "Space Mono", "Courier New", monospace;

  --radius-stub: 4px;
  --shadow-card: 0 18px 40px -20px rgba(0, 0, 0, 0.55);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:root { color-scheme: dark; }

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; }

.container {
  width: min(1180px, 92%);
  margin: 0 auto;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--gold);
  display: inline-block;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0;
  color: var(--paper);
  letter-spacing: -0.01em;
}

h2.section-title {
  font-size: clamp(2rem, 4vw, 2.9rem);
  font-optical-sizing: auto;
  margin-top: 0.5rem;
}

p { color: var(--steel); margin: 0.75em 0; }

::selection { background: var(--gold); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ---------- Barber-pole stripe divider (signature motif) ---------- */
.pole-divider {
  height: 10px;
  width: 100%;
  background: repeating-linear-gradient(
    -45deg,
    var(--burgundy) 0 14px,
    var(--paper) 14px 28px,
    var(--gold) 28px 42px
  );
  background-size: 200% 100%;
  animation: pole-scroll 6s linear infinite;
}
@keyframes pole-scroll {
  from { background-position: 0 0; }
  to { background-position: -84px 0; }
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(21, 17, 13, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--steel-line);
}
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 0;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.02em;
}
.brand strong { color: var(--gold); font-weight: 700; }
.brand span { color: var(--steel); font-size: 0.65rem; font-family: var(--font-mono); letter-spacing: 0.2em; text-transform: uppercase; }

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.88rem;
}
.nav-links a {
  text-decoration: none;
  color: var(--paper);
  position: relative;
  padding-bottom: 4px;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--gold);
  transition: width 0.3s var(--ease);
}
.nav-links a:hover::after { width: 100%; }

.nav-right { display: flex; align-items: center; gap: 1.1rem; }

.lang-toggle {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  background: transparent;
  border: 1px solid var(--steel-line);
  color: var(--paper);
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.lang-toggle:hover { border-color: var(--gold); color: var(--gold); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-stub);
  border: 1px solid var(--gold);
  background: var(--gold);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -10px rgba(200, 163, 95, 0.55); }
.btn.ghost { background: transparent; color: var(--paper); border-color: var(--steel-line); }
.btn.ghost:hover { border-color: var(--gold); color: var(--gold); }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--paper);
  font-size: 1.4rem;
  cursor: pointer;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 5.5rem 0 4rem;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 140%;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(200,163,95,0.14), transparent 55%),
    radial-gradient(ellipse at 80% 60%, rgba(109,42,42,0.22), transparent 55%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}
.hero-copy h1 {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 1.02;
  margin-top: 0.6rem;
}
.hero-copy h1 em {
  font-style: italic;
  color: var(--gold);
}
.hero-copy p.lead {
  font-size: 1.08rem;
  max-width: 46ch;
  color: var(--paper-dim);
  margin: 1.2rem 0 1.8rem;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-stats {
  display: flex;
  gap: 2.2rem;
  margin-top: 2.6rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--steel-line);
}
.hero-stats div strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--gold);
}
.hero-stats div span {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--steel);
}

/* ---------- Mascot ---------- */
.mascot-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.mascot-wrap svg { width: 100%; max-width: 380px; height: auto; }

#blade-open { transform-origin: 271px 168px; animation: snip 1.8s ease-in-out infinite; }
#blade-close { transform-origin: 271px 168px; animation: snip-2 1.8s ease-in-out infinite; }
@keyframes snip {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-16deg); }
}
@keyframes snip-2 {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(16deg); }
}
#razor-arm {
  transform-origin: 108px 252px;
  animation: shave 2.6s ease-in-out infinite;
}
@keyframes shave {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(-4deg); }
}
#mascot-blink {
  animation: blink 4s infinite;
}
@keyframes blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.1); }
}
.mascot-float { animation: float-y 5s ease-in-out infinite; }
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Section shell ---------- */
section { padding: 5rem 0; }
.section-head {
  max-width: 640px;
  margin-bottom: 3rem;
}
.section-head p { margin-top: 0.9rem; }

/* ---------- Services (ticket stubs) ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.4rem;
}
.ticket {
  position: relative;
  background: var(--ink-soft);
  border: 1px dashed var(--steel-line);
  border-radius: var(--radius-stub);
  padding: 1.3rem 1.3rem 1.1rem;
  display: flex;
  gap: 1rem;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.ticket:hover { transform: translateY(-4px); border-color: var(--gold); }
.ticket-photo {
  width: 74px; height: 74px;
  border-radius: var(--radius-stub);
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--steel-line);
}
.ticket-photo img { width: 100%; height: 100%; object-fit: cover; }
.ticket-body { flex: 1; }
.ticket-top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; }
.ticket-top h4 { font-size: 1.05rem; }
.ticket-price {
  font-family: var(--font-mono);
  color: var(--gold);
  font-size: 1rem;
  white-space: nowrap;
}
.ticket-body p { font-size: 0.88rem; margin: 0.4rem 0 0; }
.ticket-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--steel);
}
.ticket::before {
  content: "";
  position: absolute;
  left: -6px; top: 50%;
  width: 12px; height: 12px;
  background: var(--ink);
  border: 1px dashed var(--steel-line);
  border-radius: 50%;
  transform: translateY(-50%);
}
.ticket::after {
  content: "";
  position: absolute;
  right: -6px; top: 50%;
  width: 12px; height: 12px;
  background: var(--ink);
  border: 1px dashed var(--steel-line);
  border-radius: 50%;
  transform: translateY(-50%);
}

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 160px;
  gap: 0.8rem;
}
.gallery-grid img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: var(--radius-stub);
  filter: grayscale(0.25) contrast(1.05);
  transition: filter 0.4s var(--ease), transform 0.4s var(--ease);
}
.gallery-grid a:hover img { filter: grayscale(0); transform: scale(1.03); }
.gallery-grid a:nth-child(1) { grid-column: span 2; grid-row: span 2; }

/* ---------- Booking ---------- */
.booking-shell {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 3rem;
  align-items: start;
}
.barber-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
  margin-top: 1.4rem;
}
.barber-option {
  background: var(--ink-soft);
  border: 1px solid var(--steel-line);
  border-radius: var(--radius-stub);
  padding: 0.8rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.barber-option:hover { transform: translateY(-3px); }
.barber-option.selected { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.barber-option img {
  width: 56px; height: 56px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 0.5rem;
  border: 2px solid var(--steel-line);
}
.barber-option.selected img { border-color: var(--gold); }
.barber-option span { font-size: 0.8rem; display: block; }
.barber-option small { font-family: var(--font-mono); color: var(--steel); font-size: 0.62rem; }

.booking-form {
  background: var(--ink-soft);
  border: 1px solid var(--steel-line);
  border-radius: var(--radius-stub);
  padding: 2rem;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { margin-bottom: 1.1rem; }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel);
  margin-bottom: 0.45rem;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--steel-line);
  color: var(--paper);
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-stub);
  font-family: var(--font-body);
  font-size: 0.92rem;
  transition: border-color 0.25s var(--ease);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--gold);
  outline: none;
}
.field textarea { resize: vertical; min-height: 80px; }
.field-error {
  color: var(--burgundy-bright);
  font-size: 0.76rem;
  margin-top: 0.35rem;
  min-height: 1em;
  font-family: var(--font-mono);
}
.field.invalid input, .field.invalid select { border-color: var(--burgundy-bright); }

.form-note {
  font-size: 0.78rem;
  color: var(--steel);
  margin-top: 1rem;
}
.form-success {
  display: none;
  background: rgba(200, 163, 95, 0.12);
  border: 1px solid var(--gold);
  border-radius: var(--radius-stub);
  padding: 1rem 1.2rem;
  margin-top: 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}
.form-success.show { display: block; }

/* ---------- Branches ---------- */
.branches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.4rem;
}
.branch-card {
  background: var(--ink-soft);
  border: 1px solid var(--steel-line);
  border-radius: var(--radius-stub);
  padding: 1.6rem;
}
.branch-card h4 { font-size: 1.15rem; margin-bottom: 0.3rem; }
.branch-card .addr { color: var(--gold); font-size: 0.85rem; margin-bottom: 0.9rem; }
.branch-meta {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--steel);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border-top: 1px dashed var(--steel-line);
  padding-top: 0.8rem;
}

/* ---------- Testimonials ---------- */
.testimonial-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.4rem;
}
.testimonial {
  padding: 1.6rem;
  border-left: 2px solid var(--gold);
  background: var(--ink-soft);
  border-radius: 0 var(--radius-stub) var(--radius-stub) 0;
}
.testimonial p.quote { color: var(--paper-dim); font-style: italic; font-size: 0.95rem; }
.testimonial .who { font-family: var(--font-mono); font-size: 0.72rem; color: var(--gold); text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- FAQ ---------- */
.faq-item {
  border-bottom: 1px solid var(--steel-line);
}
.faq-q {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 1.1rem;
  padding: 1.2rem 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq-q .icon { color: var(--gold); font-family: var(--font-mono); transition: transform 0.3s var(--ease); }
.faq-item.open .faq-q .icon { transform: rotate(45deg); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease);
  color: var(--steel);
  font-size: 0.92rem;
}
.faq-item.open .faq-a { max-height: 200px; padding-bottom: 1.2rem; }

/* ---------- Contact / footer ---------- */
.contact-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}
.social-row { display: flex; gap: 0.9rem; margin-top: 1.4rem; }
.social-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--steel-line);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  color: var(--paper);
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.social-btn:hover { border-color: var(--gold); color: var(--gold); }
.contact-list { list-style: none; padding: 0; margin: 1.4rem 0 0; font-family: var(--font-mono); font-size: 0.85rem; }
.contact-list li { padding: 0.5rem 0; border-bottom: 1px dashed var(--steel-line); }
.map-embed {
  border: 1px solid var(--steel-line);
  border-radius: var(--radius-stub);
  overflow: hidden;
  min-height: 260px;
}
.map-embed iframe { width: 100%; height: 100%; min-height: 260px; border: 0; filter: grayscale(0.6) invert(0.92) contrast(0.9); }

footer.site-footer {
  padding: 2.5rem 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--steel);
}

/* ---------- RTL ---------- */
html[dir="rtl"] .eyebrow::before { order: 2; }
html[dir="rtl"] .ticket { direction: rtl; }
html[dir="rtl"] .hero-stats { border-top: 1px solid var(--steel-line); }
html[dir="rtl"] .testimonial { border-left: none; border-right: 2px solid var(--gold); border-radius: var(--radius-stub) 0 0 var(--radius-stub); }
html[dir="rtl"] .faq-q { text-align: right; }
html[dir="rtl"] body { font-family: "Cairo", var(--font-body); }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, html[dir="rtl"] h4 { font-family: "Cairo", var(--font-display); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .mascot-wrap { order: -1; max-width: 260px; margin: 0 auto; }
  .booking-shell { grid-template-columns: 1fr; }
  .contact-shell { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid a:nth-child(1) { grid-column: span 2; grid-row: span 1; }
}
@media (max-width: 720px) {
  .nav-links, .nav-right .btn.ghost { display: none; }
  .menu-toggle { display: block; }
  .barber-picker { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { flex-wrap: wrap; gap: 1.4rem; }
}
.nav-links.open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: var(--ink);
  padding: 1.4rem 6%;
  border-bottom: 1px solid var(--steel-line);
  gap: 1.1rem;
}
