/* ============================================================
   EDITAS — Interior Design & Build
   Shared stylesheet: public site (index.html) + admin (admin.html)
   ============================================================ */

:root {
  --ink: #111111;
  --ink-soft: #4a4a48;
  --ink-mute: #8b8a86;
  --paper: #f7f6f3;
  --paper-2: #efedE8;
  --line: #ddd9d2;
  --dark: #141413;
  --dark-soft: #2a2927;
  --white: #ffffff;
  --accent: #6b4ea8;
  --radius: 2px;
  --shell: 1180px;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', Roboto, sans-serif;
  --serif: 'Cormorant Garamond', 'Times New Roman', Georgia, serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

button, input, textarea, select { font: inherit; color: inherit; }

h1, h2, h3 { margin: 0; font-weight: 400; letter-spacing: -0.01em; }

p { margin: 0 0 1em; }

.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;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 28px;
}

.eyebrow {
  margin: 0 0 18px;
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.section-title {
  font-family: var(--serif);
  font-size: clamp(30px, 5.2vw, 54px);
  line-height: 1.1;
  letter-spacing: -0.015em;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 246, 243, .86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.site-header.is-stuck { border-bottom-color: var(--line); }

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

.brand { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }

/* uploaded EDITAS wordmark — height-based so the ratio never distorts */
.brand-logo {
  display: block;
  height: 52px;
  width: auto;
  max-width: min(280px, 58vw);
  mix-blend-mode: multiply;
}
/* on dark surfaces the mark sits on its own light plate to stay legible */
.brand-logo-plate {
  mix-blend-mode: normal;
  background: var(--white);
  padding: 6px 9px;
  border-radius: var(--radius);
}
.brand-sub {
  font-size: 10.5px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 6px;
}

.primary-nav { display: flex; align-items: center; gap: 30px; }
.primary-nav a {
  font-size: 13px;
  letter-spacing: .09em;
  color: var(--ink-soft);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.primary-nav a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.nav-cta {
  border: 1px solid var(--ink) !important;
  border-radius: 999px;
  padding: 7px 18px !important;
  color: var(--ink) !important;
}
.nav-cta:hover { background: var(--ink); color: var(--paper) !important; }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  background: none; border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav-toggle-bar {
  display: block; width: 18px; height: 1px; background: var(--ink);
  transition: transform .25s var(--ease), opacity .25s var(--ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:first-child { transform: translateY(3px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:last-child { transform: translateY(-3px) rotate(-45deg); }

/* ---------- Hero ---------- */

.hero { position: relative; padding: clamp(72px, 14vw, 150px) 0 clamp(60px, 10vw, 110px); }
.hero-inner { max-width: 940px; }

.hero-title {
  font-family: var(--serif);
  font-size: clamp(46px, 11vw, 116px);
  line-height: .98;
  letter-spacing: -0.03em;
  margin: 0 0 30px;
}
.hero-title em { font-style: italic; color: var(--ink-soft); }

.hero-lead {
  max-width: 620px;
  font-size: clamp(15px, 2.1vw, 18px);
  color: var(--ink-soft);
  margin-bottom: 36px;
}

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

.hero-rule {
  max-width: calc(var(--shell) - 56px);
  margin: clamp(48px, 9vw, 96px) auto 0;
  height: 1px;
  background: var(--line);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 28px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  font-size: 13px; letter-spacing: .1em; text-transform: uppercase;
  cursor: pointer;
  transition: background .25s var(--ease), color .25s var(--ease), opacity .2s var(--ease);
}
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--dark-soft); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: progress; }

.btn-sm {
  padding: 8px 16px;
  font-size: 11px;
  letter-spacing: .08em;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line);
}
.btn-sm:hover { border-color: var(--ink); }
.btn-danger:hover { border-color: #b3261e; color: #b3261e; }

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

.section { padding: clamp(64px, 11vw, 128px) 0; }
.section-soft { background: var(--paper-2); }
.section-dark { background: var(--dark); color: var(--paper); }
.section-dark .eyebrow { color: rgba(247, 246, 243, .5); }

.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head-row {
  max-width: none;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.section-note { font-size: 13px; color: var(--ink-mute); margin: 0; }

/* ---------- Story ---------- */

.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: start;
}
.story-grid .section-head { margin-bottom: 0; }
.story-body p { color: var(--ink-soft); font-size: 16.5px; }

.story-points {
  list-style: none;
  margin: 34px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.story-points li {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.point-key { font-family: var(--serif); font-size: 28px; line-height: 1.1; }
.point-label { font-size: 14px; color: var(--ink-mute); align-self: center; }

/* ---------- Services ---------- */

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: rgba(247, 246, 243, .16);
  border: 1px solid rgba(247, 246, 243, .16);
}
.service-card { background: var(--dark); padding: clamp(28px, 4vw, 44px); }
.service-no {
  font-size: 11px; letter-spacing: .2em; color: rgba(247, 246, 243, .45);
}
.service-card h3 {
  font-family: var(--serif);
  font-size: 28px;
  margin: 18px 0 14px;
}
.service-card p { color: rgba(247, 246, 243, .68); font-size: 14.5px; margin: 0; }

/* ---------- Projects ---------- */

/* Commercial / Residential tabs sit above the category chips */
.sector-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
  margin: 0 0 24px;
  border-bottom: 1px solid var(--line);
}
.sector-row:empty { display: none; }
.sector-tab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 0 0 12px;
  cursor: pointer;
  font-family: var(--serif);
  font-size: clamp(21px, 3vw, 28px);
  line-height: 1.25;
  color: var(--ink-mute);
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.sector-tab:hover { color: var(--ink); }
.sector-tab.is-active { color: var(--ink); border-bottom-color: var(--ink); }
.sector-tab .tab-count {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--ink-mute);
  margin-left: 7px;
  vertical-align: middle;
}

.card-sector {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(247, 246, 243, .93);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.filter-row:empty { display: none; }
.chip {
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-size: 12.5px;
  letter-spacing: .06em;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.chip:hover { border-color: var(--ink); }
.chip.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: clamp(18px, 2.4vw, 30px);
}

.project-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  width: 100%;
}
.card-media {
  display: block;
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--line);
}
.card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .7s var(--ease);
}
.project-card:hover .card-media img { transform: scale(1.045); }

.media-fallback {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #e7e4de 0%, #f3f1ed 55%, #e2ded7 100%);
  color: var(--ink-mute);
}
.media-fallback span {
  font-family: var(--serif);
  font-size: 38px;
  letter-spacing: .12em;
  color: var(--ink-soft);
}
.media-fallback em {
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.card-info {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 14px;
  padding: 16px 2px 0;
}
.card-title { font-family: var(--serif); font-size: 24px; line-height: 1.2; margin: 0; }
.card-cat { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-mute); }
.card-loc { width: 100%; font-size: 13.5px; color: var(--ink-soft); margin: 0; }

.grid-state {
  margin: 28px 0 0;
  font-size: 14px;
  color: var(--ink-mute);
}
.grid-state.is-error { color: #b3261e; }

/* ---------- Clients ---------- */

.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.client-tile {
  background: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 34px 20px;
  min-height: 190px;
}
.client-name {
  font-size: 10.5px;
  letter-spacing: .2em;
  color: var(--ink-mute);
  text-align: center;
}
.client-wordmark {
  font-family: var(--serif);
  font-size: clamp(24px, 3.4vw, 34px);
  letter-spacing: .04em;
  text-align: center;
}
.client-wordmark-sm { font-size: clamp(20px, 2.6vw, 26px); }

/* two logos live inside one uploaded image — crop each half */
.logo-crop {
  width: 104px;
  aspect-ratio: 433 / 442;
  overflow: hidden;
  position: relative;
}
.logo-crop img {
  width: 200%;
  max-width: none;
  height: auto;
  position: absolute;
  top: 0;
}
.logo-crop--left img { left: 0; }
.logo-crop--right img { left: -100%; }

/* ---------- Contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}
.contact-grid .section-head { margin-bottom: 0; }
.contact-copy { color: var(--ink-soft); }
.contact-meta { font-size: 12.5px; letter-spacing: .08em; color: var(--ink-mute); margin: 24px 0 0; }

.contact-form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
.field-label {
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 13px 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  transition: border-color .2s var(--ease);
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--ink); }
.field textarea { resize: vertical; min-height: 110px; }
.field input.is-invalid, .field textarea.is-invalid { border-color: #b3261e; }

.form-state { margin: 2px 0 0; font-size: 13.5px; min-height: 20px; }
.form-state.is-ok { color: #2f6b45; }
.form-state.is-error { color: #b3261e; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--dark);
  color: rgba(247, 246, 243, .72);
  padding: 56px 0 44px;
}
.footer-inner { display: grid; gap: 14px; justify-items: start; }
.footer-logo { height: 44px; margin-bottom: 6px; }
.footer-line { margin: 0; font-size: 14px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-nav a {
  font-size: 12.5px;
  letter-spacing: .08em;
  border-bottom: 1px solid transparent;
}
.footer-nav a:hover { color: var(--paper); border-bottom-color: rgba(247, 246, 243, .5); }
.footer-copy { font-size: 11.5px; color: rgba(247, 246, 243, .45); margin-top: 8px; }

/* ---------- Modal ---------- */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  padding: 24px;
  align-items: center;
  justify-content: center;
}
.modal.is-open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(17, 17, 17, .68); }
.modal-panel {
  position: relative;
  width: min(880px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .3);
}
.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; line-height: 1;
  background: rgba(247, 246, 243, .92);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  z-index: 2;
}
.modal-close:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.modal-media { position: relative; aspect-ratio: 16 / 10; background: var(--paper-2); overflow: hidden; }
.modal-media img { width: 100%; height: 100%; object-fit: cover; }
.modal-body { padding: clamp(22px, 4vw, 38px); }
.modal-eyebrow { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-mute); margin: 0 0 10px; }
.modal-title { font-family: var(--serif); font-size: clamp(26px, 4.4vw, 40px); line-height: 1.12; }
.modal-meta { margin: 10px 0 18px; font-size: 13.5px; color: var(--ink-mute); }
.modal-text { margin: 0; color: var(--ink-soft); }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 24px);
  max-width: min(420px, calc(100vw - 32px));
  padding: 13px 22px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  font-size: 13.5px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  z-index: 90;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: #b3261e; }

/* ---------- Reveal animation ---------- */

.reveal, .will-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.is-in, .will-reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .will-reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   Admin (admin.html) — Korean UI
   ============================================================ */

.admin-body { background: var(--paper-2); }

.admin-header {
  background: var(--dark);
  color: var(--paper);
  padding: 22px 0;
}
.admin-header .header-inner { min-height: 0; }
.admin-header .brand-sub { color: rgba(247, 246, 243, .55); }
.admin-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-actions .btn-sm { color: var(--paper); border-color: rgba(247, 246, 243, .35); }
.admin-actions .btn-sm:hover { border-color: var(--paper); background: rgba(247, 246, 243, .1); }
.admin-user { font-size: 12px; color: rgba(247, 246, 243, .6); }

.admin-main { padding: 40px 0 80px; }

.auth-card {
  width: min(440px, 100%);
  margin: 40px auto;
  background: var(--white);
  border: 1px solid var(--line);
  padding: clamp(24px, 5vw, 38px);
}
.auth-card h2 { font-family: var(--serif); font-size: 28px; margin-bottom: 8px; }
.auth-card .muted { color: var(--ink-mute); font-size: 13.5px; }
.auth-tabs { display: flex; gap: 8px; margin: 20px 0 22px; }
.auth-tabs .chip { flex: 1; text-align: center; }

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  padding: clamp(20px, 3vw, 28px);
}
.panel-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 18px;
}
.panel-head h2 { font-family: var(--serif); font-size: 24px; }
.panel-hint { font-size: 12.5px; color: var(--ink-mute); margin: 0; }

.admin-form { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.form-actions .btn { flex: 1 1 auto; }

.preview-box {
  aspect-ratio: 4 / 3;
  border: 1px dashed var(--line);
  background: var(--paper-2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  color: var(--ink-mute);
  font-size: 12.5px;
  text-align: center;
  padding: 10px;
}
.preview-box img { width: 100%; height: 100%; object-fit: cover; }

.admin-list { display: grid; gap: 12px; }
.admin-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--white);
  align-items: center;
}
.admin-item.is-editing { border-color: var(--ink); }
.admin-thumb {
  aspect-ratio: 1 / 1;
  background: var(--paper-2);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-size: 20px;
  color: var(--ink-mute);
}
.admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-item h3 { font-size: 16px; font-weight: 500; margin-bottom: 2px; }
.admin-item .meta { font-size: 12.5px; color: var(--ink-mute); margin: 0 0 10px; }
.item-actions { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 960px) {
  .admin-layout { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .story-grid, .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .story-points li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .point-label { align-self: start; }
}

@media (max-width: 720px) {
  .shell { padding: 0 20px; }
  .brand-logo { height: 40px; }
  .footer-logo { height: 36px; }
  .header-inner { min-height: 78px; }
  .brand-sub { font-size: 9px; letter-spacing: .2em; margin-top: 4px; }
  .nav-toggle { display: flex; }
  .primary-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 8px 20px 18px;
  }
  .primary-nav.is-open { display: flex; }
  .primary-nav a { padding: 13px 0; font-size: 15px; }
  .nav-cta { text-align: center; margin-top: 10px; }
  .site-header { position: sticky; }
  .header-inner { position: relative; }

  .project-grid { grid-template-columns: minmax(0, 1fr); }
  .client-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-tile-wide { grid-column: 1 / -1; }
  .hero-actions .btn { flex: 1 1 100%; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .modal { padding: 0; align-items: flex-end; }
  .modal-panel { max-height: 92vh; width: 100%; border-radius: 0; }
  .admin-item { grid-template-columns: 64px minmax(0, 1fr); }
}
