/* =========================================================
   AI Career Journal — Design System
   Strict black & white editorial / magazine style
   (inspired by panorama-template.webflow.io)
   Color images are allowed only inside article media.
   ========================================================= */

:root {
  --black: #000000;
  --white: #ffffff;
  --ink: #0a0a0a;
  --paper: #ffffff;
  --gray-900: #111111;
  --gray-700: #333333;
  --gray-500: #6b6b6b;
  --gray-400: #8a8a8a;
  --gray-300: #d4d4d4;
  --gray-200: #e6e6e6;
  --gray-100: #f4f4f4;
  --line: #000000;

  --font-serif: "Times New Roman", Georgia, "Playfair Display", serif;
  --font-sans: "Helvetica Neue", Arial, "Inter", system-ui, sans-serif;
  --font-mono: "SFMono-Regular", "Roboto Mono", ui-monospace, monospace;

  --container: 1240px;
  --gap: 24px;
  --radius: 0px;

  --step-1: clamp(0.78rem, 0.9vw, 0.85rem);
  --step0: clamp(0.95rem, 1vw, 1rem);
  --step1: clamp(1.1rem, 1.4vw, 1.25rem);
  --step2: clamp(1.4rem, 2.2vw, 1.9rem);
  --step3: clamp(1.9rem, 3.4vw, 2.9rem);
  --step4: clamp(2.6rem, 6vw, 5rem);
  --step5: clamp(3.4rem, 9vw, 7.5rem);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  font-size: var(--step0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, picture, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 48px);
}
.section { padding-block: clamp(48px, 7vw, 96px); }
.section--tight { padding-block: clamp(32px, 4vw, 56px); }
.border-top { border-top: 1px solid var(--line); }
.border-bottom { border-bottom: 1px solid var(--line); }
.stack > * + * { margin-top: 1rem; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 700; line-height: 1.05; letter-spacing: -0.01em; }
.display { font-size: var(--step5); line-height: 0.92; letter-spacing: -0.03em; text-transform: uppercase; }
h1 { font-size: var(--step4); }
h2 { font-size: var(--step3); }
h3 { font-size: var(--step2); }
p { font-size: var(--step0); }
.lead { font-size: var(--step1); line-height: 1.5; color: var(--gray-700); }

.eyebrow, .kicker {
  font-family: var(--font-mono);
  font-size: var(--step-1);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--black);
}
.muted { color: var(--gray-500); }
.mono { font-family: var(--font-mono); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.85em 1.6em;
  font-family: var(--font-mono);
  font-size: var(--step-1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--black);
  background: var(--black);
  color: var(--white);
  transition: background .18s ease, color .18s ease, transform .1s ease;
}
.btn:hover { background: var(--white); color: var(--black); }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: var(--black); }
.btn--ghost:hover { background: var(--black); color: var(--white); }
.btn--block { width: 100%; justify-content: center; }

.link-arrow {
  font-family: var(--font-mono);
  font-size: var(--step-1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--black);
  padding-bottom: 2px;
  display: inline-flex;
  gap: .5em;
}
.link-arrow:hover { opacity: .55; }

/* ---------- Tag / meta ---------- */
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--step-1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--black);
  padding: 0.35em 0.7em;
}
.meta {
  font-family: var(--font-mono);
  font-size: var(--step-1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-500);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
.meta .dot::before { content: "•"; margin: 0 0.5em; color: var(--gray-400); }

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  min-height: 72px;
}
.brand { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.brand img { height: 20px; width: auto; max-width: none; }
@media (max-width: 480px) { .brand img { height: 16px; } }

.nav { display: flex; align-items: center; gap: clamp(9px, 0.95vw, 15px); }
.nav a {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  padding-block: 6px;
  border-bottom: 1px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--black); }

.header-actions { display: flex; align-items: center; gap: 16px; }
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--black);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}
.lang-switch a { padding: 6px 10px; }
.lang-switch a[aria-current="true"] { background: var(--black); color: var(--white); }

.nav-toggle { display: none; width: 40px; height: 40px; border: 1px solid var(--black); align-items: center; justify-content: center; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; width: 18px; height: 1.5px; background: var(--black); position: relative;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

@media (max-width: 1240px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: fixed; inset: 72px 0 auto 0;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 0;
    transform: translateY(-120%);
    transition: transform .25s ease;
    max-height: calc(100vh - 72px);
    overflow-y: auto;
  }
  .nav.is-open { transform: translateY(0); }
  .nav a { width: 100%; padding: 14px clamp(16px, 4vw, 48px); border-bottom: 1px solid var(--gray-200); }
}

/* =========================================================
   HERO / HOME
   ========================================================= */
.hero { border-bottom: 1px solid var(--line); }
.hero-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 0; }
.hero-lead { padding: clamp(32px,5vw,72px) clamp(24px,4vw,56px); border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; }
.hero-lead .display { margin: 0.3em 0; }
.hero-media { position: relative; min-height: 320px; background: var(--gray-100); }
.hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-lead { border-right: none; border-bottom: 1px solid var(--line); }
  .hero-media { min-height: 240px; }
}

/* ---------- Section head ---------- */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding-bottom: 20px; margin-bottom: 32px; border-bottom: 1px solid var(--line);
}
.section-head h2 { font-size: var(--step2); }

/* =========================================================
   CARDS / GRID
   ========================================================= */
.grid { display: grid; gap: clamp(24px, 3vw, 40px); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid--4 { grid-template-columns: repeat(2,1fr); } .grid--3 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 640px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

.card { display: flex; flex-direction: column; gap: 14px; }
.card__media { position: relative; aspect-ratio: 3 / 2; background: var(--gray-100); overflow: hidden; border: 1px solid var(--line); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card__media img { transform: scale(1.04); }
.card__cat { align-self: flex-start; }
.card__title { font-family: var(--font-serif); font-size: var(--step1); line-height: 1.15; }
.card:hover .card__title { text-decoration: underline; text-underline-offset: 3px; }
.card__excerpt { color: var(--gray-500); font-size: 0.92rem; }
.card__meta { margin-top: auto; }

/* Feature card (large) */
.card--feature { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(20px,3vw,40px); align-items: center; }
.card--feature .card__media { aspect-ratio: 4 / 3; }
.card--feature .card__title { font-size: var(--step3); }
@media (max-width: 760px) { .card--feature { grid-template-columns: 1fr; } }

/* Horizontal list item */
.post-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 20px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--line); }
.post-row__num { font-family: var(--font-mono); font-size: 1.1rem; }
.post-row__title { font-family: var(--font-serif); font-size: var(--step1); }
.post-row:hover .post-row__title { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) { .post-row { grid-template-columns: 32px 1fr; } .post-row .meta { grid-column: 2; } }

/* Category promo tiles */
.cat-grid { display: grid; grid-template-columns: repeat(3,1fr); border: 1px solid var(--line); }
.cat-tile { padding: clamp(24px,3vw,40px); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 200px; display: flex; flex-direction: column; justify-content: space-between; transition: background .2s ease, color .2s ease; }
.cat-tile:hover { background: var(--black); color: var(--white); }
.cat-tile:hover .muted { color: var(--gray-300); }
.cat-tile__idx { font-family: var(--font-mono); font-size: var(--step-1); }
.cat-tile h3 { font-size: var(--step2); margin-top: 12px; }
@media (max-width: 860px) { .cat-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 560px) { .cat-grid { grid-template-columns: 1fr; } }

/* =========================================================
   PAGE HEADER (category / generic)
   ========================================================= */
.page-header { border-bottom: 1px solid var(--line); padding-block: clamp(40px,6vw,80px); }
.breadcrumb { font-family: var(--font-mono); font-size: var(--step-1); letter-spacing: 0.1em; text-transform: uppercase; color: var(--gray-500); margin-bottom: 20px; }
.breadcrumb a:hover { color: var(--black); }
.page-header h1 { font-size: var(--step4); }

/* =========================================================
   ARTICLE
   ========================================================= */
.article-head { padding-block: clamp(32px,5vw,64px); border-bottom: 1px solid var(--line); }
.article-head .container { max-width: 860px; }
.article-head h1 { font-size: var(--step3); margin: 18px 0; }
.article-media { margin-block: 0; }
.article-media img { width: 100%; max-height: 640px; object-fit: cover; }
.article-media figcaption { font-family: var(--font-mono); font-size: var(--step-1); color: var(--gray-500); padding: 10px 0; }

.article-body { max-width: 720px; margin-inline: auto; padding-block: clamp(40px,5vw,72px); font-size: 1.12rem; line-height: 1.75; }
.article-body > * + * { margin-top: 1.5rem; }
.article-body h2 { font-size: var(--step2); margin-top: 2.4rem; padding-top: 1rem; border-top: 1px solid var(--gray-200); }
.article-body h3 { font-size: var(--step1); margin-top: 1.8rem; }
.article-body ul, .article-body ol { padding-left: 1.4rem; }
.article-body ul li { list-style: disc; margin-top: .5rem; }
.article-body ol li { list-style: decimal; margin-top: .5rem; }
.article-body blockquote { border-left: 3px solid var(--black); padding-left: 1.2rem; font-family: var(--font-serif); font-size: 1.4rem; line-height: 1.35; }
.article-body figure img { width: 100%; }
.article-body .callout { border: 1px solid var(--black); padding: 1.4rem; }

.article-nav { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.article-nav a { padding: clamp(20px,3vw,36px); display: flex; flex-direction: column; gap: 8px; }
.article-nav a:first-child { border-right: 1px solid var(--line); }
.article-nav a:hover { background: var(--gray-100); }
.article-nav .label { font-family: var(--font-mono); font-size: var(--step-1); letter-spacing: 0.1em; text-transform: uppercase; color: var(--gray-500); }
.article-nav .t { font-family: var(--font-serif); font-size: var(--step1); }
.article-nav a.is-next { text-align: right; align-items: flex-end; }
@media (max-width: 640px) { .article-nav { grid-template-columns: 1fr; } .article-nav a:first-child { border-right: none; border-bottom: 1px solid var(--line); } }

/* =========================================================
   QUIZ
   ========================================================= */
.quiz-wrap { max-width: 760px; margin-inline: auto; }
.quiz-progress { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; }
.quiz-progress__label { font-family: var(--font-mono); font-size: var(--step-1); letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; }
.quiz-progress__bar { flex: 1; height: 2px; background: var(--gray-200); position: relative; }
.quiz-progress__fill { position: absolute; inset: 0 auto 0 0; background: var(--black); width: 0; transition: width .3s ease; }

.quiz-step { display: none; }
.quiz-step.is-active { display: block; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.quiz-question { font-family: var(--font-serif); font-size: var(--step2); margin-bottom: 28px; }

.quiz-options { display: grid; gap: 12px; }
.quiz-option {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--black); padding: 16px 18px; text-align: left; width: 100%;
  transition: background .15s ease, color .15s ease;
}
.quiz-option:hover { background: var(--gray-100); }
.quiz-option.is-selected { background: var(--black); color: var(--white); }
.quiz-option__mark { width: 16px; height: 16px; border: 1px solid currentColor; border-radius: 50%; flex: 0 0 auto; }
.quiz-option.is-selected .quiz-option__mark { background: var(--white); }

.quiz-actions { display: flex; justify-content: space-between; gap: 16px; margin-top: 32px; }

/* Quiz results */
.course-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 20px; }
@media (max-width: 720px) { .course-grid { grid-template-columns: 1fr; } }
.course-card { border: 1px solid var(--black); padding: clamp(20px,3vw,32px); display: flex; flex-direction: column; gap: 12px; position: relative; }
.course-card.is-recommended { outline: 3px solid var(--black); }
.course-card__badge { position: absolute; top: -1px; right: -1px; background: var(--black); color: var(--white); font-family: var(--font-mono); font-size: var(--step-1); letter-spacing: 0.08em; text-transform: uppercase; padding: 6px 12px; }
.course-card h3 { font-size: var(--step1); }
.course-card .who { font-size: 0.9rem; color: var(--gray-500); }
.course-card .btn { margin-top: auto; }

/* =========================================================
   FORMS
   ========================================================= */
.form-wrap { max-width: 620px; margin-inline: auto; }
.form-selected { border: 1px solid var(--black); padding: 16px 20px; margin-bottom: 28px; font-family: var(--font-mono); font-size: 0.85rem; letter-spacing: 0.04em; }
.form-selected strong { display: block; font-family: var(--font-serif); font-size: 1.2rem; letter-spacing: 0; margin-top: 4px; }
.field { margin-bottom: 20px; }
.field label { display: block; font-family: var(--font-mono); font-size: var(--step-1); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 8px; }
.field input, .field textarea {
  width: 100%; padding: 14px 16px; border: 1px solid var(--black); background: var(--white); border-radius: 0;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--black); outline-offset: -1px; }
.field-error { color: #b00020; font-size: 0.8rem; margin-top: 6px; display: none; }
.field.has-error input { outline: 2px solid #b00020; outline-offset: -1px; }
.field.has-error .field-error { display: block; }
.checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: 0.9rem; }
.checkbox input { width: 18px; height: 18px; margin-top: 2px; flex: 0 0 auto; }
.form-note { font-size: 0.82rem; color: var(--gray-500); margin-top: 16px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 520px) { .form-grid-2 { grid-template-columns: 1fr; } }

/* Contact layout */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px,5vw,64px); }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-info dt { font-family: var(--font-mono); font-size: var(--step-1); letter-spacing: 0.1em; text-transform: uppercase; color: var(--gray-500); margin-top: 18px; }
.contact-info dd { font-size: 1.05rem; }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer { background: var(--black); color: var(--white); padding-block: clamp(48px,6vw,80px); }
.site-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer-top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: clamp(24px,4vw,48px); }
.footer-brand img { height: 22px; width: auto; filter: invert(1); margin-bottom: 20px; }
.footer-brand p { color: var(--gray-300); max-width: 34ch; font-size: 0.92rem; }
.footer-col h4 { font-family: var(--font-mono); font-weight: 400; font-size: var(--step-1); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gray-400); margin-bottom: 16px; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { font-size: 0.92rem; color: var(--white); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: clamp(32px,4vw,56px); padding-top: 24px; border-top: 1px solid var(--gray-700); flex-wrap: wrap; }
.footer-bottom .lang-switch { border-color: var(--white); }
.footer-bottom .lang-switch a[aria-current="true"] { background: var(--white); color: var(--black); }
.footer-copy { font-family: var(--font-mono); font-size: var(--step-1); color: var(--gray-400); letter-spacing: 0.06em; }
@media (max-width: 860px) { .footer-top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-top { grid-template-columns: 1fr; } }

/* =========================================================
   UTILITIES
   ========================================================= */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.divider { height: 1px; background: var(--line); border: 0; margin-block: clamp(32px,4vw,56px); }
