/* 서울북하우스 — 독립 레이아웃 스타일 */

:root {
  --ink: #1a1612;
  --paper: #f7f3ed;
  --cream: #ede6da;
  --rust: #c45c3e;
  --rust-dark: #a3472e;
  --sage: #5a7a6a;
  --gold: #c9a84c;
  --shadow: rgba(26, 22, 18, 0.12);
  --radius: 12px;
  --radius-lg: 24px;
  --font: 'Noto Sans KR', sans-serif;
  --font-display: 'Playfair Display', serif;
  --max: 1280px;
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: cover;
}

a { color: var(--rust); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 1rem;
  z-index: 9999;
  border-radius: 4px;
}
.skip-link:focus { top: 1rem; }

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: rgba(247, 243, 237, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(26, 22, 18, 0.06);
  z-index: 1000;
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  height: 100%;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  flex-shrink: 0;
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.logo-text { font-size: 1rem; }

.main-nav {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
}

.main-nav a {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  position: relative;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--rust);
  transition: width 0.3s;
}

.main-nav a:hover::after { width: 100%; }

.header-cta {
  background: var(--ink);
  color: var(--paper);
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s;
}

.header-cta:hover {
  background: var(--rust);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.3s, opacity 0.3s;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.8rem;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
  text-decoration: none;
}

.btn:hover { transform: translateY(-2px); text-decoration: none; }

.btn-primary {
  background: var(--rust);
  color: #fff;
  box-shadow: 0 4px 20px rgba(196, 92, 62, 0.35);
}

.btn-primary:hover { background: var(--rust-dark); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
}

.btn-ghost:hover { background: var(--ink); color: var(--paper); }

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
}

/* Hero */
.hero {
  padding-top: calc(var(--header-h) + 3rem);
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hero-grid {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 3rem;
  align-items: center;
  flex: 1;
}

.hero-eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 1rem;
}

.hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4.2rem);
  line-height: 1.15;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hero-copy h1 em {
  font-style: italic;
  color: var(--rust);
}

.hero-desc {
  font-size: 1.05rem;
  color: rgba(26, 22, 18, 0.75);
  max-width: 480px;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
}

.hero-stats {
  display: flex;
  gap: 2.5rem;
  border-top: 1px solid rgba(26, 22, 18, 0.1);
  padding-top: 1.5rem;
}

.hero-stats dt {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
}

.hero-stats dd {
  font-size: 0.82rem;
  color: rgba(26, 22, 18, 0.55);
}

/* Hero visual — orbit + floating photos */
.hero-visual {
  position: relative;
  min-height: 520px;
}

.orbit-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 340px;
  height: 340px;
  transform: translate(-50%, -50%);
  border: 1px dashed rgba(196, 92, 62, 0.3);
  border-radius: 50%;
  animation: spin 30s linear infinite;
}

.orbit-item {
  position: absolute;
  background: var(--paper);
  border: 1px solid rgba(26, 22, 18, 0.08);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  box-shadow: 0 4px 16px var(--shadow);
  animation: spin-reverse 30s linear infinite;
}

.o1 { top: -14px; left: 50%; transform: translateX(-50%); }
.o2 { bottom: 20%; right: -20px; }
.o3 { bottom: -14px; left: 30%; }
.o4 { top: 25%; left: -30px; }

@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes spin-reverse { to { transform: rotate(-360deg); } }

.hero-photo {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px var(--shadow);
}

.main-photo {
  width: 72%;
  margin-left: auto;
  transform: rotate(2deg);
}

.float-photo {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 48%;
  transform: rotate(-4deg);
  border: 4px solid var(--paper);
}

/* Marquee */
.hero-marquee {
  background: var(--ink);
  color: var(--cream);
  padding: 0.9rem 0;
  overflow: hidden;
  margin-top: auto;
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 25s linear infinite;
}

.marquee-track span {
  white-space: nowrap;
  padding-right: 4rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* Sections */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 5rem 1.5rem;
}

.section-head {
  margin-bottom: 2.5rem;
}

.section-head h2,
.section > h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  margin-bottom: 0.5rem;
}

.section-head p {
  color: rgba(26, 22, 18, 0.6);
}

/* Bento grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(180px, auto);
  gap: 1rem;
}

.book-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 12px var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
}

.book-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px var(--shadow);
}

.book-card figure {
  overflow: hidden;
  aspect-ratio: 3/4;
}

.book-card figure img {
  width: 100%;
  height: 100%;
  transition: transform 0.5s;
}

.book-card:hover figure img { transform: scale(1.06); }

.book-card.featured {
  grid-column: span 2;
  grid-row: span 2;
}

.book-card.wide {
  grid-column: span 2;
}

.book-card.wide figure { aspect-ratio: 16/10; }

.book-card.tall { grid-row: span 2; }

.book-info {
  padding: 1rem 1.2rem 1.2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tag {
  display: inline-block;
  background: var(--cream);
  color: var(--rust);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  width: fit-content;
}

.book-info h3 {
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}

.author {
  font-size: 0.82rem;
  color: rgba(26, 22, 18, 0.5);
  margin-bottom: 0.5rem;
}

.price {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: auto;
  margin-bottom: 0.8rem;
}

/* Categories — diagonal clip */
.categories-section {
  max-width: none;
  background: var(--ink);
  color: var(--paper);
  clip-path: polygon(0 4%, 100% 0, 100% 96%, 0 100%);
  padding: 6rem 0;
}

.categories-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.categories-intro h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  margin-bottom: 0.5rem;
}

.categories-intro p {
  color: rgba(247, 243, 237, 0.65);
  margin-bottom: 2.5rem;
}

.category-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.cat-card {
  position: relative;
  border: none;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4/3;
  padding: 0;
  background: none;
}

.cat-card img {
  width: 100%;
  height: 100%;
  filter: brightness(0.6);
  transition: filter 0.3s, transform 0.5s;
}

.cat-card span {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  z-index: 1;
}

.cat-card.active img,
.cat-card:hover img {
  filter: brightness(0.85);
  transform: scale(1.05);
}

.cat-card.active {
  outline: 3px solid var(--rust);
  outline-offset: 3px;
}

.cat-panel {
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
}

.cat-desc { margin-bottom: 1rem; color: rgba(247, 243, 237, 0.8); }

.cat-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.cat-list li { font-size: 0.95rem; }
.cat-list strong { color: var(--gold); }

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  align-items: start;
}

.about-text h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin-bottom: 1.5rem;
}

.about-text p {
  margin-bottom: 1rem;
  color: rgba(26, 22, 18, 0.75);
}

.about-values {
  list-style: none;
  margin-top: 1.5rem;
}

.about-values li {
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(26, 22, 18, 0.08);
  font-size: 0.95rem;
}

.about-values li::before {
  content: '◆';
  color: var(--rust);
  margin-right: 0.6rem;
  font-size: 0.6rem;
}

.about-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.about-gallery figure {
  border-radius: var(--radius);
  overflow: hidden;
}

.about-gallery figure:nth-child(1) { transform: translateY(1rem); }
.about-gallery figure:nth-child(4) { transform: translateY(-1rem); }

/* Reviews */
.reviews-section > h2 {
  font-family: var(--font-display);
  text-align: center;
  margin-bottom: 2.5rem;
}

.reviews-slider {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.review-card {
  background: #fff;
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 12px var(--shadow);
  border-left: 4px solid var(--rust);
}

.review-card p {
  font-style: italic;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.review-card footer {
  font-size: 0.82rem;
  color: rgba(26, 22, 18, 0.5);
}

/* Policies */
.policy-section {
  background: var(--cream);
  max-width: none;
  border-radius: 0;
}

.policy-section > h2 {
  max-width: var(--max);
  margin: 0 auto 2rem;
  padding: 0 1.5rem;
  font-family: var(--font-display);
}

.policy-grid {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.policy-grid article {
  background: #fff;
  padding: 1.5rem;
  border-radius: var(--radius);
}

.policy-grid h3 {
  font-size: 1rem;
  margin-bottom: 0.6rem;
  color: var(--rust);
}

.policy-grid p {
  font-size: 0.88rem;
  color: rgba(26, 22, 18, 0.7);
  line-height: 1.65;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.contact-info h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin-bottom: 1rem;
}

.contact-info p { color: rgba(26, 22, 18, 0.7); margin-bottom: 1.5rem; }

address { font-style: normal; }
address p { margin-bottom: 0.4rem; font-size: 0.92rem; }

.contact-form {
  background: #fff;
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-form label {
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 0.5rem;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  font-family: var(--font);
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(26, 22, 18, 0.15);
  border-radius: 8px;
  background: var(--paper);
  transition: border-color 0.2s;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--rust);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.85rem;
  margin: 0.5rem 0 1rem;
  cursor: pointer;
}

.checkbox-label input { margin-top: 0.25rem; }

.form-note {
  font-size: 0.85rem;
  min-height: 1.2em;
}

.form-note.success { color: var(--sage); }
.form-note.error { color: var(--rust); }

.contact-form .btn-primary { align-self: flex-start; margin-top: 0.5rem; }

/* Footer */
.site-footer {
  background: var(--ink);
  color: rgba(247, 243, 237, 0.7);
  padding: 3rem 1.5rem;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.footer-brand .logo-mark {
  background: var(--rust);
}

.footer-brand p { font-size: 0.85rem; }

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-left: auto;
}

.footer-nav a {
  color: rgba(247, 243, 237, 0.7);
  font-size: 0.85rem;
  text-decoration: none;
}

.footer-nav a:hover { color: var(--paper); }

.footer-copy {
  width: 100%;
  font-size: 0.78rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(247, 243, 237, 0.1);
  text-align: center;
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: calc(100% - 2rem);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  z-index: 2000;
}

.cookie-banner[hidden] { display: none; }

.cookie-banner p { font-size: 0.85rem; }
.cookie-banner a { color: var(--gold); }

/* Toast */
.toast {
  position: fixed;
  bottom: 5rem;
  right: 1.5rem;
  background: var(--ink);
  color: var(--paper);
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 2001;
  animation: toast-in 0.3s ease;
}

.toast[hidden] { display: none; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { min-height: 400px; max-width: 520px; margin: 0 auto; }
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
  .book-card.featured { grid-column: span 2; grid-row: span 1; }
  .book-card.tall { grid-row: span 1; }
  .category-cards { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .policy-grid { grid-template-columns: repeat(2, 1fr); }
  .reviews-slider { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--paper);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid rgba(26, 22, 18, 0.08);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s, opacity 0.3s;
    margin-left: 0;
  }

  .main-nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .header-cta { display: none; }

  .nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .hero-stats { flex-direction: column; gap: 1rem; }
  .bento-grid { grid-template-columns: 1fr; }
  .book-card.featured,
  .book-card.wide { grid-column: span 1; }
  .category-cards { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .policy-grid { grid-template-columns: 1fr; }
  .footer-nav { margin-left: 0; }
  .cookie-banner { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .orbit-ring { width: 260px; height: 260px; }
  .category-cards { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
