:root {
  --bg: #0b0c0f;
  --panel: #0f1117;
  --panel2: rgba(15, 17, 23, 0.72);

  --text: #e9ecf1;
  --muted: #a7afbd;

  --line: rgba(233, 236, 241, 0.1);
  --line2: rgba(233, 236, 241, 0.18);

  --shadow: 0 16px 44px rgba(0, 0, 0, 0.45);
  --radius: 14px;
  --max: 980px;

  --accent: #3b82f6;
  --accent-hover: #4f8df7;
  --accent-border: rgba(59, 130, 246, 0.5);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif;
  line-height: 1.6;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main.main {
  flex: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px;
}

.header {
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(
      1200px 500px at 10% 0%,
      rgba(233, 236, 241, 0.1),
      transparent 62%
    ),
    radial-gradient(
      900px 400px at 90% 10%,
      rgba(233, 236, 241, 0.06),
      transparent 55%
    );
}

.header-inner {
  padding: 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.name {
  margin: 0 0 6px;
  font-size: 34px;
  letter-spacing: -0.02em;
}

.title {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--muted);
}

.subtitle {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--muted);
}

.header-contacts {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 13px;
}

.link.subtle {
  color: var(--muted);
  border-bottom: 1px solid rgba(233, 236, 241, 0.12);
}

.link.subtle:hover {
  color: var(--text);
  border-bottom-color: rgba(233, 236, 241, 0.3);
}

.header-links,
.footer-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sep {
  color: rgba(167, 175, 189, 0.65);
}

.link {
  color: var(--text);
  border-bottom: 1px solid rgba(233, 236, 241, 0.22);
  padding-bottom: 2px;
}

.link:hover {
  border-bottom-color: rgba(233, 236, 241, 0.45);
}

.photo {
  width: 132px;
  height: 132px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: rgba(233, 236, 241, 0.05);
  box-shadow: var(--shadow);
  filter: contrast(1.02) saturate(0.98);
}

.section {
  padding: 26px 0;
}

.section-title {
  margin: 0 0 14px;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel2);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.card-title {
  margin: 0;
  font-size: 15px;
}

.badge {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(233, 236, 241, 0.04);
  white-space: nowrap;
}

.card-text {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line2);
  background: rgba(233, 236, 241, 0.08);
  color: var(--text);
  font-size: 13px;
  transition:
    transform 120ms ease,
    background 120ms ease,
    border-color 120ms ease,
    opacity 120ms ease,
    box-shadow 120ms ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
  background: rgba(233, 236, 241, 0.12);
  border-color: rgba(233, 236, 241, 0.28);
}

.btn:active {
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
}

.btn-disabled {
  background: rgba(233, 236, 241, 0.06);
  border-color: rgba(233, 236, 241, 0.1);
  color: rgba(167, 175, 189, 0.8);
  pointer-events: none;
}

.card-actions .btn-details {
  margin-left: auto;
  opacity: 0.82;
}

.card-actions .btn-details:hover {
  opacity: 1;
}

.project-card .project-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.project-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(233, 236, 241, 0.05);
  padding: 4px;
  flex: 0 0 auto;
}

.project-meta .muted {
  margin: 2px 0 0;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.footer {
  border-top: 1px solid var(--line);
  background: rgba(15, 17, 23, 0.55);
}

.footer-inner {
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
}

.modal-panel {
  position: relative;
  width: min(var(--max), calc(100% - 40px));
  margin: 60px auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 120px);
  overflow: hidden;
  padding: 0;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.modal-title {
  margin: 0;
  font-size: 16px;
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line2);
  background: rgba(233, 236, 241, 0.06);
  color: var(--text);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
}

.modal-close:hover {
  background: rgba(233, 236, 241, 0.1);
  border-color: rgba(233, 236, 241, 0.28);
}

.modal-body {
  padding: 12px 20px 16px;
  overflow-y: auto;
  flex: 1;
}

.modal-intro {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-logo {
  width: 140px;
  height: 140px;
  object-fit: contain;
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}

.modal-label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.modal-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  padding: 12px 20px;
  min-height: 64px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
  flex-wrap: wrap;
}

@media (max-width: 1024px) {
  .container {
    padding: 16px;
  }
}

@media (max-width: 820px) {
  .header-inner {
    flex-direction: column-reverse;
    align-items: flex-start;
  }

  .photo {
    width: 120px;
    height: 120px;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .modal-grid {
    grid-template-columns: 1fr;
  }

  .modal-panel {
    margin: 24px auto;
  }
}

@media (max-width: 560px) {
  .card-actions {
    align-items: stretch;
  }

  .card-actions .btn {
    flex: 1 1 auto;
  }

  .card-actions .btn-details {
    margin-left: 0;
  }

  .modal-intro {
    flex-direction: column;
  }

  .modal-logo {
    width: 96px;
    height: 96px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f9fc;
    --panel: #ffffff;
    --panel2: rgba(255, 255, 255, 0.8);

    --text: #0e1116;
    --muted: #5a6472;

    --line: rgba(14, 17, 22, 0.08);
    --line2: rgba(14, 17, 22, 0.16);

    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);

    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-border: rgba(37, 99, 235, 0.45);
  }

  .header {
    background:
      radial-gradient(
        1200px 500px at 10% 0%,
        rgba(14, 17, 22, 0.06),
        transparent 62%
      ),
      radial-gradient(
        900px 400px at 90% 10%,
        rgba(14, 17, 22, 0.04),
        transparent 55%
      );
  }

  .footer {
    background: rgba(255, 255, 255, 0.7);
  }

  .link {
    border-bottom-color: rgba(14, 17, 22, 0.2);
  }

  .link:hover {
    border-bottom-color: rgba(14, 17, 22, 0.4);
  }

  .badge {
    background: rgba(14, 17, 22, 0.04);
  }

  .btn {
    background: rgba(14, 17, 22, 0.04);
  }

  .btn:hover {
    background: rgba(14, 17, 22, 0.08);
  }

  .btn-ghost {
    background: transparent;
  }

  .btn-disabled {
    background: rgba(14, 17, 22, 0.03);
    color: rgba(90, 100, 114, 0.7);
  }

  .project-logo {
    background: rgba(14, 17, 22, 0.03);
  }

  .photo {
    background: rgba(14, 17, 22, 0.04);
  }

  .modal-backdrop {
    background: rgba(0, 0, 0, 0.4);
  }

  .modal-close {
    background: rgba(14, 17, 22, 0.04);
  }

  .modal-close:hover {
    background: rgba(14, 17, 22, 0.08);
  }
}
