/* Local Open Fonts: Inter & Manrope (SIL Open Font License 1.1 — see ../fonts/OFL.txt) */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/inter-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/inter-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url('../fonts/manrope-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url('../fonts/manrope-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url('../fonts/manrope-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url('../fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Colors (inlined from replica/design/tokens.css for standalone deployment) */
  --color-bg: #ffffff;
  --color-surface: #f5f0dd;
  --color-surface-card-top: #fcf9ef;
  --color-surface-footer: #f5f5f5;
  --color-surface-nav: #222222;
  --color-surface-banner: #1e2229;
  --color-border: #d5d5d5;
  --color-border-footer: #dddddd;
  --color-border-card-top: #f6f0e0;
  --color-border-card-side: #e9e5db;
  --color-border-card-bottom: #beb395;
  --color-border-input: #767676;
  --color-text: #222222;
  --color-text-muted: #555555;
  --color-text-nav: #ffffff;
  --color-text-nav-muted: #d9d9d9;
  --color-text-banner: #f3f4f6;
  --color-accent: #1d5fa7;
  --color-accent-hover: #123e70;
  --color-on-accent: #ffffff;
  --color-danger: #a94442;
  --color-success: #1f7a4d;

  /* Gradients */
  --gradient-card: linear-gradient(to bottom, var(--color-surface-card-top) 0%, var(--color-surface) 100%);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Manrope', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  --text-xs-size: 12px;
  --text-xs-line: 18px;
  --text-sm-size: 14px;
  --text-sm-line: 22px;
  --text-base-size: 16px;
  --text-base-line: 26px;
  --text-lg-size: 20px;
  --text-lg-line: 28px;
  --text-xl-size: 28px;
  --text-xl-line: 36px;
  --text-display-size: 34px;
  --text-display-line: 42px;

  /* Spacing */
  --space-0: 0px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 15px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 48px;
  --space-footer: 60px;
  --space-header-offset: 70px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-card: inset 0 -2px rgba(219, 213, 191, 1), 0 2px 6px rgba(0, 0, 0, 0.12);
  --shadow-card-hover: inset 0 -2px rgba(219, 213, 191, 1), 0 8px 20px rgba(0, 0, 0, 0.22);
  --shadow-banner: 0 10px 30px rgba(0, 0, 0, 0.35);

  /* Layout */
  --container-max-width: 1170px;
  --card-width: 340px;
  --card-img-width: 316px;
  --project-img-max-width: 500px;
  --project-text-max-width: 800px;

  /* Motion */
  --motion-fast: 120ms;
  --motion-base: 200ms;
  --motion-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  min-width: 320px;
  margin: var(--space-0);
  padding: var(--space-0);
  font-family: var(--font-sans);
  font-size: var(--text-sm-size);
  line-height: var(--text-sm-line);
  color: var(--color-text);
  background-color: var(--color-bg);
  background-image: url('../images/page-bg.png');
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--motion-fast) var(--motion-ease);
}

a:hover,
a:focus {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Sticky footer layout */
.wrap {
  margin: var(--space-0) auto calc(var(--space-footer) * -1);
  height: auto;
  min-height: 100%;
  padding: var(--space-0) var(--space-0) var(--space-footer);
}

.container {
  width: 100%;
  max-width: var(--container-max-width);
  min-width: 320px;
  margin-right: auto;
  margin-left: auto;
  padding-right: var(--space-4);
  padding-left: var(--space-4);
}

.wrap > .container {
  padding-top: var(--space-header-offset);
  padding-bottom: var(--space-5);
}

/* Top Navbar */
.navbar-inverse {
  background-color: var(--color-surface-nav);
  border-bottom: 1px solid var(--color-text);
}

.navbar-fixed-top {
  position: fixed;
  top: var(--space-0);
  right: var(--space-0);
  left: var(--space-0);
  z-index: 1030;
  min-height: 50px;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
}

.navbar-header {
  display: flex;
  align-items: center;
}

.navbar-brand {
  display: inline-block;
  padding: var(--space-3) var(--space-0);
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: var(--text-sm-line);
  color: var(--color-text-nav-muted);
  text-decoration: none;
}

.navbar-brand:hover,
.navbar-brand:focus {
  color: var(--color-text-nav);
  text-decoration: none;
}

.navbar-nav {
  list-style: none;
  margin: var(--space-0);
  padding: var(--space-0);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.navbar-nav a {
  color: var(--color-text-nav-muted);
  font-size: var(--text-sm-size);
  font-weight: 500;
  padding: var(--space-2) var(--space-3);
}

.navbar-nav a:hover,
.navbar-nav a:focus {
  color: var(--color-text-nav);
  text-decoration: none;
}

/* Headings & Divider lines */
div.title {
  text-align: center;
}

div.title h1,
div.title h2,
.project-view h1 {
  font-family: var(--font-heading);
  margin-top: var(--space-5);
  margin-bottom: var(--space-3);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

div.title h2 {
  font-size: var(--text-xl-size);
  line-height: var(--text-xl-line);
}

.project-view h1 {
  font-size: var(--text-display-size);
  line-height: var(--text-display-line);
  text-align: center;
}

.line {
  width: 100%;
  margin-top: var(--space-6);
  margin-bottom: var(--space-4);
  height: 1px;
  background-color: var(--color-border);
  border: none;
}

/* About Section */
div.about-my {
  text-align: center;
  background-image: url('../images/grey_gradient.png');
  background-repeat: no-repeat;
  background-position: top center;
  padding: var(--space-4) var(--space-5);
  font-size: 15px;
  line-height: 1.75;
}

div.about-my span {
  font-weight: 600;
}

/* Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin: var(--space-4) auto;
  padding: var(--space-1) var(--space-2);
}

.filter-btn {
  font-family: var(--font-sans);
  font-size: var(--text-xs-size);
  font-weight: 500;
  line-height: var(--text-xs-line);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-card-bottom);
  background: var(--gradient-card);
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--motion-fast) var(--motion-ease);
}

.filter-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.filter-btn[aria-pressed="true"] {
  background: var(--color-accent);
  color: var(--color-on-accent);
  border-color: var(--color-accent);
}

/* Portfolio Grid (#body-cards) — Balanced 3-column CSS Grid & Uniform Card Layout */
#body-cards {
  margin: var(--space-4) auto;
  width: 100%;
  min-width: 320px;
  padding: var(--space-6);
  background-image: url('../images/dark-content-bg.png');
  border-radius: var(--radius-md);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: var(--space-5);
  align-items: stretch;
}

.card {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  border: 1px solid;
  border-top-color: var(--color-border-card-top);
  border-left-color: var(--color-border-card-side);
  border-right-color: var(--color-border-card-side);
  border-bottom-color: var(--color-border-card-bottom);
  background: var(--gradient-card);
  overflow: hidden;
  width: 100%;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform var(--motion-base) var(--motion-ease),
              box-shadow var(--motion-base) var(--motion-ease);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}

.card[hidden] {
  display: none !important;
}

.project_title {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--space-3);
}

.project_title > a:first-child {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--color-accent);
}

.project_title > a:nth-child(2) {
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background-color: #ffffff;
  border: 1px solid var(--color-border-card-side);
}

.small_img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  height: auto;
  margin: var(--space-0) auto;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius-sm);
  transition: transform var(--motion-base) var(--motion-ease);
}

.card:hover .small_img {
  transform: scale(1.02);
}

.project_technologyDevelopment {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--color-text-muted);
  padding: var(--space-2) var(--space-2) var(--space-1);
  border-top: 1px solid var(--color-border-card-side);
  width: 100%;
}

.empty-filter-state {
  grid-column: 1 / -1;
  color: var(--color-on-accent);
  text-align: center;
  padding: var(--space-6);
  font-size: var(--text-base-size);
}

/* Project Detail View (#project) */
.project-view {
  padding-bottom: var(--space-6);
}

#project {
  margin-top: var(--space-5);
}

#project .left {
  width: 100%;
  text-align: center;
  margin-bottom: var(--space-6);
}

#project .left img {
  width: 100%;
  max-width: var(--project-img-max-width);
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

#project .right {
  text-align: left;
  max-width: var(--project-text-max-width);
  margin: var(--space-0) auto;
  font-size: var(--text-base-size);
  line-height: var(--text-base-line);
}

#project .right h2 {
  font-family: var(--font-heading);
  text-align: left;
  font-size: var(--text-lg-size);
  font-weight: 700;
  line-height: var(--text-lg-line);
  margin-top: var(--space-7);
  margin-bottom: var(--space-3);
  color: var(--color-text);
}

#project .right p {
  margin-top: var(--space-0);
  margin-bottom: var(--space-4);
}

.project_link,
.project_description,
.project_team,
.project_duration_development,
.project_technology_development {
  margin-bottom: var(--space-4);
}

.project_link a {
  font-weight: 600;
  word-break: break-all;
}

.back-nav {
  max-width: var(--project-text-max-width);
  margin: var(--space-6) auto var(--space-0);
  text-align: center;
}

.back-link {
  display: inline-block;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-card-bottom);
  background: var(--gradient-card);
  color: var(--color-accent);
  font-size: var(--text-sm-size);
  font-weight: 600;
}

.back-link:hover {
  text-decoration: none;
  box-shadow: var(--shadow-card-hover);
}

/* Footer */
.footer {
  height: var(--space-footer);
  background-color: var(--color-surface-footer);
  border-top: 1px solid var(--color-border-footer);
  padding-top: var(--space-5);
}

.footer p {
  margin: var(--space-0);
  text-align: center;
  font-size: var(--text-sm-size);
}

.footer .email-bold {
  font-weight: 600;
}

/* Cookie & Analytics Consent Banner */
.cookie-banner {
  position: fixed;
  bottom: var(--space-5);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1050;
  width: calc(100% - 30px);
  max-width: 760px;
  background-color: var(--color-surface-banner);
  color: var(--color-text-banner);
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-banner);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}

.cookie-banner[hidden] {
  display: none !important;
}

.cookie-banner__text {
  margin: var(--space-0);
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-banner);
}

.cookie-banner__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.cookie-btn {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--motion-fast) var(--motion-ease);
}

.cookie-btn--accept {
  background-color: var(--color-accent);
  color: var(--color-on-accent);
  border: 1px solid var(--color-accent);
}

.cookie-btn--accept:hover {
  background-color: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.cookie-btn--decline {
  background-color: transparent;
  color: var(--color-text-banner);
  border: 1px solid var(--color-border-input);
}

.cookie-btn--decline:hover {
  border-color: var(--color-text-banner);
}

/* Mobile Responsive Adjustments */
@media screen and (max-width: 640px) {
  #body-cards {
    padding: var(--space-4) var(--space-3);
    grid-template-columns: 1fr;
  }

  .project-view h1 {
    font-size: var(--text-xl-size);
    line-height: var(--text-xl-line);
  }

  .footer {
    height: auto;
    min-height: var(--space-footer);
    padding: var(--space-4) var(--space-2);
  }

  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
    bottom: var(--space-3);
    padding: var(--space-4);
    gap: var(--space-3);
  }

  .cookie-banner__actions {
    justify-content: flex-end;
  }
}
