/* ==========================================================================
   sanatbek.com — design system
   Hand-written CSS, no framework. Organized by section:
   1. Fonts & reset   2. Tokens   3. Base/typography   4. Layout
   5. Buttons         6. Header/nav   7. Hero   8. Cards
   9. Sections (about/services/portfolio/journal/contact)
   10. Footer         11. Forms   12. Tabs   13. Timeline
   14. Modal/admin    15. Utilities/animation   16. Responsive
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Spectral:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Mulish:wght@400;500;600;700;800&display=swap');

/* ---------- 1. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
ul, ol { list-style: none; }

/* ---------- 2. Design tokens ---------- */
:root {
  /* warm cream/espresso base palette */
  --cream-white: #FDF8F2;
  --warm-sand:   #F5ECD7;
  --linen:       #EDE0C8;
  --ivory:       #F9F3E8;
  --espresso:    #3D2B1F;
  --walnut:      #6B5040;
  --taupe:       #9C8070;
  --caramel:     #B5763F;
  --caramel-dark:#96602F;
  --honey:       #E8C99A;

  --bg:          var(--cream-white);
  --bg-alt:      var(--warm-sand);
  --surface:     #ffffff;
  --border:      var(--linen);
  --text:        var(--espresso);
  --text-muted:  var(--walnut);
  --text-soft:   var(--taupe);
  --accent:      var(--caramel);
  --accent-dark: var(--caramel-dark);
  --accent-ink:  #ffffff;

  --shadow-sm: 0 1px 2px rgba(61, 43, 31, 0.06), 0 1px 1px rgba(61, 43, 31, 0.04);
  --shadow-md: 0 8px 24px rgba(61, 43, 31, 0.08);
  --shadow-lg: 0 20px 48px rgba(61, 43, 31, 0.14);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --font-display: 'Spectral', Georgia, serif;
  --font-body: 'Mulish', -apple-system, BlinkMacSystemFont, sans-serif;

  --container: 1180px;
  --header-h: 84px;

  color-scheme: light;
}

body.darkmode {
  --bg:          #17100B;
  --bg-alt:      #241811;
  --surface:     #1F1610;
  --border:      #3A281C;
  --text:        #F5ECD7;
  --text-muted:  #D4B896;
  --text-soft:   #A98F79;
  --accent:      #E0A868;
  --accent-dark: #C98F4E;
  --accent-ink:  #1A110C;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.5);

  color-scheme: dark;
}

/* ---------- Custom scrollbar (uses the same tokens as everything else, so it re-colors itself for dark mode automatically) ---------- */
html { scrollbar-width: thin; scrollbar-color: var(--accent) var(--bg-alt); }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb {
  background: var(--accent); border-radius: var(--radius-pill);
  border: 3px solid var(--bg-alt); background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-dark); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: var(--bg-alt); }

/* ---------- 3. Base / typography ---------- */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  color: var(--text);
}

h1 { font-size: clamp(2.4rem, 4vw + 1rem, 4.2rem); font-weight: 700; }
h2 { font-size: clamp(1.9rem, 2.4vw + 1rem, 2.7rem); }
h3 { font-size: clamp(1.3rem, 1vw + 1rem, 1.6rem); }
h4 { font-size: 1.15rem; }

p { color: var(--text-muted); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: .9rem;
}
.eyebrow::before {
  content: '';
  width: 28px; height: 2px;
  background: var(--accent);
  display: inline-block;
}

.lede { font-size: 1.1rem; max-width: 60ch; }

.tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--radius-pill);
  background: #e0473e; color: #fff;
  font-size: .72rem; font-weight: 700; line-height: 1;
  margin-left: .35em;
}

.lede a {
  color: var(--accent-dark);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent-dark) 45%, transparent);
  text-underline-offset: 3px;
  transition: color .15s ease;
}
.lede a:hover { color: var(--accent); }

.lede strong, .lede b { font-weight: 800; color: var(--text); }

.lede em, .lede i { font-style: italic; color: var(--accent-dark); }

.lede blockquote {
  margin: 1.4rem 0;
  padding: .85rem 1.3rem;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
  font-style: italic;
}

/* ---------- 4. Layout ---------- */
.container { max-width: var(--container); margin-inline: auto; padding-inline: 24px; }
.section { padding-block: clamp(64px, 8vw, 120px); }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 640px; margin-bottom: 3rem; }
.section-head.center { margin-inline: auto; text-align: center; }
.grid { display: grid; gap: 28px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  padding: .9em 1.7em;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: .95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-dark); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn-ghost { background: transparent; color: var(--text); padding: .6em 1em; }
.btn-sm { padding: .55em 1.1em; font-size: .82rem; }
.btn-danger { background: #C0392B; color: #fff; }
.btn-danger:hover { background: #A5311F; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- 6. Header / nav ---------- */
.site-header {
  position: fixed; inset-inline: 0; top: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  border-bottom: 1px solid transparent;
  transition: height .25s ease, border-color .25s ease, background .25s ease;
}
.site-header.is-scrolled { height: 68px; border-color: var(--border); box-shadow: var(--shadow-sm); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; width: 100%; }

.brand { display: flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.brand img { height: 34px; width: auto; }

.nav { display: flex; align-items: center; gap: 2.1rem; }
.nav-link {
  font-weight: 600; font-size: .95rem; color: var(--text-muted);
  position: relative; padding-block: 6px;
  transition: color .18s ease;
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; background: var(--accent); border-radius: 2px;
}
.nav-drop { position: relative; }
.nav-drop-panel {
  position: absolute; top: calc(100% + 14px); left: 50%; transform: translateX(-50%) translateY(6px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: .5rem; min-width: 190px;
  opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
}
.nav-drop:hover .nav-drop-panel, .nav-drop:focus-within .nav-drop-panel {
  opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0);
}
.nav-drop-panel a { display: block; padding: .65rem .8rem; border-radius: var(--radius-sm); font-weight: 600; font-size: .9rem; color: var(--text-muted); }
.nav-drop-panel a:hover { background: var(--bg-alt); color: var(--text); }

.header-actions { display: flex; align-items: center; gap: .8rem; }
.theme-switch {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--text);
  transition: border-color .18s ease, transform .18s ease;
}
.theme-switch:hover { border-color: var(--accent); transform: rotate(12deg); }
.theme-switch .fa-sun { display: none; }
body.darkmode .theme-switch .fa-sun { display: block; }
body.darkmode .theme-switch .fa-moon { display: none; }

/* ---------- Language switcher ---------- */
.lang-switch { position: relative; }
.lang-switch-btn {
  height: 40px; padding: 0 .8rem 0 .7rem; border-radius: var(--radius-pill); border: 1px solid var(--border);
  background: var(--surface); display: flex; align-items: center; gap: .4rem; cursor: pointer; color: var(--text);
  font-weight: 700; font-size: .78rem; letter-spacing: .03em; transition: border-color .18s ease;
}
.lang-switch-btn:hover { border-color: var(--accent); }
.lang-switch-btn i { font-size: .85rem; color: var(--text-soft); }
.lang-switch-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 150px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  padding: .4rem; display: none; flex-direction: column; gap: .1rem; z-index: 120;
}
.lang-switch.open .lang-switch-menu { display: flex; }
.lang-switch-menu button {
  display: block; width: 100%; text-align: left; padding: .55rem .7rem; border-radius: var(--radius-sm);
  background: none; border: none; cursor: pointer; color: var(--text-muted); font-weight: 600; font-size: .88rem;
}
.lang-switch-menu button:hover { background: var(--bg-alt); color: var(--text); }
.lang-switch-menu button.active { color: var(--accent-dark); background: color-mix(in srgb, var(--accent) 12%, transparent); }

.nav-toggle {
  display: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); align-items: center; justify-content: center; cursor: pointer;
}

/* ---------- 7. Hero ---------- */
.hero {
  min-height: 680px; display: flex; align-items: center; position: relative;
  padding-top: var(--header-h);
  background:
    radial-gradient(circle at 82% 18%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 55%),
    var(--bg);
  overflow: hidden;
}
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero-kicker { font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: .85rem; color: var(--accent-dark); margin-bottom: 1rem; }
.hero h1 { margin-bottom: 1.1rem; }
.hero .typed-role { color: var(--accent-dark); font-style: italic; }
.hero-desc { font-size: 1.15rem; max-width: 52ch; margin-bottom: 2.2rem; }
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2.6rem; }
.hero-social { display: flex; gap: .7rem; }
.icon-link {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--text-muted); transition: all .18s ease;
}
.icon-link:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: translateY(-3px); }

.hero-portrait { position: relative; }
.hero-portrait .frame {
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg);
  border: 8px solid var(--surface); aspect-ratio: 4/5;
}
.hero-portrait .frame img { width: 100%; height: 100%; object-fit: cover; }
.hero-stat-card {
  position: absolute; bottom: -24px; left: -24px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 1.1rem 1.4rem; box-shadow: var(--shadow-md); display: flex; gap: .9rem; align-items: center;
}
.hero-stat-card .num { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; color: var(--accent-dark); }
.hero-stat-card .label { font-size: .8rem; color: var(--text-soft); max-width: 12ch; line-height: 1.25; }
.scroll-cue {
  position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-soft);
}
.scroll-cue .line { width: 1px; height: 34px; background: linear-gradient(var(--text-soft), transparent); animation: scrollcue 1.8s ease infinite; }
@keyframes scrollcue { 0% { opacity: 0; transform: scaleY(0); transform-origin: top; } 40% { opacity: 1; transform: scaleY(1); transform-origin: top; } 100% { opacity: 0; transform: scaleY(1); transform-origin: bottom; } }

/* ---------- 8. Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: box-shadow .25s ease, border-color .25s ease;
}
.card:hover {
  box-shadow: var(--shadow-lg), 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}
.card-media { aspect-ratio: 4/3; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card-media img { transform: scale(1.06); }
.card-body { padding: 1.5rem; }
.card-tag {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-dark); background: color-mix(in srgb, var(--accent) 14%, transparent);
  padding: .3em .8em; border-radius: var(--radius-pill); margin-bottom: .8rem;
}
.card-title { font-size: 1.15rem; margin-bottom: .5rem; }
.card-text { font-size: .92rem; color: var(--text-muted); }
.card-meta { display: flex; align-items: center; gap: .5rem; font-size: .8rem; color: var(--text-soft); margin-top: 1rem; }

/* ---------- 9. Shared content sections ---------- */
.about-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 56px; align-items: center; }
.about-portrait { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); aspect-ratio: 3/4; }
.about-portrait img { width: 100%; height: 100%; object-fit: cover; }
.stat-row { display: flex; flex-wrap: wrap; gap: 2.2rem; margin-block: 1.8rem; padding-block: 1.6rem; border-block: 1px solid var(--border); }
.stat-row .stat .num { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--accent-dark); display: block; }
.stat-row .stat .label { font-size: .8rem; color: var(--text-soft); }

.service-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px; counter-reset: service; }
.service-card {
  position: relative; overflow: hidden;
  padding: 2.5rem 1.8rem 2.1rem; text-align: left; flex: 1 1 280px; max-width: 340px;
  border-color: transparent; background: var(--surface);
}
.service-card::before {
  counter-increment: service; content: counter(service, decimal-leading-zero);
  position: absolute; top: -.3rem; right: .6rem; font-family: var(--font-display); font-weight: 700;
  font-size: 3.4rem; line-height: 1; color: color-mix(in srgb, var(--accent) 10%, transparent); pointer-events: none;
}
.service-card:hover {
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
}
.service-icon {
  position: relative; width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 1.35rem; margin-bottom: 1.4rem;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform .3s ease, box-shadow .3s ease;
}
.service-card:hover .service-icon { transform: rotate(-6deg) scale(1.06); box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 45%, transparent); }

.filter-bar { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 2.4rem; }
.filter-btn {
  padding: .55em 1.3em; border-radius: var(--radius-pill); border: 1px solid var(--border);
  background: transparent; font-weight: 700; font-size: .82rem; cursor: pointer; color: var(--text-muted);
  transition: all .18s ease;
}
.filter-btn.active, .filter-btn:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.contact-panel {
  background: var(--espresso); color: var(--warm-sand); border-radius: var(--radius-lg);
  padding: clamp(2.4rem, 5vw, 4rem); display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center;
}
body.darkmode .contact-panel { background: var(--surface); border: 1px solid var(--border); }
.contact-panel h2 { color: var(--warm-sand); }
body.darkmode .contact-panel h2 { color: var(--text); }
.contact-panel p { color: color-mix(in srgb, var(--warm-sand) 75%, transparent); }
.contact-links { display: flex; flex-direction: column; gap: .9rem; }
.contact-link {
  display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem; border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--warm-sand) 8%, transparent); border: 1px solid color-mix(in srgb, var(--warm-sand) 18%, transparent);
  transition: all .18s ease; font-weight: 700;
  /* email/@handle text has no spaces to wrap at — without these, flex's
     default min-width:auto keeps the item at full content width and the
     long string pushes straight past the card/viewport edge on narrow screens. */
  min-width: 0; overflow-wrap: anywhere;
}
.contact-link:hover { background: var(--accent); color: var(--accent-ink); transform: translateX(4px); }
.contact-link .icon-link { border-color: color-mix(in srgb, var(--warm-sand) 30%, transparent); color: inherit; flex-shrink: 0; }
.map-embed { border-radius: var(--radius-lg); overflow: hidden; margin-top: 3rem; border: 1px solid var(--border); }
.map-embed iframe { width: 100%; height: 340px; border: 0; display: block; }

/* ---------- 10. Footer ---------- */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding-block: 3.5rem 2rem; }
.footer-top { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; margin-bottom: 2.4rem; }
.footer-social { display: flex; gap: .6rem; flex-wrap: wrap; }
.footer-links { display: flex; gap: 2rem .4rem; flex-wrap: wrap; }
.footer-links a { font-size: .9rem; font-weight: 600; color: var(--text-muted); }
.footer-links a:hover { color: var(--accent-dark); }
.footer-bottom { padding-top: 1.6rem; border-top: 1px solid var(--border); font-size: .82rem; color: var(--text-soft); display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.footer-credit { text-align: center; font-size: .78rem; color: var(--text-soft); margin-top: 1rem; }
.footer-credit a { color: var(--accent-dark); font-weight: 600; }
.footer-credit a:hover { text-decoration: underline; }

/* ---------- 11. Forms ---------- */
.field { margin-bottom: 1.3rem; }
.field label { display: block; font-weight: 700; font-size: .85rem; margin-bottom: .5rem; }
.field input, .field textarea {
  width: 100%; padding: .85em 1em; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: .95rem; transition: border-color .18s ease, box-shadow .18s ease;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.field textarea { min-height: 160px; resize: vertical; }
.field-file { display: flex; align-items: center; gap: 1rem; }
.field-file img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.form-msg { font-size: .88rem; padding: .8em 1em; border-radius: var(--radius-sm); margin-top: 1rem; display: none; }
.form-msg.show { display: block; }
.form-msg.error { background: color-mix(in srgb, #C0392B 12%, transparent); color: #C0392B; }
.form-msg.success { background: color-mix(in srgb, #2E7D32 14%, transparent); color: #2E7D32; }

/* ---------- 12. Tabs (achievements / experience / articles) ---------- */
.tab-nav { display: flex; gap: .6rem; border-bottom: 1px solid var(--border); margin-bottom: 2.6rem; flex-wrap: wrap; }
.tab-btn {
  padding: .9em 1.6em; font-weight: 700; font-size: .95rem; color: var(--text-soft); background: none; border: none;
  cursor: pointer; position: relative; top: 1px;
}
.tab-btn.active { color: var(--accent-dark); }
.tab-btn.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }
.tab-content { display: none; animation: fadein .35s ease; }
.tab-content.active { display: block; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- 12b. Citation / numbered list ---------- */
.citation-list { display: flex; flex-direction: column; }
.citation-item { display: flex; gap: 1.2rem; padding: 1.6rem 0; border-bottom: 1px solid var(--border); }
.citation-item:last-child { border-bottom: none; }
.citation-num {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent-dark); font-weight: 700; font-size: .85rem; display: grid; place-items: center;
}
.citation-item h4 { font-size: 1rem; margin-bottom: .35rem; }
.citation-item p { font-size: .88rem; color: var(--text-soft); }

/* ---------- 13. Timeline ---------- */
.timeline { position: relative; padding-left: 2.6rem; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 2.6rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ''; position: absolute; left: -2.6rem; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); }
.timeline-item .period { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-dark); margin-bottom: .3rem; }

/* ---------- 14. Admin / modal ---------- */
.admin-shell { min-height: 100svh; background: var(--bg); }
.admin-login { min-height: 100svh; display: grid; place-items: center; padding: 24px; }
.admin-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2.6rem; box-shadow: var(--shadow-lg); text-align: center; }
.admin-card .brand { justify-content: center; margin-bottom: 1.4rem; }
.admin-bar { display: flex; align-items: center; justify-content: space-between; padding: 1.2rem 0; border-bottom: 1px solid var(--border); margin-bottom: 2.4rem; }
.admin-list { display: grid; gap: 1rem; }
.admin-row { display: flex; align-items: center; gap: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1rem 1.2rem; }
.admin-row img { width: 56px; height: 56px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; background: var(--bg-alt); }
.admin-row .info { flex: 1; min-width: 0; }
.admin-row .info h4 { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-row .info .date { font-size: .78rem; color: var(--text-soft); }
.admin-row .actions { display: flex; gap: .5rem; flex-shrink: 0; }

.editor-toolbar {
  display: flex; gap: .3rem; padding: .5rem; border: 1px solid var(--border); border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--bg-alt);
}
.editor-btn {
  width: 32px; height: 32px; border-radius: var(--radius-sm); border: 1px solid transparent; background: none;
  color: var(--text-muted); cursor: pointer; transition: background .15s ease, color .15s ease;
}
.editor-btn:hover { background: var(--surface); color: var(--accent-dark); border-color: var(--border); }

/* ---------- Admin: per-article language tabs (UZ/RU/EN authoring) ---------- */
.lang-tab-nav { display: flex; gap: .4rem; border-bottom: 1px solid var(--border); margin-bottom: 1.2rem; flex-wrap: wrap; }
.lang-tab-btn {
  padding: .6rem 1rem; border: none; background: none; cursor: pointer; font-weight: 700; font-size: .88rem;
  color: var(--text-soft); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s ease, border-color .15s ease;
}
.lang-tab-btn:hover { color: var(--text); }
.lang-tab-btn.active { color: var(--accent-dark); border-bottom-color: var(--accent); }
.lang-tab-content { display: none; }
.lang-tab-content.active { display: block; }

.comment-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1.1rem 1.3rem; }
.comment-item + .comment-item { margin-top: 1rem; }
.comment-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; flex-wrap: wrap; }
.comment-author { font-weight: 700; font-size: .9rem; }
.comment-meta { font-size: .76rem; color: var(--text-soft); }
.comment-article { font-size: .76rem; color: var(--accent-dark); font-weight: 700; margin-bottom: .4rem; }
.comment-article-badge {
  display: inline-flex; align-items: center; gap: .6rem; margin-bottom: .8rem;
  padding: .4rem .8rem .4rem .4rem; border-radius: var(--radius-pill);
  background: var(--bg-alt); border: 1px solid var(--border); max-width: 100%;
  transition: border-color .18s ease, background .18s ease;
}
.comment-article-badge:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg-alt)); }
.comment-article-badge img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-article-badge span { font-size: .8rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.comment-article-badge i { font-size: .7rem; color: var(--text-soft); flex-shrink: 0; }
.comment-text { font-size: .9rem; color: var(--text-muted); }
.comment-actions { display: flex; gap: .4rem; margin-top: .7rem; }
.comment-replies { margin-top: 1rem; padding-left: 1.2rem; border-left: 2px solid var(--border); display: grid; gap: .8rem; }
.comment-reply { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border)); border-radius: var(--radius-sm); padding: .8rem 1rem; }
.comment-reply .comment-author { color: var(--accent-dark); }

/* public comment section (articles.html) */
.comments-section { max-width: 760px; margin: 3rem auto 0; }
.comment-form { display: grid; gap: 1rem; margin-top: 1.5rem; }
.comment-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .comment-form .row2 { grid-template-columns: 1fr; } }

.overlay {
  position: fixed; inset: 0; background: rgba(23, 16, 11, .55); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; z-index: 200; padding: 20px;
}
.overlay.show { display: flex; }
.modal { width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: var(--surface); border-radius: var(--radius-lg); padding: 2.2rem; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.6rem; }
.modal-close { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: none; cursor: pointer; color: var(--text); }
.modal-actions { display: flex; justify-content: flex-end; gap: .8rem; margin-top: 1.6rem; }

.fab-add {
  position: fixed; bottom: 28px; right: 28px; width: 58px; height: 58px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); border: none; font-size: 1.5rem; cursor: pointer;
  display: grid; place-items: center; box-shadow: var(--shadow-lg); z-index: 90; transition: transform .18s ease;
}
.fab-add:hover { transform: scale(1.08); }

/* ---------- 15. Utilities / scroll-reveal ---------- */
.reveal { opacity: 0; translate: 0 24px; transition: opacity .7s ease, translate .7s ease; }
.reveal.is-visible { opacity: 1; translate: 0 0; }
/* elements that are both scroll-reveal AND hoverable cards need their own combined,
   higher-specificity transition list — otherwise whichever of .card/.reveal comes
   later in the cascade silently wins and drops the other's transitions */
.card.reveal { transition: opacity .7s ease, translate .7s ease, box-shadow .25s ease, border-color .25s ease; }
.service-card.reveal { transition: opacity .7s ease, translate .7s ease, box-shadow .3s ease, background .3s ease, border-color .3s ease; }
.text-center { text-align: center; }
.mt-lg { margin-top: 3rem; }
.empty-state, .loading-state { text-align: center; padding: 3rem 1rem; color: var(--text-soft); }
#listView, #detailView { display: none; }
#listView.active, #detailView.active { display: block; }
.breadcrumb { display: flex; gap: .5rem; align-items: center; font-size: .85rem; color: var(--text-soft); margin-bottom: 1.2rem; }
.breadcrumb a { font-weight: 600; color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent-dark); }
.page-hero { padding-top: calc(var(--header-h) + 56px); padding-bottom: 56px; }
.page-hero .eyebrow { margin-bottom: 1rem; }

/* ---------- 16. Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid, .about-grid, .contact-panel { grid-template-columns: 1fr; }
  .hero-portrait { order: -1; max-width: 360px; margin-inline: auto; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  /* Once the hero switches to a single stacked column its content (portrait +
     heading + CTA + social icons) is routinely taller than 100svh, so this
     absolutely-positioned "scroll" hint — pinned near the bottom of the
     whole .hero box — ends up sitting on top of the CTA buttons/social row
     instead of below them. It's redundant on touch devices anyway. */
  .scroll-cue { display: none; }
}
@media (max-width: 900px) {
  /* Full nav (logo + 6 links + theme switch) has no room past this point and
     wraps the brand text onto two lines, squashing the header — switch to the
     hamburger menu before that happens instead of at 760px. */
  .nav, .header-actions .theme-switch ~ .btn { display: none; }
  .nav-toggle { display: flex; }
  .site-header.nav-open .nav {
    display: flex; position: fixed; inset: var(--header-h) 0 0 0; background: var(--bg);
    flex-direction: column; align-items: flex-start; padding: 2rem 24px; gap: 1.4rem; overflow-y: auto;
  }
  .site-header.nav-open .nav-drop-panel { position: static; transform: none; opacity: 1; pointer-events: auto; box-shadow: none; border: none; padding-left: 1rem; display: none; }
  .site-header.nav-open .nav-drop.open .nav-drop-panel { display: block; }
}
@media (max-width: 420px) {
  /* Brand text + theme switch + language switch + hamburger all competing
     for ~270px of usable width — drop the "UZ/RU/EN" label and keep the
     language button icon-only so it doesn't push into the brand text. */
  .lang-switch-btn { width: 40px; padding: 0; justify-content: center; }
  .lang-switch-current { display: none; }
  .lang-switch-menu { right: -8px; }
}
@media (max-width: 760px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero-stat-card { position: static; margin-top: -30px; margin-inline: 20px; }
  h1 { font-size: clamp(2.1rem, 8vw, 3rem); }
  .admin-row { flex-wrap: wrap; }
}
