@import url("https://fonts.googleapis.com/css2?family=Jua&family=Noto+Sans+KR:wght@400;500;600&display=swap");

:root {
  color-scheme: light;
  --ink: #29372d;
  --muted: #5d6b5f;
  --canvas: #f4efe2;
  --paper: #fffdf5;
  --subtle: #f1ead8;
  --line: #d5c9ae;
  --accent: #a54b35;
  --accent-ink: #813825;
  --accent-soft: #efd5bd;
  --focus: #6d351f;
  --blue: #496e7a;
  --pink: #a54b35;
  --amber: #96662b;
  --green: #456c4a;
  --plum: #8f4939;
  --plum-dark: #3d513e;
  --lilac: #dce5c8;
  --peach: #f0d4ad;
  --mint: #cfe0c9;
  --butter: #eddfad;
  --hero: linear-gradient(135deg, #fbf5df 0%, #e3e9c8 58%, #c8dfcf 100%);
  --header: rgb(255 253 245 / 93%);
  --on-light: #29372d;
  --on-light-muted: #5d6b5f;
  --on-dark: #fffdf5;
  --on-dark-muted: #e7e5d4;
  --shadow: 0 8px 22px rgb(74 71 47 / 9%);
}
:root[saved-theme="dark"] {
  color-scheme: dark;
  --ink: #f3f0dd;
  --muted: #c8cfba;
  --canvas: #202a25;
  --paper: #2e3a30;
  --subtle: #39463a;
  --line: #5d6c58;
  --accent: #e18b66;
  --accent-ink: #ffc3a2;
  --accent-soft: #66493d;
  --focus: #ffe0a8;
  --blue: #afced0;
  --pink: #ffc3a2;
  --amber: #e6c57f;
  --green: #b6d1a6;
  --plum: #f0a77d;
  --plum-dark: #e3efce;
  --lilac: #4d5c40;
  --peach: #624a37;
  --mint: #405b48;
  --butter: #5b5233;
  --hero: linear-gradient(135deg, #374638 0%, #3d5141 58%, #354d50 100%);
  --header: rgb(32 42 37 / 95%);
  --shadow: 0 10px 24px rgb(0 0 0 / 23%);
  --on-light: #f3f0dd;
  --on-light-muted: #c8cfba;
  --on-dark: #fffdf5;
  --on-dark-muted: #e7e5d4;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--canvas) url("/static/cel-study-desktop-light-v6.webp") center / cover fixed;
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}
:root[saved-theme="dark"] body {
  background-color: var(--canvas);
  background-image: url("/static/cel-study-desktop-dark-v6.webp");
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
}
@media (min-width: 600px) and (max-width: 1023px) {
  body {
    background-image: url("/static/cel-study-tablet-light-v6.webp");
  }
  :root[saved-theme="dark"] body {
    background-image: url("/static/cel-study-tablet-dark-v6.webp");
  }
}
@media (max-width: 599px) {
  body {
    background-image: url("/static/cel-study-mobile-light-v6.webp");
    background-position: center;
  }
  :root[saved-theme="dark"] body {
    background-image: url("/static/cel-study-mobile-dark-v6.webp");
    background-position: center;
  }
}
.skip-link {
  position: fixed;
  z-index: 1000;
  top: max(0.5rem, env(safe-area-inset-top));
  left: max(0.5rem, env(safe-area-inset-left));
  padding: 0.65rem 1rem;
  border: 2px solid var(--focus);
  color: var(--ink);
  background: var(--paper);
  transform: translateY(-200%);
}
.skip-link:focus-visible {
  transform: none;
}
button,
input {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
a {
  color: inherit;
}
.topbar {
  position: sticky;
  z-index: 200;
  top: 0;
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 1rem;
  height: 72px;
  min-height: 72px;
  padding: 0 clamp(1rem, 2.4vw, 1.75rem);
  border: 1px solid var(--line);
  border-radius: 0 0 1.5rem 1.5rem;
  background: color-mix(in srgb, var(--header) 82%, transparent);
  box-shadow: 0 5px 16px rgb(70 79 50 / 8%);
  backdrop-filter: blur(12px) saturate(1.05);
}
.brand {
  display: inline-flex;
  gap: 0.6rem;
  align-items: center;
  width: max-content;
  min-height: 44px;
  font-family: "Jua", "Noto Sans KR", sans-serif;
  font-weight: 400;
  text-decoration: none;
}
.brand-mark {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.topbar-search {
  display: none;
  width: 100%;
  max-width: none;
}
.topbar-search > .search > .search-button {
  width: 100%;
}
.site-nav {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  width: max-content;
  max-width: 100%;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.site-nav a:hover,
.site-nav a.active {
  color: var(--plum-dark);
  background: var(--lilac);
}
.site-nav a.active {
  box-shadow: inset 0 -2px 0 var(--green);
}
.topbar .site-nav {
  padding: 0;
  border: 0;
  background: transparent;
}
.mobile-bottom-nav {
  display: none;
}
html {
  scrollbar-width: none;
}
html::-webkit-scrollbar {
  display: none;
}
.topbar-meta {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  justify-self: end;
}
.privacy-label {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
}
.privacy-label i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}
.workspace {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(1.4rem, 3vw, 2.5rem) 0 max(3rem, env(safe-area-inset-bottom));
}
.theme-settings {
  position: relative;
}
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 500;
}
.theme-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.theme-switch {
  position: relative;
  overflow: hidden;
  width: 2.65rem;
  height: 1.5rem;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--accent-soft);
  transition:
    background 180ms ease,
    border-color 180ms ease;
}
.theme-icon {
  position: absolute;
  top: 0.22rem;
  left: 0.24rem;
  width: 0.92rem;
  height: 0.92rem;
  z-index: 1;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  color: var(--ink);
  opacity: 0;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}
.theme-icon-light {
  opacity: 1;
}
.theme-switch::after {
  position: absolute;
  top: 0.16rem;
  left: 0.16rem;
  width: 1.08rem;
  height: 1.08rem;
  z-index: 0;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 1px 3px rgb(60 51 67 / 18%);
  content: "";
  transition:
    transform 180ms ease,
    background 180ms ease;
}
.theme-toggle input:checked + .theme-switch {
  background: var(--accent);
  border-color: var(--accent);
}
.theme-toggle input:checked + .theme-switch::after {
  transform: translateX(1.15rem);
  background: var(--canvas);
}
.theme-toggle input:checked + .theme-switch .theme-icon-light {
  opacity: 0;
  transform: translateX(1.15rem);
}
.theme-toggle input:checked + .theme-switch .theme-icon-dark {
  opacity: 1;
  transform: translateX(1.15rem);
}
.theme-toggle input:focus-visible + .theme-switch {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
.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;
}
:is(a, button, input, summary):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
.pwa-update-notice {
  position: fixed;
  z-index: 220;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1.5rem, env(safe-area-inset-bottom));
  left: max(1rem, env(safe-area-inset-left));
  width: min(31rem, calc(100% - 2rem));
  margin-left: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.pwa-update-notice strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
}
.pwa-update-notice p {
  margin: 0.35rem 0 0.8rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.pwa-update-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
.pwa-update-actions button {
  min-height: 44px;
  padding: 0.5rem 0.8rem;
  border-radius: 0.7rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
}
.pwa-update-dismiss {
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--paper);
}
.pwa-update-apply {
  border: 1px solid var(--accent);
  color: var(--on-dark);
  background: var(--accent);
}
@media (min-width: 600px) and (max-width: 900px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    padding-inline: max(1rem, 3vw);
  }
}
@media (max-width: 599px) {
  .topbar {
    top: 0;
    width: 100%;
    margin-top: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    height: 44px;
    min-height: 44px;
    padding: 0.45rem 20px;
    overflow-x: clip;
  }
  .brand {
    min-width: 0;
    width: 100%;
    overflow: hidden;
  }
  .brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar .site-nav {
    display: none;
  }
  .theme-settings {
    display: block;
  }
  .privacy-label {
    display: none;
  }
  body {
    padding-bottom: calc(6rem + env(safe-area-inset-bottom));
  }
  /* 하단 탭으로 주요 이동을 제공하므로, 모바일에는 중복된 사이트 푸터를 두지 않는다. */
  .page > #quartz-body > footer {
    display: none;
  }
  .page > #quartz-body {
    row-gap: 0;
  }
  .center > hr,
  .center > .page-footer {
    display: none;
  }
  .page {
    padding-bottom: 0;
  }
  .mobile-bottom-nav {
    position: fixed;
    z-index: 210;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 0.5rem;
    border: 1px solid var(--line);
    border-radius: 1.5rem 1.5rem 0 0;
    background: color-mix(in srgb, var(--header) 78%, transparent);
    box-shadow: 0 -8px 24px rgb(87 65 83 / 10%);
    backdrop-filter: blur(12px) saturate(1.05);
  }
  .mobile-bottom-nav a {
    display: grid;
    min-width: 0;
    min-height: 60px;
    place-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.2rem;
    border-radius: 18px;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 500;
    line-height: 1.1;
    text-decoration: none;
  }
  .mobile-bottom-nav a.active {
    color: var(--plum-dark);
    background: var(--accent-soft);
    box-shadow: inset 0 -2px 0 var(--green);
  }
  .mobile-bottom-nav svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
  }
  .pwa-update-notice {
    right: max(0.75rem, env(safe-area-inset-right));
    bottom: calc(5.55rem + env(safe-area-inset-bottom));
    left: max(0.75rem, env(safe-area-inset-left));
    width: auto;
  }
}

/* The portfolio record keeps its reading surface independent from the study-room scene. */
body[data-slug="knowledge/projects/ai-service-developer-portfolio"] .page-header,
body[data-slug="knowledge/projects/ai-service-developer-portfolio"] .center > article {
  position: relative;
  z-index: 0;
  isolation: isolate;
  padding-inline: clamp(1rem, 3vw, 1.75rem);
  border: 0;
  background: transparent;
  box-shadow: none;
}
body[data-slug="knowledge/projects/ai-service-developer-portfolio"] .page-header::before,
body[data-slug="knowledge/projects/ai-service-developer-portfolio"] .center > article::before {
  position: absolute;
  z-index: -1;
  inset: -0.65rem -0.8rem;
  border-radius: 1.6rem;
  background: color-mix(in srgb, var(--paper) 70%, transparent);
  filter: blur(15px);
  content: "";
}
body[data-slug="knowledge/projects/ai-service-developer-portfolio"] .page-header {
  padding-block: clamp(1rem, 2.5vw, 1.5rem);
  border-radius: 1.25rem 1.25rem 0 0;
}
body[data-slug="knowledge/projects/ai-service-developer-portfolio"] .center > article {
  padding-block: 0.4rem clamp(1.5rem, 4vw, 2.5rem);
  border-top: 0;
  border-radius: 0 0 1.25rem 1.25rem;
}
body[data-slug="knowledge/projects/ai-service-developer-portfolio"] .center > article > h2 {
  margin-top: clamp(2rem, 5vw, 3rem);
  color: var(--ink);
  font-family: "Jua", "Noto Sans KR", sans-serif;
  font-weight: 400;
  line-height: 1.3;
}
body[data-slug="knowledge/projects/ai-service-developer-portfolio"]
  .center
  > article
  > h2:first-of-type
  + ul {
  display: grid;
  gap: 0.85rem;
  margin: 1rem 0 0;
  padding: clamp(1rem, 3vw, 1.35rem);
  border: 0;
  border-radius: 1rem;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--subtle) 60%, transparent),
    color-mix(in srgb, var(--subtle) 18%, transparent) 72%,
    transparent
  );
}
body[data-slug="knowledge/projects/ai-service-developer-portfolio"]
  .center
  > article
  > h2:first-of-type
  + ul
  li {
  padding-left: 0;
  color: var(--ink);
  line-height: 1.75;
  list-style: none;
}
body[data-slug="knowledge/projects/ai-service-developer-portfolio"]
  .center
  > article
  > h2:first-of-type
  + ul
  li::before {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin: 0 0.55rem 0.08rem 0;
  border-radius: 50%;
  background: var(--green);
  content: "";
}
:root[saved-theme="dark"]
  body[data-slug="knowledge/projects/ai-service-developer-portfolio"]
  .page-header::before,
:root[saved-theme="dark"]
  body[data-slug="knowledge/projects/ai-service-developer-portfolio"]
  .center
  > article::before {
  background: rgb(28 42 33 / 68%);
}
@media (max-width: 599px) {
  body[data-slug="knowledge/projects/ai-service-developer-portfolio"]
    .page
    > #quartz-body
    > footer {
    display: none;
  }
  body[data-slug="knowledge/projects/ai-service-developer-portfolio"] {
    padding-bottom: calc(6rem + env(safe-area-inset-bottom));
  }
  body[data-slug="knowledge/projects/ai-service-developer-portfolio"] .breadcrumb-container {
    display: none;
  }
  body[data-slug="knowledge/projects/ai-service-developer-portfolio"] .center > article {
    padding-inline: 1rem;
  }
  body[data-slug="knowledge/projects/ai-service-developer-portfolio"] .page-header {
    padding-inline: 1rem !important;
  }
  body[data-slug="knowledge/projects/ai-service-developer-portfolio"] .page-header .popover-hint {
    position: relative;
    min-height: 44px;
    padding-bottom: 0.15rem;
  }
  body[data-slug="knowledge/projects/ai-service-developer-portfolio"] .article-title {
    margin: 0;
    font-size: clamp(1.7rem, 7vw, 2rem);
    text-wrap: balance;
    word-break: keep-all;
  }
  body[data-slug="knowledge/projects/ai-service-developer-portfolio"] .content-meta {
    margin: 0.35rem 0 0;
    padding-right: 3.25rem;
  }
  body[data-slug="knowledge/projects/ai-service-developer-portfolio"] .readermode.mobile-only {
    display: flex;
    position: absolute;
    right: 0;
    bottom: 0;
    margin: 0;
  }
}
@media (max-width: 599px) {
  .topbar {
    height: calc(44px + max(0.3rem, env(safe-area-inset-top)) + 0.3rem);
    min-height: calc(44px + max(0.3rem, env(safe-area-inset-top)) + 0.3rem);
    padding: max(0.3rem, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 0.3rem
      max(14px, env(safe-area-inset-left));
  }
  .brand {
    min-width: 0;
  }
  .brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .workspace {
    width: calc(100% - 28px);
  }
}
