/* ============================================================
   HSK in a Hurry — Global Stylesheet
   Palette: white, #f8f6fd (light purple), #f8aaa3 (coral),
            #fff3b1 (yellow), #323232 (dark gray)
   Fonts: DM Serif Display (headings), Arimo (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Arimo:ital,wght@0,400;0,600;0,700;1,400&display=swap');

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

:root {
  --white:      #ffffff;
  --purple-bg:  #f8f6fd;
  --coral:      #f8aaa3;
  --yellow:     #fff3b1;
  --dark:       #323232;
  --mid:        #5a5a5a;
  --border:     #e2ddf7;
  --radius:     12px;
  --radius-sm:  8px;
  --shadow:     0 2px 16px rgba(50,50,50,.08);
  --shadow-lg:  0 8px 40px rgba(50,50,50,.12);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Arimo', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--dark);
  background: var(--white);
}

h1, h2, h3, h4 {
  font-family: 'DM Serif Display', Georgia, serif;
  line-height: 1.2;
  color: var(--dark);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Layout helpers ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 80px 0; }
.section--alt { background: var(--purple-bg); }

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: var(--radius);
  font-family: 'Arimo', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform .15s, box-shadow .15s, opacity .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn:active { transform: translateY(0); }
.btn--coral  { background: var(--coral);  color: var(--dark); }
.btn--dark   { background: var(--dark);   color: var(--white); }
.btn--ghost  { background: transparent; border: 2px solid var(--dark); color: var(--dark); }
.btn--full   { width: 100%; text-align: center; }

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.nav__logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.35rem;
  color: var(--dark);
}

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

.nav__links a {
  font-weight: 600;
  font-size: .95rem;
  color: var(--mid);
  transition: color .15s;
}
.nav__links a:hover { color: var(--dark); }

.nav__links .btn { padding: 8px 20px; font-size: .9rem; }

/* ── Hero ── */
.hero {
  background: var(--purple-bg);
  padding: 100px 0 80px;
  text-align: center;
}

.hero__eyebrow {
  display: inline-block;
  background: var(--coral);
  color: var(--dark);
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 100px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  max-width: 700px;
  margin: 0 auto 20px;
}

.hero__sub {
  font-size: 1.2rem;
  color: var(--mid);
  max-width: 520px;
  margin: 0 auto 40px;
}

.hero__cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.hero__badge {
  display: inline-block;
  background: var(--yellow);
  padding: 4px 14px;
  border-radius: 100px;
  font-size: .85rem;
  font-weight: 600;
  margin-top: 32px;
}

/* ── Feature cards ── */
.features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.feature-card__accent {
  height: 8px;
}
.feature-card__accent--coral  { background: var(--coral); }
.feature-card__accent--yellow { background: var(--yellow); }
.feature-card__accent--purple { background: var(--purple-bg); border-bottom: 1px solid var(--border); }

.feature-card__body { padding: 28px; }

.feature-card__icon {
  font-size: 2rem;
  margin-bottom: 14px;
}

.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
}

.feature-card p {
  color: var(--mid);
  font-size: .95rem;
}

/* ── Benefits ── */
.benefits__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

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

.benefits__heading {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  margin-bottom: 20px;
}

.benefits__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.benefits__list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 1rem;
  color: var(--mid);
}

.benefits__list li::before {
  content: '✓';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  min-width: 24px;
  background: var(--coral);
  border-radius: 50%;
  font-size: .75rem;
  font-weight: 700;
  color: var(--dark);
  margin-top: 2px;
}

.benefits__visual {
  background: var(--purple-bg);
  border-radius: var(--radius);
  padding: 48px 40px;
  text-align: center;
  border: 2px solid var(--border);
}

.benefits__visual-number {
  font-family: 'DM Serif Display', serif;
  font-size: 5rem;
  color: var(--coral);
  line-height: 1;
}

.benefits__visual-label {
  font-size: 1.1rem;
  color: var(--mid);
  margin-top: 8px;
}

/* ── Subscribe section ── */
.subscribe {
  background: var(--purple-bg);
  padding: 80px 0;
}

.subscribe__card {
  background: var(--white);
  max-width: 520px;
  margin: 0 auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
}

.subscribe__card h2 {
  font-size: 2rem;
  margin-bottom: 8px;
  text-align: center;
}

.subscribe__card .subtitle {
  text-align: center;
  color: var(--mid);
  margin-bottom: 32px;
}

/* ── Forms ── */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: 6px;
  color: var(--dark);
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Arimo', sans-serif;
  font-size: 1rem;
  color: var(--dark);
  background: var(--white);
  transition: border-color .15s;
  outline: none;
}

.form-group input:focus {
  border-color: var(--coral);
}

.form-group input::placeholder { color: #aaa; }

.form-notice {
  text-align: center;
  font-size: .85rem;
  color: var(--mid);
  margin-top: 14px;
}

.error-msg {
  background: #fff0ef;
  border: 1px solid var(--coral);
  border-radius: var(--radius-sm);
  color: #c0392b;
  padding: 10px 14px;
  font-size: .9rem;
  margin-bottom: 16px;
  display: none;
}
.error-msg.visible { display: block; }

/* ── Footer ── */
.footer {
  background: var(--dark);
  color: rgba(255,255,255,.7);
  padding: 48px 0;
  text-align: center;
}

.footer__logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.4rem;
  color: var(--white);
  margin-bottom: 16px;
}

.footer__links {
  display: flex;
  justify-content: center;
  gap: 24px;
  list-style: none;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.footer__links a {
  color: rgba(255,255,255,.6);
  font-size: .9rem;
  transition: color .15s;
}
.footer__links a:hover { color: var(--white); }

.footer__copy { font-size: .85rem; }

/* ── Page heading ── */
.page-hero {
  background: var(--purple-bg);
  padding: 60px 0 40px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.page-hero h1 { font-size: clamp(1.8rem, 4vw, 3rem); margin-bottom: 10px; }
.page-hero p  { color: var(--mid); }

/* ── Archive ── */
.archive-controls {
  padding: 32px 0 24px;
}

.search-bar {
  display: flex;
  max-width: 440px;
  gap: 0;
}

.search-bar input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  font-family: 'Arimo', sans-serif;
  font-size: 1rem;
  outline: none;
}
.search-bar input:focus { border-color: var(--coral); }

.search-bar button {
  padding: 12px 20px;
  border: 2px solid var(--coral);
  background: var(--coral);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: opacity .15s;
}
.search-bar button:hover { opacity: .85; }

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding-bottom: 80px;
}

.post-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.post-card__accent {
  height: 6px;
}
.post-card__accent--0 { background: var(--coral); }
.post-card__accent--1 { background: var(--yellow); }
.post-card__accent--2 { background: var(--purple-bg); border-bottom: 1px solid var(--border); }

.post-card__body { padding: 22px 24px; }

.post-card__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.tag--coral  { background: var(--coral);  color: var(--dark); }
.tag--yellow { background: var(--yellow); color: var(--dark); }
.tag--purple { background: var(--purple-bg); color: var(--dark); border: 1px solid var(--border); }

.post-card h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
  line-height: 1.35;
}

.post-card__date {
  font-size: .85rem;
  color: var(--mid);
}

/* ── Modal / overlay ── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(50,50,50,.55);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 680px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 40px;
  position: relative;
}

.modal__close {
  position: absolute;
  top: 16px; right: 20px;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--mid);
  background: none;
  border: none;
  line-height: 1;
}
.modal__close:hover { color: var(--dark); }

.modal h2 { margin-bottom: 6px; }
.modal .post-meta { color: var(--mid); font-size: .9rem; margin-bottom: 24px; }
.modal .post-body { font-size: 1rem; line-height: 1.8; }
.modal .post-body h1,
.modal .post-body h2,
.modal .post-body h3 { margin: 24px 0 10px; }
.modal .post-body p  { margin-bottom: 14px; }
.modal .post-body ul,
.modal .post-body ol { padding-left: 24px; margin-bottom: 14px; }

/* ── Auth gate messages ── */
.auth-gate {
  text-align: center;
  padding: 80px 24px;
}
.auth-gate h2  { font-size: 1.8rem; margin-bottom: 12px; }
.auth-gate p   { color: var(--mid); margin-bottom: 28px; }
.auth-gate .actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ── Login / success pages ── */
.centered-page {
  min-height: 100vh;
  background: var(--purple-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
}

.auth-card h1 {
  font-size: 2rem;
  margin-bottom: 6px;
  text-align: center;
}

.auth-card .subtitle {
  text-align: center;
  color: var(--mid);
  margin-bottom: 32px;
}

.auth-card .footer-link {
  text-align: center;
  margin-top: 22px;
  font-size: .9rem;
  color: var(--mid);
}

.auth-card .footer-link a {
  color: var(--dark);
  font-weight: 600;
  text-decoration: underline;
}

/* ── Success page ── */
.success-icon {
  font-size: 4rem;
  text-align: center;
  margin-bottom: 16px;
}

/* ── Spinner ── */
.spinner {
  display: inline-block;
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--coral);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 60px 0;
  color: var(--mid);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .subscribe__card { padding: 32px 24px; }
  .auth-card        { padding: 32px 24px; }
  .modal            { padding: 28px 20px; }
  .nav__links .nav-text { display: none; }
}

/* ── Privacy modal content ── */
.policy-content { font-size: .9rem; color: var(--mid); line-height: 1.7; }
.policy-content h3 { color: var(--dark); margin: 20px 0 8px; font-size: 1rem; }
