@font-face {
  font-family: "FK Roman Standard";
  src: url("/fonts/FKRomanStandard.woff2") format("woff2");
  font-display: swap;
  font-style: normal oblique;
  font-weight: 100 900;
}

:root {
  color-scheme: dark;
  --dy-black: #000000;
  --dy-panel: rgba(5, 5, 5, 0.74);
  --dy-line: rgba(174, 156, 131, 0.28);
  --dy-sand: #ae9c83;
  --dy-sand-muted: rgba(174, 156, 131, 0.68);
  --dy-cream: #f4efe6;
  --dy-white-soft: rgba(255, 255, 255, 0.9);
  --dy-main-font: "FK Roman Standard", Georgia, "Times New Roman", serif;
  font-family:
    var(--dy-main-font);
  background: var(--dy-black);
  color: var(--dy-cream);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--dy-black);
}

a {
  color: inherit;
}

button,
a {
  font: inherit;
}

.system-portal {
  --system-black: #181818;
  --system-muted: #5e5e5e;
  --system-surface: #ffffff;
  --system-surface-subtle: #eff0f4;
  --system-focus: rgba(24, 24, 24, 0.38);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  width: 100%;
  min-height: 100svh;
  background: var(--system-surface);
  color: var(--system-black);
  font-family: "Instrument Sans", Inter, Arial, sans-serif;
}

.system-hero {
  position: relative;
  display: flex;
  min-height: 840px;
  align-items: flex-end;
  overflow: hidden;
  padding: 40px;
}

.system-hero-image,
.system-hero-overlay {
  position: absolute;
  inset: 0;
}

.system-hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 47% center;
}

.system-hero-overlay {
  background: linear-gradient(1deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 43%);
}

.system-quote {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(255, 255, 255, 0.94);
  font-family: "Instrument Sans", Inter, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.3;
}

.system-nav {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  display: flex;
  width: 200%;
  min-height: 73px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 28px 40px 0;
  pointer-events: none;
}

.system-logo-link,
.system-nav-button,
.system-logout-form {
  pointer-events: auto;
}

.system-logo-link {
  display: inline-flex;
  width: 66px;
  height: 61px;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.system-logo {
  --fill-0: var(--system-black);
  display: block;
  width: 66px;
  height: 61px;
}

.system-nav-button {
  display: inline-flex;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  border: 1px solid #000000;
  border-radius: 999px;
  background: transparent;
  color: #010101;
  font-family: "Instrument Sans", Inter, Arial, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  padding: 11px 16px;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.system-nav-button:hover {
  background: rgba(24, 24, 24, 0.06);
  transform: translateY(-1px);
}

.system-nav-button:focus-visible,
.system-app-card:focus-visible,
.system-logo-link:focus-visible {
  outline: 3px solid var(--system-focus);
  outline-offset: 3px;
}

.system-nav-icon-button {
  width: 44px;
  padding: 0;
}

.system-nav-icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.system-logout-form {
  margin: 0;
}

.system-content {
  display: flex;
  min-height: 840px;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  padding: 64px 40px 40px;
}

.system-intro {
  display: flex;
  width: min(100%, 380px);
  min-height: 298px;
  flex-direction: column;
  justify-content: center;
  margin-bottom: 0;
}

.system-kicker {
  margin: 0;
  color: var(--system-muted);
  font-family: "Chivo Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  letter-spacing: 0.7px;
  line-height: 1.3;
  text-transform: uppercase;
}

.system-intro h1 {
  margin: 4px 0;
  color: var(--system-black);
  font-family: var(--dy-main-font);
  font-size: 72px;
  font-weight: 400;
  letter-spacing: -4.32px;
  line-height: 1;
}

.system-description {
  width: min(100%, 362px);
  margin: 48px 0 0;
  color: var(--system-muted);
  font-size: 16px;
  line-height: 1.3;
}

.system-app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  margin-top: 0;
}

.system-app-card {
  display: flex;
  min-height: 148px;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  border-radius: 6px;
  background: var(--system-surface-subtle);
  color: var(--system-black);
  padding: 16px;
  text-decoration: none;
  transition:
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.system-app-card:hover {
  background: #e4e6ec;
  box-shadow: 0 18px 46px rgba(24, 24, 24, 0.12);
  transform: translateY(-2px);
}

.system-app-card:active {
  transform: translateY(0);
}

.system-app-icon-wrap {
  display: flex;
  height: 44px;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
}

.system-app-icon {
  --fill-0: var(--system-black);
  display: block;
  max-width: 34px;
  max-height: 33px;
}

.system-app-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.system-app-copy strong {
  min-width: 0;
  overflow: hidden;
  color: var(--system-black);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-app-copy span {
  display: flex;
  min-width: 0;
  gap: 8px;
  align-items: flex-end;
  color: var(--system-black);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
}

.system-app-arrow {
  --fill-0: var(--system-black);
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
}

.system-empty-state {
  width: 100%;
  margin: 0;
  border-radius: 6px;
  background: var(--system-surface-subtle);
  color: var(--system-muted);
  font-size: 16px;
  line-height: 1.4;
  padding: 20px;
}

@media (max-width: 900px) {
  .system-portal {
    grid-template-columns: 1fr;
    min-height: 100svh;
  }

  .system-hero {
    min-height: 225px;
    padding: 12px;
  }

  .system-hero-image {
    object-position: center;
  }

  .system-quote {
    width: 100%;
    opacity: 0.8;
    padding: 4px;
    text-align: right;
  }

  .system-nav {
    width: 100%;
    min-height: 64px;
    align-items: center;
    padding: 10px 16px;
  }

  .system-logo-link,
  .system-logo {
    width: 34px;
    height: 32px;
  }

  .system-nav-button {
    min-height: 38px;
    font-size: 14px;
    padding: 8px 14px;
  }

  .system-nav-icon-button {
    width: 38px;
    padding: 0;
  }

  .system-content {
    min-height: calc(100svh - 225px);
    justify-content: space-between;
    gap: 40px;
    padding: 20px 16px;
  }

  .system-intro {
    width: 100%;
    min-height: auto;
    justify-content: flex-start;
  }

  .system-kicker {
    font-size: 12px;
    letter-spacing: 0.24px;
  }

  .system-intro h1 {
    margin: 0;
    font-size: 40px;
    letter-spacing: -2.4px;
    line-height: 1.2;
  }

  .system-description {
    width: 100%;
    margin-top: 24px;
  }

  .system-app-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .system-app-card {
    min-height: 116px;
  }

  .system-app-icon-wrap {
    height: 28px;
    justify-content: flex-end;
  }
}

.auth-page {
  grid-template-columns: minmax(56px, 12vw) minmax(0, 1fr) minmax(320px, 420px);
  gap: clamp(24px, 4vw, 64px);
  min-height: 100vh;
  align-items: center;
  padding: clamp(24px, 5vw, 72px);
}

.dy-wallpaper {
  position: relative;
  display: grid;
  overflow: hidden;
  background: var(--dy-black);
}

.wallpaper-mark {
  display: block;
  width: clamp(34px, 3vw, 52px);
  aspect-ratio: 193 / 180;
  object-fit: fill;
}

.auth-wallpaper-mark {
  justify-self: center;
  opacity: 0.96;
}

.login-visual {
  position: relative;
  min-height: clamp(280px, 45vw, 520px);
  overflow: hidden;
  border: 1px solid var(--dy-line);
}

.login-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-visual::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.36), rgba(0, 0, 0, 0.08)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.38));
}

.login-visual p {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  margin: 0;
  color: var(--dy-white-soft);
  font-family: var(--dy-main-font);
  font-weight: 400;
  font-size: clamp(34px, 4vw, 60px);
  line-height: 0.89;
  text-align: center;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.login-visual span {
  display: block;
}

.login-panel {
  width: min(100%, 260px);
  justify-self: end;
  border: 1px solid var(--dy-line);
  border-radius: 8px;
  background: var(--dy-panel);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.46);
  padding: 12px;
  backdrop-filter: blur(18px);
}

.login-panel h1,
.dashboard-header h1,
.app-card span {
  margin: 0;
  letter-spacing: 0;
}

.login-panel h1 {
  font-size: 32px;
  line-height: 1.1;
}

.login-panel p {
  margin: 14px 0 26px;
  color: var(--dy-sand-muted);
  line-height: 1.6;
}

.primary-button,
.secondary-button,
.icon-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.primary-button {
  width: 100%;
  background: var(--dy-sand);
  color: var(--dy-black);
}

.secondary-button {
  border: 1px solid var(--dy-line);
  background: transparent;
  color: var(--dy-cream);
  padding: 0 22px;
  cursor: pointer;
}

.danger-button {
  border-color: rgba(248, 113, 113, 0.54);
  color: #fecaca;
}

.icon-button {
  width: 48px;
  height: 48px;
  min-height: 48px;
  border: 1px solid var(--dy-line);
  background: transparent;
  color: var(--dy-cream);
  cursor: pointer;
  padding: 0;
}

.icon-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.primary-button:hover,
.secondary-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.error-message {
  border: 1px solid rgba(248, 113, 113, 0.48);
  border-radius: 8px;
  background: rgba(127, 29, 29, 0.32);
  color: #fecaca !important;
  padding: 12px 14px;
}

.dashboard-shell {
  min-height: 100vh;
  grid-template-columns: minmax(54px, 12vw) minmax(0, 1040px) minmax(180px, 20vw);
  gap: clamp(22px, 3vw, 56px);
  align-items: center;
  padding: clamp(24px, 4vw, 56px);
}

.dashboard-wallpaper-mark {
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
}

.wallpaper-tagline {
  grid-column: 3;
  grid-row: 1;
  margin: 0;
  justify-self: end;
  align-self: center;
  color: var(--dy-sand);
  font-family: var(--dy-main-font);
  font-weight: 400;
  font-size: clamp(14px, 1.2vw, 22px);
  line-height: 1.2;
  text-align: right;
}

.dashboard-panel {
  grid-column: 2;
  grid-row: 1;
  width: min(100%, 1040px);
  border: 1px solid var(--dy-line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.48);
  padding: clamp(28px, 4vw, 64px);
  backdrop-filter: blur(18px);
}

.dashboard-header {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: clamp(28px, 4vw, 48px);
}

.dashboard-heading {
  min-width: 0;
}

.dashboard-header h1 {
  max-width: 720px;
  font-weight: 500;
  line-height: 0.98;
}

.dashboard-header h1 span {
  display: block;
  color: var(--dy-sand-muted);
  font-style: oblique;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 16px;
}

.app-card {
  display: grid;
  min-height: 178px;
  align-content: space-between;
  border: 1px solid var(--dy-line);
  border-radius: 8px;
  background: rgba(174, 156, 131, 0.07);
  padding: clamp(24px, 3vw, 40px);
  text-decoration: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.app-card:hover {
  border-color: rgba(174, 156, 131, 0.52);
  background: rgba(174, 156, 131, 0.12);
  transform: translateY(-2px);
}

.app-card span {
  color: var(--dy-cream);
  font-size: clamp(30px, 3.1vw, 46px);
  font-weight: 500;
  line-height: 0.98;
}

.app-card strong {
  display: flex;
  min-width: 0;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  color: var(--dy-sand-muted);
  font-size: clamp(17px, 1.55vw, 22px);
  font-weight: 500;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.app-card svg {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.section-kicker {
  margin: 0 0 18px;
  color: var(--dy-sand);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.integration-panel {
  max-width: 860px;
}

.integration-header {
  margin-bottom: clamp(24px, 3vw, 40px);
}

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

.integration-status div {
  display: grid;
  min-height: 132px;
  align-content: space-between;
  border: 1px solid var(--dy-line);
  border-radius: 8px;
  background: rgba(174, 156, 131, 0.07);
  padding: clamp(20px, 2.4vw, 28px);
}

.integration-status span {
  color: var(--dy-sand-muted);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
}

.integration-status strong {
  color: var(--dy-cream);
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 500;
  line-height: 0.98;
}

.integration-note {
  margin: 24px 0 0;
  border: 1px solid rgba(174, 156, 131, 0.42);
  border-radius: 8px;
  color: var(--dy-sand-muted);
  font-size: 22px;
  line-height: 1.35;
  padding: 18px 20px;
}

.integration-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.integration-actions form {
  margin: 0;
}

.integration-actions .primary-button,
.integration-actions .secondary-button {
  width: auto;
  min-width: 180px;
  padding: 0 24px;
}

@media (max-width: 980px) {
  .auth-page {
    grid-template-columns: 1fr;
    align-content: center;
    padding: 20px;
  }

  .auth-wallpaper-mark {
    justify-self: start;
  }

  .login-panel {
    padding: 28px;
    justify-self: stretch;
  }

  .login-visual {
    min-height: 240px;
  }

  .login-visual p {
    white-space: normal;
  }

  .dashboard-shell {
    grid-template-columns: 1fr;
    align-content: center;
    padding: 28px 18px;
  }

  .dashboard-wallpaper-mark,
  .wallpaper-tagline,
  .dashboard-panel {
    grid-column: 1;
    grid-row: auto;
  }

  .dashboard-wallpaper-mark {
    justify-self: start;
  }

  .wallpaper-tagline {
    justify-self: start;
    text-align: left;
  }

  .dashboard-panel {
    width: 100%;
  }

  .dashboard-header {
    display: block;
  }

  .dashboard-header form {
    margin-top: 20px;
  }

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

  .integration-status {
    grid-template-columns: 1fr;
  }

}
