:root {
  --bg: #faf9f6;
  --fg: #17160f;
  --muted: #7a7869;
  --line: #e6e3d8;
  --accent: #17160f;
  --serif: "Newsreader", "Noto Serif KR", "Nanum Myeongjo", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Malgun Gothic", "Apple SD Gothic Neo",
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --nav-h: 64px;
  --pad: clamp(20px, 5vw, 56px);
}

* {
  box-sizing: border-box;
}

html,
body {
  padding: 0;
  margin: 0;
}

html.no-scroll,
html.no-scroll body {
  overflow: hidden;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
}

.main {
  padding-top: var(--nav-h);
  min-height: 60vh;
}

/* ---------------------------------------------------------------- Nav */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  padding: 0 var(--pad);
  padding-top: env(safe-area-inset-top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(250, 249, 246, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  z-index: 50;
}

.nav-logo {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.14em;
  font-weight: 500;
  white-space: nowrap;
}

.nav-links {
  display: none;
  gap: 28px;
}

.nav-link {
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--muted);
  position: relative;
  padding: 4px 0;
}

.nav-link.is-active {
  color: var(--fg);
}

.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--fg);
}

.nav-burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
}

.nav-burger span {
  display: block;
  height: 1px;
  background: var(--fg);
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-burger.is-open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-burger.is-open span:nth-child(2) {
  opacity: 0;
}
.nav-burger.is-open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.nav-overlay {
  position: fixed;
  inset: 0;
  top: var(--nav-h);
  background: var(--bg);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 22px;
  padding: 0 var(--pad);
  padding-bottom: env(safe-area-inset-bottom);
  animation: fade-in 0.2s ease;
}

.nav-overlay-link {
  font-family: var(--serif);
  font-size: 34px;
}

.nav-overlay-sub {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--muted);
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
  .nav-burger {
    display: none;
  }
}

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

.hero {
  position: relative;
  height: 100svh;
  height: 100vh;
  min-height: 480px;
  overflow: hidden;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.55) 100%);
}

.hero-copy {
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  bottom: 56px;
  color: #fff;
}

.hero-name {
  font-size: clamp(32px, 6vw, 56px);
  color: #fff;
}

.hero-tagline {
  margin-top: 10px;
  font-size: clamp(13px, 1.6vw, 16px);
  color: rgba(255, 255, 255, 0.85);
  max-width: 480px;
}

.hero-scroll {
  position: absolute;
  right: var(--pad);
  top: 24px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
}

/* ------------------------------------------------------------ Section */

.section {
  max-width: 1240px;
  margin: 0 auto;
  padding: 72px var(--pad);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.section-head h2 {
  font-size: 26px;
}

.section-link {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.section-link:hover {
  color: var(--fg);
}

/* ------------------------------------------------------------- Cards */

.work-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
}

@media (min-width: 700px) {
  .work-grid {
    grid-template-columns: 1fr 1fr;
    gap: 44px 32px;
  }
}

.work-card {
  display: block;
}

.work-card-img {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #efeee8;
}

.work-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.work-card:hover .work-card-img img {
  transform: scale(1.035);
}

.work-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 14px;
}

.work-card-meta h3 {
  font-size: 19px;
}

.work-card-meta span {
  font-size: 13px;
  color: var(--muted);
}

.work-grid-full {
  margin-top: 8px;
}

/* --------------------------------------------------------- Daily strip */

.daily-preview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 700px) {
  .daily-preview {
    grid-template-columns: repeat(4, 1fr);
  }
}

.daily-preview-item {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #efeee8;
}

.daily-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ------------------------------------------------------------- Pages */

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 48px var(--pad) 96px;
}

.page-narrow {
  max-width: 720px;
}

.page-center {
  text-align: center;
  padding-top: 120px;
}

.page-head {
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.page-head h1 {
  font-size: clamp(30px, 5vw, 44px);
}

.page-head p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
}

/* --------------------------------------------------------- Project */

.project-head {
  max-width: 1240px;
  margin: 0 auto;
  padding: 48px var(--pad) 24px;
}

.project-back {
  font-size: 13px;
  color: var(--muted);
}

.project-head h1 {
  margin-top: 18px;
  font-size: clamp(30px, 5vw, 52px);
}

.project-title-ko {
  margin-top: 6px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 17px;
}

.project-meta {
  margin-top: 10px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}

.project-hero {
  width: 100%;
  max-height: 82vh;
  overflow: hidden;
  background: #efeee8;
}

.project-hero img {
  width: 100%;
  height: 100%;
  max-height: 82vh;
  object-fit: cover;
}

.project-text {
  max-width: 1240px;
  margin: 0 auto;
  padding: 56px var(--pad);
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 820px) {
  .project-text {
    grid-template-columns: 1fr 1fr;
    gap: 64px;
  }
}

.project-text-col p {
  margin: 0 0 18px;
  font-size: 15.5px;
  color: #2c2b25;
}

.project-text-col-ko p {
  font-size: 15px;
  color: var(--muted);
}

.project-gallery {
  max-width: 1240px;
  margin: 0 auto;
  padding: 48px var(--pad) 96px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

@media (min-width: 700px) {
  .project-gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
}

.project-gallery-item {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #efeee8;
  cursor: pointer;
}

.project-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.project-gallery-item:hover img {
  transform: scale(1.04);
}

/* ----------------------------------------------------------------- Tabs */

.tabs {
  display: flex;
  gap: 22px;
  margin-bottom: 28px;
}

.tab {
  font-size: 14px;
  color: var(--muted);
  padding-bottom: 8px;
  border-bottom: 2px solid transparent;
}

.tab.is-active {
  color: var(--fg);
  border-bottom-color: var(--fg);
}

/* -------------------------------------------------------------- Masonry */

.masonry {
  column-count: 1;
  column-gap: 10px;
}

@media (min-width: 560px) {
  .masonry {
    column-count: 2;
  }
}

@media (min-width: 900px) {
  .masonry {
    column-count: 3;
  }
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 10px;
  overflow: hidden;
  background: #efeee8;
  cursor: pointer;
}

.masonry-item img {
  width: 100%;
  height: auto;
  transition: transform 0.4s ease;
}

.masonry-item:hover img {
  transform: scale(1.03);
}

/* -------------------------------------------------------------- Journal */

.journal-list {
  display: flex;
  flex-direction: column;
}

.journal-item {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.journal-item:first-child {
  padding-top: 0;
}

.journal-date {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.journal-item h2 {
  margin-top: 8px;
  font-size: 24px;
}

.journal-item p {
  margin-top: 10px;
  color: #2c2b25;
}

/* ----------------------------------------------------------------- About */

.about-body p {
  font-size: 16px;
  margin: 0 0 20px;
}

.about-contact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  font-size: 15px;
}

.about-contact a:hover {
  text-decoration: underline;
}

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

.footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px var(--pad) 56px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a:hover {
  color: var(--fg);
}

/* --------------------------------------------------------------- Image */

.img-frame {
  position: relative;
  overflow: hidden;
  background: #efeee8;
}

.img-el {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.img-el.is-loaded {
  opacity: 1;
}

/* ------------------------------------------------------------ Lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 8, 0.94);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.15s ease;
}

.lightbox-img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  right: 18px;
  color: #fff;
  font-size: 18px;
  width: 40px;
  height: 40px;
}

.lightbox-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 20%;
  color: rgba(255, 255, 255, 0.85);
  font-size: 40px;
  display: flex;
  align-items: center;
}

.lightbox-prev {
  left: 0;
  justify-content: flex-start;
  padding-left: 14px;
}

.lightbox-next {
  right: 0;
  justify-content: flex-end;
  padding-right: 14px;
}

.lightbox-count {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  letter-spacing: 0.06em;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
