/* ==========================================================================
   C&P SYSTEM — V1 Homepage
   Phase 2: Visual refinement toward reference design.
   Focus: editorial portfolio layout, restraint, premium feel, no pill UI.
   ========================================================================== */

:root {
  /* Color system (Blueprint §3) */
  --color-charcoal: #16151a;
  --color-charcoal-soft: #201f26;
  --color-offwhite: #f7f5f1;
  --color-white: #ffffff;
  --color-gray-900: #1c1b20;
  --color-gray-600: #6b6a70;
  --color-gray-400: #9c9aa3;
  --color-gray-200: #e4e2dd;
  --color-accent: #d95f26; /* C&P orange — controlled accent only */
  --color-on-dark: #f4f2ee;
  --color-on-dark-muted: #a8a6ad;

  /* Typography: system font stack (no bundled files) */
  --font-sans: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Malgun Gothic", "Segoe UI", "Noto Sans KR", sans-serif;

  /* Spacing / layout */
  --container-max: 1280px;
  --gutter: clamp(20px, 5vw, 64px);
  --section-padding-y: clamp(80px, 12vw, 160px);

  --header-height: 72px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-gray-900);
  background: var(--color-offwhite);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul {
  margin: 0;
}

ul {
  list-style: none;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 0;
  top: -48px;
  background: var(--color-accent);
  color: var(--color-white);
  padding: 12px 20px;
  z-index: 200;
  transition: top 0.2s var(--ease);
}
.skip-link:focus {
  top: 0;
}

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

.section-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 24px;
}

/* Placeholder image (Phase 1: no real photography yet) */
.image-placeholder {
  width: 100%;
  height: 100%;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: #c4c1b8;
  color: #999490;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.section-charcoal .image-placeholder,
.hero .image-placeholder,
.about .image-placeholder {
  background: #3a3934;
  color: var(--color-on-dark-muted);
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: rgba(22, 21, 26, 0.92);
  backdrop-filter: blur(8px);
  color: var(--color-on-dark);
}

.header-inner {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.logo span {
  font-weight: 400;
  opacity: 0.8;
  margin-left: 4px;
}

.main-nav ul {
  display: flex;
  gap: clamp(16px, 2.5vw, 36px);
}

.main-nav a {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  font-weight: 500;
  opacity: 0.85;
  transition: opacity 0.2s var(--ease);
}
.main-nav a:hover,
.main-nav a:focus-visible {
  opacity: 1;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  padding: 0;
}
.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-on-dark);
  margin: 0 auto;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  background: var(--color-charcoal);
  color: var(--color-on-dark);
  overflow: hidden;
}

.hero-media {
  width: 50%;
  flex-shrink: 0;
  order: 2;
}
.hero-media .image-placeholder {
  width: 100%;
  height: 100svh;
  opacity: 0.85;
}

.hero-image {
  width: 100%;
  height: 100svh;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero-content {
  width: 50%;
  z-index: 1;
  order: 1;
  padding: clamp(80px, 10vw, 120px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-title {
  font-size: clamp(2.8rem, 7.5vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
}

.hero .eyebrow {
  display: none;
}

.hero-sub {
  display: none;
}

/* ==========================================================================
   OUR VALUE
   ========================================================================== */
.value {
  background: var(--color-offwhite);
  padding: var(--section-padding-y) 0;
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(32px, 5vw, 0px);
}

.value-item {
  padding: 0 clamp(0px, 3vw, 40px);
  border-left: 1px solid var(--color-gray-200);
}
.value-item:first-child {
  border-left: none;
  padding-left: 0;
}

.value-item h2 {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 14px;
  color: var(--color-gray-900);
}

.value-item p {
  color: var(--color-gray-600);
  font-size: 0.92rem;
  line-height: 1.75;
}

/* ==========================================================================
   ABOUT
   ========================================================================== */
.about {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  background: var(--color-charcoal);
  color: var(--color-on-dark);
}

.about-media {
  min-height: 100%;
}

.about-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.about-content {
  padding: var(--section-padding-y) var(--gutter);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.about-content h2 {
  font-size: clamp(1.8rem, 3.2vw, 2.2rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 28px;
  letter-spacing: -0.01em;
}

.about-body {
  color: var(--color-on-dark-muted);
  font-size: 0.95rem;
  line-height: 1.85;
  margin-bottom: 40px;
}

.capability-labels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 32px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 28px;
}

.capability-labels li {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.capability-labels strong {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  font-weight: 700;
  text-transform: uppercase;
}

.capability-labels span {
  font-size: 0.8rem;
  color: var(--color-on-dark-muted);
  line-height: 1.5;
}

.about-note {
  font-size: 0.8rem;
  color: var(--color-on-dark-muted);
}

/* ==========================================================================
   DESIGN / PORTFOLIO — EDITORIAL LAYOUT
   ========================================================================== */
.work {
  background: var(--color-charcoal);
  color: var(--color-on-dark);
  padding: var(--section-padding-y) 0;
}

.work h2 {
  font-size: clamp(1.8rem, 3.2vw, 2.2rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: clamp(48px, 8vw, 72px);
  letter-spacing: -0.01em;
}

/* Editorial portfolio grid: variable sizing for visual rhythm */
.work-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(24px, 4vw, 40px);
  align-items: start;
}

.work-card {
  display: block;
  color: inherit;
}

/* Base card spans 2 columns by default */
.work-card:nth-child(1) { grid-column: span 2; }
.work-card:nth-child(2) { grid-column: span 2; }
.work-card:nth-child(3) { grid-column: span 2; }
.work-card:nth-child(4) { grid-column: span 2; }
.work-card:nth-child(5) { grid-column: span 2; }
.work-card:nth-child(6) { grid-column: span 2; }

/* Alternate some to be larger (4 columns) for editorial rhythm */
.work-card:nth-child(3) { grid-column: span 3; }
.work-card:nth-child(6) { grid-column: span 3; }

.work-card-media {
  overflow: hidden;
  border-radius: 0;
  margin-bottom: 16px;
}

/* Aspect ratios vary for editorial effect */
.work-card:nth-child(1) .work-card-media { aspect-ratio: 3 / 4; }
.work-card:nth-child(2) .work-card-media { aspect-ratio: 3 / 4; }
.work-card:nth-child(3) .work-card-media { aspect-ratio: 16 / 12; }
.work-card:nth-child(4) .work-card-media { aspect-ratio: 3 / 4; }
.work-card:nth-child(5) .work-card-media { aspect-ratio: 3 / 4; }
.work-card:nth-child(6) .work-card-media { aspect-ratio: 16 / 10; }

.work-card-media .image-placeholder {
  height: 100%;
  min-height: 0;
  transition: transform 0.5s var(--ease);
}
.work-card:hover .work-card-media .image-placeholder {
  transform: scale(1.02);
}

.work-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.5s var(--ease);
}
.work-card:hover .work-card-image {
  transform: scale(1.02);
}

.work-card-title {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 3px;
  line-height: 1.3;
}

.work-card-meta {
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  color: var(--color-on-dark-muted);
  font-weight: 400;
}

.work-empty {
  color: var(--color-on-dark-muted);
  font-size: 0.9rem;
  padding: 60px 0;
  text-align: center;
  grid-column: 1 / -1;
}

/* ==========================================================================
   PRINT
   ========================================================================== */
.capability {
  background: var(--color-charcoal);
  color: var(--color-on-dark);
  padding: var(--section-padding-y) 0;
}

.capability h2 {
  font-size: clamp(1.8rem, 3.2vw, 2.2rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: clamp(48px, 8vw, 80px);
  letter-spacing: -0.01em;
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: clamp(32px, 5vw, 60px);
}

.capability-grid li {
  padding: 0;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
  line-height: 1.6;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-on-dark-muted);
}

/* ==========================================================================
   SELECTED CLIENTS
   ========================================================================== */
.clients {
  background: var(--color-white);
  padding: var(--section-padding-y) 0;
}

.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 32px;
  align-items: center;
  margin-bottom: 28px;
}

.clients-grid li {
  filter: grayscale(1);
  opacity: 0.7;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-gray-600);
}

.clients-note {
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-gray-400);
}

/* ==========================================================================
   CONTACT
   ========================================================================== */
.contact {
  background: var(--color-charcoal);
  color: var(--color-on-dark);
  padding: var(--section-padding-y) 0;
}

.contact h2 {
  font-size: clamp(1.8rem, 3.2vw, 2.2rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}

.contact-body {
  color: var(--color-on-dark-muted);
  font-size: 0.98rem;
  line-height: 1.8;
  margin-bottom: 48px;
}

.contact-cta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 3vw, 32px);
}

.cta-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
  min-height: auto;
}
.cta-card:hover,
.cta-card:focus-visible {
  border-color: var(--color-accent);
  background: transparent;
}

.cta-title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.cta-desc {
  font-size: 0.85rem;
  color: var(--color-on-dark-muted);
  line-height: 1.6;
}

.cta-arrow {
  margin-top: 4px;
  transition: transform 0.2s var(--ease);
}
.cta-card:hover .cta-arrow {
  transform: translateX(3px);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  background: var(--color-gray-900);
  color: var(--color-on-dark-muted);
  padding: 48px 0;
  font-size: 0.8rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 32px;
  justify-content: space-between;
}

.footer-logo {
  font-weight: 700;
  color: var(--color-on-dark);
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.footer-copyright {
  width: 100%;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* Tablet: <1024px */
@media (max-width: 1023px) {
  .about {
    grid-template-columns: 1fr;
  }
  .about-media {
    min-height: 340px;
  }
  .capability-labels {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Tablet work grid: 4 columns */
  .work-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .work-card { grid-column: span 1 !important; }
  .work-card:nth-child(3) { grid-column: span 2 !important; }
  .work-card:nth-child(6) { grid-column: span 2 !important; }
}

/* Mobile: <768px */
@media (max-width: 767px) {
  :root {
    --section-padding-y: clamp(60px, 10vw, 100px);
  }

  .main-nav {
    position: fixed;
    inset: var(--header-height) 0 0 0;
    background: var(--color-charcoal);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
    overflow-y: auto;
  }
  .main-nav.is-open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
  .main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 12px var(--gutter) 32px;
  }
  .main-nav a {
    display: block;
    padding: 16px 0;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .nav-toggle {
    display: flex;
  }

  .hero {
    flex-direction: column-reverse;
    min-height: auto;
  }

  .hero-media {
    width: 100%;
    order: initial;
    min-height: 340px;
  }

  .hero-media .image-placeholder {
    height: auto;
    min-height: 280px;
  }

  .hero-image {
    width: 100%;
    height: auto;
    min-height: 280px;
    object-fit: cover;
  }

  .hero-content {
    width: 100%;
    order: initial;
    padding: clamp(60px, 8vw, 80px);
  }

  .hero .eyebrow {
    display: block;
    margin-bottom: 16px;
  }

  .hero-sub {
    display: block;
    font-size: clamp(0.9rem, 3vw, 1rem);
    line-height: 1.7;
    margin-top: 12px;
    color: var(--color-on-dark-muted);
  }

  .hero-title {
    font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  }

  .value-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .value-item {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--color-gray-200);
    padding-top: 28px;
  }
  .value-item:first-child {
    border-top: none;
    padding-top: 0;
  }

  .work h2,
  .capability h2,
  .contact h2 {
    margin-bottom: clamp(32px, 6vw, 48px);
  }

  /* Mobile work grid: single column, full width images */
  .work-grid {
    grid-template-columns: 1fr;
    gap: clamp(28px, 5vw, 36px);
  }

  .work-card { grid-column: span 1 !important; }
  .work-card:nth-child(3) { grid-column: span 1 !important; }
  .work-card:nth-child(6) { grid-column: span 1 !important; }

  /* Mobile: all cards same aspect, full width */
  .work-card-media {
    aspect-ratio: 9 / 11 !important;
    margin-bottom: 12px;
  }

  .work-card-title {
    font-size: 0.9rem;
    margin-bottom: 4px;
  }

  .work-card-meta {
    font-size: 0.75rem;
  }

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

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

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
