:root {
  --linkedin-blue: #0a66c2;
  --linkedin-blue-dark: #004182;
  --bg: #f3f2ef;
  --card-bg: #ffffff;
  --text: #1d2226;
  --text-muted: #56687a;
  --border: #e0dfdc;
  --accent: #d11149;
  --accent-soft: #ffe8ef;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

body.popup-body {
  padding: 24px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

a { color: var(--linkedin-blue); }

/* ---------- Site chrome ---------- */
.site-header {
  background: linear-gradient(135deg, var(--linkedin-blue), var(--linkedin-blue-dark));
  color: white;
  padding: 48px 24px 40px;
  text-align: center;
}
.site-header h1 {
  margin: 0;
  font-size: 32px;
  letter-spacing: -0.5px;
}
.site-header .tagline {
  margin: 10px auto 0;
  max-width: 720px;
  opacity: 0.9;
  font-size: 16px;
}
.site-header .subtitle {
  margin: 16px 0 0;
  opacity: 0.75;
  font-size: 13px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

section { margin-bottom: 56px; }
section h2 {
  font-size: 22px;
  margin: 0 0 16px;
  color: var(--linkedin-blue);
  border-bottom: 2px solid var(--linkedin-blue);
  display: inline-block;
  padding-bottom: 4px;
}

.about p {
  color: var(--text);
  max-width: 760px;
  font-size: 16px;
}

/* ---------- Team ---------- */
.team-photo {
  width: 100%;
  max-width: 800px;
  height: auto;
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: block;
  margin: 0 0 24px;
}
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  max-width: 800px;
}
.team-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.team-name {
  margin: 0;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}
.team-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.team-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--linkedin-blue);
  background: transparent;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.team-link:hover {
  background: #eef3f8;
  color: var(--linkedin-blue-dark);
  border-color: var(--linkedin-blue);
}
.team-link svg { display: block; }

/* ---------- Site nav ---------- */
.site-nav {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.site-nav a {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: white;
  text-decoration: none;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  transition: background 120ms;
}
.site-nav a:hover {
  background: rgba(255, 255, 255, 0.3);
  color: white;
}

/* ---------- Chicken page (shared by /loading and /chicken) ---------- */
.chicken-page {
  background: #fff8e1;
  background-image:
    radial-gradient(circle at 20% 80%, #ffe89a 0%, transparent 40%),
    radial-gradient(circle at 80% 20%, #fff1c1 0%, transparent 40%);
  min-height: 100vh;
  box-sizing: border-box;
  padding: 32px;
  overflow: hidden;
}
.chicken-tracker {
  position: fixed;
  left: 0; top: 0;
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
}
.chicken-face {
  display: inline-block;
  transition: transform 180ms ease;
}
.chicken-body {
  display: inline-block;
  font-size: 56px;
  line-height: 1;
  transform-origin: 50% 100%;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.18));
}
.chicken-tracker.peck .chicken-body {
  animation: peck 320ms ease-in-out infinite;
}
@keyframes peck {
  0%, 100% { transform: rotate(0deg); }
  45%, 55% { transform: rotate(45deg) translate(2px, -2px); }
}
.cluck-burst {
  position: fixed;
  pointer-events: none;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  transform: translate(-50%, 0);
  animation: cluckFloat 900ms ease-out forwards;
  z-index: 9998;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}
@keyframes cluckFloat {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(0.5) rotate(-5deg); }
  30%  { opacity: 1; transform: translate(-50%, -22px) scale(1.15) rotate(5deg); }
  100% { opacity: 0; transform: translate(-50%, -56px) scale(0.9) rotate(0deg); }
}
.egg-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}
.egg {
  position: absolute;
  font-size: 22px;
  animation: bob 4s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.chicken-page main {
  position: relative;
  z-index: 1;
}

/* ---------- Live demo ---------- */
.demo-form textarea {
  width: 100%;
  min-height: 140px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
  resize: vertical;
  background: var(--card-bg);
}
.demo-form textarea:focus {
  outline: none;
  border-color: var(--linkedin-blue);
  box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.15);
}
.demo-form button {
  margin-top: 12px;
  padding: 10px 24px;
  background: var(--linkedin-blue);
  color: white;
  border: none;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background 120ms;
}
.demo-form button:hover:not(:disabled) { background: var(--linkedin-blue-dark); }
.demo-form button:disabled { opacity: 0.6; cursor: progress; }

#demo-output { margin-top: 24px; }
.demo-loading {
  color: var(--text-muted);
  font-style: italic;
  padding: 16px;
  text-align: center;
}
.error {
  padding: 16px 20px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 10px;
  color: var(--accent);
  line-height: 1.6;
}

/* ---------- Meme card (shared by site + popup) ---------- */
.meme-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.meme-col .col-label {
  margin: 0 0 14px;
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.meme-col.right .col-label { color: var(--accent); }
.original-text {
  margin: 0;
  white-space: pre-wrap;
  font-size: 15px;
}

.cliche {
  background: var(--accent-soft);
  border-bottom: 2px dotted var(--accent);
  padding: 0 2px;
  border-radius: 2px;
  cursor: help;
}

.translation-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.category-badge {
  display: inline-block;
  padding: 5px 14px;
  background: var(--accent);
  color: white;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
}
.spice-meter {
  display: flex;
  gap: 3px;
  align-items: center;
}
.spice-tick {
  width: 8px;
  height: 16px;
  border-radius: 2px;
  background: var(--border);
}
.spice-tick.on { background: var(--accent); }
.spice-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 4px;
  letter-spacing: 0.5px;
}

.translation-main {
  margin: 0;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.4;
}

.speak-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px 5px 10px;
  margin-top: 4px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--linkedin-blue);
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.speak-btn:hover { background: #eef3f8; }
.speak-btn:active { background: #d3e3f3; }
.speak-btn.speaking {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}
.speak-btn svg { display: block; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-block;
  padding: 3px 10px;
  background: #eef3f8;
  color: var(--linkedin-blue);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.alts { margin-top: 4px; }
.alts h4 {
  margin: 0 0 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}
.alt {
  margin: 4px 0;
  font-style: italic;
  color: var(--text-muted);
  font-size: 14px;
  padding-left: 10px;
  border-left: 2px solid var(--border);
}

.card-footer {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.caption {
  margin: 0 0 4px;
  font-weight: 600;
  font-size: 14px;
}
.disclaimer {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
}

/* ---------- Install + Changelog ---------- */
.install ol { padding-left: 22px; }
.install li { margin-bottom: 8px; }
.install code {
  background: #eef3f8;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

.changelog ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.changelog li {
  padding: 14px 18px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.changelog .date {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
  padding-top: 2px;
}
.changelog .entry { flex: 1; }

footer {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 13px;
}

@media (max-width: 720px) {
  .meme-card { grid-template-columns: 1fr; }
  .site-header h1 { font-size: 26px; }
}
