@font-face {
  font-family: "Sora";
  src: url("/assets/Sora-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sora";
  src: url("/assets/Sora-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f3f6fa;
  --fg: #0f1723;
  --muted: #5f6f82;
  --line: rgba(16, 23, 35, 0.12);
  --soft: rgba(16, 23, 35, 0.07);
  --brand-card: #ffffff;
  --brand-card-alt: #eef4fb;
  --brand-dark: #0c1a29;
  --topbar-bg: rgba(243, 246, 250, 0.9);
  --footer-bg: rgba(255, 255, 255, 0.84);
  --control-bg: rgba(255, 255, 255, 0.62);
  --control-active: #0c1a29;
  --control-active-text: #f3f7fb;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0f14;
  --fg: #f3f7fb;
  --muted: #b8c2cf;
  --line: rgba(255, 255, 255, 0.16);
  --soft: rgba(255, 255, 255, 0.08);
  --brand-card: #101925;
  --brand-card-alt: #162538;
  --brand-dark: #07101b;
  --topbar-bg: rgba(11, 15, 20, 0.9);
  --footer-bg: rgba(16, 25, 37, 0.9);
  --control-bg: rgba(255, 255, 255, 0.08);
  --control-active: #f3f7fb;
  --control-active-text: #0c1a29;
}

html {
  background: var(--bg);
}

body {
  font-family: "Sora", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 640px at 50% -10%, rgba(125, 152, 190, 0.28), transparent 64%),
    linear-gradient(180deg, #f3f6fa 0%, #d7e3ee 48%, #fefefe 100%);
  background-attachment: fixed;
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(1100px 620px at 50% -12%, rgba(69, 103, 142, 0.28), transparent 66%),
    linear-gradient(180deg, #0b0f14 0%, #07101a 52%, #0b0f14 100%);
}

.topbar {
  background: var(--topbar-bg);
}

.topbar__tools,
.lang {
  display: inline-flex;
  align-items: center;
}

.topbar__tools {
  gap: 0.55rem;
  margin-left: auto;
}

.lang {
  gap: 0.2rem;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--control-bg);
}

.lang__btn,
.theme-toggle {
  border: 0;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.lang__btn {
  min-width: 2.2rem;
  min-height: 2.2rem;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  background: transparent;
  font-size: 0.78rem;
  font-weight: 600;
}

.lang__btn:hover,
.lang__btn:focus-visible {
  color: var(--fg);
  background: var(--soft);
}

.lang__btn.is-active {
  color: var(--control-active-text);
  background: var(--control-active);
}

.theme-toggle {
  width: 2.75rem;
  height: 2.75rem;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--control-bg);
  color: var(--fg);
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: var(--soft);
}

.theme-toggle__sun {
  display: none;
}

.theme-toggle__moon {
  display: block;
}

:root[data-theme="dark"] .theme-toggle__sun {
  display: block;
}

:root[data-theme="dark"] .theme-toggle__moon {
  display: none;
}

.card,
.portfolio-panel {
  background: linear-gradient(160deg, var(--brand-card) 0%, var(--brand-card-alt) 100%);
  border-color: var(--line);
  border-radius: 1.375rem;
  box-shadow: 0 12px 28px rgba(10, 18, 30, 0.08);
}

:root[data-theme="dark"] .card,
:root[data-theme="dark"] .portfolio-panel {
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
}

.card__link {
  height: 100%;
}

.card__body {
  display: flex;
  min-height: 15rem;
  flex-direction: column;
}

.card__more {
  margin-top: auto;
  padding-top: 1rem;
}

.project-commercial,
.closing-cta {
  background: linear-gradient(160deg, var(--brand-dark) 0%, #11243a 100%);
  color: #f3f7fb;
  border-color: #2c465f;
  box-shadow: 0 16px 34px rgba(3, 10, 20, 0.22);
}

.project-commercial .kicker,
.project-commercial p,
.project-commercial li,
.closing-cta p {
  color: rgba(232, 240, 251, 0.84);
}

.project-commercial h2,
.closing-cta h2 {
  color: #f3f7fb;
}

.closing-cta .btn {
  border-color: rgba(255, 255, 255, 0.3);
  color: #f3f7fb;
}

.closing-cta .btn--primary {
  background: #f3f7fb;
  color: #0c1a29;
}

.btn--primary {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #f3f7fb;
}

.btn--primary:hover {
  background: #142b45;
}

:root[data-theme="dark"] .btn--primary {
  background: #f3f7fb;
  border-color: #f3f7fb;
  color: #0c1a29;
}

:root[data-theme="dark"] .btn--primary:hover {
  background: #dce8f5;
}

.footer__inner {
  background: var(--footer-bg);
  border-color: var(--line);
}

.footer__social-link {
  background: var(--control-bg);
}

:root[data-theme="dark"] .footer__logo {
  filter: invert(1);
}

.project-richtext > :first-child,
.card__desc > :first-child {
  margin-top: 0;
}

.project-richtext > :last-child,
.card__desc > :last-child {
  margin-bottom: 0;
}

@media (prefers-reduced-motion: no-preference) {
  html.portfolio-ui-ready body,
  html.portfolio-ui-ready .topbar,
  html.portfolio-ui-ready .card,
  html.portfolio-ui-ready .portfolio-panel,
  html.portfolio-ui-ready .footer__inner,
  html.portfolio-ui-ready .lang,
  html.portfolio-ui-ready .lang__btn,
  html.portfolio-ui-ready .theme-toggle,
  html.portfolio-ui-ready .btn {
    transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  }
}

@media (max-width: 900px) {
  .topbar__inner {
    gap: 0.65rem;
  }

  .nav__list {
    gap: 0.25rem;
  }
}

@media (max-width: 720px) {
  .topbar__tools {
    order: 2;
  }

  .nav {
    order: 3;
    width: 100%;
  }

  .nav__list {
    justify-content: center;
  }
}
