/* ============================================================
   Jason Powers — Marketing Executive
   main.css — modern, accessible, executive design system
   ============================================================ */

/* --- Tokens --- */
:root {
  /* Colors */
  --bg: #ffffff;
  --bg-elev: #f7f8fa;
  --bg-dark: #0b1220;
  --bg-dark-2: #111a2e;
  --ink: #0f172a;
  --ink-2: #1f2937;
  --muted: #475569;
  --muted-2: #64748b;
  --line: #e6e8ec;
  --line-2: #d8dde4;
  --accent: #d97706;          /* warm amber */
  --accent-2: #f59e0b;
  --accent-soft: #fef3c7;
  --link: #1d4ed8;
  --on-dark: #f8fafc;
  --on-dark-muted: #94a3b8;

  /* Type */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Fraunces", "Playfair Display", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Sizing */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow: 0 4px 12px rgba(15, 23, 42, .06), 0 2px 4px rgba(15, 23, 42, .04);
  --shadow-lg: 0 24px 48px rgba(15, 23, 42, .12), 0 12px 24px rgba(15, 23, 42, .08);

  /* Layout */
  --max: 1200px;
  --max-text: 760px;
}

/* --- Base --- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--accent-soft); color: var(--ink); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.25rem, 4.6vw + .5rem, 4.25rem); font-weight: 600; }
h2 { font-size: clamp(1.75rem, 2.4vw + .5rem, 2.75rem); }
h3 { font-size: clamp(1.25rem, 1vw + .9rem, 1.6rem); }
h4 { font-size: 1.125rem; font-family: var(--font-sans); font-weight: 600; letter-spacing: 0; }

p { margin: 0 0 1em; }
p.lead { font-size: 1.2rem; color: var(--muted); }
.eyebrow {
  display: inline-block;
  font-size: .82rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1em;
}

/* --- Layout --- */
.container { width: min(100% - 2rem, var(--max)); margin-inline: auto; }
.container-narrow { width: min(100% - 2rem, var(--max-text)); margin-inline: auto; }
section { padding: clamp(3.5rem, 7vw, 6rem) 0; }
.section-tight { padding: clamp(2rem, 4vw, 3rem) 0; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

.bg-elev { background: var(--bg-elev); }
.bg-dark { background: linear-gradient(180deg, var(--bg-dark), var(--bg-dark-2)); color: var(--on-dark); }
.bg-dark h1, .bg-dark h2, .bg-dark h3 { color: var(--on-dark); }
.bg-dark p { color: var(--on-dark-muted); }

/* --- Header / Nav --- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .85);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-row {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex; align-items: center; gap: .65rem;
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -.02em;
}
.brand-sub { color: var(--muted); font-weight: 400; font-family: var(--font-sans); font-size: .9rem; margin-left: .25rem; }

.nav-links { display: flex; gap: 1.75rem; align-items: center; list-style: none; padding: 0; margin: 0; }
.nav-links a {
  color: var(--ink-2);
  font-size: .96rem;
  font-weight: 500;
  padding: .25rem 0;
  position: relative;
}
.nav-links a:hover { color: var(--accent); text-decoration: none; }
.nav-links a.active { color: var(--accent); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -8px;
  height: 2px; background: var(--accent); border-radius: 2px;
}
.nav-cta { display: flex; gap: .5rem; align-items: center; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  width: 42px; height: 42px;
  cursor: pointer;
  align-items: center; justify-content: center;
  color: var(--ink);
}
.nav-toggle svg { width: 20px; height: 20px; }
.nav-mobile {
  display: none;
  border-top: 1px solid var(--line);
  background: #fff;
  padding: .75rem 0;
}
.nav-mobile.open { display: block; }
.nav-mobile a {
  display: block;
  padding: .85rem 0;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 500;
  border-bottom: 1px solid var(--line);
}
.nav-mobile a:last-child { border-bottom: 0; }

@media (max-width: 860px) {
  .nav-links, .nav-cta .btn-secondary { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .85rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .98rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap;
  line-height: 1;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--accent); color: #fff; box-shadow: var(--shadow); }

.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #b45309; color: #fff; box-shadow: var(--shadow); }

.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-secondary:hover { border-color: var(--ink); color: var(--ink); background: var(--bg-elev); }

.btn-on-dark { background: #fff; color: var(--ink); }
.btn-on-dark:hover { background: var(--accent); color: #fff; }

.btn-ghost-on-dark { background: transparent; color: #fff; border-color: rgba(255,255,255,.25); }
.btn-ghost-on-dark:hover { border-color: #fff; background: rgba(255,255,255,.06); }

.btn-sm { padding: .55rem 1rem; font-size: .88rem; }

/* --- Hero --- */
.hero {
  position: relative;
  background: linear-gradient(180deg, var(--bg-dark), var(--bg-dark-2));
  color: var(--on-dark);
  padding: clamp(4rem, 9vw, 7.5rem) 0 clamp(4.5rem, 9vw, 7rem);
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(800px 400px at 80% -10%, rgba(245, 158, 11, .18), transparent 60%),
    radial-gradient(600px 320px at 0% 110%, rgba(59, 130, 246, .12), transparent 60%);
  pointer-events: none;
}
.hero .container { position: relative; }
.hero h1 { color: #fff; max-width: 16ch; margin-bottom: .25em; }
.hero h1 .accent { color: var(--accent-2); font-style: italic; }
.hero .lead { color: #cbd5e1; max-width: 60ch; font-size: clamp(1.05rem, 1vw + .8rem, 1.3rem); }
.hero .hero-meta {
  display: flex; flex-wrap: wrap; gap: .5rem .9rem;
  color: #94a3b8; font-size: .92rem; margin-top: 1.25rem;
}
.hero .hero-meta span { display: inline-flex; align-items: center; gap: .4rem; }
.hero .hero-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: #475569; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 2rem; }

/* --- Stats row --- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 2rem 0;
  background: #fff;
}
.stats .stat { text-align: center; padding: .25rem 1rem; }
.stats .num {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw, 2.75rem);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.02em;
  line-height: 1;
}
.stats .num .accent { color: var(--accent); }
.stats .label { font-size: .82rem; color: var(--muted); margin-top: .35rem; letter-spacing: .04em; text-transform: uppercase; font-weight: 500; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* --- Cards / Tiles --- */
.cards {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.5rem 1.4rem;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2); }
.card h3 { margin: .25rem 0 .5rem; }
.card p { color: var(--muted); margin: 0; }
.card .icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid; place-items: center;
  margin-bottom: .85rem;
}

/* --- Logos row --- */
.logos {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 2rem 3rem;
  padding: 1.25rem 0;
  color: var(--muted);
}
.logos .logo-item {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -.01em;
  opacity: .8;
  transition: opacity .2s ease;
}
.logos .logo-item:hover { opacity: 1; }

/* --- Timeline --- */
.timeline { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.tl-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2rem;
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 .25rem;
}
.tl-item:first-child { border-top: 0; padding-top: 0; }
.tl-when { color: var(--muted); font-size: .92rem; font-weight: 500; }
.tl-when .role-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: .5rem; vertical-align: middle; }
.tl-body h3 { margin: 0 0 .15em; }
.tl-body .org { color: var(--muted); margin-bottom: .85em; font-size: .98rem; }
.tl-body ul { padding-left: 1.1rem; margin: 0 0 .25em; }
.tl-body li { margin-bottom: .35em; color: var(--ink-2); }
@media (max-width: 720px) {
  .tl-item { grid-template-columns: 1fr; gap: .25rem; padding: 1.5rem 0; }
}

/* --- Portfolio grid ---
   Flexbox so widowed thumbs in the last row center automatically.
   Source thumbs are 120x120; we keep size modest so they stay sharp.
   7 across desktop, 5 across tablet, 3 across mobile. */
.work-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
  max-width: 1240px;
  margin: 0 auto;
}
.work-grid > a {
  flex: 0 0 160px;
  display: block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  position: relative;
  aspect-ratio: 1 / 1;
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
}
.work-grid > a:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: var(--line-2);
}
.work-grid img {
  width: 100%; height: 100%;
  object-fit: cover;
  image-rendering: -webkit-optimize-contrast;
}

@media (max-width: 1100px) { .work-grid > a { flex: 0 0 140px; } }
@media (max-width: 900px)  { .work-grid > a { flex: 0 0 130px; } }
@media (max-width: 600px)  {
  .work-grid { gap: .4rem; }
  .work-grid > a { flex: 0 0 calc((100% - 0.8rem) / 3); }
}

/* --- Tabs (portfolio) --- */
.tabs {
  display: flex; flex-wrap: wrap;
  gap: .35rem;
  justify-content: center;
  margin: 0 0 1.75rem;
  padding: .35rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 999px;
  width: fit-content;
  margin-inline: auto;
}
.tab-btn {
  border: 0;
  background: transparent;
  padding: .55rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 500;
  font-size: .92rem;
  transition: background .15s, color .15s;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { background: var(--ink); color: #fff; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadein .25s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* --- Form --- */
.form {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 2.25rem);
  box-shadow: var(--shadow-sm);
}
.form .row { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .form .row { grid-template-columns: 1fr; } }
.form label {
  display: block;
  font-size: .88rem;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: .35rem;
}
.form input[type=text], .form input[type=email], .form input[type=tel], .form textarea {
  width: 100%;
  padding: .8rem 1rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  font: inherit;
  background: #fff;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form input:focus, .form textarea:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(217, 119, 6, .15);
}
.form textarea { resize: vertical; min-height: 140px; }
.form .field { margin-bottom: 1rem; }
.form .actions { display: flex; gap: .75rem; align-items: center; margin-top: .5rem; flex-wrap: wrap; }
.form .helper { color: var(--muted); font-size: .9rem; }
.form .honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* --- Confirmation modal --- */
#submitpop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(11, 18, 32, .82);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  display: grid; place-items: center;
  padding: 1rem;
  animation: popfade .18s ease;
}
@keyframes popfade { from { opacity: 0; } to { opacity: 1; } }
@keyframes poprise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
#submitpop .pop {
  background: #fff; color: var(--ink);
  border-radius: var(--radius-lg);
  max-width: 460px; width: 100%;
  padding: 2.25rem 1.75rem 1.75rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
  position: relative;
  animation: poprise .25s ease;
}
#submitpop .pop h3 {
  margin: 0 0 .5rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
}
#submitpop .close {
  position: absolute; top: .65rem; right: .65rem;
  width: 36px; height: 36px;
  display: inline-grid; place-items: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: var(--muted);
  transition: background .15s, color .15s;
}
#submitpop .close:hover { background: var(--bg-elev); color: var(--ink); }
#submitpop .close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#submitpop .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* --- Footer --- */
.site-footer {
  background: var(--bg-dark);
  color: var(--on-dark-muted);
  padding: 3.5rem 0 2rem;
  margin-top: 4rem;
}
.site-footer .grid {
  display: grid; gap: 2rem;
  grid-template-columns: 1.4fr 1fr 1fr;
  margin-bottom: 2.5rem;
}
@media (max-width: 760px) { .site-footer .grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: #fff; font-family: var(--font-sans); font-size: .92rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 1em; }
.site-footer a { color: #cbd5e1; }
.site-footer a:hover { color: var(--accent-2); text-decoration: none; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .5rem; }
.site-footer .brand-block p { color: #94a3b8; max-width: 36ch; font-size: .95rem; }

.social-row { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; }
.social-row a {
  width: 38px; height: 38px;
  display: inline-grid; place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
  color: #cbd5e1;
  transition: background .15s, color .15s, border-color .15s;
}
.social-row a:hover { background: var(--accent); color: #fff; border-color: var(--accent); text-decoration: none; }
.social-row svg { width: 18px; height: 18px; }

.copyright {
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 1.5rem;
  font-size: .9rem;
  color: #94a3b8;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
}

/* --- Page header (interior pages) --- */
.page-head {
  background: linear-gradient(180deg, var(--bg-dark), var(--bg-dark-2));
  color: var(--on-dark);
  padding: clamp(3rem, 7vw, 5rem) 0 clamp(3rem, 6vw, 4rem);
}
.page-head h1 { color: #fff; margin-bottom: .35em; max-width: 22ch; }
.page-head .lead { color: #cbd5e1; max-width: 64ch; }

/* --- Print --- */
@media print {
  .site-header, .site-footer, .nav-toggle, .form, .hero-actions, .actions, .tabs, .nav-mobile { display: none !important; }
  body { background: #fff; color: #000; }
  .hero, .page-head, .bg-dark { background: #fff !important; color: #000 !important; }
  .hero h1, .page-head h1, .bg-dark h1, .bg-dark h2, .bg-dark h3 { color: #000 !important; }
  a { color: #000 !important; text-decoration: underline; }
  section { padding: 1.25rem 0; }
  .container { width: 100%; max-width: none; padding: 0 .5rem; }
}

/* --- Email obfuscation helper ---
   Mark up email links as: <a class="e" data-u="jason" data-d="powersadvertising.com">contact</a>
   Inline JS in bottom.php turns these into real mailto links at runtime.
   Naive scrapers that don't run JS see the obfuscated markup. */
a.e:not([href]) { cursor: pointer; }
a.e .at::before { content: " [at] "; }
a.e .dot::before { content: " [dot] "; }

/* --- Misc --- */
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.tag {
  display: inline-block;
  padding: .25rem .65rem;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: .82rem;
  font-weight: 500;
  margin: 0 .25rem .25rem 0;
}
.skill-cloud { margin: 1.25rem 0 .25rem; }
