/* paulfromapco.com — colors taken from the Paul bobblehead:
   blue wall, black vest with white piping, forest green shirt, khaki pants, oak shelf. */
:root {
  --wall: #3f5878;
  --vest: #161719;
  --piping: #f4f1ea;
  --shirt: #1f3a2a;
  --shirt-hover: #2a4d38;
  --khaki: #c9923f;
  --khaki-light: #f1dfbf;
  --oak: #c68a3a;
  --oak-dark: #94601f;
  --hair: #c9cbc8;

  --bg: #f6f2ea;
  --fg: #1b1b19;
  --muted: #5d5a53;
  --card: #ffffff;
  --line: #e4ddd0;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141412;
    --fg: #eeebe4;
    --muted: #a8a399;
    --card: #1e1e1b;
    --line: #34322d;
    --khaki-light: #3a2f1d;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
img { display: block; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Top bar: the vest ---------- */
.topbar { background: var(--vest); color: var(--piping); border-bottom: 3px solid var(--piping); box-shadow: 0 3px 0 var(--vest); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.wordmark { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; min-width: 0; }
.wordmark img { height: 42px; width: auto; flex: none; filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
.wordmark .name { font-weight: 800; font-size: 22px; letter-spacing: -0.02em; white-space: nowrap; }
.wordmark .from { font-weight: 400; color: var(--hair); }
.wordmark .apco { color: var(--khaki); }
.wordmark .tld { color: var(--hair); font-weight: 500; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; font: inherit; font-weight: 700; font-size: 15px;
  padding: 10px 16px; border-radius: 999px; white-space: nowrap; border: 0; cursor: pointer;
  transition: background .15s ease;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-khaki { background: var(--khaki); color: var(--vest); }
.btn-khaki:hover { background: #d9a352; }
.btn-green { background: var(--shirt); color: var(--piping); }
.btn-green:hover { background: var(--shirt-hover); }
.btn-dark { background: var(--vest); color: var(--piping); }
.btn-dark:hover { background: #2b2d30; }

/* ---------- The oak shelf ---------- */
.shelf {
  height: 18px;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.06) 0 2px, transparent 2px 38px),
    repeating-linear-gradient(0deg, rgba(90,50,10,.18) 0 1px, transparent 1px 5px),
    linear-gradient(180deg, #d69a4a 0%, var(--oak) 45%, var(--oak-dark) 100%);
  box-shadow: 0 5px 10px rgba(0,0,0,.15);
}

/* ---------- 2 × 2 items ---------- */
main { padding-top: 32px; padding-bottom: 56px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.card {
  background: var(--card); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column;
  border: 1px solid var(--line); box-shadow: 0 6px 22px rgba(0,0,0,.06);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(0,0,0,.12); }
.card .img { position: relative; background: #fff; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; padding: 18px; }
.card .img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tag { position: absolute; top: 12px; left: 12px; font-size: 12px; font-weight: 600; background: #f1eee7; color: #333; padding: 4px 10px; border-radius: 999px; display: flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.25); margin-left: -3px; }
.card .body {
  padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1;
  border-top: 4px solid var(--vest);
  box-shadow: inset 0 2px 0 var(--piping), inset 0 4px 0 var(--vest);
}
.brand { font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.card h2 { font-size: 18px; line-height: 1.3; margin: -6px 0 0; }
.details { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; margin: 0; font-size: 14px; }
.details dt { color: var(--muted); white-space: nowrap; }
.details dd { margin: 0; }
.foot { margin-top: auto; display: flex; align-items: end; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px dashed var(--line); }
.price { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.price.call { font-size: 18px; }
.model { font-size: 12px; color: var(--muted); }

/* ---------- Footer: the vest again ---------- */
footer { background: var(--vest); color: var(--hair); border-top: 3px solid var(--piping); box-shadow: inset 0 3px 0 var(--vest); font-size: 14px; padding-bottom: 90px; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-top: 26px; padding-bottom: 10px; }
footer strong { color: var(--piping); }
footer a { color: var(--khaki); }

/* ============================================================
   Paul helper — bottom-right bobblehead
   Body sits in a round frame; the real cut-out head pops out
   of the top and bobbles on its "spring" at the neck.
   ============================================================ */
.helper { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; flex-direction: column; align-items: flex-end; gap: 14px; }

.helper-btn {
  --size: 96px;
  appearance: none; border: 0; padding: 0; background: none; cursor: pointer;
  width: var(--size); height: var(--size); position: relative;
  margin-top: calc(var(--size) * .28); /* room for the head poking out */
  filter: drop-shadow(0 10px 14px rgba(0,0,0,.35));
  transition: transform .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.helper-btn:hover { transform: translateY(-3px) scale(1.04); }
.helper-btn:active { transform: scale(.97); }
.helper-btn:focus-visible { outline: 3px solid var(--khaki); outline-offset: 6px; border-radius: 50%; }

.helper-frame {
  position: absolute; inset: 0; border-radius: 50%; overflow: hidden;
  background: var(--wall);
  border: 3px solid var(--piping); box-shadow: 0 0 0 4px var(--vest);
}
.helper-frame img { width: 100%; height: 100%; object-fit: cover; }

/* Head position measured from the photo (percent of the frame) */
.helper-head {
  position: absolute; left: 23.68%; top: -27.5%; width: 54.08%; height: auto;
  transform-origin: 50% 97%;           /* the neck spring */
  animation: idle-bob 3.2s ease-in-out infinite;
  pointer-events: none;
  will-change: transform;
}
.helper-btn:hover .helper-head,
.helper-head.go { animation: big-bobble 1.5s cubic-bezier(.3,.6,.3,1) 1; }

/* Always-on gentle nod */
@keyframes idle-bob {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  25%      { transform: rotate(2.5deg) translateY(-1px); }
  50%      { transform: rotate(0deg) translateY(0); }
  75%      { transform: rotate(-2.5deg) translateY(-1px); }
}
/* Springy wobble that settles, like flicking a real bobblehead */
@keyframes big-bobble {
  0%   { transform: rotate(0deg)   translateY(0); }
  8%   { transform: rotate(-14deg) translateY(-3px); }
  20%  { transform: rotate(11deg)  translateY(-2px); }
  32%  { transform: rotate(-8deg)  translateY(-1px); }
  44%  { transform: rotate(6deg)   translateY(0); }
  56%  { transform: rotate(-4deg); }
  68%  { transform: rotate(2.5deg); }
  80%  { transform: rotate(-1.2deg); }
  90%  { transform: rotate(.5deg); }
  100% { transform: rotate(0deg); }
}

/* Hover tip */
.helper-tip {
  position: absolute; right: 116px; bottom: 34px; white-space: nowrap;
  background: var(--vest); color: var(--piping); font-size: 14px; font-weight: 600;
  padding: 8px 12px; border-radius: 10px; opacity: 0; transform: translateX(6px);
  transition: opacity .15s ease, transform .15s ease; pointer-events: none;
}
.helper-tip::after { content: ""; position: absolute; right: -6px; top: 50%; margin-top: -6px; border: 6px solid transparent; border-right: 0; border-left-color: var(--vest); }
.helper:has(.helper-btn:hover) .helper-tip,
.helper:has(.helper-btn:focus-visible) .helper-tip,
.helper.hint .helper-tip { opacity: 1; transform: none; }
.helper.open .helper-tip { opacity: 0 !important; }

/* Speech bubble */
.bubble {
  width: min(340px, calc(100vw - 32px)); max-height: calc(100vh - 170px); overflow-y: auto;
  background: var(--card); color: var(--fg); border-radius: 18px;
  border: 3px solid var(--vest); box-shadow: inset 0 0 0 2px var(--piping), 0 18px 44px rgba(0,0,0,.3);
  transform-origin: 85% 100%; animation: pop .2s ease-out;
}
.bubble[hidden] { display: none; }
@keyframes pop { from { opacity: 0; transform: scale(.9) translateY(10px); } to { opacity: 1; transform: none; } }
.bubble-head { display: flex; gap: 10px; align-items: center; padding: 14px 14px 12px; background: var(--shirt); color: var(--piping); border-radius: 14px 14px 0 0; }
.bubble-head img { height: 50px; width: auto; flex: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
.bubble-head strong { display: block; font-size: 16px; line-height: 1.2; }
.bubble-head span { font-size: 13px; color: rgba(244,241,234,.8); }
.bubble-close { margin-left: auto; appearance: none; border: 0; background: rgba(255,255,255,.12); color: var(--piping); width: 30px; height: 30px; border-radius: 50%; font-size: 18px; line-height: 1; cursor: pointer; flex: none; }
.bubble-close:hover { background: rgba(255,255,255,.22); }
.bubble-body { padding: 14px 16px 16px; }
.say { margin: 0 0 10px; font-size: 15px; }
.bubble textarea {
  width: 100%; min-height: 80px; resize: vertical; font: inherit; font-size: 15px;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--fg);
}
.bubble textarea:focus { outline: 2px solid var(--khaki); outline-offset: 1px; }
.send-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 14px; }
.send-row .btn { font-size: 14px; padding: 10px 12px; border-radius: 10px; }
.contact-list { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: grid; gap: 6px; font-size: 14px; }
.contact-list li { display: grid; grid-template-columns: 86px 1fr; gap: 8px; }
.contact-list .k { color: var(--muted); }
.contact-list a { color: inherit; font-weight: 600; text-decoration: none; border-bottom: 1px dotted var(--muted); }
.contact-list a:hover { color: var(--khaki); }
.motto { margin: 14px 0 0; padding-left: 12px; border-left: 3px solid var(--khaki); font-style: italic; font-size: 14px; color: var(--muted); }

/* ---------- Mobile ---------- */
@media (max-width: 680px) {
  main { padding-top: 20px; }
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .wordmark .name { font-size: 18px; }
  .wordmark img { height: 36px; }
  .topbar .btn .label { display: none; }
  .topbar .btn { padding: 10px 12px; }
  .helper { right: 12px; bottom: 12px; }
  .helper-btn { --size: 76px; }
  .helper-tip { display: none; }
}
@media (max-width: 380px) {
  .wordmark .name { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .helper-head, .helper-btn:hover .helper-head, .helper-head.go { animation: none; }
  .bubble { animation: none; }
  .card, .card:hover, .helper-btn, .helper-btn:hover { transition: none; transform: none; }
}
