/* Centralized styles for fibricar site */
:root {
  --bg: #0f1724;
  --card: #0d1b2e;
  --accent: #f59e0b;
  --accent2: #7c3aed;
  --muted: #8fa5bf;
  --glass: rgba(255, 255, 255, 0.04);
}

html { scroll-behavior: smooth; }

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color: #e6eef8;
  background: linear-gradient(180deg, #071025 0%, var(--bg) 100%);
}

/* ── Header ──────────────────────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 1rem 2rem;
  transition: background .25s, box-shadow .25s;
}

header.scrolled {
  background: rgba(7, 16, 37, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(245, 158, 11, 0.15);
}

.brand {
  flex: 1;
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-decoration: none;
  color: inherit;
}

.brand img { width: 40px; height: 28px; }

.wordmark {
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: -0.5px;
  background: linear-gradient(95deg, var(--accent) 0%, #e879f9 60%, var(--accent2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ── Nav ─────────────────────────────────────────────────────────────── */
nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 1rem;
  font-weight: 600;
  transition: color .15s;
}

nav a:hover { color: #e6eef8; }
nav a.nav-active { color: var(--accent); }

/* ── Hamburger ───────────────────────────────────────────────────────── */
.nav-close { display: none; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  cursor: pointer;
}

.hamburger-line {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--muted);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}

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

/* ── Language Switcher ───────────────────────────────────────────────── */
.lang-switcher {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--muted);
  padding: .55rem .65rem;
  min-height: 44px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}

.lang-btn:hover { border-color: rgba(245, 158, 11, 0.45); color: #e6eef8; }

.lang-icon { font-size: .95rem; line-height: 1; }
.lang-caret { font-size: .65rem; opacity: .6; transition: transform .2s; }
.lang-btn[aria-expanded="true"] .lang-caret { transform: rotate(180deg); }

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 150px;
  background: #0b1a2e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: .35rem 0;
  list-style: none;
  margin: 0;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.7);
  z-index: 1000;
}

.lang-dropdown.open { display: block; }

.lang-dropdown li {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: .45rem .85rem;
  font-size: .85rem;
  color: var(--muted);
  cursor: pointer;
  transition: background .12s, color .12s;
}

.lang-dropdown li:hover  { background: rgba(245, 158, 11, 0.09); color: #e6eef8; }
.lang-dropdown li.lang-active { color: var(--accent); font-weight: 700; }

/* ── Layout ──────────────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 2rem auto; padding: 0 1rem; }

.hero { display: grid; grid-template-columns: 1fr 360px; gap: 2rem; align-items: center; padding: 3rem 0; }
.hero h1 { color: #fff; font-size: 2.2rem; margin: 0 0 0.6rem; }
.hero p { color: var(--muted); margin: 0 0 1.25rem; }

.cta { display: inline-flex; gap: .75rem; align-items: center; }
.btn-primary {
  display: inline-block;
  background: linear-gradient(90deg, var(--accent), #e879f9);
  color: #140800;
  padding: .75rem 1rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.cta .btn-primary { min-width: 140px; }

.card {
  background: var(--card);
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 6px 24px rgba(2, 6, 23, 0.5);
  color: var(--muted);
}

.skills { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }
.skills span {
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: .4rem .7rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 600;
}

/* ── Sections ────────────────────────────────────────────────────────── */
section { padding: 4rem 0; }
#contact { display: none; }

/* Thin amber gradient line between content sections */
section:not(.hero) + section:not(.hero) {
  border-top: 1px solid rgba(245, 158, 11, 0.12);
}

/* ── Section headings ─────────────────────────────────────────────────── */
.h2-heading {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 1.25rem;
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
  line-height: 1.25;
}

/* ── Modal ───────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }

.modal {
  background: linear-gradient(180deg, var(--card), #071020);
  padding: 1.5rem;
  border-radius: 14px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(2, 6, 23, 0.8);
  position: relative;
}
.modal h3 { margin: 0 0 .75rem; color: #fff; }

.modal-close-btn { position: absolute; top: 1rem; right: 1rem; }

.modal label  { display: block; font-size: .9rem; color: var(--muted); margin-top: .75rem; }
.modal input,
.modal textarea {
  width: 100%;
  padding: .6rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: #e6eef8;
  margin-top: .4rem;
  font-family: inherit;
  font-size: .95rem;
  transition: border-color .15s;
}
.modal input:focus,
.modal textarea:focus {
  outline: none;
  border-color: rgba(245, 158, 11, 0.5);
}
.modal .actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: .75rem; }

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  padding: .5rem .75rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, color .15s;
}
.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.2); color: #e6eef8; }

/* ── Grid & Footer ───────────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
footer { padding: 2rem 0; color: var(--muted); text-align: center; font-size: .9rem; }

/* ── Back to top ─────────────────────────────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #e879f9);
  color: #140800;
  font-size: 1.2rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.4);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .25s, transform .25s;
  z-index: 800;
  pointer-events: none;
}
#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#back-to-top:hover { box-shadow: 0 6px 26px rgba(245, 158, 11, 0.55); }

/* ── AI Topics Section ───────────────────────────────────────────────── */
.ai-topics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }

.topic-card {
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.6);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: border-color .2s, box-shadow .2s, transform .2s;
  cursor: pointer;
}
.topic-card:hover        { border-color: rgba(245, 158, 11, 0.35); box-shadow: 0 10px 32px rgba(245, 158, 11, 0.1); transform: translateY(-2px); }
.topic-card:focus        { outline: 2px solid var(--accent); outline-offset: 2px; }
.topic-card.open         { border-color: rgba(245, 158, 11, 0.5); }

.topic-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  gap: 1rem;
}
.topic-meta    { display: flex; align-items: center; gap: .9rem; }
.topic-icon    { font-size: 1.6rem; line-height: 1; flex-shrink: 0; }
.topic-tag {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(245, 158, 11, 0.1);
  padding: .2rem .55rem;
  border-radius: 999px;
  margin-bottom: .3rem;
}
.topic-title { margin: 0; font-size: 1rem; font-weight: 700; color: #e6eef8; }

.topic-chevron {
  color: var(--muted);
  font-size: 1.1rem;
  transition: transform .3s;
  flex-shrink: 0;
  line-height: 1;
}
.topic-card.open .topic-chevron { transform: rotate(180deg); }

.topic-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s cubic-bezier(.4, 0, .2, 1), padding .3s;
}
.topic-card.open .topic-body { max-height: 1600px; padding: 0 1.25rem 1.25rem; }
.topic-body p           { color: var(--muted); font-size: .92rem; line-height: 1.65; margin: .5rem 0; }
.topic-body p:first-child { margin-top: 0; }
.topic-body strong      { color: #c8d9f0; }
.topic-body em          { color: var(--accent); font-style: normal; }

.topic-tags-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; }
.chip {
  font-size: .72rem;
  font-weight: 600;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.22);
  color: #b89cf5;
  padding: .25rem .55rem;
  border-radius: 999px;
  letter-spacing: .3px;
}

.topic-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .45rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.topic-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-height: 42px;
  padding: .55rem .7rem;
  border-radius: 8px;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  text-decoration: none;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.25;
  transition: border-color .15s, color .15s, background .15s;
}

.topic-links a::after {
  content: "↗";
  color: var(--accent);
  font-size: .8rem;
  line-height: 1;
  flex-shrink: 0;
}

.topic-links a:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent);
  color: #fff;
}

/* ── Utility classes ─────────────────────────────────────────────────── */
.brand-accent  { color: var(--accent); }
.mt-lg         { margin-top: 1.25rem; }
.text-white    { color: #fff; }
.mt-0          { margin-top: 0; }
.m-025         { margin: .25rem 0; }
.m-06          { margin: .6rem 0; }
.m-1           { margin-top: 1rem; }
.social-link   { color: var(--muted); text-decoration: none; margin-right: 1rem; transition: color .15s; }
.social-link:hover { color: #e6eef8; }
.text-muted    { color: var(--muted); }
.max-70ch      { max-width: 70ch; }
.mb-2          { margin-bottom: 2rem; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .card { margin-top: 1rem; }
}

@media (max-width: 700px) {
  header { padding: .85rem 1rem; }

  .nav-toggle { display: flex; }

  nav {
    display: none;
    position: fixed;
    inset: 0 0 0 30%;
    background: rgba(7, 16, 37, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem 2rem 2rem;
    gap: .2rem;
    z-index: 850;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
  }

  nav.nav-open { display: flex; }

  .nav-close {
    display: flex;
    align-self: flex-end;
    background: none;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: var(--muted);
    font-size: 1.2rem;
    line-height: 1;
    padding: .45rem .65rem;
    cursor: pointer;
    margin-bottom: .75rem;
  }

  .nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 840;
    cursor: pointer;
  }
  .nav-backdrop.active { display: block; }

  nav a {
    margin-left: 0;
    padding: .6rem .25rem;
    font-size: 1.05rem;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  }

  .lang-caret { display: none; }

  /* Bottom sheet for language picker on mobile */
  .lang-dropdown {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    min-width: unset;
    border-radius: 16px 16px 0 0;
    padding: 1rem .75rem 2rem;
    box-shadow: 0 -8px 40px rgba(2, 6, 23, 0.95);
    z-index: 1100;
  }
  .lang-dropdown::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    margin: 0 auto .85rem;
  }
  .lang-dropdown.open {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .25rem;
  }
  .lang-dropdown li {
    border-radius: 10px;
    font-size: .92rem;
    padding: .65rem .75rem;
  }
  .lang-dropdown li:hover { background: rgba(245, 158, 11, 0.12); }

  /* Hide profile aside in hero — save vertical space */
  .hero aside { display: none; }

  /* Collapsible sections */
  .section-body {
    overflow: hidden;
    transition: max-height .38s cubic-bezier(.4, 0, .2, 1);
    max-height: 5000px;
  }
  .section-collapsed .section-body { max-height: 0; }
  .section-collapsed { padding-bottom: .5rem; }

  .h2-heading {
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .section-chevron {
    font-size: .95rem;
    color: var(--muted);
    transition: transform .3s;
    flex-shrink: 0;
    margin-left: .5rem;
  }
  .section-collapsed .section-chevron { transform: rotate(-90deg); }
}

@media (max-width: 600px) {
  .cta { flex-direction: column; align-items: stretch; }
  .cta .btn-primary { width: 100%; display: block; }
  .hero { padding: 1.5rem 0; }
  section { padding: 2rem 0; }
}
