/* ============================================================
   Connection Notebook — Styles
   Design Concept: "Woven Pages" — Editorial warmth meets
   modern boldness. Serif headings, node-network hero,
   page-curl cards, reading-progress on articles.
   ============================================================ */

/* --- Custom Properties --- */
:root {
  --primary:    #2C3E50;
  --secondary:  #E67E22;
  --accent:     #27AE60;
  --background: #F9F9F9;
  --text:       #333333;
  --white:      #ffffff;
  --card-bg:    #ffffff;
  --border:     rgba(44, 62, 80, 0.12);
  --shadow-sm:  0 2px 12px rgba(44, 62, 80, 0.08);
  --shadow-md:  0 6px 28px rgba(44, 62, 80, 0.14);
  --shadow-lg:  0 12px 48px rgba(44, 62, 80, 0.2);
  --radius:     10px;
  --transition: 0.28s ease;
}

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--primary);
  line-height: 1.28;
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.05rem, 2vw, 1.35rem); }

p { margin-bottom: 1.25em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--secondary);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--primary); }

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

ul, ol { list-style: none; }

/* --- Layout --- */
.wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
}

.text-content {
  max-width: 780px;
  margin: 0 auto;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.22);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  max-width: 1200px;
  margin: 0 auto;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-link img {
  height: 46px;
  width: auto;
  filter: invert(1);
}

/* --- Desktop Nav --- */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-menu li a {
  display: block;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.93rem;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 6px;
  position: relative;
  transition: color var(--transition), background var(--transition);
  letter-spacing: 0.01em;
}

.nav-menu li a::after {
  content: '';
  position: absolute;
  bottom: 5px;
  left: 18px;
  right: 18px;
  height: 2px;
  background: var(--secondary);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s ease;
  border-radius: 1px;
}

.nav-menu li a:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.07);
}

.nav-menu li a:hover::after {
  transform: scaleX(1);
}

.nav-menu li a.active {
  color: var(--secondary);
}

.nav-menu li a.active::after {
  transform: scaleX(1);
}

/* --- Hamburger --- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  transition: background var(--transition);
}

.hamburger:hover {
  background: rgba(255, 255, 255, 0.1);
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Mobile Nav --- */
.mobile-nav {
  display: none;
  background: var(--primary);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-nav.open {
  display: block;
}

.mobile-nav ul {
  padding: 6px 28px 18px;
}

.mobile-nav ul li a {
  display: block;
  padding: 13px 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  transition: color var(--transition), padding-left var(--transition);
}

.mobile-nav ul li:last-child a {
  border-bottom: none;
}

.mobile-nav ul li a:hover {
  color: var(--secondary);
  padding-left: 10px;
}

/* ============================================================
   HERO — index page
   ============================================================ */
.hero {
  position: relative;
  background: var(--primary);
  overflow: hidden;
  min-height: 460px;
  display: flex;
  align-items: center;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.45;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding: 72px 0 64px;
  max-width: 680px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: rgba(230, 126, 34, 0.14);
  border: 1px solid rgba(230, 126, 34, 0.38);
  border-radius: 100px;
  padding: 5px 16px 5px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 22px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-tag-dot {
  width: 8px;
  height: 8px;
  background: var(--secondary);
  border-radius: 50%;
  animation: tag-pulse 2.2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes tag-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.45; transform: scale(1.35); }
}

.hero h1 {
  color: var(--white);
  margin-bottom: 20px;
}

.hero h1 em {
  font-style: normal;
  color: var(--secondary);
  position: relative;
}

.hero-sub {
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 0;
}

/* ============================================================
   INDEX PAGE — Main text block
   ============================================================ */
.index-intro {
  padding: 64px 0 48px;
}

.index-intro p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
}

.index-intro img {
  margin: 36px auto;
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  width: 100%;
  max-height: 500px;
  object-fit: cover;
}

/* ============================================================
   SECTION HEADER with accent bar
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 44px;
}

.section-header-bar {
  width: 4px;
  height: 42px;
  background: linear-gradient(180deg, var(--secondary), var(--accent));
  border-radius: 2px;
  flex-shrink: 0;
}

.section-header h2 {
  margin: 0;
}

.section-header p {
  font-size: 1rem;
  color: var(--text);
  margin: 6px 0 0;
  opacity: 0.8;
}

/* ============================================================
   SCIENCE SECTION (adding-section)
   ============================================================ */
.science-section {
  padding: 72px 0;
  background: var(--white);
}

.science-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.science-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid var(--border);
}

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

/* Page-curl effect — unique feature */
.science-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 0;
  background: linear-gradient(
    225deg,
    var(--background) 44%,
    rgba(44, 62, 80, 0.1) 50%,
    var(--secondary) 51%
  );
  transition: width 0.3s ease, height 0.3s ease;
  border-radius: 4px 0 var(--radius) 0;
}

.science-card:hover::after {
  width: 40px;
  height: 40px;
}

.science-card-media {
  height: 196px;
  overflow: hidden;
}

.science-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  transition: transform 0.45s ease;
}

.science-card:hover .science-card-media img {
  transform: scale(1.06);
}

.science-card-body {
  padding: 22px 22px 26px;
}

.science-card-body h3 {
  color: var(--primary);
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.science-card-body p {
  font-size: 0.93rem;
  color: var(--text);
  margin: 0;
  line-height: 1.65;
}

/* ============================================================
   FEATURE BLOCKS (adding-blocks)
   ============================================================ */
.features-section {
  padding: 72px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.feature-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px 20px 26px;
  text-align: center;
  border-bottom: 3px solid transparent;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
  border-bottom-color: var(--secondary);
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.feature-icon-wrap {
  width: 66px;
  height: 66px;
  background: rgba(230, 126, 34, 0.09);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  padding: 14px;
  transition: background var(--transition);
}

.feature-card:hover .feature-icon-wrap {
  background: rgba(230, 126, 34, 0.17);
}

.feature-icon-wrap img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.feature-card h3 {
  font-size: 0.98rem;
  color: var(--primary);
  margin-bottom: 9px;
  font-weight: 700;
}

.feature-card p {
  font-size: 0.86rem;
  color: var(--text);
  margin: 0;
  line-height: 1.6;
}

/* ============================================================
   FAQ SECTION (adding-faq)
   ============================================================ */
.faq-section {
  padding: 72px 0;
  background: var(--primary);
}

.faq-section .section-header-bar {
  background: linear-gradient(180deg, var(--secondary), rgba(230,126,34,0.4));
}

.faq-section .section-header h2 {
  color: var(--white);
}

.faq-list {
  display: flex;
  flex-direction: column;
}

.faq-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 22px 0;
  transition: padding-left var(--transition);
}

.faq-item:first-child {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.faq-item h3 {
  font-size: 1.08rem;
  color: var(--secondary);
  margin-bottom: 10px;
  font-weight: 700;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.faq-item h3::before {
  content: '';
  display: block;
  width: 7px;
  height: 7px;
  background: var(--secondary);
  border-radius: 50%;
  margin-top: 7px;
  flex-shrink: 0;
}

.faq-item p {
  font-size: 0.97rem;
  color: rgba(255, 255, 255, 0.76);
  padding-left: 19px;
  margin: 0;
}

/* ============================================================
   ARTICLES LIST PAGE
   ============================================================ */
.page-hero {
  background: var(--primary);
  padding: 64px 0 56px;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 340px;
  height: 340px;
  background: rgba(230, 126, 34, 0.07);
  border-radius: 50%;
  pointer-events: none;
}

.page-hero::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: 40%;
  width: 220px;
  height: 220px;
  background: rgba(39, 174, 96, 0.05);
  border-radius: 50%;
  pointer-events: none;
}

.page-hero h1 {
  color: var(--white);
  position: relative;
  z-index: 1;
}

.page-hero p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 1.05rem;
  margin-top: 14px;
  margin-bottom: 0;
  position: relative;
  z-index: 1;
}

/* Articles list */
.articles-section {
  padding: 64px 0 80px;
}

.articles-list {
  display: flex;
  flex-direction: column;
}

.article-row {
  display: grid;
  grid-template-columns: 64px 1fr 32px;
  gap: 0 20px;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background var(--transition);
  border-radius: 6px;
  margin: 0 -12px;
  padding-left: 12px;
  padding-right: 12px;
}

.article-row:first-child {
  border-top: 1px solid var(--border);
}

.article-row:hover {
  background: rgba(230, 126, 34, 0.04);
}

.article-row-num {
  font-family: Georgia, serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: rgba(230, 126, 34, 0.18);
  line-height: 1;
  transition: color var(--transition);
  user-select: none;
}

.article-row:hover .article-row-num {
  color: var(--secondary);
}

.article-row-title {
  font-family: Georgia, serif;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  font-weight: 700;
  color: var(--primary);
  line-height: 1.35;
  transition: color var(--transition);
}

.article-row:hover .article-row-title {
  color: var(--secondary);
}

.article-row-arrow {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary);
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.article-row:hover .article-row-arrow {
  background: var(--secondary);
  border-color: var(--secondary);
  color: var(--white);
  transform: translateX(4px);
}

/* ============================================================
   ARTICLE PAGE
   ============================================================ */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--secondary), var(--accent));
  z-index: 200;
  width: 0%;
  transition: width 0.1s linear;
}

.article-hero {
  background: var(--primary);
  padding: 52px 0 48px;
  position: relative;
  overflow: hidden;
}

.article-hero::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 280px;
  height: 280px;
  background: rgba(230, 126, 34, 0.06);
  border-radius: 50%;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.88rem;
  margin-bottom: 24px;
  transition: color var(--transition), gap var(--transition);
  position: relative;
  z-index: 1;
}

.back-link:hover {
  color: var(--secondary);
  gap: 11px;
}

.back-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.article-hero h1 {
  color: var(--white);
  position: relative;
  z-index: 1;
}

.article-body {
  padding: 60px 0 80px;
}

.article-body h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  margin: 2.2em 0 0.85em;
  padding-left: 18px;
  border-left: 3px solid var(--secondary);
  color: var(--primary);
}

.article-body h2:first-child {
  margin-top: 0;
}

.article-body p {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text);
}

.article-body img {
  margin: 36px auto;
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  width: 100%;
}

/* ============================================================
   COMMUNICATION STYLES PAGE (3rd page)
   ============================================================ */
.comm-hero {
  background: var(--primary);
  padding: 64px 0 56px;
  position: relative;
  overflow: hidden;
}

.comm-hero::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 300px;
  height: 300px;
  background: rgba(39, 174, 96, 0.07);
  border-radius: 50%;
}

.comm-hero h1 {
  color: var(--white);
  position: relative;
  z-index: 1;
}

.comm-body {
  padding: 60px 0 80px;
}

.comm-body p {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text);
}

.comm-body img {
  margin: 36px auto;
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  width: 100%;
}

/* Communication info-cards (replacing inline styles from JSON) */
.comm-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--white);
  padding: 22px 24px;
  border-radius: var(--radius);
  margin-top: 28px;
  border-left: 4px solid var(--secondary);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.comm-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

.comm-card .comm-card-icon {
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 8px;
  margin: 0;
  box-shadow: none;
}

.comm-card-content h3 {
  font-size: 1.1rem;
  color: var(--primary);
  margin: 0 0 7px;
  font-weight: 700;
}

.comm-card-content p {
  margin: 0;
  color: var(--text);
  font-size: 0.96rem;
  line-height: 1.65;
}

/* Communication styles spectrum — visual section */
.comm-spectrum {
  padding: 64px 0;
  background: var(--white);
}

.comm-spectrum-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}

.comm-style-card {
  border-radius: var(--radius);
  padding: 28px 22px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.comm-style-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.comm-style-card--direct {
  background: rgba(44, 62, 80, 0.06);
  border-top: 4px solid var(--primary);
}

.comm-style-card--empathic {
  background: rgba(230, 126, 34, 0.07);
  border-top: 4px solid var(--secondary);
}

.comm-style-card--analytical {
  background: rgba(39, 174, 96, 0.07);
  border-top: 4px solid var(--accent);
}

.comm-style-card h3 {
  font-size: 1rem;
  margin-bottom: 10px;
}

.comm-style-card p {
  font-size: 0.9rem;
  color: var(--text);
  margin: 0;
  line-height: 1.6;
  opacity: 0.85;
}

.comm-style-icon {
  font-size: 2.2rem;
  margin-bottom: 14px;
  display: block;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--primary);
  color: rgba(255, 255, 255, 0.75);
  padding: 52px 0 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 40px;
  align-items: start;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.footer-logo-link img {
  height: 40px;
  width: auto;
  filter: invert(1);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 28px;
  align-self: center;
  padding-left: 8px;
}

.footer-nav li a {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.92rem;
  transition: color var(--transition);
  position: relative;
}

.footer-nav li a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--secondary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.footer-nav li a:hover {
  color: var(--secondary);
}

.footer-nav li a:hover::after {
  transform: scaleX(1);
}

.footer-copy {
  font-size: 0.82rem;
  opacity: 0.55;
  align-self: center;
  text-align: right;
  white-space: nowrap;
}

.footer-bottom {
  padding: 18px 0;
  text-align: center;
  font-size: 0.78rem;
  opacity: 0.4;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }

  .footer-copy {
    grid-column: 1 / -1;
    text-align: left;
  }
}

@media (max-width: 860px) {
  .science-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .comm-spectrum-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .nav-menu  { display: none; }
  .hamburger { display: flex; }

  .hero-inner { padding: 52px 0 48px; }

  .science-grid { grid-template-columns: 1fr; }

  .features-grid { grid-template-columns: 1fr 1fr; }

  .article-row {
    grid-template-columns: 48px 1fr 28px;
  }

  .comm-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-copy {
    grid-column: auto;
    text-align: left;
  }
}

@media (max-width: 520px) {
  .wrapper { padding: 0 18px; }

  .features-grid { grid-template-columns: 1fr; }

  .comm-spectrum-grid { grid-template-columns: 1fr; }

  .article-row {
    grid-template-columns: 40px 1fr;
  }

  .article-row-arrow { display: none; }

  .hero-inner { padding: 44px 0 40px; }
}
