/* =====================================================
   phllpclrk.com — main.css
   Monochrome UI, poppy card hover, tidy contact form
   ===================================================== */

/* ---------- Base ---------- */
:root { color-scheme: dark; }

html, body { height: 100%; }

body {
  background: #0e0e0e url('../images/double-bubble-outline.png') repeat;
  color: #f2f2f2;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.darkRepeatBackground {
  background: #111 url('../images/double-bubble-dark.png') repeat;
}

/* Images */
img, .card-img-top { display: block; max-width: 100%; height: auto; }

/* ---------- Typography ---------- */
h1, h2, h3 {
  color: #111;
  text-shadow: 0 1px 0 rgba(255,255,255,0.15);
  margin: .5rem 0 1.25rem;
}

.darkRepeatBackground h1,
.darkRepeatBackground h2,
.darkRepeatBackground h3 {
  color: #fff;
  text-shadow: 0 1px 0 rgba(0,0,0,0.4);
}

/* Balance long lines where supported */
header .fs-4,
.card .card-text { text-wrap: balance; }

/* ---------- Navbar ---------- */
.navbar-dark .navbar-nav .nav-link.active {
  color: #fff;
  border-bottom: 2px solid #fff;
}
.navbar-dark .navbar-nav .nav-link:hover { color: #ddd; }

/* ---------- Buttons (light) ---------- */
.btn-light {
  background: #f0f0f0;
  color: #111;
  border: none;
  transition: transform .3s ease, box-shadow .3s ease, background-color .3s ease;
}
.btn-light:hover,
.btn-light:focus {
  background: #fff;
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255,255,255,0.25);
}

/* ---------- Portfolio Cards ---------- */
.card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #111;
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 2px 6px rgba(255,255,255,0.05);
  transform-style: preserve-3d;
  transition:
    transform .4s cubic-bezier(0.19, 1, 0.22, 1),
    box-shadow .4s ease,
    filter .4s ease;
}

.card img { transition: opacity .5s ease, transform .5s ease; }
.card-body { transition: background-color .5s ease; }

.card h4.card-title { color: #fff; font-weight: 700; }
.card h5 { color: #bbb; letter-spacing: .5px; font-weight: 500; }
.card p  { color: #ccc; }

/* Hover */
.card:hover,
.card:focus-within {
  transform: translateY(-14px) scale(1.045);
  border-color: rgba(255,255,255,0.35);
  box-shadow:
    0 28px 60px rgba(0,0,0,0.65),
    0 0 0 1px rgba(255,255,255,0.20),
    0 0 22px rgba(255,255,255,0.10);
  filter: brightness(1.05);
  z-index: 5;
}
.card:hover img,
.card:focus-within img { transform: scale(1.06); opacity: .90; filter: contrast(1.08) brightness(1.06) saturate(0); }
.card:hover .card-body,
.card:focus-within .card-body { background-color: rgba(255,255,255,0.05); }

/* Spotlight + sheen */
.card::after,
.card::before {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  opacity: 0; transition: opacity .35s ease, transform .35s ease;
}
.card::after {
  background: radial-gradient(120% 70% at 50% 0%, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0.10) 30%, rgba(255,255,255,0.03) 55%, transparent 70%);
}
.card::before {
  background: linear-gradient(115deg, transparent 0%, rgba(255,255,255,0.12) 45%, rgba(255,255,255,0.22) 50%, rgba(255,255,255,0.12) 55%, transparent 100%);
  transform: translateX(-30%);
}
.card:hover::after, .card:focus-within::after { opacity: 1; }
.card:hover::before, .card:focus-within::before { opacity: 1; transform: translateX(30%); }

/* Equal heights + tidy layout */
.row { display: flex; flex-wrap: wrap; justify-content: center; align-content: stretch; gap: 1rem; }
.card { height: 100%; }
.card .card-body { display: flex; flex-direction: column; flex-grow: 1; }
.card .btn { margin-top: auto; }

/* ---------- Footer ---------- */
footer.darkRepeatBackground {
  position: relative;
  color: #eaeaea;
  border-top: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
}
footer.darkRepeatBackground::before {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(0,0,0,0.20), rgba(0,0,0,0.40));
  z-index: 0;
}
footer.darkRepeatBackground > * { position: relative; z-index: 1; }
footer.darkRepeatBackground a { color: #bbb; text-decoration: none; }
footer.darkRepeatBackground a:hover { color: #fff; text-decoration: underline; }

/* ---------- Forms (Contact) ---------- */
form.contact { max-width: 760px; margin: 0 auto; text-align: left; }
form.contact .form-label { color: #111; font-weight: 600; }

.form-control {
  width: 100%;
  background: #000;
  color: #f5f5f5;
  border: 1px solid #333;
  border-radius: 8px;
  font-size: 18px;
  padding: 12px 14px;
  margin-bottom: 16px;
  transition: border-color .3s ease, background-color .3s ease, box-shadow .3s ease;
}
.form-control::placeholder { color: #8e8e8e; }
.form-control:focus {
  border-color: #999;
  background-color: #111;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.05);
  outline: none;
}

textarea.form-control { min-height: 10rem; resize: vertical; }
input { height: 48px; }

/* Submit button matches the form width */
form.contact .submit {
  display: block;
  width: 100%;
  background: linear-gradient(180deg, #333 0%, #111 100%);
  border: 1px solid #555;
  color: #f5f5f5;
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 14px;
  border-radius: 8px;
  margin: 14px auto 0;
  box-shadow: none;
  transition: transform .3s ease, box-shadow .3s ease, background .3s ease, border-color .3s ease;
}
form.contact .submit:hover {
  background: linear-gradient(180deg, #444 0%, #000 100%);
  border-color: #888;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255,255,255,0.05);
  cursor: pointer;
}

/* In case Bootstrap .btn/.w-100 are used */
form.contact .btn.btn-primary {
  width: 100% !important;
  background: linear-gradient(180deg, #333 0%, #111 100%) !important;
  border: 1px solid #555 !important;
  color: #f5f5f5 !important;
  font-size: 18px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  padding: 14px; border-radius: 8px; box-shadow: none !important;
}

/* ---------- Accessibility ---------- */
.card a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px #000 inset, 0 0 0 3px #fff;
  border-radius: 4px;
}
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid #f2f2f2; outline-offset: 2px;
}
::selection { background: rgba(255,255,255,0.3); color: #111; }

/* ---------- Responsive tweaks ---------- */
@media (max-width: 576px) {
  .row.m-5 { margin: 1.5rem !important; }
  .row .col { margin-top: 1rem !important; }
  .form-control { font-size: 16px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .card, .card img, .card-body { transition: none; }
  .card:hover, .card:focus-within { transform: none; }
  .card::before, .card::after { transition: opacity .01s linear; }
}

/* ---------- Optional helpers (drop-in) ---------- */

/* Narrower content width when you want it */
.container-narrow { max-width: 820px; margin-inline: auto; }

/* Soft panel behind content (e.g., the contact form) */
.panel {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.panel--soft { padding: 1.25rem; }

/* hCaptcha: align with form width + spacing */
form.contact .h-captcha {
  display: flex;
  justify-content: center;   /* centers the widget inside the form */
  align-items: center;
  width: 100%;
  margin: 0 0 16px;
}

/* Make the widget visually consistent (subtle polish) */
form.contact .h-captcha iframe {
  border-radius: 8px;        /* matches inputs/buttons */
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}

/* Tighten spacing when stacked on small screens */
@media (max-width: 576px) {
  form.contact .h-captcha { margin-bottom: 12px; }
}

/* Ensure visible input text color */
form.contact .form-control,
form.contact .form-control:focus,
form.contact textarea {
  color: #f5f5f5 !important;
  background-color: #000 !important;
  caret-color: #f5f5f5; /* ensures cursor stays visible */
}

/* ——— Force visible input text in Chrome/Safari (typing + autofill) ——— */
form.contact .form-control,
form.contact textarea {
  color: #f5f5f5 !important;
  background-color: #000 !important;
  caret-color: #f5f5f5 !important;
  -webkit-text-fill-color: #f5f5f5;   /* Chrome/Safari typing color */
}

/* Autofill states (email/name/subject/message) */
form.contact input.form-control:-webkit-autofill,
form.contact textarea.form-control:-webkit-autofill,
form.contact input.form-control:-webkit-autofill:focus,
form.contact textarea.form-control:-webkit-autofill:focus {
  -webkit-text-fill-color: #f5f5f5 !important;   /* text color */
  caret-color: #f5f5f5 !important;               /* cursor color */
  box-shadow: 0 0 0 1000px #000 inset !important;/* background stays dark */
  -webkit-box-shadow: 0 0 0 1000px #000 inset !important;
  border-color: #555 !important;
}

/* iOS/Safari quirks */
form.contact .form-control {
  appearance: none;
  -webkit-appearance: none;
  background-clip: padding-box; /* prevents odd overlay edges */
}
