/*
Theme Name: Hector Fox — Relevance
Theme URI: https://www.hector-fox.com
Author: Héctor Fox
Description: Cargo-inspired one-page portfolio theme. Frosted-glass fixed panel over a full-bleed photo, inner scrolling, EN/ES toggle, contact popup, selected-work gallery with case pages, client logos, Calendly/email/WhatsApp CTAs. Everything customizable without code.
Version: 2.3.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: hector-fox
*/

/* ============================================================
   Variables — injected from the Customizer in functions.php.
   ============================================================ */
:root {
  --panel: #1c1d1c;                  /* solid — text on accent buttons   */
  --panel-bg: rgba(28, 29, 28, 0.8); /* color + transparency of glass    */
  --blur: 12px;                      /* frosted-glass blur amount        */
  --accent: #bdff00;
  --ink: #fffcf8;
  --line: rgba(255, 252, 248, 0.4);      /* overridden: follows text color */
  --line-soft: rgba(255, 252, 248, 0.14);
  --hover-bg: rgba(255, 252, 248, 0.08);
  --radius: 22px;
  --font-sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-list: var(--font-sans);     /* optional list/mono font          */
  --bg-pos: center;
  /* typography controls (Customizer → Design) */
  --title-size: 72px;
  --title-weight: 800;
  --menu-size: 14px;
  --menu-weight: 600;
  --body-size: 15px;
  --body-weight: 400;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background-color: #0e0f0e;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: var(--bg-pos);
  background-attachment: fixed;
  min-height: 100vh;
}

/* Mobile can use its own photo / framing */
@media (max-width: 700px) {
  body { background-image: var(--bg-image-m, var(--bg-image)); background-attachment: scroll; }
}

/* Film grain overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
  z-index: 3;
}

/* ============================================================
   Language visibility
   ============================================================ */
html[data-lang="en"] .lang-es { display: none !important; }
html[data-lang="es"] .lang-en { display: none !important; }

/* ============================================================
   Glass surface (shared by panel, modals, case card, dock)
   ============================================================ */
.glass {
  background: var(--panel-bg);
  -webkit-backdrop-filter: blur(var(--blur));
  backdrop-filter: blur(var(--blur));
}

/* ============================================================
   THE PANEL — fixed, full height, scrolls inside (static page)
   ============================================================ */
body.hf-home { overflow: hidden; height: 100dvh; }

.panel {
  position: fixed;
  top: 24px;
  left: 24px;
  bottom: 24px;
  width: min(620px, calc(100vw - 48px));
  border-radius: var(--radius);
  padding: 38px 40px 32px;
  z-index: 4;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.panel::-webkit-scrollbar { width: 6px; }
.panel::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

/* pushes CTAs + menu toward the bottom when there's spare room,
   collapses when the content needs to scroll (Cargo-style) */
.panel-spacer { flex: 1 0 24px; }

.panel-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
  flex: 0 0 auto;
}
.lang-toggle {
  display: flex;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 99px;
  overflow: hidden;
}
.lang-toggle button {
  background: transparent;
  border: 0;
  color: var(--ink);
  font: 600 12px/1 var(--font-sans);
  letter-spacing: 0.06em;
  padding: 8px 12px;
  cursor: pointer;
}
html[data-lang="en"] .lang-toggle [data-set="en"],
html[data-lang="es"] .lang-toggle [data-set="es"] {
  background: var(--accent);
  color: var(--panel);
}

.site-title {
  font-weight: var(--title-weight);
  font-size: min(var(--title-size), 11vw);
  letter-spacing: -0.03em;
  line-height: 0.95;
  color: var(--ink);
}

.tagline {
  margin-top: 16px;
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  max-width: 26ch;
}
.tagline em, .row-inner em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  font-size: 1.1em;
}

.role {
  margin-top: 10px;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.75;
}

/* ============================================================
   CTA buttons — Contact me / Selected work
   ============================================================ */
.cta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 30px 0 10px;
  flex: 0 0 auto;
}
.cta-row button {
  display: block;
  width: 100%;
  text-align: center;
  padding: 11px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: transparent;
  font-family: var(--font-list);
  font-size: calc(var(--menu-size) + 1px);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
button.cta-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--panel);
  font-weight: 700;
}
button.cta-primary:hover { filter: brightness(1.08); }
button.cta-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ============================================================
   Accordion rows — accent ↓ arrow instead of numbers
   ============================================================ */
.rows { margin-top: 6px; }
.row { border-top: 1px solid var(--line); }
.row:last-child { border-bottom: 1px solid var(--line); }

.row-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: none;
  border: 0;
  color: var(--ink);
  font-family: var(--font-list);
  text-align: left;
  padding: 13px 2px;
  cursor: pointer;
}
.row-head .row-title { font-size: var(--menu-size); font-weight: var(--menu-weight); letter-spacing: -0.01em; }
.row-head .row-sub { display: block; font-size: calc(var(--menu-size) - 1px); font-weight: 400; opacity: 0.7; margin-top: 2px; font-family: var(--font-list); }
.row-arrow {
  color: var(--accent);
  font-size: calc(var(--menu-size) + 2px);
  line-height: 1;
  transition: transform 0.3s;
  flex: 0 0 auto;
}
.row.open .row-arrow { transform: rotate(180deg); }

.row-body { overflow: hidden; max-height: 0; transition: max-height 0.35s ease; }
.row.open .row-body { max-height: 1400px; }

.row-inner { padding: 2px 2px 22px; font-size: var(--body-size); font-weight: var(--body-weight); line-height: 1.55; font-family: var(--font-list); }
.row-inner p { margin-bottom: 12px; opacity: 0.92; }
.row-inner p:last-child { margin-bottom: 0; }

/* "My method" — numbered journey steps (any <ol> inside a section) */
.row-inner ol {
  list-style: none;
  counter-reset: step;
  margin: 6px 0 4px;
}
.row-inner ol li {
  counter-increment: step;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
}
.row-inner ol li:last-child { border-bottom: 0; }
.row-inner ol li::before {
  content: "0" counter(step);
  color: var(--accent);
  font-size: calc(var(--body-size) - 2px);
  flex: 0 0 auto;
}

/* Testimonials */
.row-inner blockquote {
  border-left: 2px solid var(--accent);
  padding: 2px 0 2px 16px;
  margin: 0 0 16px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: calc(var(--body-size) + 3px);
  line-height: 1.45;
}
.row-inner blockquote cite {
  display: block;
  margin-top: 8px;
  font-family: var(--font-list);
  font-style: normal;
  font-size: calc(var(--body-size) - 2px);
  opacity: 0.7;
}

.mini-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.mini-ctas:empty { display: none; }
.mini-cta {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  text-align: center;
  font-family: var(--font-list);
}
.mini-cta:hover { border-color: var(--accent); color: var(--accent); }

/* Client logos grid */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 6px;
}
.logo-grid .logo-cell {
  background: var(--hover-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  place-items: center;
  padding: 16px 12px;
  min-height: 76px;
}
.logo-grid img { max-width: 100%; max-height: 44px; object-fit: contain; }

.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  margin: 10px 0 4px;
  background: #000;
}
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.panel-foot {
  margin-top: 26px;
  font-size: 12.5px;
  opacity: 0.6;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  flex: 0 0 auto;
}
.panel-foot a { color: inherit; }

/* ============================================================
   Social dock — vertical on ALL screen sizes (like Cargo)
   ============================================================ */
.dock {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-radius: 14px;
  padding: 10px 8px;
  z-index: 6;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.dock a {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: var(--ink);
}
.dock a:hover { background: var(--hover-bg); color: var(--accent); }
.dock svg { width: 18px; height: 18px; fill: currentColor; }

/* ============================================================
   MODALS (contact popup + selected-work gallery)
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  background: rgba(0, 0, 0, 0.45);
}
.modal.open { display: block; }

/* contact: small card, same look as the panel */
.modal-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 32px));
  border-radius: var(--radius);
  padding: 30px 28px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}
.modal-card h2 { font-size: 26px; letter-spacing: -0.02em; margin-bottom: 18px; }
.modal-card .stack { display: flex; flex-direction: column; gap: 12px; }
.modal-card .stack a {
  display: block;
  text-align: center;
  padding: 13px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
}
.modal-card .stack a.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--panel);
  font-weight: 700;
}
.modal-card .stack a:hover:not(.primary) { border-color: var(--accent); color: var(--accent); }

/* gallery: near-fullscreen sheet, like the Cargo shop overlay */
.modal-sheet {
  position: absolute;
  inset: 20px;
  border-radius: var(--radius);
  padding: 24px;
  overflow-y: auto;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}
.sheet-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.sheet-bar h2 { font-size: 24px; letter-spacing: -0.02em; }

.modal-close {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-family: var(--font-list);
  font-size: 14px;
  padding: 8px 16px;
  cursor: pointer;
}
.modal-close:hover { border-color: var(--accent); color: var(--accent); }

.work-grid { columns: 3; column-gap: 16px; }
.work-item {
  display: block;
  break-inside: avoid;
  margin-bottom: 16px;
  text-decoration: none;
  color: var(--ink);
}
.work-item img {
  width: 100%;
  border-radius: 10px;
  display: block;
  border: 1px solid transparent;
}
.work-item .work-caption {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font-list);
}
.work-item:hover .work-caption { border-color: var(--accent); color: var(--accent); }
.work-empty { opacity: 0.7; font-size: 15px; }

/* ============================================================
   CASE PAGES (single hf_case) — clean editorial layout
   ============================================================ */
body.single-hf_case { overflow-y: auto; }
.case-wrap {
  position: relative;
  z-index: 4;
  max-width: 760px;
  margin: 40px auto 60px;
  border-radius: var(--radius);
  padding: 44px 48px 48px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}
.case-back {
  display: inline-block;
  margin-bottom: 26px;
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-family: var(--font-list);
}
.case-title {
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin-bottom: 20px;
}
.case-hero { width: 100%; border-radius: 12px; margin-bottom: 28px; display: block; }
.case-content { font-size: 16.5px; line-height: 1.65; }
.case-content p { margin-bottom: 16px; opacity: 0.94; }
.case-content h2, .case-content h3 {
  margin: 30px 0 10px;
  letter-spacing: -0.01em;
}
.case-content h2 { font-size: 24px; }
.case-content h3 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}
.case-content em {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--accent);
  font-size: 1.08em;
}
.case-content img { max-width: 100%; border-radius: 10px; }
.case-content ul, .case-content ol { margin: 0 0 16px 22px; }
.case-content li { margin-bottom: 6px; }
.case-cta {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.case-cta a {
  padding: 12px 22px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 15px;
}
.case-cta a.primary { background: var(--accent); color: var(--panel); font-weight: 700; }
.case-cta a.ghost { border: 1px solid var(--line); color: var(--ink); }
.case-cta a.ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ============================================================
   Mobile
   ============================================================ */
@media (max-width: 700px) {
  .panel { top: 12px; left: 12px; bottom: 12px; width: calc(100vw - 24px); padding: 24px 20px; }
  .cta-row { grid-template-columns: 1fr; }
  .mini-ctas { flex-direction: column; }
  .mini-cta { display: block; width: 100%; }
  .logo-grid { grid-template-columns: repeat(2, 1fr); }
  .dock { right: 10px; bottom: 10px; padding: 8px 6px; }   /* stays vertical */
  .dock a { width: 32px; height: 32px; }
  .work-grid { columns: 1; }
  .modal-sheet { inset: 10px; padding: 16px; }
  .case-wrap { margin: 12px; padding: 28px 22px 32px; }
}
@media (min-width: 701px) and (max-width: 1100px) {
  .work-grid { columns: 2; }
}
