/* =============================================
   Engineer Book Guide - Premium Stylesheet
   テーマ: 技術者の書斎 / Dark Forest × Gold
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Zen+Antique+Soft&family=Noto+Sans+JP:wght@300;400;500;700&family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400&display=swap');

/* ── CSS Variables ── */
:root {
  --forest:    #1a2e1f;
  --forest-mid:#243828;
  --forest-lt: #2f4d34;
  --gold:      #c9a84c;
  --gold-lt:   #e8c97a;
  --cream:     #f5f0e8;
  --cream-dk:  #ede5d8;
  --ink:       #1c1c1c;
  --ink-soft:  #3d3d3d;
  --muted:     #7a7a6e;
  --white:     #ffffff;
  --shadow:    rgba(0,0,0,0.15);
  --card-bg:   #ffffff;
  --radius:    12px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.8;
  font-size: 15px;
}

/* ── Noise texture overlay ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ── Header ── */
.site-header {
  background: var(--forest);
  border-bottom: 2px solid var(--gold);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}

.site-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.site-header h1 a {
  color: var(--gold);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color var(--transition);
}

.site-header h1 a:hover { color: var(--gold-lt); }

.site-nav {
  display: flex;
  gap: 4px;
}

.site-nav a {
  color: var(--cream);
  text-decoration: none;
  font-size: 0.8rem;
  padding: 6px 14px;
  border-radius: 20px;
  transition: all var(--transition);
  border: 1px solid transparent;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.site-nav a:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201,168,76,0.08);
}

/* ── Hero ── */
.hero {
  background: var(--forest);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(201,168,76,0.12) 0%, transparent 70%),
    linear-gradient(160deg, var(--forest) 0%, var(--forest-mid) 100%);
  color: var(--cream);
  text-align: center;
  padding: 90px 24px 80px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '📚';
  position: absolute;
  font-size: 260px;
  top: -40px;
  left: -40px;
  opacity: 0.04;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.hero-eyebrow {
  display: inline-block;
  background: rgba(201,168,76,0.15);
  border: 1px solid rgba(201,168,76,0.4);
  color: var(--gold);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 5px 16px;
  border-radius: 20px;
  margin-bottom: 22px;
  font-weight: 500;
}

.hero h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 600;
  line-height: 1.4;
  color: var(--white);
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.hero h2 em {
  font-style: italic;
  color: var(--gold);
}

.hero p {
  font-size: 1rem;
  color: rgba(245,240,232,0.75);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.9;
}

.hero-stats {
  display: flex;
  gap: 36px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
}

.hero-stat strong {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  color: var(--gold);
  font-weight: 600;
  line-height: 1;
  margin-bottom: 4px;
}

.hero-stat span {
  font-size: 0.75rem;
  color: rgba(245,240,232,0.6);
  letter-spacing: 0.08em;
}

/* ── Section Titles ── */
.section-label {
  text-align: center;
  margin-bottom: 40px;
}

.section-label h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--forest);
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.section-label p {
  color: var(--muted);
  font-size: 0.9rem;
}

.section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 auto 10px;
  width: fit-content;
}

.section-divider::before,
.section-divider::after {
  content: '';
  width: 40px;
  height: 1px;
  background: var(--gold);
}

.section-divider span {
  color: var(--gold);
  font-size: 1rem;
}

/* ── Index Article Grid ── */
.articles-section {
  padding: 70px 0;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
}

.article-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 20px var(--shadow);
  border: 1px solid rgba(201,168,76,0.1);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}

.article-card-header {
  background: var(--forest-mid);
  padding: 22px 42px 16px;
  position: relative;
  overflow: hidden;
}

.article-card-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.article-card-cover {
  width: 80px;
  height: 110px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 4px 4px 16px rgba(0,0,0,0.4);
  margin-bottom: 14px;
}

.article-card-badge {
  display: inline-block;
  background: rgba(201,168,76,0.2);
  border: 1px solid rgba(201,168,76,0.5);
  color: var(--gold-lt);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 12px;
  margin-bottom: 10px;
}

.article-card-header h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.4;
  margin-bottom: 6px;
}

.article-card-body {
  padding: 18px 22px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-card-body p {
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.75;
  flex: 1;
  margin-bottom: 16px;
}

.article-card .target {
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--cream-dk);
  padding: 4px 10px;
  border-radius: 6px;
  display: block;
  margin-bottom: 10px;
  border-left: 2px solid var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Buttons ── */
.btn-primary {
  display: inline-block;
  background: var(--forest);
  color: var(--gold);
  padding: 11px 22px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: all var(--transition);
  border: 1px solid var(--gold);
  text-align: center;
}

.btn-primary:hover {
  background: var(--gold);
  color: var(--forest);
  transform: translateX(2px);
}

.btn-amazon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #ff9900, #ffb732);
  color: var(--forest);
  padding: 11px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  transition: all var(--transition);
  box-shadow: 0 3px 12px rgba(255,153,0,0.3);
  margin-top: 10px;
}

.btn-amazon:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255,153,0,0.45);
  filter: brightness(1.05);
}

.btn-amazon::before { content: '🛒'; font-size: 1rem; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--forest);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 8px 0;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), gap var(--transition);
}

.btn-secondary:hover {
  border-bottom-color: var(--forest);
  gap: 10px;
}

/* ── Article Page ── */
.article-page {
  padding: 50px 0 80px;
}

.article-page-header {
  margin-bottom: 48px;
}

.article-page-header .eyebrow {
  display: inline-block;
  background: var(--forest);
  color: var(--gold);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
  font-weight: 500;
}

.article-page-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.7rem, 3.5vw, 2.5rem);
  font-weight: 600;
  color: var(--forest);
  line-height: 1.35;
  margin-bottom: 14px;
  letter-spacing: 0.01em;
}

.article-page-header .lead {
  color: var(--ink-soft);
  font-size: 0.95rem;
  max-width: 640px;
  line-height: 2;
  border-left: 3px solid var(--gold);
  padding-left: 18px;
}

/* ── Book Cards (Article Pages) ── */
.book-list { display: flex; flex-direction: column; gap: 32px; }

.book-card {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 28px;
  background: var(--card-bg);
  padding: 28px;
  border-radius: var(--radius);
  box-shadow: 0 2px 20px var(--shadow);
  border: 1px solid rgba(201,168,76,0.12);
  border-left: 4px solid var(--gold);
  transition: transform var(--transition), box-shadow var(--transition);
  align-items: start;
}

.book-card:hover {
  transform: translateX(4px);
  box-shadow: 0 8px 36px rgba(0,0,0,0.15);
}

.book-card-rank {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.8rem;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.book-card-rank::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
  opacity: 0.4;
}

.book-card img {
  width: 130px;
  border-radius: 6px;
  box-shadow: 4px 6px 24px rgba(0,0,0,0.2);
  display: block;
  transition: transform var(--transition);
}

.book-card:hover img { transform: rotate(-1deg) scale(1.03); }

.book-card-body h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--forest);
  line-height: 1.35;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.book-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.book-card-tag {
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.tag-engineer { color: var(--forest); border-color: var(--forest); background: rgba(26,46,31,0.06); }
.tag-thinking { color: #6b4200; border-color: #c47a00; background: rgba(196,122,0,0.07); }
.tag-career   { color: #1a2e5a; border-color: #2563eb; background: rgba(37,99,235,0.07); }

.book-card-body p {
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.85;
  margin-bottom: 10px;
}

.book-card-point {
  background: var(--cream-dk);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.83rem;
  color: var(--forest-mid);
  margin-bottom: 14px;
  display: flex;
  gap: 8px;
}

.book-card-point::before { content: '💡'; flex-shrink: 0; }

/* ── CTA Banner ── */
.cta-banner {
  background: var(--forest);
  border-radius: var(--radius);
  padding: 40px 36px;
  text-align: center;
  margin: 60px 0 0;
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at 50% 120%, rgba(201,168,76,0.15), transparent 70%);
}

.cta-banner h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  color: var(--white);
  margin-bottom: 10px;
  position: relative;
}

.cta-banner p {
  color: rgba(245,240,232,0.7);
  font-size: 0.88rem;
  margin-bottom: 22px;
  position: relative;
}

.cta-banner .btn-amazon {
  font-size: 1rem;
  padding: 14px 32px;
  position: relative;
}

/* ── Affiliate Notice ── */
.affiliate-notice {
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 32px 0 0;
  text-align: center;
  line-height: 1.7;
}

/* ── Footer ── */
.site-footer {
  background: var(--forest);
  color: rgba(245,240,232,0.6);
  text-align: center;
  padding: 48px 24px 32px;
  margin-top: 0;
  border-top: 2px solid rgba(201,168,76,0.3);
}

.site-footer .footer-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  color: var(--gold);
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}

.site-footer p {
  font-size: 0.8rem;
  margin-top: 8px;
}

.site-footer .footer-links {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin: 16px 0;
  flex-wrap: wrap;
}

.site-footer .footer-links a {
  color: rgba(245,240,232,0.5);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color var(--transition);
}

.site-footer .footer-links a:hover { color: var(--gold); }

.back-top {
  text-align: center;
  padding: 20px;
  background: var(--cream);
}

/* ── Mobile ── */
@media (max-width: 700px) {
  .site-nav { display: none; }

  .book-card {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .book-card img { width: 100px; }

  .hero { padding: 60px 20px 52px; }

  .hero-stats { gap: 20px; }
}

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero h2, .hero p, .hero-stats {
  animation: fadeInUp 0.7s ease both;
}

.hero p { animation-delay: 0.1s; }
.hero-stats { animation-delay: 0.2s; }

.article-card { animation: fadeInUp 0.5s ease both; }
.article-card:nth-child(2) { animation-delay: 0.1s; }
.article-card:nth-child(3) { animation-delay: 0.2s; }
.article-card:nth-child(4) { animation-delay: 0.3s; }