:root{
  /* Brand */
  --creamson: #A52A2A;
  --creamson-2: #880000;

  /* Base */
  --bg: #ffffff;
  --card: #FFF9F6;

  --text: #1A1A1A;
  --muted: #5A5A5A;

  /* Header */
  --header-text: #FFF3ED;
  --header-link: #FFF3ED;
  --header-link-hover-bg: rgba(255, 243, 237, 0.16);

  /* Borders */
  --border: rgba(136, 0, 0, 0.18);
}

/* ================= Base Reset / Safety ================= */
*,
*::before,
*::after{ box-sizing: border-box; }

html{ -webkit-text-size-adjust: 100%; }

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

img{
  max-width: 100%;
  height: auto;
  display: block;
}

a{ color: inherit; }

.container{
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

/* Long text safety (URLs, long paper titles, etc.) */
p, li, div, a, h1, h2, h3{ overflow-wrap: anywhere; }

/* ================= Header ================= */
.site-header{
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, var(--creamson), var(--creamson-2));
  border-bottom: 2px solid var(--creamson-2);
}

.header-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  /* ✅ 데스크탑에서는 높이 고정 */
  height: 72px;
}

/* Brand */
.brand{
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  user-select: none;
}

.brand-logo{
  height: 60px;
  width: auto;
}

.brand-text{
  font-size: 52px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 1px;
  color: var(--header-text);
  text-transform: uppercase;
}

/* Nav */
.nav{
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.nav a{
  text-decoration: none;
  color: var(--header-link);
  padding: 10px 12px;
  border-radius: 12px;

  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.2px;

  transition: background 0.15s ease, transform 0.08s ease;
}

.nav a:hover{
  background: var(--header-link-hover-bg);
}

.nav a:active{
  transform: translateY(1px);
}

.nav a.active{
  background: rgba(255, 243, 237, 0.22);
  color: var(--header-text);
}

/* Keyboard focus */
.nav a:focus-visible,
.brand:focus-visible{
  outline: 2px solid rgba(255, 243, 237, 0.75);
  outline-offset: 2px;
  border-radius: 12px;
}

/* ================= Common Sections ================= */
.hero{
  padding: 48px 0 24px;
}

.hero h1{
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
}

.hero p{
  margin: 0 0 18px;
  color: var(--muted);
  max-width: 70ch;
}

.hero-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn{
  display: inline-block;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--text);
  color: #fff;
  background: var(--text);
}

.btn.btn-ghost{
  background: transparent;
  color: var(--text);
}

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

.card{
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
}

.card h2{ margin: 0 0 8px; }
.card p{ margin: 0 0 10px; color: var(--muted); }

.site-footer{
  border-top: 2px solid var(--creamson-2);
  padding: 18px 0;
  color: var(--muted);
  font-size: 14px;
}

/* ================= Responsive ================= */

/* Tablet & below */
@media (max-width: 900px){
  .container{
    width: min(1100px, calc(100% - 24px));
  }

  /* ✅ 헤더 높이 자동 */
  .header-inner{
    height: auto;
    padding: 10px 0;
    align-items: center;
  }

  .brand-logo{ height: 44px; }
  .brand-text{ font-size: 34px; }

  .nav{ gap: 8px; }

  .nav a{
    font-size: 16px;
    padding: 8px 10px;
    border-radius: 10px;
  }

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

/* Phone: 모바일에서는 로고(텍스트+이미지) 숨김 + nav 탭 + 본문 워터마크 */
@media (max-width: 560px){
  /* ✅ 헤더에서는 로고(텍스트/이미지) 모두 숨김 */
  .brand-text{ display: none; }
  .brand-logo{ display: none; }

  /* ✅ nav를 한 줄 탭처럼(가로 스크롤) */
  .nav{
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .nav a{ flex: 0 0 auto; }

  /* ✅ 워터마크는 "본문(main)"에만 (헤더 배경 절대 안 깨짐) */
  main{
    position: relative;
  }

  main::before{
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;

    background-image: url("assets/img/logo.png"); /* ✅ 요청한 경로 */
    background-repeat: no-repeat;
    background-position: center 120px;            /* ✅ 헤더 아래쪽부터 보이게 */
    background-size: min(72vw, 360px);

    opacity: 0.06;
    filter: grayscale(100%);
  }

  /* ✅ main 안의 실제 콘텐츠는 워터마크 위로 */
  main > *{
    position: relative;
    z-index: 1;
  }
}
