/*
  Style system adapted from the "Seline Analytics" reference:
  warm stone canvas, flat white cards with hairline borders,
  one cyan accent, pill-shaped controls, Inter Tight display type.
*/

:root {
  --bg: #fafaf9;            /* stone canvas */
  --surface: #ffffff;       /* pure white */
  --border: #e8e6e5;        /* stone border */
  --border-muted: #d6d3d1;  /* stone muted */
  --text: #0c0a09;          /* ink black */
  --text-muted: #78716c;    /* warm gray */
  --text-faint: #a8a29e;    /* ash gray */
  --accent: #3ba6f1;        /* cyan signal */
  --accent-edge: #3398e1;   /* cyan edge */
  --accent-soft: #c1e1f7;   /* sky wash */
  --accent-ink: #ffffff;    /* text on filled accent */

  --shadow-card: 0 4px 16px rgba(0,0,0,0.05);
  --shadow-elevated: 0 12px 45px rgba(17,12,46,0.12);
  --shadow-subtle: 0 1px 2px rgba(0,0,0,0.05);

  --radius-card: 10px;
  --radius-feature: 16px;
  --radius-pill: 9999px;

  --placeholder: #b3560a;
  --placeholder-bg: #fff4e8;

  --font-display: "Inter Tight", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --maxw: 880px;

  /* legacy aliases kept for any untouched rule below */
  --radius: var(--radius-card);
  --shadow: var(--shadow-card);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1917;             /* soot canvas */
    --surface: #262220;        /* dark card surface */
    --border: #3a3532;
    --border-muted: #4a443f;
    --text: #fafaf9;
    --text-muted: #a8a29e;
    --text-faint: #78716c;
    --accent: #3ba6f1;
    --accent-edge: #5db8f5;
    --accent-soft: rgba(59, 166, 241, 0.16);
    --accent-ink: #0c0a09;

    --shadow-card: 0 4px 16px rgba(0,0,0,0.35);
    --shadow-elevated: 0 12px 45px rgba(0,0,0,0.5);
    --shadow-subtle: 0 1px 2px rgba(0,0,0,0.4);

    --placeholder: #ffb066;
    --placeholder-bg: #3a2a17;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 20px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.64;
}

a { color: var(--accent-edge); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 .5em;
  color: var(--text);
}
h1 { font-size: 2rem; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; margin-top: 0; }
h3 { font-size: 1.1rem; }

main, .hub-wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-bottom: 60px;
}

section { margin-top: 56px; }
section > h2 {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* ---------- Placeholder marker ---------- */
.ph {
  color: var(--placeholder);
  background: var(--placeholder-bg);
  border-radius: 4px;
  padding: 0 4px;
  font-style: italic;
}

/* ---------- Hub page ---------- */
.hub-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 28px;
}

.lang-switch {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px;
  box-shadow: var(--shadow-subtle);
}
.lang-switch button,
.lang-switch a {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: .85rem;
}
.lang-switch a { text-decoration: none; }
.lang-switch button.active,
.lang-switch a.active {
  background: var(--accent);
  color: var(--accent-ink);
}

.avatar {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-elevated);
  border: 3px solid var(--surface);
}

.identity h1 { margin-bottom: 6px; }
.identity .contacts { color: var(--text-muted); font-size: .95rem; }

.role-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.role-card {
  display: block;
  padding: 22px 34px;
  border-radius: var(--radius-feature);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--text);
  transition: transform .15s ease, border-color .15s ease;
}
.role-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  text-decoration: none;
}
.role-card span.sub {
  display: block;
  margin-top: 4px;
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 400;
  color: var(--text-muted);
}

[hidden] { display: none !important; }

/* ---------- CV page header ---------- */
.cv-header {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 18px;
}
.cv-header .home-link {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--text);
}
.switchers { display: flex; gap: 14px; flex-wrap: wrap; font-size: .85rem; }
.switchers .group { display: flex; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 4px; background: var(--surface); }
.switchers .group a { padding: 4px 12px; border-radius: var(--radius-pill); color: var(--text-muted); font-weight: 500; }
.switchers .group a.active { background: var(--accent); color: var(--accent-ink); }

/* ---------- Sticky right-hand "on this page" table of contents ---------- */
.page-body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 32px;
  max-width: calc(var(--maxw) + 190px);
  margin: 0 auto;
}
.page-body main {
  margin: 0;
  flex: 0 1 var(--maxw);
  min-width: 0;
}
.toc {
  position: sticky;
  top: 32px;
  flex: 0 0 140px;
  padding-top: 140px;
}
.toc nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: .82rem;
}
.toc a { color: var(--text-muted); }
.toc a:hover { color: var(--accent-edge); text-decoration: none; }

@media (max-width: 700px) {
  .toc { display: none; }
}

.role-title {
  max-width: var(--maxw);
  margin: 28px auto 0;
}
.role-title h1 { font-size: 2rem; letter-spacing: -0.025em; }
.role-title p { color: var(--text-muted); margin: 0; font-size: 1.05rem; }

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
}
.skill-card h3 { color: var(--text); }
.skill-card ul { margin: 0; padding-left: 20px; }
.skill-card li { margin-bottom: 4px; }

/* ---------- Cases ---------- */
.case-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 22px 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}
.case-card dl, .ai-example dl { margin: 12px 0 0; }
.case-card dt, .ai-example dt { font-weight: 600; color: var(--accent-edge); margin-top: 10px; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.case-card dd, .ai-example dd { margin: 4px 0 0; }

/* ---------- Carousel (used for the case-studies block) ---------- */
.carousel {
  position: relative;
}
.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 20px;
  scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track .case-card {
  flex: 0 0 100%;
  scroll-snap-align: start;
  margin-bottom: 0;
}
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.carousel-arrow:hover { border-color: var(--accent); color: var(--accent-edge); }
.carousel-arrow-prev { left: -18px; }
.carousel-arrow-next { right: -18px; }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}
.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--border-muted);
  cursor: pointer;
  padding: 0;
}
.carousel-dot.active { background: var(--accent); }

@media (max-width: 640px) {
  .carousel-arrow { display: none; }
}
.ai-example dl { margin-top: 10px; }
.ai-example dt { margin-top: 20px; }
.ai-example dt:first-child { margin-top: 0; }

/* ---------- Metrics ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  text-align: center;
}
.stat {
  background: var(--accent-soft);
  border-radius: var(--radius-card);
  padding: 24px 12px;
}
.stat-number {
  display: block;
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--accent-edge);
}
.stat-label {
  display: block;
  font-size: .9rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Featured metrics (completed projects, skills acquired, application areas): big number + compact tag list */
.metric-featured {
  display: flex;
  align-items: center;
  gap: 32px;
  background: var(--accent-soft);
  border-radius: var(--radius-card);
  padding: 28px 30px;
  margin-bottom: 20px;
}
.metric-featured-number {
  flex: 0 0 auto;
  text-align: center;
}
.metric-featured-number .stat-number {
  font-size: 3.4rem;
}
.metric-featured-number .stat-label {
  white-space: nowrap;
}
.metric-featured .project-list {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--border-muted);
  padding-left: 28px;
}
.metric-featured .project-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: .85rem;
  color: var(--text);
}

@media (max-width: 640px) {
  .metric-featured {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }
  .metric-featured-number { text-align: left; }
  .metric-featured .project-list {
    border-left: none;
    padding-left: 0;
    padding-top: 18px;
    border-top: 1px solid var(--border-muted);
  }
}

/* ---------- AI section ---------- */
.ai-intro {
  background: var(--accent-soft);
  border-radius: var(--radius-card);
  padding: 18px 22px;
  margin-bottom: 20px;
}
.ai-intro strong { color: var(--accent-edge); }
.ai-examples-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.ai-example {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}
.ai-example .tag {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--accent-edge);
  margin-bottom: 6px;
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

/* ---------- Salary ---------- */
.salary-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px 26px;
  box-shadow: var(--shadow-card);
}
.salary-box table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}
.salary-box th, .salary-box td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-size: .95rem;
}
.salary-box th { color: var(--text-muted); font-weight: 600; }

.salary-list {
  margin: 0;
  padding-left: 20px;
  font-size: 1.05rem;
}
.salary-list li { margin-bottom: 10px; }
.salary-list li:last-child { margin-bottom: 0; }

footer.page-footer {
  max-width: var(--maxw);
  margin: 40px auto 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: .85rem;
}
.footer-contacts {
  margin: 0 0 6px;
  font-size: .9rem;
}

@media (max-width: 640px) {
  .skills-grid, .stats-grid, .ai-examples-grid { grid-template-columns: 1fr; }
  .cv-header { flex-direction: column; align-items: flex-start; }
}
