@layer reset, base, layout, components, responsive, enhancements, theme;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  body, h1, h2, p, ul { margin: 0; }
  ul { padding: 0; list-style: none; }
  button, a { -webkit-tap-highlight-color: transparent; }
  button { font: inherit; }
  button, a { touch-action: manipulation; }
  [hidden] { display: none !important; }
}

@layer base {
  :root {
    color-scheme: dark;
    --page: #090d12;
    --surface: #0c1117;
    --line: #242c38;
    --line-soft: #1c2430;
    --text: #f1f3fa;
    --muted: #a3afc3;
    --subtle: #788599;
    --mint: #39dba0;
    --font: 'Inter', 'Avenir Next', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-family: var(--font);
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }
  body {
    min-width: 320px;
    background: radial-gradient(ellipse at 45% -25%, #18223155, transparent 65%), var(--page);
    color: var(--text);
    font-size: 15px;
  }
  html { scrollbar-gutter: stable; }
  body::before {
    position: fixed;
    z-index: -1;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23ffffff' filter='url(%23n)' opacity='.13' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
    opacity: .12;
    pointer-events: none;
    content: '';
  }
  button { cursor: pointer; }
  a { color: inherit; text-decoration: none; }
  button:focus-visible, a:focus-visible { outline: 2px solid #9ab8f8; outline-offset: 5px; }
  ::selection { color: white; background: #42537d; }
  .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
}

@layer enhancements {
  .page-header { margin-bottom: 27px; align-items: center; }
  .gallery-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px 20px; margin-bottom: 24px; }
  .category-control { position: relative; display: flex; align-items: center; flex: 1 1 0; min-width: 0; gap: 8px; }
  .gallery-toolbar .filters { display: flex; flex: 1 1 0; flex-wrap: nowrap; min-width: 0; width: auto; overflow: hidden; }
  .gallery-toolbar .filter { flex: 0 0 auto; max-width: 160px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .category-control .filter:focus-visible { outline-offset: -3px; }
  .category-more { display: inline-flex; align-items: center; justify-content: space-between; flex: 0 0 84px; gap: 8px; min-height: 38px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 99px; background: #11171f8c; color: var(--muted); font-size: 12px; line-height: 20px; }
  .category-more .icon { width: 13px; height: 13px; }
  .category-more:hover, .category-more[aria-expanded="true"] { color: var(--text); border-color: #465167; background: #18212c; }
  .category-panel { position: absolute; z-index: 6; right: 0; top: calc(100% + 9px); display: flex; flex-direction: column; width: min(300px, calc(100vw - 30px)); overflow: hidden; border: 1px solid #333e4f; border-radius: 13px; background: #121922; box-shadow: 0 16px 45px #0008; }
  .category-panel[data-placement="above"] { top: auto; bottom: calc(100% + 9px); }
  .category-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 12px; }
  .category-panel-header h2 { font-size: 13px; font-weight: 600; }
  .category-panel-header > span { color: var(--subtle); font-size: 10px; }
  .category-search { display: flex; align-items: center; flex-shrink: 0; gap: 9px; margin: 0 12px 10px; padding: 7px 10px; border: 1px solid #303c4f; border-radius: 8px; background: #0b111a; color: var(--subtle); }
  .category-search:focus-within { border-color: #6684ae; }
  .category-search .icon { width: 16px; height: 16px; }
  .category-search input { width: 100%; min-width: 0; border: 0; padding: 0; outline: none; background: transparent; color: var(--text); font: 12px/22px var(--font); }
  .category-search input::placeholder { color: var(--subtle); }
  .category-options { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 0 7px 8px; }
  .category-option { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 8px 9px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); text-align: left; font-size: 12px; }
  .category-option:hover { color: var(--text); background: #1c2634; }
  .category-option[aria-pressed="true"] { color: var(--text); background: #23334a80; border-color: #3c53714d; }
  .category-option:focus-visible { outline-offset: -2px; }
  .category-option-label { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .category-option-count { color: var(--subtle); font-size: 10px; font-variant-numeric: tabular-nums; }
  .category-option-check { width: 14px; color: #a3bbdf; visibility: hidden; }
  .category-option-check .icon { width: 14px; height: 14px; }
  .category-option[aria-pressed="true"] .category-option-check { visibility: visible; }
  .category-empty { padding: 16px 12px 26px; color: var(--muted); text-align: center; font-size: 12px; }
  .footer-name { padding-top: 18px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: .1px; }
  #footer-tools:not([hidden]) + .footer-name { margin-top: 24px; }
  .gallery-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 14px; margin-left: auto; }
  .deployed-toggle { display: inline-flex; align-items: center; gap: 9px; min-height: 40px; padding: 8px 4px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; transition: color .18s; }
  .deployed-toggle:hover { color: var(--text); }
  .toggle-track { display: inline-flex; align-items: center; width: 28px; height: 17px; padding: 2px; border: 1px solid #455064; border-radius: 99px; background: #1a222e; transition: background .18s, border-color .18s; }
  .toggle-track > span { width: 11px; height: 11px; border-radius: 50%; background: #8794a9; transition: transform .18s, background .18s; }
  .deployed-toggle[aria-pressed="true"] { color: #b4eed8; }
  .deployed-toggle[aria-pressed="true"] .toggle-track { background: #276c52; border-color: #3c9b78; }
  .deployed-toggle[aria-pressed="true"] .toggle-track > span { transform: translateX(11px); background: #c7ffe8; }
  .gallery-empty { grid-column: 1 / -1; display: flex; align-items: center; flex-direction: column; justify-content: center; min-height: 290px; padding: 40px 22px; border: 1px dashed #303b4c; border-radius: 13px; text-align: center; background: #10172045; }
  .gallery-empty-icon { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; margin-bottom: 17px; border: 1px solid #303b4c; border-radius: 12px; color: #8b9bb4; background: #192332; }
  .gallery-empty h2 { font-size: 18px; font-weight: 550; letter-spacing: -.3px; }
  .gallery-empty p { max-width: 400px; margin-top: 9px; color: var(--muted); font-size: 13px; line-height: 1.65; }
  .gallery-empty button { margin-top: 20px; padding: 9px 15px; border: 1px solid #354257; border-radius: 8px; background: #1b2635; color: #d9e5f8; font-size: 12px; }
  .gallery-empty button:hover { border-color: #607698; background: #253449; }
  .search-trigger, .view-trigger { display: inline-flex; align-items: center; gap: 12px; min-height: 40px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: #11171f8c; transition: color .18s, border-color .18s, background .18s; }
  .search-trigger:hover, .view-trigger:hover, .view-trigger[aria-expanded="true"] { color: var(--text); background: #18212c; border-color: #465167; }
  .search-trigger { justify-content: space-between; width: 246px; padding: 8px 10px 8px 13px; font-size: 12px; }
  .search-trigger-label { display: flex; align-items: center; gap: 10px; }
  .search-trigger .icon { width: 17px; height: 17px; }
  kbd { display: inline-flex; justify-content: center; align-items: center; flex-shrink: 0; padding: 2px 5px; min-width: 22px; border: 1px solid #343d4b; border-radius: 5px; background: #ffffff04; color: #a7b3c7; font: 11px/17px var(--font); }
  .view-control { position: relative; flex-shrink: 0; }
  .view-trigger { padding: 8px 12px; gap: 9px; font-size: 12px; }
  .view-trigger .icon { width: 16px; height: 16px; }
  .view-trigger .icon-chevron { width: 13px; color: var(--subtle); }
  .view-panel { position: absolute; z-index: 5; right: 0; top: calc(100% + 9px); width: 272px; padding: 18px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; border: 1px solid #333e4f; border-radius: 13px; background: #121922; box-shadow: 0 16px 45px #0008, 0 1px 0 #ffffff06 inset; }
  .view-panel[data-placement="above"] { top: auto; bottom: calc(100% + 9px); }
  .view-panel-title { color: var(--text); font-size: 13px; font-weight: 600; }
  .view-setting { margin-top: 17px; }
  .view-setting > p { margin-bottom: 8px; color: var(--muted); font-size: 11px; }
  .column-options, .density-options, .theme-options { display: grid; gap: 4px; padding: 4px; background: #090e16; border: 1px solid var(--line-soft); border-radius: 8px; }
  .column-options { grid-template-columns: 1.35fr repeat(4, 1fr); }
  .density-options, .theme-options { grid-template-columns: 1fr 1fr; }
  .theme-options button { display: flex; align-items: center; justify-content: center; gap: 7px; }
  .theme-options .icon { width: 14px; height: 14px; }
  .view-setting button { border: 1px solid transparent; border-radius: 5px; min-height: 32px; padding: 4px; background: transparent; color: #8e9bb0; font-size: 11px; }
  .view-setting button:hover { color: var(--text); background: #1c2632; }
  .view-setting button[aria-pressed="true"] { color: #eef2fc; background: #253042; border-color: #3a4960; box-shadow: 0 1px 3px #0003; }
  .view-note { margin-top: 15px; color: var(--subtle); font-size: 10px; }
  .card-detail-settings { padding-top: 15px; border-top: 1px solid var(--line-soft); }
  .view-setting .detail-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 39px; padding: 7px 0; border: 0; color: var(--muted); text-align: left; }
  .view-setting .detail-toggle:hover { color: var(--text); background: transparent; }
  .detail-toggle .toggle-track { flex-shrink: 0; }
  .detail-toggle[aria-checked="true"] .toggle-track { background: #276c52; border-color: #3c9b78; }
  .detail-toggle[aria-checked="true"] .toggle-track > span { transform: translateX(11px); background: #c7ffe8; }

  .project-grid[data-columns="1"] { grid-template-columns: minmax(0, 1fr); }
  .project-grid[data-columns="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-grid[data-columns="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .project-grid[data-columns="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .project-card { scroll-margin: 24px; }
  .project-card.is-highlighted { border-color: #8ba8e2; box-shadow: 0 0 0 3px #8ba8e222, 0 0 28px #8ba8e21a; }
  .project-card:focus { outline: none; }
  .project-card:focus-visible { outline: 2px solid #9ab8f8; outline-offset: 3px; }
  .project-grid[data-density="compact"] { gap: 15px; }
  [data-density="compact"] .project-media { aspect-ratio: 3.2; }
  [data-density="compact"] .project-body { padding: 12px; }
  [data-density="compact"] .project-body h2 { font-size: 17px; letter-spacing: -.3px; }
  [data-density="compact"] .project-description { display: none; }
  [data-density="compact"] .project-tags { min-height: 34px; padding-top: 8px; margin-top: 10px; gap: 8px; }
  [data-density="compact"] .project-tags li { gap: 7px; font-size: 10px; }
  [data-density="compact"] .project-tags .icon { width: 16px; height: 16px; }
  [data-density="compact"] .project-tags li:last-child { padding-right: 0; }
  [data-density="compact"] .tech-list { margin: 8px 0 0; gap: 6px; }
  [data-density="compact"] .tech-chip { min-height: 28px; padding: 3px 7px; gap: 6px; font-size: 10px; line-height: 18px; }
  [data-density="compact"] .tech-chip .brand-icon { width: 16px; height: 16px; }
  [data-density="compact"] .status-badge { top: 11px; left: 11px; min-height: 26px; padding: 3px 9px; gap: 6px; font-size: 10px; }
  [data-density="compact"] .status-badge .icon { width: 13px; height: 13px; }
  [data-density="compact"] .project-arrow { top: 15px; right: 14px; }
  [data-density="compact"] .project-arrow .icon { width: 15px; height: 15px; }
  [data-show-footer="false"] .project-body { padding-bottom: 14px; }
  [data-show-footer="false"] .tech-list { margin-bottom: 0; }
  [data-show-stack="false"] .project-tags { margin-top: 12px; }

  body:has(.command-dialog[open]) { overflow: hidden; }
  .command-dialog { width: min(600px, calc(100% - 32px)); max-height: calc(100dvh - min(16vh, 130px) - 24px); margin: min(16vh, 130px) auto auto; padding: 0; overflow: hidden; border: 1px solid #384456; border-radius: 17px; background: #111820; color: var(--text); box-shadow: 0 30px 100px #0009, 0 0 0 1px #ffffff04 inset; }
  .command-dialog[open] { display: flex; flex-direction: column; }
  .command-dialog > :not(.command-results) { flex-shrink: 0; }
  .command-dialog::backdrop { background: #03070ec2; backdrop-filter: blur(7px); }
  .command-input-row { display: flex; align-items: center; gap: 13px; padding: 17px 19px; border-bottom: 1px solid #293342; }
  .command-input-row > span { color: #8f9fba; }
  .command-input-row .icon { width: 21px; height: 21px; }
  #command-input { flex: 1; width: 100%; min-width: 0; padding: 4px 0; border: 0; outline: none; background: transparent; color: var(--text); font: 15px/24px var(--font); caret-color: #a9c4ff; }
  #command-input::placeholder { color: #74849d; }
  #command-input::-webkit-search-cancel-button { display: none; }
  .command-close { display: flex; align-items: center; justify-content: center; padding: 6px 0 6px 6px; border: 0; border-radius: 6px; background: transparent; }
  .command-close:hover kbd { background: #263244; color: var(--text); }
  .command-scopes { display: flex; gap: 4px; padding: 12px 16px 0; }
  .command-scopes button { padding: 7px 11px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); font-size: 11px; line-height: 16px; }
  .command-scopes button:hover { color: var(--text); background: var(--surface); }
  .command-scopes button[aria-pressed="true"] { color: var(--text); background: var(--line-soft); border-color: var(--line); }
  .command-results-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 20px 9px; color: #9aa9bf; font-size: 10px; }
  #command-results-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #command-result-count { color: var(--subtle); }
  #command-result-count { flex-shrink: 0; }
  .command-results { min-height: 0; max-height: 420px; overflow-y: auto; overscroll-behavior: contain; padding: 0 9px 9px; scrollbar-width: thin; scrollbar-color: #344054 transparent; }
  .command-group + .command-group { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
  .command-group-label { padding: 8px 10px 5px; color: var(--subtle); font-size: 10px; font-weight: 550; }
  .command-result { display: flex; align-items: center; gap: 12px; min-height: 67px; padding: 11px 10px; margin: 2px 0; border: 1px solid transparent; border-radius: 9px; cursor: pointer; }
  .command-result[aria-selected="true"] { background: #202d405e; border-color: #384b677a; }
  .command-result-command, .command-result-category { min-height: 58px; padding-block: 8px; }
  .command-project-icon { display: flex; justify-content: center; align-items: center; flex: 0 0 36px; height: 36px; border-radius: 9px; background: #34486b3d; border: 1px solid #516d9c38; }
  .command-tone-green { background: #267c4e26; border-color: #397d5a3d; }
  .command-tone-amber { background: #90653826; border-color: #98754538; }
  .command-tone-purple { background: #5d468f38; border-color: #7960b83d; }
  .command-tone-rose { background: #903e5126; border-color: #a4506633; }
  .command-tone-neutral { background: var(--surface); border-color: var(--line); color: var(--muted); }
  .command-project-icon .icon { width: 18px; height: 18px; }
  .command-project-info { display: flex; flex: 1; flex-direction: column; min-width: 0; gap: 4px; }
  .command-project-title { font-size: 13px; font-weight: 550; line-height: 18px; overflow-wrap: anywhere; }
  .command-project-description { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #8393ad; font-size: 11px; line-height: 16px; }
  .command-project-category { color: #8291a9; font-size: 10px; }
  .command-state { flex-shrink: 0; max-width: 95px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font-size: 10px; line-height: 14px; }
  .command-result-action { display: flex; flex-shrink: 0; width: 25px; justify-content: center; color: #92a4c1; }
  .command-result-action .icon { width: 15px; height: 15px; }
  .command-result-action .icon-chevron { transform: rotate(-90deg); }
  .command-result .command-result-action.is-current { opacity: 1; color: var(--mint); }
  .command-result:not([aria-selected="true"]) .command-result-action { opacity: .35; }
  .command-empty { padding: 30px 20px 40px; text-align: center; }
  .command-empty > span:first-child { display: flex; justify-content: center; margin-bottom: 13px; color: #74849d; }
  .command-empty p { margin-bottom: 7px; font-size: 14px; }
  .command-empty > span:last-child { color: #8999b1; font-size: 12px; }
  .command-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 18px; border-top: 1px solid #273140; background: #0b111980; color: #8999b1; font-size: 10px; }
  .command-footer > span { display: inline-flex; gap: 5px; align-items: center; }
  .command-footer kbd { min-width: 18px; padding: 0 4px; font-size: 10px; line-height: 18px; }

  @media (min-width: 651px) {
    .project-grid[data-columns="1"] .project-card { flex-direction: row; }
    .project-grid[data-columns="1"] .project-media { flex: 0 0 38%; min-height: 208px; aspect-ratio: auto; border-right: 1px solid var(--line-soft); border-bottom: 0; }
    .project-grid[data-columns="1"] .project-art { position: absolute; inset: 0; }
    .project-grid[data-columns="1"] .project-body { min-width: 0; padding-top: 18px; }
    .project-grid[data-columns="1"] .project-description { min-height: auto; }
    .project-grid[data-columns="1"][data-density="compact"] .project-media { flex-basis: 26%; min-width: 200px; min-height: 98px; }
    .project-grid[data-columns="1"][data-density="compact"] .project-body { justify-content: center; padding: 16px 20px; }
  }
  @media (max-width: 1300px) and (min-width: 1051px) {
    .project-grid[data-columns="4"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  }
  @media (max-width: 1050px) {
    .page-header { flex-direction: row; }
    .project-grid[data-columns="3"], .project-grid[data-columns="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @media (max-width: 800px) {
    .search-trigger { width: auto; gap: 20px; }
    .gallery-toolbar .filters { gap: 7px; }
    .gallery-toolbar .filter { padding-inline: 16px; }
    .title-row { flex-wrap: wrap; row-gap: 3px; }
  }
  @media (max-width: 650px) {
    .page-header { flex-direction: column; align-items: stretch; gap: 18px; margin-bottom: 17px; }
    .search-trigger { width: 100%; min-height: 43px; }
    .gallery-toolbar { flex-wrap: wrap; gap: 13px; margin-bottom: 18px; }
    .category-control { flex: 1 0 100%; }
    .gallery-toolbar .filters { display: flex; flex: 1 1 0; gap: 7px; }
    .gallery-toolbar .filter { max-width: min(148px, calc(100vw - 160px)); }
    .category-more { flex-basis: 76px; min-height: 44px; padding-inline: 11px; }
    .category-option { min-height: 42px; }
    .category-search input { font-size: 16px; }
    .gallery-toolbar .filter { padding-inline: 8px; }
    .view-control { margin-left: auto; }
    .view-trigger { min-height: 40px; }
    .deployed-toggle { min-height: 44px; }
    .view-setting button { min-height: 38px; }
    .project-grid[data-columns] { grid-template-columns: minmax(0, 1fr); }
    .command-dialog { margin-top: 9dvh; max-height: calc(91dvh - 16px); border-radius: 14px; }
    .command-scopes { padding-inline: 12px; }
    .command-scopes button { padding-inline: 9px; }
    .command-state { max-width: 76px; font-size: 9px; padding-inline: 4px; }
    .command-result-action { width: 18px; }
    .command-input-row { padding: 13px; gap: 9px; }
    #command-input { font-size: 16px; }
    .command-project-category { display: none; }
    .command-result { gap: 10px; }
    .command-results-heading { padding-inline: 17px; }
    .command-footer { padding-inline: 13px; gap: 8px; }
  }
  @media (max-width: 380px) {
    .gallery-toolbar .filters { gap: 5px; }
    .gallery-toolbar .filter { padding-inline: 6px; }
    .command-footer { font-size: 9px; }
  }
  @media (max-height: 500px) {
    .command-dialog { margin-top: 16px; max-height: calc(100dvh - 32px); }
  }
  @container (max-width: 320px) {
    .project-tags { gap: 10px; }
    .project-tags li { gap: 7px; font-size: 11px; }
    .project-tags li:last-child { padding-right: 0; }
    .project-tags .icon { width: 18px; height: 18px; }
  }
}

@layer layout {
  .portfolio { width: 100%; max-width: 1560px; min-height: 100svh; margin: 0 auto; padding: 37px 4.3% 36px; display: flex; flex-direction: column; }
  .page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; margin-bottom: 31px; }
  .title-row { display: flex; align-items: center; gap: 25px; }
  .project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; align-content: start; flex: 1; }
  .page-footer { margin-top: 31px; }
  .footer-heading { display: flex; align-items: center; gap: 20px; margin-bottom: 14px; }
  .footer-heading > span { height: 1px; flex: 1; background: var(--line-soft); }
  .footer-content { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
}

@layer components {
  .eyebrow { color: #99a8c1; font-size: 10px; font-weight: 600; line-height: 1.6; letter-spacing: 4.4px; text-transform: uppercase; }
  .heading-group > .eyebrow { margin-bottom: 3px; }
  h1 { font-size: clamp(28px, 2.6vw, 39px); line-height: 1.2; font-weight: 600; letter-spacing: -1.25px; }
  .project-count { display: inline-flex; align-items: center; gap: 11px; padding-top: 7px; font-size: 13px; color: var(--muted); white-space: nowrap; }
  .count-dot { width: 5px; height: 5px; background: #b5c8e3; border-radius: 50%; }
  .filters { display: flex; align-items: center; gap: 11px; padding-bottom: 1px; }
  .filter { min-width: 70px; min-height: 38px; padding: 8px 21px; border: 1px solid var(--line); border-radius: 99px; background: #11161d80; color: #b7c0d3; font-size: 13px; line-height: 20px; transition: background .18s, color .18s, border-color .18s, box-shadow .18s; }
  .filter:hover { background: #1a222e; color: #fff; border-color: #3b4556; }
  .filter.is-active { color: #111720; background: #f2f4fc; border-color: #fff; box-shadow: 0 0 0 3px #a8bcff08, 0 0 23px #c3d1ff23, inset 0 0 9px white; font-weight: 600; }
  .project-card { position: relative; display: flex; flex-direction: column; container-type: inline-size; min-width: 0; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: linear-gradient(125deg, #10161d65, #0a101480), var(--surface); transition: border-color .22s, box-shadow .22s, transform .22s; animation: card-appear .5s both; animation-delay: calc(var(--card-index) * 45ms); }
  .project-card:hover { border-color: #3c4658; box-shadow: 0 8px 28px #00000026; }
  .project-card.has-link:hover { transform: translateY(-3px); }
  .project-media { position: relative; aspect-ratio: 2.07; overflow: hidden; border-bottom: 1px solid #20273760; background: #111823; }
  .project-art { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.3,1); }
  .project-card:hover .project-art { transform: scale(1.025); }
  .status-badge { position: absolute; left: 18px; top: 18px; display: inline-flex; align-items: center; gap: 9px; min-height: 33px; padding: 6px 15px; border: 1px solid; border-radius: 99px; backdrop-filter: blur(12px); font-size: 12px; line-height: 18px; box-shadow: inset 0 1px 0 #ffffff08; }
  .status-badge .icon { width: 16px; height: 16px; stroke-width: 2; }
  .status-green { color: #bdffe3; background: #1c704b73; border-color: #329b7180; }
  .status-green .icon { color: #4debab; }
  .status-amber { color: #f6d3a8; background: #71543661; border-color: #b088597d; }
  .status-purple { color: #d0c6ff; background: #4a3a855c; border-color: #7158be80; }
  .status-purple .icon { color: #b19bff; }
  .status-blue { color: #dbe7ff; background: #3d557e63; border-color: #557ab980; }
  .status-blue .icon { color: #adc7ff; }
  .status-rose { color: #ffced4; background: #743b4663; border-color: #b55a6885; }
  .project-arrow { position: absolute; top: 23px; right: 22px; color: #dfe6f1; }
  .project-arrow .icon { width: 18px; height: 18px; }
  .project-body { display: flex; flex: 1; flex-direction: column; padding: 12px 18px 0; }
  .project-body h2 { font-size: 21px; line-height: 1.4; font-weight: 600; letter-spacing: -.5px; }
  .project-link::after { position: absolute; inset: 0; content: ''; z-index: 1; }
  .project-link:focus-visible { outline: none; }
  .project-card:has(.project-link:focus-visible) { outline: 2px solid #9ab8f8; outline-offset: 3px; }
  .project-description { min-height: 48px; margin-top: 3px; color: #aebbd0; font-size: 15px; line-height: 1.55; letter-spacing: .02px; }
  .tech-list { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 13px; margin-bottom: 11px; }
  .tech-chip, .tool-chip { display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 99px; background: linear-gradient(120deg, #141b2580, #12172050); color: #cad3e2; white-space: nowrap; }
  .tech-chip { min-height: 37px; padding: 6px 12px 6px 9px; font-size: 12px; line-height: 20px; }
  .brand-icon { display: block; width: 22px; height: 22px; flex: 0 0 auto; }
  .icon { display: block; width: 21px; height: 21px; flex: 0 0 auto; }
  .project-tags { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 49px; margin-top: auto; border-top: 1px solid var(--line-soft); }
  .project-tags li { display: flex; align-items: center; gap: 13px; color: var(--muted); font-size: 12px; white-space: nowrap; }
  .project-tags li:last-child { padding-right: 10px; }
  .icon-globe { color: #20dcd7; }
  .icon-chart { color: #70c9ff; }
  .icon-palette { color: #b277ed; }
  .icon-cloud, .icon-users, .icon-graduation { color: #15bbf5; }
  .icon-phone, .icon-sparkles, .icon-flask { color: #9a7fff; }
  .icon-heart, .icon-pin { color: #ff669c; }
  .icon-database { color: #54a5ff; }
  .project-tags .icon-lock { color: #e0e6f0; }
  .icon-desktop { color: #ff607d; }
  [data-project="visionlab"] .icon-sparkles { color: #ec669d; }
  .tool-list { display: flex; flex-wrap: wrap; gap: 8px; }
  .tool-chip { gap: 8px; min-height: 36px; padding: 7px 10px; border-radius: 11px; font-size: 10px; line-height: 18px; }
  .tool-chip .brand-icon { width: 20px; height: 20px; }
  .learning { display: flex; align-items: center; flex: 0 0 auto; gap: 11px; color: #8996aa; font-size: 11px; }
  .learning > span:first-child { height: 6px; width: 6px; border-radius: 50%; background: #22deaa; box-shadow: 0 0 11px #22deaa3d; }
  .learning-arrow { margin-left: 8px; font-size: 21px; font-weight: 300; color: #a1b0c7; }
  .noscript { padding: 24px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); }
  @keyframes card-appear { from { opacity: 0; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }
}

@layer responsive {
  @media (min-width: 1600px) { .portfolio { padding-inline: 60px; } }
  @media (max-width: 1250px) {
    .portfolio { padding-inline: 32px; }
    .title-row { gap: 17px; }
    .filters { gap: 7px; }
    .filter { min-width: 58px; padding-inline: 16px; }
    .project-grid { gap: 18px; }
    .project-body { padding-inline: 15px; }
    .tech-list { gap: 6px; }
    .tech-chip { gap: 7px; padding-inline: 8px; font-size: 11px; }
    .tech-chip .brand-icon { width: 19px; height: 19px; }
    .project-tags li { gap: 8px; font-size: 11px; }
    .project-tags li:last-child { padding-right: 0; }
    .footer-content { align-items: flex-start; }
    .learning { padding-top: 8px; }
  }
  @media (max-width: 1050px) {
    .page-header { align-items: flex-start; flex-direction: column; gap: 24px; }
    .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    h1 { font-size: 35px; }
    .filters { gap: 10px; }
    .filter { padding-inline: 23px; }
    .project-body { padding-inline: 18px; }
    .tech-list { gap: 9px; }
    .tech-chip { padding-inline: 10px; font-size: 12px; gap: 9px; }
    .project-tags li { gap: 10px; font-size: 12px; }
    .footer-content { flex-direction: column; gap: 16px; }
  }
  @media (max-width: 650px) {
    .portfolio { padding: 29px 20px 28px; }
    .page-header { gap: 22px; margin-bottom: 23px; }
    h1 { font-size: 31px; letter-spacing: -1px; }
    .eyebrow { font-size: 9px; letter-spacing: 3.7px; }
    .title-row { gap: 15px; flex-wrap: wrap; row-gap: 6px; }
    .project-count { font-size: 11px; gap: 8px; padding-top: 5px; }
    .filters { display: grid; grid-template-columns: .7fr .8fr 1fr 1.15fr 1.55fr; width: 100%; gap: 7px; }
    .filter { min-width: 0; padding: 7px 8px; min-height: 44px; font-size: 12px; }
    .project-grid { grid-template-columns: minmax(0, 1fr); gap: 19px; }
    .project-media { aspect-ratio: 2; }
    .project-body { padding: 13px 18px 0; }
    .project-description { font-size: 14px; min-height: 44px; }
    .project-body h2 { font-size: 21px; }
    .project-tags { min-height: 50px; }
    .page-footer { margin-top: 29px; }
    .footer-content { gap: 18px; }
    .tool-list { gap: 7px; }
    .tool-chip { padding: 6px 9px; }
    .learning { padding-top: 0; }
  }
  @media (max-width: 380px) {
    .portfolio { padding-inline: 15px; }
    h1 { font-size: 28px; }
    .filters { gap: 5px; }
    .filter { padding-inline: 6px; font-size: 11px; }
    .tech-list { gap: 6px; }
    .tech-chip { gap: 6px; font-size: 10px; padding-inline: 8px; }
    .project-tags li { gap: 7px; font-size: 11px; }
  }
  @container (max-width: 390px) {
    .tech-list { gap: 7px; }
    .tech-chip { gap: 7px; padding-inline: 8px; font-size: 11px; }
    .tech-chip .brand-icon { width: 19px; height: 19px; }
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  }
}
