/* =====================================================================
   psykhologist.com — Warm IG site styles
   Shared across all pages. See DESIGN.md v2 for the full system.
===================================================================== */

:root {
  --cream-soft: #FBF4E3;
  --cream:      #F4E9CF;
  --blue:       #5BA4C8;
  --blue-deep:  #2E6F90;
  --blue-ink:   #1F4E68;
  --ink:        #23303B;
  --ink-soft:   #52606D;
  --rule:       rgba(46,111,144,0.15);
  --rule-strong:rgba(46,111,144,0.28);
  --accent-warm:#E8B96A;
  --accent-clay:#C97B5C;
  --accent-leaf:#7FA88A;

  --r-sm: 8px;  --r-md: 14px;  --r-lg: 20px;  --r-xl: 28px; --r-full: 9999px;

  --font-display: 'Nunito', system-ui, sans-serif;
  --font-serif:   'Fraunces', 'Times New Roman', serif;
  --font-body:    'Noto Sans TC', 'DM Sans', system-ui, sans-serif;
  --font-mono:    'DM Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--cream-soft);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--blue-ink); text-decoration: none; }
a:hover { color: var(--blue-deep); }

.container { max-width: 1080px; margin: 0 auto; padding: 0 60px; }
.container-wide { max-width: 1180px; margin: 0 auto; padding: 0 60px; }
.section { padding: 100px 0; }
.section-blue { background: var(--blue); color: var(--cream-soft); position: relative; overflow: hidden; }
.section-cream { background: var(--cream); }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 800; color: var(--blue-ink); margin: 0; line-height: 1.25; letter-spacing: -0.005em; }
h1 { font-size: 56px; line-height: 1.15; }
h2 { font-size: 36px; }
h3 { font-size: 22px; }
.section-blue h1, .section-blue h2, .section-blue h3 { color: var(--cream-soft); }

p { margin: 0 0 18px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--blue-deep);
}
.eyebrow::before { content: ""; width: 24px; height: 1.5px; background: currentColor; }
.section-blue .eyebrow { color: rgba(251,244,227,0.85); }

.serif-italic { font-family: var(--font-serif); font-style: italic; font-weight: 400; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px;
  border-radius: var(--r-full);
  font-family: var(--font-display); font-weight: 800; font-size: 15px;
  text-decoration: none;
  transition: transform 180ms cubic-bezier(0,0,0.2,1), box-shadow 180ms;
  border: none; cursor: pointer;
}
.btn-primary { background: var(--blue); color: var(--cream-soft); }
.btn-primary:hover { background: var(--blue-deep); color: var(--cream-soft); transform: translateY(-1px); }
.btn-on-blue { background: var(--cream-soft); color: var(--blue-ink); }
.btn-on-blue:hover { background: white; color: var(--blue-ink); transform: translateY(-1px); }
.btn-ghost {
  padding: 14px 24px; color: var(--blue-ink); font-weight: 700; font-family: var(--font-display);
  text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--rule-strong);
}
.btn-outline {
  background: transparent; border: 1.5px solid var(--rule-strong); color: var(--blue-ink);
}
.btn-outline:hover { border-color: var(--blue-deep); }

/* Pills */
.pill {
  display: inline-flex; align-items: center;
  padding: 6px 14px; border-radius: var(--r-full);
  font-weight: 700; font-size: 13px;
  border: 1.5px solid var(--rule-strong); color: var(--blue-deep);
  background: transparent;
}
/* legacy class — kept for back-compat but no longer applied to chips */
.pill-filled { background: transparent; color: var(--blue-ink); border-color: var(--line); }
.pill-warm   { background: var(--accent-warm); color: var(--blue-ink); border-color: transparent; }
.pill-leaf   { background: var(--accent-leaf); color: var(--cream-soft); border-color: transparent; }

/* Hover-fill: consistent cream pill that turns blue on hover */
.pill { transition: background 220ms, color 220ms, border-color 220ms, transform 220ms; cursor: default; }
.pill:hover { background: var(--blue); color: var(--cream-soft); border-color: transparent; transform: translateY(-2px); }

/* ============== Scroll-triggered motion ==============
   Add `data-reveal` to any element. JS adds .is-visible when it scrolls in. */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 800ms cubic-bezier(.22,.61,.36,1), transform 900ms cubic-bezier(.22,.61,.36,1);
  will-change: opacity, transform;
}
[data-reveal="fade"]      { transform: none; }
[data-reveal="left"]      { transform: translateX(-32px); }
[data-reveal="right"]     { transform: translateX(32px); }
[data-reveal="scale"]     { transform: scale(0.96); }
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
/* Stagger helpers: add data-reveal-delay="1..6" on children */
[data-reveal-delay="1"] { transition-delay: 80ms; }
[data-reveal-delay="2"] { transition-delay: 160ms; }
[data-reveal-delay="3"] { transition-delay: 240ms; }
[data-reveal-delay="4"] { transition-delay: 320ms; }
[data-reveal-delay="5"] { transition-delay: 400ms; }
[data-reveal-delay="6"] { transition-delay: 480ms; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ============== NAV ============== */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 60px;
  background: var(--cream-soft);
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 100;
}
.nav-brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.nav-brand img { width: 52px; height: 52px; border-radius: 50%; }
.nav-brand .name {
  font-family: var(--font-display); font-weight: 800; font-size: 17px; color: var(--blue-ink); line-height: 1.1;
}
.nav-brand .sub {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--blue-deep); opacity: 0.75; margin-top: 3px;
}
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
  font-size: 14px; font-weight: 600; color: var(--blue-ink); text-decoration: none;
  position: relative; padding: 4px 0;
}
.nav-links a:hover { color: var(--blue-deep); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--blue); border-radius: 2px;
}
.nav-right { display: flex; align-items: center; gap: 16px; }
.lang-toggle {
  font-family: var(--font-mono); font-size: 12px; color: var(--blue-deep);
  background: none; border: none; cursor: pointer; letter-spacing: 0.08em;
}

/* ============== FOOTER ============== */
.footer {
  background: var(--cream);
  padding: 72px 60px 28px;
  border-top: 1px solid var(--rule);
  position: relative; overflow: hidden;
}
.footer-grid {
  max-width: 1080px; margin: 0 auto;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px;
  align-items: start;
}
.footer-brand img { width: 220px; }
.footer-brand p { margin-top: 18px; font-size: 13px; color: var(--ink-soft); line-height: 1.75; max-width: 320px; }
.footer-brand .tagline {
  font-family: var(--font-serif); font-style: italic; font-size: 16px; color: var(--blue-ink);
}
.footer-col h4 {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--blue-deep); margin: 0 0 14px; font-weight: 600;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; font-size: 14px; line-height: 2.1; color: var(--ink); }
.footer-col a { color: var(--ink); }
.footer-col a:hover { color: var(--blue-deep); }
.footer-social { display: flex; gap: 8px; margin-top: 18px; }
.footer-social a {
  width: 38px; height: 38px; border-radius: 12px;
  border: 1px solid var(--rule-strong); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--blue-ink);
}
.footer-social a:hover { background: var(--blue); color: var(--cream-soft); border-color: transparent; }
.footer-bottom {
  max-width: 1080px; margin: 50px auto 0; padding-top: 22px;
  border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); letter-spacing: 0.1em;
}

/* ============== UTILITIES ============== */
.cream-card {
  background: var(--cream-soft);
  border-radius: var(--r-xl);
  padding: 36px;
  position: relative;
  border: 1px solid var(--rule);
}
.cream-card-flat {
  background: var(--cream-soft);
  border-radius: var(--r-lg);
  padding: 28px;
  border: 1px solid var(--rule);
}
.tag-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* Decorative SVG inline helpers (sized via height attr) */
.deco { display: block; }
.deco-tr { position: absolute; top: 24px; right: 32px; opacity: 0.7; }
.deco-tl { position: absolute; top: 24px; left: 32px; opacity: 0.55; }
.deco-bl { position: absolute; bottom: 32px; left: 32px; opacity: 0.6; }

/* Photo placeholders (until real assets supplied) */
.photo-ph {
  background: repeating-linear-gradient(45deg, #E8DBBE 0 8px, #EFE3C7 8px 16px);
  border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  color: var(--blue-ink);
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  border: 1px dashed var(--rule-strong);
  aspect-ratio: 4 / 5;
}
.photo-ph.tall { aspect-ratio: 3 / 4; }
.photo-ph.wide { aspect-ratio: 16 / 9; }
.photo-ph.square { aspect-ratio: 1 / 1; }

/* Numbered card */
.num-card {
  background: var(--cream);
  border-radius: var(--r-lg);
  padding: 30px;
  display: flex; flex-direction: column; gap: 12px;
  position: relative; overflow: hidden;
}
.num-card .num {
  font-family: var(--font-display); font-weight: 800; font-size: 13px;
  letter-spacing: 0.06em; color: var(--blue-deep);
}
.num-card.featured { background: var(--blue); color: var(--cream-soft); }
.num-card.featured .num,
.num-card.featured h3 { color: var(--cream-soft); }
.num-card.featured p { color: rgba(251,244,227,0.92); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  color: var(--blue-deep); letter-spacing: 0.06em;
}
.field input, .field textarea, .field select {
  padding: 14px 16px;
  background: var(--cream-soft);
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--r-md);
  font-family: var(--font-body); font-size: 15px; color: var(--ink);
  transition: border-color 180ms;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--blue);
}
.field textarea { min-height: 140px; resize: vertical; line-height: 1.7; }

/* Mobile */
@media (max-width: 900px) {
  .container, .container-wide { padding: 0 24px; }
  .section { padding: 64px 0; }
  .nav { padding: 16px 20px; flex-wrap: wrap; gap: 12px; }
  .nav-brand img { width: 44px; height: 44px; }
  .nav-brand .name { font-size: 15px; }
  .nav-links { width: 100%; flex-wrap: wrap; gap: 10px 16px; font-size: 13px; order: 3; }
  .nav-right { gap: 10px; }
  .nav-right .btn { padding: 10px 18px; font-size: 13px; }
  h1 { font-size: 36px; line-height: 1.2; }
  h2 { font-size: 26px; }
  h3 { font-size: 20px; }
  .footer { padding: 48px 20px 24px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 10px; align-items: flex-start; padding-top: 18px; }
  .btn { padding: 12px 22px; font-size: 14px; }
}
@media (max-width: 600px) {
  body { font-size: 15px; }
  h1 { font-size: 30px; }
  h2 { font-size: 22px; }
  .section { padding: 48px 0; }
  .container, .container-wide { padding: 0 18px; }
  .nav { padding: 14px 16px; }
}
