/* R L Frederick Private Security & Weapon Safety */

:root {
  --black: #0b0b0c;
  --panel: #141416;
  --line: #2a2a2e;
  --input-line: #3a3a40;
  --text: #f2efe6;
  --muted: #b8b3a6;
  --gold: #c9a227;
  --gold-hover: #e0bd4a;
  --gold-dark: #8a6d12;
  --cream: #f4f1ea;
  --cream-line: #d9d4c7;
  --cream-muted: #4a4741;
  --ink: #141413;
  --display: 'Cinzel', Georgia, serif;
  --body: 'Barlow', system-ui, sans-serif;
  --gutter: 72px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  background: var(--black);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--gold); }
a:hover { color: var(--gold-hover); }

img, svg { max-width: 100%; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
}

p { margin: 0; }

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.eyebrow {
  font-size: 13px;
  letter-spacing: 0.22em;
  color: var(--gold);
  font-weight: 600;
  text-transform: uppercase;
}

.lead {
  font-size: 19px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 720px;
}

/* Buttons */

.btn {
  display: inline-block;
  padding: 18px 30px;
  font-family: var(--body);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.04em;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
}

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

.btn-outline { border-color: var(--gold); color: var(--gold); background: transparent; }
.btn-outline:hover { background: var(--gold); color: var(--black); }

.btn-dark { background: var(--black); color: var(--text); }
.btn-dark:hover { background: #222; color: var(--text); }

.btn-sm { padding: 12px 20px; font-size: 15px; }

/* Header */

.site-header {
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--black);
  z-index: 10;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 88px;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text);
}

.brand:hover { color: var(--text); }

.brand span {
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.08em;
}

.site-nav {
  display: flex;
  gap: 36px;
  align-items: center;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.site-nav a { color: var(--text); text-decoration: none; }
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--gold); }

.site-nav .btn { display: none; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  width: 44px;
  height: 44px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* Sections */

.section { padding: 88px 0; border-bottom: 1px solid var(--line); }
.section-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 40px; }
.section-head h2 { font-size: 38px; line-height: 1.15; }

.page-intro .container { display: flex; flex-direction: column; gap: 20px; }
.page-intro { padding: 88px 0 64px; border-bottom: 1px solid var(--line); }
.page-intro h1 { font-size: 52px; line-height: 1.1; max-width: 800px; }

/* Hero */

.hero { position: relative; overflow: hidden; }

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.hero-bg.ready { opacity: 1; }

/* Darkens the silk behind the headline so the text stays readable. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(11, 11, 12, 0.85) 0%, rgba(11, 11, 12, 0.55) 55%, rgba(11, 11, 12, 0.2) 100%);
  pointer-events: none;
}

.hero .container { position: relative; z-index: 1; }

.hero .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 64px;
}

.hero { padding: 96px 0 88px; border-bottom: 1px solid var(--line); }
.hero-text { display: flex; flex-direction: column; gap: 28px; max-width: 640px; }
.hero h1 { font-size: 60px; line-height: 1.08; }
.hero p { font-size: 20px; line-height: 1.55; color: var(--muted); }
.hero-actions { display: flex; gap: 16px; margin-top: 8px; flex-wrap: wrap; }
.hero-emblem { position: relative; width: 380px; aspect-ratio: 200 / 220; flex-shrink: 0; }
.hero-emblem svg, .hero-emblem canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-emblem canvas { opacity: 0; transition: opacity 0.8s ease; }
.hero-emblem.is-3d canvas { opacity: 1; }
.hero-emblem.is-3d .badge-flat { opacity: 0; transition: opacity 0.8s ease; }

/* Cards */

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 36px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.card h2, .card h3 { font-size: 22px; }
.card h2 { font-size: 24px; }
.card p { font-size: 16px; line-height: 1.6; color: var(--muted); }
.card .more { font-weight: 600; text-decoration: none; font-size: 15px; letter-spacing: 0.04em; }

.card-num {
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--gold);
}

/* Credentials / standards */

.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px 0;
  border-top: 2px solid var(--gold);
}

.stat strong { font-family: var(--display); font-size: 20px; }
.stat span { font-size: 15px; line-height: 1.55; color: var(--muted); }

/* Light (cream) sections */

.light { background: var(--cream); color: var(--ink); padding: 88px 0; }
.light .eyebrow { color: var(--gold-dark); }
.light .container { display: flex; gap: 64px; }
.light-intro { display: flex; flex-direction: column; gap: 16px; width: 420px; flex-shrink: 0; }
.light-intro h2 { font-size: 38px; line-height: 1.15; }
.light-intro p { font-size: 17px; line-height: 1.6; color: var(--cream-muted); }
.light .grid { flex-grow: 1; gap: 20px; }

.tile {
  padding: 28px;
  background: #fff;
  border: 1px solid var(--cream-line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tile strong { font-size: 17px; }
.tile .tile-title { font-family: var(--display); font-size: 18px; font-weight: 700; }
.tile span { font-size: 15px; line-height: 1.55; color: var(--cream-muted); }

/* Steps */

.steps { list-style: none; margin: 0; padding: 0; flex-grow: 1; }
.steps li {
  display: flex;
  gap: 24px;
  padding: 22px 0;
  border-top: 1px solid var(--cream-line);
}
.steps li:last-child { border-bottom: 1px solid var(--cream-line); }
.steps .n { font-family: var(--display); font-weight: 700; color: var(--gold-dark); width: 40px; flex-shrink: 0; }
.steps strong { display: block; font-size: 18px; margin-bottom: 4px; }
.steps span { font-size: 15px; color: var(--cream-muted); line-height: 1.5; }

/* Courses */

.courses { display: flex; flex-direction: column; gap: 24px; }

.course {
  display: flex;
  gap: 40px;
  padding: 36px;
  background: var(--panel);
  border: 1px solid var(--line);
  align-items: flex-start;
}

.course-body { display: flex; flex-direction: column; gap: 12px; flex-grow: 1; }
.course h2 { font-size: 26px; }
.course p { font-size: 16px; line-height: 1.6; color: var(--muted); }
.course-meta { display: flex; gap: 24px; flex-wrap: wrap; font-size: 14px; color: var(--muted); margin-top: 4px; }
.course-side { display: flex; flex-direction: column; gap: 12px; align-items: flex-end; flex-shrink: 0; }
.price { font-family: var(--display); font-size: 24px; font-weight: 700; color: var(--gold); }

/* About */

.split { display: flex; gap: 72px; align-items: flex-start; }
.split-text { display: flex; flex-direction: column; gap: 24px; flex-grow: 1; }
.split-text p { font-size: 18px; line-height: 1.65; color: var(--muted); }

.photo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  font-size: 15px;
  letter-spacing: 0.06em;
}

.photo-dark { width: 420px; height: 480px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.photo-light { width: 320px; height: 400px; background: #e6e1d4; border: 1px solid var(--cream-line); color: var(--cream-muted); }

.leader { display: flex; flex-direction: column; gap: 18px; flex-grow: 1; }
.leader h2 { font-size: 36px; }
.leader .role { font-size: 16px; font-weight: 600; color: var(--gold-dark); letter-spacing: 0.04em; }
.leader p { font-size: 17px; line-height: 1.65; color: var(--cream-muted); }
.leader .certs ul { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: 16px; color: var(--cream-muted); }
.leader .certs li::marker { color: var(--gold); }
.stat a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.leader .contact-line { display: flex; gap: 32px; flex-wrap: wrap; font-size: 15px; }
.leader .contact-line a { color: var(--cream-muted); }

/* Contact */

.contact .container { display: flex; gap: 80px; align-items: flex-start; }
.contact { padding: 88px 0; }
.contact-info { display: flex; flex-direction: column; gap: 36px; width: 400px; flex-shrink: 0; }
.contact-info h1 { font-size: 48px; line-height: 1.1; }
.contact-info p { font-size: 17px; line-height: 1.6; color: var(--muted); }
.contact-intro { display: flex; flex-direction: column; gap: 18px; }

.contact-details { display: flex; flex-direction: column; gap: 22px; padding-top: 28px; border-top: 1px solid var(--line); margin: 0; }
.contact-details dt { font-size: 12px; letter-spacing: 0.18em; color: var(--gold); font-weight: 600; margin-bottom: 4px; }
.contact-details dd { margin: 0; font-size: 18px; color: var(--text); }
.contact-details dd a { color: var(--text); text-decoration: none; }
.contact-details dd a:hover { color: var(--gold); }
.contact-details .big { font-size: 22px; font-weight: 600; }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex-grow: 1;
  min-width: 0;
  width: 100%;
  padding: 44px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 13px; letter-spacing: 0.08em; color: var(--muted); font-weight: 500; text-transform: uppercase; }

.field input,
.field select,
.field textarea {
  min-height: 48px;
  padding: 0 14px;
  background: var(--black);
  border: 1px solid var(--input-line);
  color: var(--text);
  font-size: 16px;
  font-family: var(--body);
  border-radius: 0;
  width: 100%;
  min-width: 0;
}

.field textarea { padding: 14px; resize: vertical; }

.field input:focus,
.field select:focus,
.field textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }

.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 4px; }
.form-foot small { font-size: 13px; color: var(--muted); line-height: 1.5; }
.form-status { font-size: 15px; color: var(--gold); min-height: 1em; }

/* Call-to-action band */

.cta { background: var(--gold); color: var(--black); padding: 64px 0; }
.cta .container { display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.cta h2 { font-size: 30px; }
.cta-text { display: flex; flex-direction: column; gap: 8px; }
.cta p { font-size: 18px; font-weight: 500; }
.cta p a { color: var(--black); }
.cta .btn { flex-shrink: 0; }

/* Footer */

.site-footer { padding: 56px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.site-footer .container { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; }
.footer-info { display: flex; flex-direction: column; gap: 10px; }
.footer-name { font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--text); letter-spacing: 0.06em; }
.footer-info a { color: var(--muted); }
.footer-links { display: flex; gap: 28px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--gold); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Tablet */

@media (max-width: 1080px) {
  :root { --gutter: 40px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-emblem { width: 280px; }
  .light .container, .split, .contact .container { flex-direction: column; gap: 40px; }
  .light-intro, .contact-info { width: 100%; }
  .photo-dark, .photo-light { width: 100%; max-width: 420px; }
}

/* Mobile */

@media (max-width: 820px) {
  :root { --gutter: 16px; }

  .nav-toggle { display: inline-flex; }
  .header-cta { display: none; }

  .site-nav {
    display: none;
    position: absolute;
    top: 88px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--black);
    border-bottom: 1px solid var(--line);
    padding: 8px 16px 16px;
  }

  .site-nav.open { display: flex; }
  .site-nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .site-nav .btn { display: block; margin-top: 16px; border-bottom: 0; }

  .hero .container { flex-direction: column-reverse; align-items: flex-start; gap: 32px; }
  .hero { padding: 56px 0; }
  .hero h1 { font-size: 38px; }
  .hero p { font-size: 18px; }
  .hero-emblem { width: 200px; }
  .hero-actions .btn { width: 100%; }

  .page-intro { padding: 56px 0 40px; }
  .page-intro h1, .contact-info h1 { font-size: 34px; }
  .section, .light, .contact { padding: 56px 0; }
  .section-head h2, .light-intro h2 { font-size: 28px; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .card, .course, .contact-form { padding: 24px; }
  .course { flex-direction: column; gap: 20px; }
  .course-side { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; }

  .form-foot { flex-direction: column; align-items: stretch; }
  .form-foot .btn { width: 100%; }

  .cta { padding: 48px 0; }
  .cta .container { flex-direction: column; align-items: flex-start; gap: 24px; }
  .cta h2 { font-size: 26px; }

  .site-footer .container { flex-direction: column; }
}

/* Accordion gallery (Services page) */

.gallery-section { padding: 72px 0; border-bottom: 1px solid var(--line); }

.accordion-gallery {
  --ag-accent: var(--gold);
  --ag-overlay: #0b0b0c;
  --ag-media-size: 320px;
  --ag-ease: cubic-bezier(0.215, 0.61, 0.355, 1);
  display: flex;
  gap: 10px;
  height: 460px;
  perspective: 1400px;
}

.ag-panel {
  --ag-rot: 0deg;
  --ag-shift: 0px;
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  border-radius: 4px;
  display: block;
  text-decoration: none;
  color: var(--text);
  transform: rotateY(var(--ag-rot));
  transform-style: preserve-3d;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.8);
  -webkit-tap-highlight-color: transparent;
}

.ag-ready .ag-panel { transition: flex-grow 0.6s var(--ag-ease), transform 0.6s var(--ag-ease); }

.ag-panel:hover { color: var(--text); }
.ag-panel:focus { outline: none; }
.ag-panel:focus-visible { box-shadow: 0 0 0 2px var(--ag-accent), 0 10px 30px -18px rgba(0, 0, 0, 0.8); }

.ag-panel__frame { position: absolute; inset: 0; overflow: hidden; }

.ag-panel__media {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--ag-media-size);
  height: 100%;
  transform: translate(-50%, -50%) translateX(var(--ag-shift));
  filter: grayscale(1);
}

.ag-ready .ag-panel__media { transition: transform 0.6s var(--ag-ease), filter 0.6s var(--ag-ease); }
.ag-panel--active .ag-panel__media { filter: grayscale(0); }

.ag-panel__media img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Stand-in until real photos are added: swap for <img src="..." alt="..."> */
.ag-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  height: 100%;
  padding: 24px;
  text-align: center;
  background: radial-gradient(circle at 50% 35%, #3a2f12 0%, #17140c 55%, #0b0b0c 100%);
  color: #b8b3a6;
  font-size: 13px;
  letter-spacing: 0.12em;
}

.ag-placeholder svg { width: 56px; height: 56px; }
.ag-panel:not(.ag-panel--active) .ag-placeholder { font-size: 0; gap: 0; }

.ag-panel__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent 45%, rgba(11, 11, 12, 0.85) 100%),
    rgba(11, 11, 12, 0.35);
}

.ag-ready .ag-panel__overlay { transition: background-color 0.6s var(--ag-ease); }
.ag-panel--active .ag-panel__overlay { background: linear-gradient(180deg, transparent 45%, rgba(11, 11, 12, 0.85) 100%); }

.ag-panel__label {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

.ag-panel__bar,
.ag-panel__text { opacity: 0; transform: translateX(-14px); }

.ag-ready .ag-panel__bar,
.ag-ready .ag-panel__text { transition: opacity 0.36s var(--ag-ease), transform 0.36s var(--ag-ease); }

.ag-panel--active .ag-panel__bar,
.ag-panel--active .ag-panel__text { opacity: 1; transform: none; transition-duration: 0.6s; }

.ag-panel--active .ag-panel__text { transition-delay: 0.06s; }

.ag-panel__bar {
  flex: 0 0 auto;
  width: 3px;
  height: 26px;
  background: var(--ag-accent);
  box-shadow: 0 0 12px rgba(201, 162, 39, 0.6);
}

.ag-panel__text {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1rem, 1.4vw, 1.35rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
}

@media (max-width: 820px) {
  .gallery-section { padding: 48px 0; }
  .accordion-gallery { flex-direction: column; height: auto; perspective: none; }
  .ag-panel { min-height: 84px; transform: none; }
  .ag-ready .ag-panel { transition: min-height 0.6s var(--ag-ease); }
  .ag-panel--active { min-height: 300px; }
  .ag-panel__media { width: 100%; height: 300px; transform: translate(-50%, -50%); }
  .ag-panel__bar, .ag-panel__text { opacity: 1; transform: none; }
  .ag-panel:not(.ag-panel--active) .ag-placeholder svg { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ag-ready .ag-panel,
  .ag-ready .ag-panel__media,
  .ag-ready .ag-panel__bar,
  .ag-ready .ag-panel__text { transition: none; }
}

.card[id] { scroll-margin-top: 110px; }

/* Home page: fixed background scene (silk + badge and flashlight) */

.scene-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.scene-bg .silk-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.2s ease; }
.scene-bg .silk-bg.ready { opacity: 0.6; }
.scene-3d { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease; }
.scene-3d.ready { opacity: 1; }
.scene-3d canvas { width: 100%; height: 100%; display: block; }

body.home main,
body.home .site-footer { position: relative; z-index: 1; }

/* Dark see-through panels keep text readable over the scene. */
body.home .section,
body.home .gallery-section { background: rgba(11, 11, 12, 0.62); }
body.home .site-footer { background: rgba(11, 11, 12, 0.9); }
body.home .hero { min-height: calc(100vh - 88px); display: flex; align-items: center; }
body.home .hero .container { width: 100%; }
body.home .hero-text { max-width: 600px; }
body.home .hero::after { background: linear-gradient(90deg, rgba(11, 11, 12, 0.88) 0%, rgba(11, 11, 12, 0.6) 38%, rgba(11, 11, 12, 0) 62%); }

@media (max-width: 900px) {
  body.home .section,
  body.home .gallery-section { background: rgba(11, 11, 12, 0.78); }
  body.home .hero::after { background: linear-gradient(180deg, rgba(11, 11, 12, 0.55) 0%, rgba(11, 11, 12, 0.8) 100%); }
}

/* Owner-managed content (filled in by js/content.js) */

.site-notice { background: var(--gold); color: var(--black); font-weight: 600; text-align: center; padding: 12px 0; position: relative; z-index: 2; }
.multiline { white-space: pre-line; }
.photo.has-photo { padding: 0; overflow: hidden; }
.photo .site-photo,
.ag-panel__media .site-photo { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Hidden field that only bots fill in (contact form spam trap) */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
