/* ============================================
   SOE Website — Practical Psychology for Humans
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --lemon: #FFE135;
  --lemon-light: #FFF9C4;
  --lemon-dark: #F9A825;
  --ink: #1a1a2e;
  --ink-light: #3a3a5e;
  --paper: #FFFDF7;
  --paper-alt: #FFF8E7;
  --accent: #FF6B6B;
  --accent-teal: #2EC4B6;
  --gray-100: #f7f7f7;
  --gray-200: #e8e8e8;
  --gray-400: #999;
  --gray-600: #666;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-width: 1200px;
  --max-width-narrow: 780px;
}

html {
  scroll-behavior: smooth;
  font-size: 18px;
}

body {
  font-family: var(--font-main);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s;
}

img { max-width: 100%; display: block; }

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 { font-size: 3rem; font-weight: 700; }
h2 { font-size: 2.2rem; font-weight: 700; }
h3 { font-size: 1.5rem; font-weight: 600; }
h4 { font-size: 1.15rem; font-weight: 600; }

p { margin-bottom: 1.2em; }

/* --- Utility --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.container--narrow {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
  padding: 0 2rem;
}

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

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 253, 247, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  padding: 0.8rem 0;
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
}

.nav__logo svg {
  width: 36px;
  height: 36px;
}

.nav__links {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}

.nav__links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-light);
  position: relative;
  padding: 0.3rem 0;
}

.nav__links a:hover,
.nav__links a.active {
  color: var(--ink);
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--lemon-dark);
  transition: width 0.3s;
}

.nav__links a:hover::after,
.nav__links a.active::after {
  width: 100%;
}

/* Mobile nav */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
  transition: 0.3s;
}

@media (max-width: 768px) {
  .nav__toggle { display: block; }
  .nav__links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--paper);
    padding: 1.5rem 2rem;
    gap: 1rem;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
  }
  .nav__links.open { display: flex; }
}

/* --- Hero --- */
.hero {
  padding: 6rem 0 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 140%;
  height: 200%;
  background: radial-gradient(ellipse at center top, var(--lemon-light) 0%, transparent 60%);
  z-index: -1;
}

.hero__lemon {
  font-size: 5rem;
  margin-bottom: 1.5rem;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(3deg); }
}

.hero__title {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-size: 1.25rem;
  color: var(--ink-light);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  font-weight: 400;
}

.hero__cta {
  display: inline-flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border-radius: 50px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
}

.btn--primary {
  background: var(--lemon);
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(255, 225, 53, 0.4);
}

.btn--primary:hover {
  background: var(--lemon-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 225, 53, 0.5);
}

.btn--secondary {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--gray-200);
}

.btn--secondary:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}

/* --- Section --- */
.section {
  padding: 5rem 0;
}

.section--alt {
  background: var(--paper-alt);
}

.section__header {
  text-align: center;
  margin-bottom: 3rem;
}

.section__header h2 {
  margin-bottom: 0.75rem;
}

.section__header p {
  color: var(--ink-light);
  font-size: 1.1rem;
  max-width: 550px;
  margin: 0 auto;
}

.section__label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--lemon-dark);
  margin-bottom: 0.75rem;
}

/* --- Card Grid --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
}

@media (max-width: 768px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Blog Card --- */
.blog-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.blog-card__img {
  height: 200px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.blog-card__tag {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--lemon);
  color: var(--ink);
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.blog-card__body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card__title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.blog-card__excerpt {
  color: var(--ink-light);
  font-size: 0.9rem;
  line-height: 1.6;
  flex: 1;
}

.blog-card__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
  font-size: 0.8rem;
  color: var(--gray-400);
}

/* --- Blog Post (Full Article) --- */
.article {
  padding: 4rem 0;
}

.article__header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--gray-200);
}

.article__tag {
  display: inline-block;
  background: var(--lemon);
  color: var(--ink);
  padding: 0.3rem 1rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}

.article__title {
  font-size: 2.8rem;
  margin-bottom: 1rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.article__subtitle {
  font-size: 1.2rem;
  color: var(--ink-light);
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

.article__meta {
  font-size: 0.85rem;
  color: var(--gray-400);
}

.article__content {
  font-size: 1.05rem;
  line-height: 1.8;
}

.article__content h2 {
  margin: 2.5rem 0 1rem;
  font-size: 1.8rem;
}

.article__content h3 {
  margin: 2rem 0 0.75rem;
  font-size: 1.3rem;
}

.article__content blockquote {
  border-left: 4px solid var(--lemon);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--lemon-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--ink-light);
}

.article__content ul, .article__content ol {
  margin: 1rem 0 1.5rem 1.5rem;
}

.article__content li {
  margin-bottom: 0.5rem;
}

.article__content .callout {
  background: var(--paper-alt);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
}

.article__content .callout--study {
  border-left: 4px solid var(--accent-teal);
}

.article__content .callout--snarky {
  border-left: 4px solid var(--accent);
}

.article__content .callout__label {
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
  color: var(--accent-teal);
}

.article__content .callout--snarky .callout__label {
  color: var(--accent);
}

.article__content code {
  font-family: var(--font-mono);
  background: var(--gray-100);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
}

/* --- Glossary --- */
.glossary__search {
  max-width: 500px;
  margin: 0 auto 2rem;
}

.glossary__input {
  width: 100%;
  padding: 1rem 1.5rem;
  border: 2px solid var(--gray-200);
  border-radius: 50px;
  font-family: var(--font-main);
  font-size: 1rem;
  background: white;
  transition: border-color 0.3s;
  outline: none;
}

.glossary__input:focus {
  border-color: var(--lemon-dark);
}

.glossary__filter-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 3rem;
}

.glossary__filter-btn {
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--gray-200);
  border-radius: 50px;
  background: white;
  font-family: var(--font-main);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.glossary__filter-btn:hover,
.glossary__filter-btn.active {
  background: var(--lemon);
  border-color: var(--lemon);
  color: var(--ink);
}

.glossary__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.glossary-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s;
  border-left: 4px solid var(--lemon);
}

.glossary-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.glossary-card__term {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.glossary-card__aka {
  font-size: 0.8rem;
  color: var(--gray-400);
  font-style: italic;
  margin-bottom: 0.5rem;
}

.glossary-card__def {
  font-size: 0.9rem;
  color: var(--ink-light);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.glossary-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.glossary-card__tag {
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  background: var(--lemon-light);
  color: var(--ink-light);
  font-weight: 600;
}

.glossary-card__link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--lemon-dark);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.glossary-card__link:hover {
  color: var(--ink);
}

/* --- About Section --- */
.about__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about__text h2 {
  margin-bottom: 1rem;
}

.about__visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.about__lemon-big {
  font-size: 12rem;
  animation: float 4s ease-in-out infinite;
}

@media (max-width: 768px) {
  .about__content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  .about__lemon-big { font-size: 8rem; }
}

/* --- Featured / Highlight Strip --- */
.highlight-strip {
  background: var(--ink);
  color: white;
  padding: 3rem 0;
  text-align: center;
}

.highlight-strip h2 {
  color: var(--lemon);
  margin-bottom: 0.5rem;
}

.highlight-strip p {
  color: rgba(255,255,255,0.7);
  max-width: 500px;
  margin: 0 auto;
}

/* --- Newsletter --- */
.newsletter {
  background: var(--lemon);
  padding: 4rem 0;
  text-align: center;
  border-radius: 0;
}

.newsletter h2 {
  margin-bottom: 0.5rem;
}

.newsletter p {
  color: var(--ink-light);
  margin-bottom: 2rem;
  max-width: 450px;
  margin-left: auto;
  margin-right: auto;
}

.newsletter__form {
  display: flex;
  gap: 0.75rem;
  max-width: 450px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}

.newsletter__input {
  flex: 1;
  min-width: 200px;
  padding: 0.85rem 1.5rem;
  border: 2px solid var(--ink);
  border-radius: 50px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  background: white;
  outline: none;
}

.newsletter__input:focus {
  box-shadow: 0 0 0 3px rgba(26, 26, 46, 0.2);
}

.newsletter__btn {
  padding: 0.85rem 2rem;
  background: var(--ink);
  color: white;
  border: none;
  border-radius: 50px;
  font-family: var(--font-main);
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
}

.newsletter__btn:hover {
  background: var(--ink-light);
}

/* --- Footer --- */
.footer {
  background: var(--ink);
  color: rgba(255,255,255,0.6);
  padding: 3rem 0;
  text-align: center;
  font-size: 0.85rem;
}

.footer a {
  color: var(--lemon);
}

.footer a:hover {
  color: white;
}

.footer__links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  list-style: none;
  margin-bottom: 1.5rem;
}

/* --- Reading Time Badge --- */
.reading-time {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--gray-400);
}

/* --- Back Link --- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--ink-light);
  margin-bottom: 2rem;
  font-weight: 500;
}

.back-link:hover { color: var(--ink); }

/* --- Responsive typography --- */
@media (max-width: 768px) {
  html { font-size: 16px; }
  h1 { font-size: 2.2rem; }
  .hero__title { font-size: 2.5rem; }
  .article__title { font-size: 2rem; }
  .hero { padding: 4rem 0 3rem; }
  .section { padding: 3rem 0; }
}

/* --- Transition for page loads --- */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
