/* ═══════════════════════════════════════════════════════════════
   Portfolio R&D — Artur Flamandzki
   style.css
   ═══════════════════════════════════════════════════════════════ */

/* ── Custom Properties ───────────────────────────────────────── */
:root {
  --navy:       #1A3A5C;
  --navy-dark:  #0f2440;
  --navy-mid:   #2d5a8e;
  --navy-light: #e8f0f8;
  --amber:      #d4880a;
  --amber-light:#fef3dc;
  --text:       #1e2a38;
  --text-muted: #5a6878;
  --surface:    #ffffff;
  --bg:         #f5f7fa;
  --border:     #dce4ed;
  --shadow-sm:  0 1px 4px rgba(26,58,92,.08);
  --shadow-md:  0 4px 16px rgba(26,58,92,.12);
  --shadow-lg:  0 8px 32px rgba(26,58,92,.16);
  --radius:     8px;
  --radius-lg:  14px;
  --nav-h:      64px;
  --font:       'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono:  'Consolas', 'Fira Code', 'Courier New', monospace;
  --transition: 220ms ease;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

img { max-width: 100%; display: block; }
a   { color: var(--navy-mid); text-decoration: none; }
a:hover { color: var(--navy); text-decoration: underline; }

/* ── Typography ──────────────────────────────────────────────── */
h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; color: var(--navy); }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }

.section-title {
  font-size: 1.75rem;
  color: var(--navy);
  margin-bottom: .25rem;
}
.section-subtitle {
  color: var(--text-muted);
  font-size: .95rem;
  margin-bottom: 2rem;
}
.section-divider {
  border: none;
  border-top: 2px solid var(--navy);
  width: 48px;
  margin: .5rem 0 1.75rem;
}

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

section {
  padding: 5rem 0;
}
section:nth-child(even) {
  background: var(--surface);
}

/* ── Navigation ──────────────────────────────────────────────── */
#navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: var(--navy);
  box-shadow: var(--shadow-md);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-brand {
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .02em;
  white-space: nowrap;
  text-decoration: none;
}
.nav-brand:hover { color: #a8c8e8; }
.nav-brand span { color: #a8c8e8; font-weight: 400; }

.nav-links {
  display: flex;
  list-style: none;
  gap: .25rem;
}

.nav-links a {
  display: block;
  padding: .4rem .75rem;
  color: #c8dff0;
  font-size: .875rem;
  border-radius: 5px;
  transition: background var(--transition), color var(--transition);
}
.nav-links a:hover,
.nav-links a.active {
  background: rgba(255,255,255,.12);
  color: #fff;
  text-decoration: none;
}

/* nav-right groups lang switcher + hamburger */
.nav-right {
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* language switcher */
.lang-switcher {
  display: flex;
  gap: .2rem;
}
.lang-btn {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.2);
  color: #a8c8e8;
  padding: .2rem .55rem;
  border-radius: 4px;
  font-size: .75rem;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: .06em;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.lang-btn:hover  { background: rgba(255,255,255,.18); color: #fff; }
.lang-btn.active { background: rgba(255,255,255,.22); color: #fff; border-color: rgba(255,255,255,.4); }

/* hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: var(--transition);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Hero ────────────────────────────────────────────────────── */
#hero {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 60%, var(--navy-mid) 100%);
  color: #fff;
  padding: 6rem 0 5rem;
  text-align: center;
}

.hero-name {
  font-size: clamp(2rem, 5vw, 3.25rem);
  color: #fff;
  letter-spacing: .02em;
  margin-bottom: .5rem;
}
.hero-title {
  color: #a8c8e8;
  font-size: clamp(.9rem, 2vw, 1.15rem);
  font-weight: 400;
  margin-bottom: 2rem;
  letter-spacing: .03em;
}
.hero-quote {
  max-width: 680px;
  margin: 0 auto 2.5rem;
  font-style: italic;
  color: #d0e4f4;
  font-size: 1.05rem;
  line-height: 1.6;
  border-left: 3px solid #a8c8e8;
  padding-left: 1.25rem;
  text-align: left;
}
.hero-badges {
  display: flex;
  gap: .75rem;
  justify-content: center;
  flex-wrap: wrap;
}
.badge {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: #e0eefc;
  padding: .35rem .9rem;
  border-radius: 20px;
  font-size: .82rem;
  letter-spacing: .02em;
}

/* ── Section: Filozofia ──────────────────────────────────────── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.tool-card {
  background: var(--navy-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border-left: 4px solid var(--navy);
}
.tool-card h4 { margin-bottom: .5rem; font-size: 1rem; }
.tool-card p  { font-size: .9rem; color: var(--text-muted); }

/* ── Section: Ewolucja (Timeline) ───────────────────────────── */
.timeline {
  position: relative;
  padding-left: 2.5rem;
  margin-top: 1.5rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: .65rem;
  top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--navy), var(--navy-mid));
}
.timeline-item {
  position: relative;
  margin-bottom: 2rem;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.87rem;
  top: .35rem;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--navy);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--navy);
}
.timeline-period {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--navy-mid);
  margin-bottom: .2rem;
}
.timeline-item h4  { margin-bottom: .25rem; }
.timeline-item p   { font-size: .9rem; color: var(--text-muted); }

.timeline-note {
  background: var(--amber-light);
  border: 1px solid #f0c060;
  border-radius: var(--radius);
  padding: 1.1rem 1.4rem;
  margin-top: 1.5rem;
  font-size: .93rem;
  line-height: 1.65;
}
.timeline-note strong { color: var(--amber); }

/* ── Section: MR Terminologia ───────────────────────────────── */
.mr-header {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin-bottom: 2rem;
}
.mr-header h3 { color: #a8c8e8; margin-bottom: .5rem; font-size: 1.1rem; }
.mr-header p  { color: #d0e4f4; font-size: .95rem; line-height: 1.65; }

.frameworks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}
.framework-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.6rem;
  transition: box-shadow var(--transition), transform var(--transition);
}
.framework-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.framework-tag {
  display: inline-block;
  background: var(--navy);
  color: #fff;
  font-family: var(--font-mono);
  font-size: .78rem;
  padding: .2rem .6rem;
  border-radius: 4px;
  margin-bottom: .6rem;
  letter-spacing: .04em;
}
.framework-card h4  { margin-bottom: .4rem; font-size: 1rem; }
.framework-card p   { font-size: .88rem; color: var(--text-muted); line-height: 1.6; }
.framework-manifest {
  font-style: italic;
  font-size: .83rem;
  color: var(--navy-mid);
  margin-top: .6rem;
  border-top: 1px solid var(--border);
  padding-top: .6rem;
}

.mr-ai-box {
  background: linear-gradient(135deg, var(--navy-light), #fff);
  border: 2px solid var(--navy);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin-top: 2rem;
}
.mr-ai-box .label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--navy-mid);
  margin-bottom: .4rem;
}
.mr-ai-box h3  { margin-bottom: .6rem; }
.mr-ai-box p   { font-size: .93rem; color: var(--text-muted); }

/* ── Section: Projekty ───────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: .875rem;
}
thead th {
  background: var(--navy);
  color: #fff;
  padding: .85rem 1rem;
  text-align: left;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}
thead th:first-child { width: 42px; text-align: center; }
tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:last-child  { border-bottom: none; }
tbody tr:hover       { background: var(--navy-light); }
tbody td { padding: .75rem 1rem; vertical-align: top; }
tbody td:first-child {
  text-align: center;
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.proj-name   { font-weight: 600; color: var(--navy); display: block; margin-bottom: .15rem; }
.proj-tech   { font-size: .78rem; color: var(--text-muted); font-family: var(--font-mono); }
.proj-result { font-size: .85rem; }
.tag-domain  {
  display: inline-block;
  background: var(--navy-light);
  color: var(--navy);
  font-size: .72rem;
  padding: .15rem .5rem;
  border-radius: 3px;
  margin-top: .3rem;
  font-family: var(--font-mono);
}

/* row category color bars */
tbody tr[data-cat="embedded"]  td:first-child { border-left: 3px solid #2d7dd2; }
tbody tr[data-cat="math"]      td:first-child { border-left: 3px solid #7b2d9b; }
tbody tr[data-cat="ai"]        td:first-child { border-left: 3px solid #1b8a50; }
tbody tr[data-cat="own"]       td:first-child { border-left: 3px solid #c47c00; }
tbody tr[data-cat="commercial"]td:first-child { border-left: 3px solid #c0392b; }

.legend {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  font-size: .8rem;
}
.legend-item { display: flex; align-items: center; gap: .4rem; }
.legend-dot  {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* filter buttons */
.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: .3rem .85rem;
  border-radius: 20px;
  font-size: .8rem;
  font-family: var(--font);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.filter-btn:hover {
  background: var(--navy-light);
  border-color: var(--navy-mid);
  color: var(--navy);
}
.filter-btn.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.filter-btn.active .legend-dot { box-shadow: 0 0 0 2px rgba(255,255,255,.5); }

/* hidden table rows */
tbody tr.filter-hidden { display: none; }

/* ── Section: Case Studies ───────────────────────────────────── */
.accordion { display: flex; flex-direction: column; gap: 1.25rem; }

.accordion-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.accordion-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.4rem 1.75rem;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  transition: background var(--transition);
}
.accordion-header:hover { background: var(--navy-light); }

.accordion-num {
  background: var(--navy);
  color: #fff;
  font-family: var(--font-mono);
  font-size: .78rem;
  padding: .3rem .7rem;
  border-radius: 4px;
  flex-shrink: 0;
}
.accordion-title { font-weight: 700; font-size: 1.05rem; color: var(--navy); flex: 1; }
.accordion-icon  {
  font-size: 1.3rem;
  color: var(--navy-mid);
  transition: transform var(--transition);
  flex-shrink: 0;
}
.accordion-item.open .accordion-icon { transform: rotate(45deg); }

.accordion-body {
  display: none;
  padding: 0 1.75rem 1.75rem;
  border-top: 1px solid var(--border);
}
.accordion-item.open .accordion-body { display: block; }

.innovation-block {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  border-left: 4px solid var(--navy-mid);
}
.innovation-block h4 {
  font-size: .95rem;
  margin-bottom: .5rem;
  color: var(--navy);
}
.innovation-block p  { font-size: .9rem; color: var(--text-muted); }

.results-box {
  background: var(--amber-light);
  border: 1px solid #f0c060;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.results-box h4      { margin-bottom: .5rem; color: var(--amber); }
.results-box p, .results-box li { font-size: .9rem; }
.results-box ul      { padding-left: 1.25rem; }
.results-box li      { margin-bottom: .25rem; }

/* ── Section: Podsumowanie ───────────────────────────────────── */
.skills-enterprise {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.6rem;
  border-top: 3px solid var(--navy);
}
.skill-card h4  { margin-bottom: .5rem; font-size: 1rem; }
.skill-card p   { font-size: .88rem; color: var(--text-muted); }

.cta-block {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
  margin-top: 2.5rem;
  text-align: center;
}
.cta-block h3 { color: #a8c8e8; margin-bottom: .5rem; }
.cta-block p  { color: #c8dff0; font-size: .93rem; }
.cta-links    {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}
.cta-btn {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  padding: .6rem 1.4rem;
  border-radius: 6px;
  font-size: .9rem;
  transition: background var(--transition);
  cursor: pointer;
}
.cta-btn:hover {
  background: rgba(255,255,255,.22);
  text-decoration: none;
  color: #fff;
}

/* ── Footer ──────────────────────────────────────────────────── */
footer {
  background: var(--navy-dark);
  color: #6a8aaa;
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: .83rem;
}
footer a { color: #8aaed0; }

/* ── Utilities ───────────────────────────────────────────────── */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 820px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--navy-dark);
    flex-direction: column;
    padding: .75rem 1rem 1.25rem;
    gap: 0;
    box-shadow: var(--shadow-lg);
  }
  .nav-links.open { display: flex; }
  .nav-toggle     { display: flex; }
  section         { padding: 3.5rem 0; }
  .mr-header, .mr-ai-box { padding: 1.25rem; }
  .lang-btn       { font-size: .7rem; padding: .15rem .45rem; }
}

@media (max-width: 500px) {
  .hero-name  { font-size: 1.75rem; }
  h2          { font-size: 1.4rem; }
  .frameworks-grid { grid-template-columns: 1fr; }
}
