/* ----------------------------------------
   Kim Ku — personal site
   Shared styles
---------------------------------------- */

:root {
  --text: #111;
  --muted: #555;
  --border: #e5e5e5;
  --border-strong: #d9d9d9;
  --bg: #E8E8E8;
  --bg-subtle: #f7f7f7;
  --accent: #2f6bff;
  --accent-hover: #1b54e6;
  --avatar-bg: #d4d4d4;
  --max-width: 1280px;
  --content-gutter: 32px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

strong, b { font-weight: 600; }
em, i { font-style: italic; }

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 12px;
}

h2 { font-size: 17px; }
h3 { font-size: 17px; }
h4 { font-size: 15px; }

p { margin: 0 0 16px; }

ul { padding-left: 20px; margin: 0 0 16px; }
li { margin-bottom: 8px; }

/* ----------------------------------------
   Layout
---------------------------------------- */

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 64px var(--content-gutter) 120px;
}

.page--wide {
  max-width: 1280px;
}

/* ----------------------------------------
   Header (shared across all pages)
---------------------------------------- */

.site-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 56px;
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--avatar-bg);
  flex-shrink: 0;
  overflow: hidden;
  object-fit: cover;
  object-position: center;
  display: block;
}

.site-header .intro {
  padding-top: 2px;
}

.site-header .intro strong {
  display: block;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.2;
  margin-bottom: 4px;
}

.site-header .intro p {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
}

/* ----------------------------------------
   Type scale
   Bold headers: 18px · Description text: 15px
---------------------------------------- */

body.work {
  display: flex;
  flex-direction: column;
}

body.work .site-header {
  margin-bottom: 0;
}

body.work:has(#work-content:not([hidden])) .site-header {
  margin-bottom: 56px;
}

body.work > .page {
  width: 100%;
}

/* Work-page-only extras: section label and card text */
body.work .section-label,
body.work .project-card h3,
body.work .project-card p {
  font-size: 15px;
}

/* ----------------------------------------
   Home — featured projects
---------------------------------------- */

.section-label {
  font-weight: 400;
  margin-bottom: 20px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.project-card {
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #F2F2F2;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 16px;
  text-decoration: none;
  transition: background-color 600ms ease;
}

.project-card__body {
  min-width: 0;
}

.project-card__arrow {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  color: var(--text);
}

.project-card__icons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.project-card__lock {
  display: inline-flex;
  align-items: center;
  color: var(--text);
}

.project-card:hover {
  background: #ffffff;
}

.project-card h3 {
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  margin: 0 0 2px;
}

.project-card p {
  margin: 0;
  color: #666;
  line-height: 19px;
}

/* ----------------------------------------
   About — two column
---------------------------------------- */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 64px;
  align-items: start;
}

.about-main {
  font-size: 15px;
}

.about-main .divider {
  width: 16px;
  height: 2px;
  background: #111;
  margin: 16px 0 32px;
  border: 0;
}

.about-main .fav-list li {
  list-style: none;
  margin-bottom: 10px;
}

.about-main .fav-list {
  padding-left: 0;
}

.sidebar {
  font-size: 15px;
}

.sidebar h4 {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 14px;
}

.sidebar ul {
  padding-left: 0;
  list-style: none;
  margin: 0;
}

.sidebar li {
  margin-bottom: 10px;
}

.sidebar li::before {
  content: "•";
  margin-right: 8px;
}

.sidebar .emoji {
  display: inline-block;
  width: 22px;
  margin-right: 4px;
}

/* ----------------------------------------
   Case study
---------------------------------------- */

.case-header h1 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px;
}

.case-header .lede {
  color: var(--muted);
  margin: 0 0 28px;
}

.case-hero-img {
  width: 100%;
  display: block;
  border-radius: 8px;
  margin-bottom: 48px;
}

.case-section img,
.placeholder-row img {
  width: 100%;
  display: block;
  border-radius: 4px;
}

.case-hero {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 13px;
  margin-bottom: 48px;
}

/* Meta info grid: Role / Team / Timeline / Impact */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 56px;
  padding-bottom: 0;
}

.meta-grid .cell h4 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.meta-grid .cell p {
  font-size: 13px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.meta-grid .cell .icon {
  font-size: 14px;
}

/* Case sections: left column copy + right column image */
.case-section {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  margin-bottom: 56px;
  align-items: start;
}

.case-section .copy h2 {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 10px;
}

.case-section .copy p {
  font-size: 14px;
  color: var(--text);
  margin: 0 0 10px;
  line-height: 1.5;
}

.case-section .copy ul {
  font-size: 14px;
  padding-left: 18px;
  margin: 0;
}

.case-section .copy li {
  margin-bottom: 8px;
  line-height: 1.5;
}

/* Full-width copy blocks (problems / challenges) */
.case-block {
  margin-bottom: 40px;
}

.case-block h2 {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 10px;
}

.case-block p,
.case-block li {
  font-size: 14px;
  line-height: 1.55;
}

/* Image placeholders inside case study */
.placeholder {
  background: var(--bg-subtle);
  border: 1px dashed var(--border-strong);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 12px;
  text-align: center;
  padding: 20px;
}

.placeholder--sm  { min-height: 140px; }
.placeholder--md  { min-height: 220px; }
.placeholder--lg  { min-height: 300px; }
.placeholder--xl  { min-height: 380px; }

/* Two-up image placeholders */
.placeholder-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Design principles row (Anchoring section) */
.principle {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  margin-bottom: 36px;
  align-items: start;
}

.principle h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 8px;
}

.principle p {
  font-size: 13px;
  color: var(--text);
  margin: 0;
  line-height: 1.5;
}

/* Success metrics table */
.metrics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 12px;
}

.metrics-table th,
.metrics-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.metrics-table thead th {
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--border-strong);
}

.metrics-table .pos { color: #128a3c; font-weight: 600; }
.metrics-table .neg { color: #c93838; font-weight: 600; }

/* Back link at bottom of case study */
.back-link {
  margin-top: 56px;
  font-size: 14px;
}

/* ----------------------------------------
   Inline password gate (work.html)
---------------------------------------- */

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

.gate-screen {
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  padding: 24px var(--content-gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gate-screen[hidden] {
  display: none;
}

.gate-lock {
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Page splits: header sits above the gate while locked.
   When unlocked, the two .page wrappers combine visually.    */
.page--top    { padding-bottom: 0; }
.page--bottom { padding-top: 0; }

.gate-form {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 4px;
  padding: 0 4px 0 16px;
  width: 100%;
  max-width: 320px;
  height: 48px;
}

.gate-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  font-size: 15px;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
}

.gate-input::placeholder {
  color: #b8b8b8;
}

.gate-submit {
  background: transparent;
  border: 0;
  padding: 8px;
  margin-left: 8px;
  cursor: pointer;
  color: #b8b8b8;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 150ms ease;
}

.gate-submit:hover { color: var(--text); }

/* Error shake on incorrect password */
.gate-form--error {
  animation: gate-shake 0.36s ease-in-out;
}
@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(8px); }
  60%      { transform: translateX(-6px); }
  80%      { transform: translateX(6px); }
}

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

@media (max-width: 780px) {
  .project-grid {
    grid-template-columns: 1fr;
  }
  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .meta-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  .case-section,
  .principle {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .placeholder-row {
    grid-template-columns: 1fr;
  }
  .site-header {
    margin-bottom: 60px;
  }
  .page { padding: 40px 20px 80px; }
  .page--top { padding-bottom: 0; }
  .page--bottom { padding-top: 0; }
}
