:root {
  color-scheme: dark;
  font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  background: #321f25;
  color: #fff6ef;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; min-height: 100vh; isolation: isolate; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 3px solid #ffd5b8; outline-offset: 5px; }
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: #321f25 url("ministry-ai-rose.webp") center center / cover no-repeat;
}
.backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(39,20,27,.88), rgba(55,30,36,.58) 48%, rgba(57,30,35,.16)),
    linear-gradient(180deg, rgba(44,23,30,.32), transparent 48%, rgba(34,17,24,.66));
}
.shell { width: min(1104px, calc(100% - 96px)); margin-inline: auto; }
.masthead {
  min-height: 85px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid rgba(246,204,180,.3);
}
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 750; letter-spacing: .13em; }
.brand img { flex-shrink: 0; object-fit: contain; border-radius: 7px; }
.banner-contact { display: grid; grid-template-columns: auto auto; gap: 3px 12px; margin: 0; color: #f7e4da; font-size: 13px; line-height: 1.55; }
.banner-contact div { display: contents; }
.banner-contact dt { color: #fff6ef; font-weight: 700; white-space: nowrap; }
.banner-contact dd { margin: 0; overflow-wrap: anywhere; }
.banner-contact a { text-decoration: underline; text-underline-offset: 3px; }
.banner-contact a:hover { color: #fff; }
.hero { padding: clamp(56px, 9vh, 94px) 0 clamp(76px, 15vh, 160px); }
.hero h1 { font-size: clamp(40px, 6vw, 72px); letter-spacing: -.072em; line-height: 1.12; margin: 0; word-break: keep-all; }
.hero p { margin: 20px 0 0; color: #f7e4da; font-size: clamp(16px, 2vw, 20px); line-height: 1.65; word-break: keep-all; }
.hero .english-title { margin-top: 12px; color: #efc6b1; font-size: clamp(18px, 2.5vw, 28px); font-weight: 650; line-height: 1.3; }
.portals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding-bottom: clamp(40px, 7vh, 72px); }
.portal {
  display: block;
  min-height: 240px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: clamp(23px, 3vw, 32px);
  border: 1px solid #b88d85;
  border-radius: 20px;
  background: linear-gradient(125deg, rgba(86,48,57,.88), rgba(52,29,36,.83));
  box-shadow: 0 24px 60px rgba(24,10,15,.48), inset 0 1px 0 rgba(255,227,210,.16);
  transition: background-color .16s, border-color .16s, transform .16s;
}
.portal:nth-child(2) { background: linear-gradient(125deg, rgba(111,65,72,.88), rgba(67,35,45,.84)); }
.portal:hover { border-color: #ffdcc7; transform: translateY(-3px); background-color: #774d53; }
.portal-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.portal-label { color: #efc6b1; font-size: 14px; font-weight: 700; }
.portal h2 { font-size: clamp(23px, 2.65vw, 30px); letter-spacing: -.053em; line-height: 1.23; margin: 14px 0 9px; word-break: keep-all; }
.portal p { color: #f7e4da; font-size: 16px; line-height: 1.65; margin: 0; word-break: keep-all; }
@media (max-width: 1050px) {
  .portals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 850px) {
  .backdrop { background-position: 68% center; }
  .backdrop::before {
    background: linear-gradient(180deg, rgba(39,20,27,.7), rgba(55,30,36,.45) 38%, rgba(34,17,24,.85));
  }
  .shell { width: calc(100% - 44px); }
  .masthead { min-height: 71px; }
  .hero { padding: 65px 0 34px; }
  .portals { grid-template-columns: 1fr; gap: 13px; }
  .portal { min-height: 0; }
}
@media (max-width: 520px) {
  .masthead { flex-wrap: wrap; gap: 10px 18px; padding-block: 12px; }
  .banner-contact { margin-inline-start: auto; }
}
@media (max-width: 390px) {
  .shell { width: calc(100% - 32px); }
  .brand { font-size: 11px; gap: 7px; }
  .hero h1 { font-size: 37px; }
}
@media (prefers-reduced-motion: reduce) {
  .portal { transition: none; }
  .portal:hover { transform: none; }
}

.install-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 25px; }
.install-button { border: 1px solid #f0cbb4; border-radius: 8px; padding: 12px 20px; background: #e9c29d; color: #3c252b; font: inherit; font-size: 14px; font-weight: 750; cursor: pointer; }
.install-button:hover { background: #f6d8b9; }
.install-button:focus-visible { outline: 3px solid #ffd5b8; outline-offset: 4px; }
.install-button:disabled { cursor: default; opacity: .8; }
#install-status { color: #f7e4da; font-size: 14px; line-height: 1.6; }
#install-guide { width: min(520px, calc(100% - 36px)); padding: 28px; border: 1px solid #b88d85; border-radius: 16px; background: #40262f; color: #fff6ef; box-shadow: 0 24px 70px #170c10; }
#install-guide::backdrop { background: rgba(20,10,15,.72); }
#install-guide h2 { margin-top: 0; font-size: 24px; }
#install-guide p { font-size: 16px; line-height: 1.8; }
#install-guide form { margin-top: 22px; text-align: right; }

.banner-info { display: grid; justify-items: end; gap: 6px; padding-block: 12px; max-width: 550px; }
.support-note { margin: 0; color: #f7e4da; font-size: 14px; line-height: 1.6; word-break: keep-all; text-align: right; }
@media (max-width: 520px) {
  .banner-info { margin-inline-start: auto; padding-block: 0; }
}
