/* ===== Reset & tokens ===== */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #000000;
  --bg-soft: #050505;
  --surface: rgba(255, 255, 255, 0.025);
  --surface-2: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.24);
  --text: #f2f0ec;
  --text-dim: #918d87;
  --text-faint: #635f5a;
  /* Monochrome first: --accent drives most UI so the page stays black & white. */
  --accent: #eae8e3;
  --accent-2: #ffffff;
  --accent-3: #c4c1bb;
  /* Gold is the rare highlight — hero emphasis, primary CTA, eyebrows only. */
  --gold: #c9a97e;
  --gold-soft: #e3cba6;
  --radius: 16px;
  --radius-lg: 24px;
  --maxw: 1160px;
  --grad: linear-gradient(120deg, var(--gold-soft), var(--gold));
  --font-serif: "Playfair Display", "Noto Serif KR", Georgia, "Apple SD Gothic Neo",
    "Batang", serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }

/* Keyboard focus visibility (skill: focus states for keyboard nav) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
.btn:focus-visible,
.nav-cta:focus-visible { outline-offset: 4px; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ===== Background decoration ===== */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 40%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000 40%, transparent 85%);
}
.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.5;
  will-change: transform;
}
.glow-1 {
  top: -280px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 640px;
  background: radial-gradient(circle, rgba(255, 252, 245, 0.09), transparent 68%);
  animation: drift-1 18s ease-in-out infinite alternate;
}
.glow-2 {
  top: 420px;
  right: -220px;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(201, 169, 126, 0.07), transparent 68%);
  animation: drift-2 22s ease-in-out infinite alternate;
}
/* Ambient light blobs — slow oscillation (Modern Dark style) */
@keyframes drift-1 {
  from { transform: translate(-50%, 0) scale(1); }
  to { transform: translate(-42%, 40px) scale(1.08); }
}
@keyframes drift-2 {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-60px, 50px) scale(1.12); }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.18s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn-primary {
  background: transparent;
  border-color: rgba(201, 169, 126, 0.55);
  color: var(--gold);
  padding-right: 10px;
}
.btn-primary:hover {
  border-color: var(--gold);
  background: rgba(201, 169, 126, 0.08);
}
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--border-strong); background: rgba(255, 255, 255, 0.05); }
.btn-block { width: 100%; justify-content: center; padding-right: 28px; }
.btn-arrow { transition: transform 0.2s ease; }
.btn:hover .btn-arrow { transform: translateX(3px); }
/* Circled arrow badge, mirroring the reference CTA */
.btn-primary .btn-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(201, 169, 126, 0.5);
  font-size: 0.8rem;
  line-height: 1;
  margin-left: 4px;
}
.btn-primary:hover .btn-arrow { border-color: var(--gold); transform: translateX(3px); }
.btn-block .btn-arrow { margin-left: 0; }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.site-header.scrolled {
  border-bottom-color: var(--border);
  background: rgba(0, 0, 0, 0.8);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-serif);
  font-size: 1.32rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.logo-mark {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.07);
}
.logo-accent { color: var(--gold); }

.nav-list {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
}
.nav-list a {
  color: var(--text-dim);
  font-size: 0.94rem;
  font-weight: 500;
  transition: color 0.2s ease;
}
.nav-list a:hover { color: var(--text); }
.nav-cta {
  color: var(--text) !important;
  border: 1px solid var(--border);
  padding: 9px 20px;
  border-radius: 999px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.nav-cta:hover { border-color: var(--border-strong); background: var(--surface-2); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: 130px 0 110px;
  text-align: center;
}
.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 6.8vw, 4.9rem);
  line-height: 1.16;
  font-weight: 400;
  letter-spacing: -0.015em;
}
.hero h1 em {
  font-style: normal;
  color: var(--gold);
}
.hero-sub {
  max-width: 640px;
  margin: 26px auto 0;
  color: var(--text-dim);
  font-size: 1.02rem;
  letter-spacing: 0.005em;
}
.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 40px;
  flex-wrap: wrap;
}
/* ===== Sections ===== */
.section { padding: 96px 0; position: relative; }
.section-head {
  max-width: 640px;
  margin: 0 auto 52px;
  text-align: center;
}
.section-eyebrow {
  display: inline-block;
  color: var(--gold);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.74rem;
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.section-lead {
  color: var(--text-dim);
  margin-top: 16px;
  font-size: 1.05rem;
}

/* Values */
.values-section { padding: 40px 0; }
.values-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.value-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.value-card:hover { transform: translateY(-4px); border-color: var(--border-strong); background: var(--surface-2); }
.value-key {
  display: block;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 8px;
}
.value-card p { color: var(--text-dim); font-size: 0.92rem; }

/* About */
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.about-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.about-block:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.about-block h3 { font-size: 1.15rem; margin-bottom: 10px; color: var(--accent); }
.about-block p { color: var(--text-dim); }

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.card:hover { transform: translateY(-5px); border-color: var(--border-strong); background: var(--surface-2); }
.card-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  color: var(--accent);
}
.card-icon svg { width: 26px; height: 26px; }
.card:hover .card-icon { color: var(--accent-2); }
.card h3 { font-size: 1.4rem; margin-bottom: 12px; letter-spacing: -0.01em; }
.card p { color: var(--text-dim); margin-bottom: 20px; }
.card-list { list-style: none; display: grid; gap: 10px; }
.card-list li {
  color: var(--text-dim);
  padding-left: 24px;
  position: relative;
}
.card-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* Portfolio projects */
.project {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: inherit;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.project:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.project-thumb {
  aspect-ratio: 1 / 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1c2b6b, #4f6cff);
}
.project-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.35));
}
.project-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Source icon has opaque white corners; scale past them so the tile reads
   full-bleed like the other product thumbs. */
.project-thumb-crop img { transform: scale(1.16); }
.project-body { padding: 26px 28px 30px; }
.project-tag {
  display: inline-block;
  font-size: 0.76rem;
  color: var(--accent);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.project h3 { font-size: 1.3rem; margin-bottom: 10px; }
.project-body p { color: var(--text-dim); font-size: 0.94rem; margin-bottom: 18px; }
.project-link {
  display: inline-block;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  width: 100%;
  transition: color 0.2s ease;
}
.project:hover .project-link { color: var(--accent-2); }

/* Process */
.process-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.process-step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.process-step:hover {
  transform: translateY(-5px);
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.process-num {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 16px;
}
.process-step h3 { font-size: 1.16rem; margin-bottom: 10px; }
.process-step p { color: var(--text-dim); font-size: 0.94rem; }

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  align-items: start;
}
.contact-form {
  display: grid;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 34px;
}
.field { display: grid; gap: 8px; }
.field label { font-size: 0.9rem; color: var(--text-dim); }
.field input,
.field textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}
.contact-info { padding: 8px 0; }
.contact-info h3 { font-size: 1rem; margin-bottom: 6px; color: var(--accent); }
.contact-info h3:not(:first-child) { margin-top: 26px; }
.contact-info p { color: var(--text-dim); }
.contact-info a:hover { color: var(--text); }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 60px 0 30px;
  margin-top: 40px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 48px;
  flex-wrap: wrap;
  padding-bottom: 44px;
}
.footer-brand { max-width: 320px; }
.footer-brand p { color: var(--text-faint); font-size: 0.9rem; margin-top: 16px; }
.footer-cols { display: flex; gap: 64px; flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: 12px; }
.footer-col h4 { font-size: 0.9rem; margin-bottom: 4px; color: var(--text); }
.footer-col a { color: var(--text-dim); font-size: 0.9rem; transition: color 0.2s ease; }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
}
.footer-biz {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-style: normal;
  color: var(--text-faint);
  font-size: 0.86rem;
  margin-bottom: 12px;
}
.footer-biz strong { color: var(--text-dim); font-weight: 600; }
.copyright { color: var(--text-faint); font-size: 0.86rem; }

/* ===== Reveal animation ===== */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px) scale(0.98);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .glow-1, .glow-2 { animation: none; }
  html { scroll-behavior: auto; }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .nav-list {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(8, 8, 11, 0.98);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .nav-list.open { max-height: 440px; }
  .nav-list li { width: 100%; text-align: center; }
  .nav-list a { display: block; padding: 15px; width: 100%; }
  .nav-cta { border: 0 !important; border-radius: 0 !important; }

  .values-grid,
  .about-grid,
  .cards,
  .cards-3,
  .process-list,
  .contact-grid { grid-template-columns: 1fr; }

  .section { padding: 68px 0; }
  .hero { padding: 90px 0 70px; }
  .hero-stats { gap: 32px; margin-top: 48px; }
  .footer-inner { flex-direction: column; gap: 36px; }
  .footer-cols { gap: 40px; }
}

@media (max-width: 480px) {
  .footer-biz { gap: 6px 16px; }
}

/* Portfolio holds 4 products: 4-up wide, 2-up mid, 1-up small.
   Declared after the shared breakpoints so it wins over `.cards`. */
.portfolio-cards { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1080px) {
  .portfolio-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .portfolio-cards { grid-template-columns: 1fr; }
}
