/* KK Partners: mobile first */

:root {
  --sand: #F3ECE2;
  --paper: #FBF8F3;
  --ink: #1E1915;
  --ink-2: #5B5048;
  --oak: #9C5B2E;
  --oak-hover: #84491F;
  --night: #18233A;
  --oak-light: #E0B48A;
  --on-night: #F3ECE2;
  --line: rgba(30, 25, 21, 0.14);
  --line-on-night: rgba(243, 236, 226, 0.22);

  --serif: "Noto Serif KR", "Nanum Myeongjo", ui-serif, "Iowan Old Style", Georgia, serif;
  --sans: Pretendard, "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --latin-serif: ui-serif, "Iowan Old Style", Georgia, "Noto Serif KR", serif;

  --dur: 240ms;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --gutter: 24px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 60px;
}

body {
  margin: 0;
  background: var(--sand);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  word-break: keep-all;
  overflow-wrap: break-word;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

@supports (overflow: clip) {
  body { overflow-x: clip; }
}

body.menu-open {
  overflow: hidden;
}

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

a {
  color: inherit;
}

p, h1, h2, h3, figure, blockquote, dl, dd {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--oak);
  outline-offset: 3px;
}

.services :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--oak-light);
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ---------- Type ---------- */

.label {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--oak);
  margin-bottom: 24px;
}

.h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 4.2vw, 60px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
  word-break: keep-all;
  color: var(--ink);
}

.lead {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.65;
  color: var(--ink);
}

.body-text {
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink-2);
}

.accent {
  font-style: normal;
  color: var(--oak);
}

/* ---------- Buttons & links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 28px;
  border: 0;
  border-radius: 9999px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), transform var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--ink);
  color: var(--sand);
}

.btn-primary:hover {
  background: #000;
}

.btn-primary:active {
  transform: scale(0.96);
}

.text-link {
  display: inline;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  transition: color var(--dur) var(--ease);
  overflow-wrap: anywhere;
}

.text-link:hover {
  color: var(--oak);
}

.text-link-night {
  color: var(--on-night);
}

.text-link-night:hover {
  color: var(--oak-light);
}

.staged-note {
  margin-top: 12px;
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}

.staged-note-night {
  color: rgba(243, 236, 226, 0.66);
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 72px;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: height var(--dur) var(--ease), background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.site-header.is-scrolled {
  height: 60px;
  background: var(--sand);
  border-bottom-color: var(--line);
}

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

.logo {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 20px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.menu-toggle {
  position: relative;
  z-index: 2;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.menu-bar {
  display: block;
  width: 22px;
  height: 1.5px;
  background: currentColor;
  transition: transform var(--dur) var(--ease);
}

.menu-toggle[aria-expanded="true"] .menu-bar:first-child {
  transform: translateY(4.25px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-bar:last-child {
  transform: translateY(-4.25px) rotate(-45deg);
}

.nav {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding: 112px var(--gutter) 40px;
  background: var(--sand);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur) var(--ease), visibility var(--dur) var(--ease);
}

.nav.is-open {
  opacity: 1;
  visibility: visible;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.nav-list li {
  border-bottom: 1px solid var(--line);
}

.nav-list a {
  display: flex;
  align-items: center;
  min-height: 76px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 28px;
  color: var(--ink);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

.nav-list a:hover {
  color: var(--oak);
}

/* ---------- Hero (mobile) ---------- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--sand);
}

.hero-inner {
  position: relative;
  z-index: 2;
  padding-top: 116px;
  padding-bottom: 56px;
}

.hero-text {
  min-width: 0;
}

.hero-label {
  color: var(--ink-2);
}

.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 9.6vw, 56px);
  line-height: 1.18;
  letter-spacing: -0.03em;
  word-break: keep-all;
  color: var(--ink);
  margin-bottom: 24px;
}

.hero-lead {
  max-width: 30em;
  margin-bottom: 32px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink-2);
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  margin: 0;
  overflow: hidden;
}

.hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 74% 50%;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(243, 236, 226, 0.9) 0%, rgba(243, 236, 226, 0.72) 38%, rgba(243, 236, 226, 0.3) 68%, rgba(243, 236, 226, 0) 100%);
  pointer-events: none;
}

.staged-tag {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 3px 9px;
  border-radius: 9999px;
  background: rgba(251, 248, 243, 0.78);
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}

/* ---------- Sections ---------- */

.section {
  padding: 100px 0;
}

/* About */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 64px;
}

.about-text,
.about-media {
  min-width: 0;
}

.about .h2 {
  margin-bottom: 32px;
}

.about .lead {
  margin-bottom: 24px;
}

.facts {
  margin-top: 40px;
}

.fact {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.fact:last-child {
  border-bottom: 1px solid var(--line);
}

.fact dt {
  font-weight: 500;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.fact dd {
  min-width: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(18px, 5vw, 20px);
  line-height: 1.45;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.fact dd .text-link {
  font-size: clamp(14px, 4.2vw, 20px);
}

.collage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.collage-main img,
.collage-sub img {
  width: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.collage-main img {
  aspect-ratio: 3 / 2;
}

.collage-sub {
  width: 58%;
  justify-self: end;
}

.collage-sub img {
  aspect-ratio: 1 / 1;
}

/* Services */

.services {
  background: var(--night);
  color: var(--on-night);
}

.services .h2 {
  color: var(--on-night);
}

.label-night {
  color: rgba(243, 236, 226, 0.72);
}

.services-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 48px;
}

.services-head,
.services-media,
.services-body {
  min-width: 0;
}

.frame img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 60% 50%;
  border-radius: 4px;
}

.route {
  --node-y: 32.5px;
  --line-y: 37px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.route-item {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  column-gap: 8px;
  align-items: baseline;
  padding: 22px 0 22px 36px;
  border-top: 1px solid var(--line-on-night);
}

.route-item:last-child {
  border-bottom: 1px solid var(--line-on-night);
}

.route-item::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line-on-night);
}

.route-item:first-child::before {
  top: var(--line-y);
}

.route-item:last-child::before {
  bottom: auto;
  height: var(--line-y);
}

.route-node {
  position: absolute;
  left: 0;
  top: var(--node-y);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid var(--oak-light);
  background: var(--night);
}

.route-item:first-child .route-node {
  background: var(--oak-light);
}

.route-num {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.25;
  color: var(--oak-light);
}

.route-text {
  min-width: 0;
}

.route-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.25;
  color: var(--on-night);
  word-break: keep-all;
}

.route-en {
  margin-top: 6px;
  font-weight: 500;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(243, 236, 226, 0.66);
}

.services-note {
  margin-top: 32px;
  margin-bottom: 16px;
  color: rgba(243, 236, 226, 0.8);
}

.services-body .text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* Motto */

.motto {
  background: var(--paper);
  padding: 100px 0;
  text-align: center;
}

.motto-inner {
  min-width: 0;
}

.motto-quote p {
  font-family: var(--latin-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(26px, 3.2vw, 44px);
  line-height: 1.3;
  color: var(--ink);
  text-wrap: balance;
}

.motto-cite {
  margin-top: 24px;
  font-size: 15px;
  color: var(--ink-2);
}

/* Contact */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 56px;
}

.contact-text,
.form-card {
  min-width: 0;
}

.contact .h2 {
  margin-bottom: 28px;
}

.email-link {
  display: inline-block;
  margin-top: 28px;
  padding: 8px 0;
  font-family: var(--serif);
  font-size: clamp(14px, 4.2vw, 20px);
  line-height: 1.4;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
  overflow-wrap: anywhere;
  transition: color var(--dur) var(--ease);
}

.email-link:hover {
  color: var(--oak);
}

.form-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px 20px;
  box-shadow: 0 24px 60px -24px rgba(30, 25, 21, 0.35);
}

.field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.field label {
  font-weight: 500;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 0 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9999px;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.field select {
  padding-right: 48px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-2) 50%),
    linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 26px) 50%, calc(100% - 21px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  text-overflow: ellipsis;
}

.field textarea {
  min-height: 150px;
  padding: 14px 20px;
  border-radius: 20px;
  line-height: 1.6;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--oak);
  box-shadow: 0 0 0 1px var(--oak);
}

.btn-submit {
  width: 100%;
  margin-top: 8px;
}

.form-status {
  margin-top: 20px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--sand);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.65;
}

.form-status:empty {
  margin: 0;
  padding: 0;
  border: 0;
}

.form-status p {
  margin-bottom: 8px;
}

.form-status .text-link {
  display: inline-block;
  padding: 8px 0;
}

/* Footer */

.site-footer {
  background: var(--night);
  color: var(--on-night);
  padding: 80px 0 calc(64px + 56px);
  overflow: hidden;
}

.route-line {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 9px;
  margin-bottom: 40px;
}

.route-line::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--line-on-night);
}

.route-line span {
  position: relative;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid var(--oak-light);
  background: var(--night);
}

.route-line span:first-child {
  background: var(--oak-light);
}

.wordmark {
  margin-bottom: 40px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 11vw, 200px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: rgba(243, 236, 226, 0.12);
  white-space: nowrap;
  overflow: hidden;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
}

.footer-id,
.footer-nav {
  min-width: 0;
}

.footer-name {
  margin-bottom: 8px;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.45;
}

.footer-email {
  display: inline-block;
  padding: 8px 0;
}

.footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--on-night);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

.footer-nav a:hover {
  color: var(--oak-light);
}

.footer-small {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line-on-night);
  font-size: 13px;
  line-height: 1.6;
  color: rgba(243, 236, 226, 0.66);
}

.footer-small p + p {
  margin-top: 6px;
}

/* Mobile contact bar */

.contact-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(64px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--ink);
  color: var(--sand);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: transform var(--dur) var(--ease);
}

.contact-bar.is-hidden {
  transform: translateY(110%);
}

.contact-bar:focus-visible {
  outline: 2px solid var(--oak-light);
  outline-offset: -4px;
}

/* ---------- ≥600px ---------- */

@media (min-width: 600px) {
  .fact {
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 24px;
    align-items: baseline;
  }

  .form-card {
    padding: 40px 36px;
  }

  .footer-nav ul {
    display: flex;
    gap: 32px;
  }
}

/* ---------- ≥900px (PC) ---------- */

@media (min-width: 900px) {
  :root {
    --gutter: 40px;
  }

  .menu-toggle {
    display: none;
  }

  .nav {
    position: static;
    inset: auto;
    display: block;
    padding: 0;
    background: none;
    opacity: 1;
    visibility: visible;
    transition: none;
  }

  .nav-list {
    display: flex;
    gap: 40px;
    border: 0;
  }

  .nav-list li {
    border: 0;
  }

  .nav-list a {
    min-height: 44px;
    font-family: var(--sans);
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.02em;
  }

  /* Hero PC */
  .hero {
    justify-content: center;
  }

  .hero-media {
    position: absolute;
    inset: 0;
    margin: 0;
    min-height: 0;
    z-index: 0;
  }

  .hero-media img {
    object-position: 100% 55%;
  }

  .hero-media::after {
    inset: 0;
    height: auto;
    background:
      radial-gradient(ellipse 34% 40% at 100% 100%, rgba(243, 236, 226, 0.6) 0%, rgba(243, 236, 226, 0) 100%),
      linear-gradient(90deg, rgba(243, 236, 226, 0.8) 0%, rgba(243, 236, 226, 0.45) 28%, rgba(243, 236, 226, 0) 50%);
  }

  .staged-tag {
    right: 24px;
    bottom: 20px;
  }

  .hero-inner {
    flex: 1 0 auto;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 24px;
    align-items: center;
    padding-top: 132px;
    padding-bottom: 96px;
  }

  .hero-text {
    grid-column: 1 / 9;
  }

  .hero-title {
    font-size: clamp(56px, 6vw, 96px);
    line-height: 1.08;
    margin-bottom: 32px;
  }

  .hero-lead {
    max-width: 32em;
    font-size: 18px;
    margin-bottom: 40px;
    color: var(--ink);
  }

  /* Sections */
  .section {
    padding: 160px 0;
  }

  .lead {
    font-size: 22px;
  }

  /* About PC */
  .about-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 24px;
    align-items: center;
  }

  .about-text {
    grid-column: 1 / 7;
  }

  .about-media {
    grid-column: 8 / 13;
  }

  .collage {
    display: block;
    padding-bottom: 24%;
  }

  .collage-sub {
    position: absolute;
    left: -18%;
    bottom: 0;
    width: 46%;
    padding: 8px;
    background: var(--sand);
    border-radius: 8px;
  }

  .about-media .staged-note {
    text-align: right;
  }

  /* Services PC */
  .services-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 24px;
    row-gap: 56px;
  }

  .services-media {
    grid-column: 1 / 6;
    grid-row: 1 / 3;
    align-self: start;
  }

  .services-head {
    grid-column: 7 / 13;
    grid-row: 1;
  }

  .services-body {
    grid-column: 7 / 13;
    grid-row: 2;
  }

  .route {
    --node-y: 35px;
    --line-y: 39.5px;
  }

  .route-num {
    font-size: 20px;
  }

  .route-name {
    font-size: 28px;
  }

  /* Motto PC */
  .motto {
    padding: 160px 0;
  }

  .motto-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 24px;
  }

  .motto-inner {
    grid-column: 3 / 11;
  }

  /* Contact PC */
  .contact-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 24px;
    align-items: start;
  }

  .contact-text {
    grid-column: 1 / 6;
  }

  .form-card {
    grid-column: 7 / 13;
    padding: 48px 44px;
  }

  /* Footer PC */
  .site-footer {
    padding: 120px 0 48px;
  }

  .footer-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 24px;
    align-items: start;
  }

  .footer-id {
    grid-column: 1 / 7;
  }

  .footer-nav {
    grid-column: 8 / 13;
    justify-self: end;
  }

  .footer-nav ul {
    gap: 40px;
  }

  .footer-small {
    display: flex;
    justify-content: space-between;
    gap: 24px;
  }

  .footer-small p + p {
    margin-top: 0;
  }

  .contact-bar {
    display: none;
  }
}

@media (min-width: 1200px) {
  .hero-text {
    grid-column: 1 / 8;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 120ms !important;
  }

  .btn-primary:active {
    transform: none;
  }
}

/* 제안용 시안 표시: 휴대폰에서 화면 맨 아래 모서리로, 작게 */
@media (max-width: 1023px) {
  body .ks-preview-badge {
    left: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    font-size: 10px;
    padding: 5px 8px;
  }
}

/* 사진 판 고르기용 감싸개 (optimize_images.py): 배치에 끼지 않음 */
picture{display:contents}
