/* ============================================================
   BarberGo.ca — main stylesheet
   Palette: black / white / silver. Minimal, premium, mobile-first.
   ============================================================ */

:root {
  --black: #0b0b0c;
  --white: #fbfbfa;
  --silver: #c8ccd2;
  --silver-dark: #85898f;
  --line: rgba(11, 11, 12, 0.14);
  --radius: 18px;
  --font-latin: "Archivo", "Segoe UI", Arial, sans-serif;
  --font-ar: "Cairo", "Segoe UI", Arial, sans-serif;
  --pad: clamp(20px, 4vw, 56px);
  --ease-exp: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* The hidden attribute must always win, even over later display: rules
   (e.g. flex containers toggled via el.hidden in JS). */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  background: var(--white);
  color: var(--black);
  font-family: var(--font-latin);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

html[lang="ar"] body,
html[lang="ar"] button,
html[lang="ar"] input,
html[lang="ar"] select,
html[lang="ar"] textarea {
  font-family: var(--font-ar);
}

::selection { background: var(--black); color: var(--white); }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ============================== Loader ============================== */

#loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.loader-logo { width: min(180px, 40vw); opacity: 0; }

.loader-count {
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--silver-dark);
  font-variant-numeric: tabular-nums;
}

/* Barber-pole loading bar (adapted from reference: red → black/silver) */
.pole-bar {
  width: min(300px, 64vw);
  height: 22px;
  padding: 3px;
  border-radius: 22px;
  outline: 2px solid var(--silver);
  outline-offset: 2px;
  background: var(--white);
  overflow: hidden;
}

.pole-bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 20px;
  background-color: var(--black);
  background-size: 28px 28px;
  background-image: linear-gradient(
    -45deg,
    var(--silver) 25%, transparent 25%,
    transparent 50%, var(--silver) 50%,
    var(--silver) 75%, transparent 75%, transparent
  );
  box-shadow: inset 0 8px 0 rgba(255, 255, 255, 0.18);
  animation: pole-move 0.9s linear infinite;
}

@keyframes pole-move {
  100% { background-position: 28px 28px; }
}

/* ========================== Background FX =========================== */

#bg-fx {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-tool {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--black);
  opacity: 0.036; /* very subtle — barely-there floating tools */
  will-change: transform;
}

.bg-tool.is-silver { color: var(--silver-dark); opacity: 0.056; }

.bg-tool svg { width: 100%; height: 100%; }

/* ============================= Header =============================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--pad);
  background: color-mix(in srgb, var(--white) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s;
}

.site-header.is-scrolled { border-bottom-color: var(--line); }

/* On mobile the floating background tools drift right under the top bar; a
   translucent header lets them read as dark dots moving through it. Make the
   mobile header solid so the bar stays clean. */
@media (max-width: 760px) {
  .site-header {
    background: var(--white);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

.brand {
  font-weight: 500;
  letter-spacing: 0.14em;
  font-size: 15px;
}
.brand b, .ty-brand b { font-weight: 900; }
.brand-dot { color: var(--silver-dark); }

.header-right { display: flex; align-items: center; gap: 14px; }

.lang-switch {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  background: var(--white);
}

.lang-switch button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--silver-dark);
  transition: color 0.25s, background 0.25s;
}

.lang-switch button.is-active { background: var(--black); color: var(--white); }

/* ============================= Buttons ============================== */

.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid var(--black);
  border-radius: 999px;
  padding: 13px 26px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--white);
  color: var(--black);
  transition: background 0.3s var(--ease-exp), color 0.3s var(--ease-exp), transform 0.3s var(--ease-exp);
}

.btn-pill:hover { background: var(--black); color: var(--white); transform: translateY(-2px); }
.btn-pill:active { transform: translateY(0); }

.btn-black { background: var(--black); color: var(--white); }
.btn-black:hover { background: var(--white); color: var(--black); }

.btn-small { padding: 9px 18px; font-size: 11px; }

.btn-pill .arrow { width: 16px; height: 16px; }
html[dir="rtl"] .btn-pill .arrow { transform: scaleX(-1); }

/* ============================== Hero ================================ */

#hero {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(64px + var(--pad)) var(--pad) var(--pad);
  overflow: hidden;
}

.hero-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
}

.hero-tagline {
  font-size: clamp(17px, 2.2vw, 24px);
  font-weight: 500;
  line-height: 1.3;
}

.hero-tagline .line { display: block; }

.hero-word {
  position: relative;
  z-index: 1;
  font-weight: 900;
  line-height: 0.84;
  letter-spacing: -0.025em;
  user-select: none;
  margin: 24px 0;
}

.hero-word .fit {
  display: block;
  white-space: nowrap;
  visibility: hidden; /* shown once fitted by JS */
}

.hero-word .one-line { display: none; }

/* Cutting effect (hero-cut.js) draws the word on #ink; the live text must
   stay hidden even after reveal.js's fitHeroWord() sets it back to visible
   on fonts-ready / resize / language switch — hence !important over a class
   instead of relying on inline style. */
.hero-word.is-cutting .fit { visibility: hidden !important; }

@media (min-width: 760px) {
  .hero-word .one-line { display: block; }
  .hero-word .two-line { display: none; }
}

#ink {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.hero-bottom {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--silver-dark);
}

.hero-scroll { display: flex; align-items: center; gap: 8px; }
.scroll-tick { display: inline-block; }

/* ============================ Sections ============================== */

.section {
  position: relative;
  z-index: 1;
  padding: clamp(80px, 12vh, 150px) var(--pad);
  max-width: 1200px;
  margin: 0 auto;
}

.kicker {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--silver-dark);
  margin-bottom: 18px;
}

.section-title {
  font-size: clamp(38px, 7vw, 84px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 0.95;
  margin-bottom: 22px;
  text-transform: uppercase;
}

/* split-heading word wrappers (injected by JS) */
.section-title .w { display: inline-block; overflow: clip; vertical-align: top; }
.section-title .w > span { display: inline-block; }

.section-intro {
  font-size: clamp(17px, 2vw, 21px);
  max-width: 640px;
  color: #3c3f44;
  margin-bottom: 40px;
}

/* Compact sections keep the whole page short so the form stays the focus. */
.section-compact { padding-top: clamp(48px, 8vh, 90px); padding-bottom: clamp(48px, 8vh, 90px); }

.compact-title {
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1;
  margin-bottom: 30px;
}

/* --------------------- Why Canada (icon + title) ------------------- */

.why-grid {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px 26px;
}

@media (min-width: 620px) { .why-grid { grid-template-columns: 1fr 1fr; } }

.why-grid li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}

.why-ic {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  color: var(--black);
}

.why-ic svg { width: 22px; height: 22px; }

.why-grid h3 { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }
.why-grid p { font-size: 14px; color: var(--silver-dark); }

/* ------------------- Before you apply (slim band) ------------------ */

.preform { max-width: 1000px; }

.preform-lead {
  font-size: clamp(15px, 1.7vw, 18px);
  color: #3c3f44;
  max-width: 720px;
  margin-bottom: 22px;
}

.preform-notices {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 720px) { .preform-notices { grid-template-columns: 1.1fr 1fr; } }

.mini-notice {
  border-radius: var(--radius);
  padding: 18px 20px;
}

.mini-notice h3 {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.mini-notice p { font-size: 13.5px; line-height: 1.5; }

.mini-tcf { background: var(--black); color: #d8dade; }
.mini-tcf h3 { color: var(--white); }

.mini-fraud { border: 1.5px dashed var(--silver-dark); color: #3c3f44; }
.mini-fraud h3 { color: var(--black); }

/* ------------------- Requirements (condensed) --------------------- */

.req-compact {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--line);
}

@media (min-width: 720px) { .req-compact { grid-template-columns: 1fr 1fr; column-gap: 40px; } }

.req-compact li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding: 15px 4px;
  border-bottom: 1px solid var(--line);
}

.req-compact b { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }
.req-compact span { font-size: 14px; color: var(--silver-dark); }

/* ======================= Application sheet ========================== */

.apply-section {
  max-width: 900px;
  padding-bottom: clamp(60px, 8vh, 120px);
}

.sheet {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 28px 28px var(--radius) var(--radius);
  box-shadow: 0 -18px 60px -30px rgba(11, 11, 12, 0.4), 0 30px 60px -40px rgba(11, 11, 12, 0.3);
  padding: 18px clamp(18px, 4vw, 48px) clamp(28px, 4vw, 48px);
  will-change: transform;
}

.sheet-handle {
  width: 46px;
  height: 5px;
  border-radius: 3px;
  background: var(--silver);
  margin: 0 auto 26px;
}

.sheet-head h2 {
  font-size: clamp(28px, 4.4vw, 44px);
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.sheet-head p { color: var(--silver-dark); margin: 6px 0 8px; }

fieldset {
  border: 0;
  border-top: 1px solid var(--line);
  padding: 26px 0 8px;
  margin-top: 26px;
}

legend {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding-inline-end: 14px;
}

.most-important {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: var(--black);
  color: var(--white);
  border-radius: 999px;
  padding: 3px 10px;
  vertical-align: middle;
  margin-inline-start: 6px;
}

.grid-2 { display: grid; grid-template-columns: 1fr; gap: 18px 24px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.field { display: block; margin-bottom: 18px; }
.grid-2 .field { margin-bottom: 0; }
.field-narrow { max-width: 320px; }

.field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.opt, .skippable {
  font-style: normal;
  font-weight: 500;
  font-size: 12px;
  color: var(--silver-dark);
}

input[type="text"], input[type="tel"], input[type="email"], input[type="number"], select {
  width: 100%;
  border: 0;
  border-bottom: 1.5px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 10px 2px;
  font-size: 16px;
  color: var(--black);
  transition: border-color 0.3s;
  appearance: none;
}

select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%230b0b0c' stroke-width='1.6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 6px center;
}

html[dir="rtl"] select { background-position: left 6px center; }

input:focus, select:focus { outline: none; border-bottom-color: var(--black); }

input::placeholder { color: var(--silver); }

.field.has-error input,
.field.has-error select { border-bottom-color: #b3261e; }

.field-note {
  font-size: 13px;
  color: var(--silver-dark);
  margin-top: 14px;
}

.field-hint {
  font-size: 13px;
  color: var(--silver-dark);
  margin: 2px 0 16px;
}

/* French audio recorder */
.audio-intro { margin-top: 0; margin-bottom: 14px; }

.audio-rec {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: color-mix(in srgb, var(--white) 70%, transparent);
}

.audio-prompt {
  font-size: 14px;
  font-weight: 600;
  font-style: italic;
  color: #3c3f44;
  margin-bottom: 14px;
}

.audio-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }

/* Record is the primary, prominent action (filled) */
.audio-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1.5px solid var(--black);
  border-radius: 999px;
  padding: 12px 26px;
  font-size: 14px;
  font-weight: 700;
  background: var(--black);
  color: var(--white);
  cursor: pointer;
  transition: background 0.25s, color 0.25s, transform 0.25s;
}

.audio-btn:hover { transform: translateY(-2px); }
.audio-btn .rec-dot { background: #ff5a4d; }

/* Upload is a small secondary fallback link */
.audio-alt {
  font-size: 13px;
  font-weight: 600;
  color: var(--silver-dark);
  text-decoration: underline;
  cursor: pointer;
}
.audio-alt:hover { color: var(--black); }
.audio-alt.audio-upload-solo {
  text-decoration: none;
  border: 1.5px solid var(--black);
  border-radius: 999px;
  padding: 12px 26px;
  color: var(--black);
  font-weight: 700;
}
.audio-alt.audio-upload-solo:hover { background: var(--black); color: var(--white); }

.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #ff5a4d; flex: none; }

#audio-record.is-recording { background: var(--black); color: var(--white); }
#audio-record.is-recording .rec-dot { animation: rec-pulse 1s infinite; }
@keyframes rec-pulse { 50% { opacity: 0.25; } }

.audio-preview { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.audio-preview audio { height: 40px; max-width: 100%; }

.audio-remove {
  border: 0;
  background: none;
  color: var(--silver-dark);
  font-weight: 600;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

.audio-status { font-size: 13px; color: var(--silver-dark); margin-top: 10px; min-height: 1em; }

/* segmented radio pills */
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.segmented label { position: relative; }

.segmented input { position: absolute; opacity: 0; inset: 0; }

.segmented span {
  display: inline-block;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #3c3f44;
  transition: all 0.25s var(--ease-exp);
  user-select: none;
}

.segmented label:hover span { border-color: var(--black); }

.segmented input:checked + span {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
}

.segmented input:focus-visible + span { outline: 2px solid var(--silver-dark); outline-offset: 2px; }

.segmented.has-error span { border-color: #b3261e; }

/* dropzones */
.dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1.5px dashed var(--silver-dark);
  border-radius: var(--radius);
  padding: 26px 18px;
  cursor: pointer;
  color: var(--silver-dark);
  transition: border-color 0.3s, color 0.3s, background 0.3s;
}

.dropzone:hover, .dropzone.is-drag { border-color: var(--black); color: var(--black); background: rgba(11, 11, 12, 0.03); }

.dropzone.has-error { border-color: #b3261e; }

.dz-slim { padding: 16px 18px; }

.dz-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  flex: none;
}

.dz-text { font-size: 14px; font-weight: 600; }

.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.thumb img { width: 100%; height: 100%; object-fit: cover; }

.thumb button {
  position: absolute;
  top: 5px;
  inset-inline-end: 5px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(11, 11, 12, 0.75);
  color: var(--white);
  font-size: 12px;
  line-height: 1;
  display: grid;
  place-items: center;
}

/* checkboxes */
.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  margin-top: 14px;
  max-width: 640px;
}

.check input {
  appearance: none;
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border: 1.5px solid var(--silver-dark);
  border-radius: 7px;
  display: grid;
  place-items: center;
  transition: all 0.2s;
  cursor: pointer;
}

.check input:checked { background: var(--black); border-color: var(--black); }

.check input:checked::after {
  content: "";
  width: 11px;
  height: 6px;
  border: 2.5px solid var(--white);
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg) translateY(-1px);
}

.check input:focus-visible { outline: 2px solid var(--silver-dark); outline-offset: 2px; }

.check span { font-size: 14px; color: #3c3f44; }

.check.has-error input { border-color: #b3261e; }

.tcf-no-text {
  background: rgba(11, 11, 12, 0.045);
  border-radius: var(--radius);
  padding: 18px 20px;
  font-size: 14px;
  margin-top: 16px;
}

.tcf-yes .grid-2 { margin: 16px 0 18px; }
.tcf-yes .field:last-child { margin-top: 16px; }

.form-error {
  color: #b3261e;
  font-size: 14px;
  font-weight: 600;
  margin-top: 22px;
}

.btn-submit {
  margin-top: 26px;
  width: 100%;
  justify-content: center;
  padding: 18px 26px;
  font-size: 14px;
}

.pole-mini {
  width: 130px;
  height: 14px;
  padding: 2px;
  outline-width: 1.5px;
  outline-offset: 1px;
  outline-color: rgba(255, 255, 255, 0.5);
  background: transparent;
}

.pole-mini .pole-bar-fill { width: 100%; background-color: var(--white); background-image: linear-gradient(-45deg, var(--silver-dark) 25%, transparent 25%, transparent 50%, var(--silver-dark) 50%, var(--silver-dark) 75%, transparent 75%, transparent); box-shadow: none; }

.btn-submit:hover .pole-mini { outline-color: rgba(11, 11, 12, 0.4); }

/* thank-you */
.thankyou {
  text-align: center;
  padding: clamp(30px, 6vw, 70px) 8px;
  max-width: 640px;
  margin: 0 auto;
}

.ty-mark { width: 76px; margin: 0 auto 26px; color: var(--black); }

.ty-check {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
}

.thankyou h2 {
  font-size: clamp(26px, 4.5vw, 40px);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.thankyou p { color: #3c3f44; margin-bottom: 26px; }

.ty-brand { font-size: 14px; letter-spacing: 0.16em; font-weight: 500; color: var(--black); }

/* ============================= Footer =============================== */

.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 60px var(--pad) 40px;
  border-top: 1px solid var(--line);
  background: var(--white);
}

.footer-logo { width: 120px; margin: 0 auto 14px; }

.site-footer p { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--silver-dark); }

.footer-small { margin-top: 8px; font-size: 11px; }

/* =========================== Utilities ============================== */

[data-reveal] { opacity: 0; }

html.no-motion [data-reveal],
html.no-motion .hero-word .fit { opacity: 1; visibility: visible; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pole-bar-fill { animation: none; }
  #ink { display: none; }
}
