*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --ink: #1c1917;
  --muted: #9c958c;
  --line: #e0dbd2;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Libre Baskerville', serif;
  font-weight: 300;
  letter-spacing: -0.1em;
}

/* ── HEADER ── */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.2rem;
  height: 28px;
  font-family: Helvetica, Arial, sans-serif;
}

.logo {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}

nav {
  display: contents;
}

nav a {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.15s;
}

nav a:hover { color: var(--muted); }
nav a.active { color: var(--ink); border-bottom: 1.5px solid var(--ink); padding-bottom: 2px; }
.logo.active { border-bottom: 1.5px solid var(--ink); padding-bottom: 2px; }

/* ── SUBHEADER (secondary bar under main header) ── */
.subheader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.2rem;
  height: 28px;
  font-family: Helvetica, Arial, sans-serif;
  background: var(--bg);
}

.subheader a {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.15s;
}
.subheader a:hover { color: var(--muted); }
.subheader a.active { color: var(--ink); border-bottom: 1.5px solid var(--ink); padding-bottom: 2px; }

.sublabel {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.subsearch-input {
  flex: 1;
  margin-left: 2.5rem;
  border: none;
  background: transparent;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
  outline: none;
  height: 28px;
}
.subsearch-input::placeholder { color: var(--muted); font-weight: 700; }

/* ── WORKS GRID (home) ── */
.works-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 40px;
  padding: 40px;
}

.work-cell {
  position: relative;
  background: #ece8e0;
  overflow: hidden;
  cursor: pointer;
}

.work-cell::before { content: ''; display: block; padding-top: 100%; }

.work-cell svg,
.work-cell img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.work-cell:hover svg,
.work-cell:hover img { transform: scale(1.04); }

.work-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 0.55rem 0.7rem;
  background: linear-gradient(transparent, rgba(247,245,241,0.94) 60%);
  opacity: 0;
  transition: opacity 0.22s;
  pointer-events: none;
}
.work-cell:hover .work-info { opacity: 1; }

.wtitle {
  font-family: 'Libre Baskerville', serif;
  font-size: 0.75rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wyear {
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.work-cell { animation: fadeIn 0.35s ease both; }
.work-cell:nth-child(1)  { animation-delay: .02s }
.work-cell:nth-child(2)  { animation-delay: .04s }
.work-cell:nth-child(3)  { animation-delay: .06s }
.work-cell:nth-child(4)  { animation-delay: .08s }
.work-cell:nth-child(5)  { animation-delay: .10s }
.work-cell:nth-child(6)  { animation-delay: .12s }
.work-cell:nth-child(7)  { animation-delay: .14s }
.work-cell:nth-child(8)  { animation-delay: .16s }
.work-cell:nth-child(9)  { animation-delay: .18s }
.work-cell:nth-child(10) { animation-delay: .20s }
.work-cell:nth-child(11) { animation-delay: .22s }
.work-cell:nth-child(12) { animation-delay: .24s }
.work-cell:nth-child(13) { animation-delay: .26s }
.work-cell:nth-child(14) { animation-delay: .28s }
.work-cell:nth-child(15) { animation-delay: .30s }
.work-cell:nth-child(16) { animation-delay: .32s }
.work-cell:nth-child(17) { animation-delay: .34s }
.work-cell:nth-child(18) { animation-delay: .36s }
.work-cell:nth-child(19) { animation-delay: .38s }
.work-cell:nth-child(20) { animation-delay: .40s }
.work-cell:nth-child(21) { animation-delay: .42s }

/* ── GENERIC SUBPAGE CONTENT WRAPPER ── */
.page-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 6rem;
  letter-spacing: 0;
}
.page-content.full-bleed {
  max-width: none;
  margin: 0;
  padding: 0 1.2rem 6rem;
}

.page-title {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2.2rem;
}

/* ── ABOUT ── */
.about-wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.about-photo {
  width: 170px;
  flex-shrink: 0;
  aspect-ratio: 3/4;
  background: #ece8e0;
  overflow: hidden;
}
.about-photo svg { width: 100%; height: 100%; display: block; }

.about-text {
  max-width: 380px;
  width: 100%;
  margin-top: 150px;
}

.about-text p {
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 0.85rem;
  line-height: 1.55;
  text-align: left;
  margin-bottom: 1.1rem;
  color: var(--ink);
}

.about-meta {
  margin-top: 2.5rem;
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}
.about-meta dt {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.about-meta dd {
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 0.85rem;
  line-height: 1.55;
  margin-bottom: 1rem;
  color: var(--ink);
}

.meta-row {
  display: flex;
  width: 100%;
  justify-content: space-between;
  gap: 1.8rem;
  margin-bottom: 0.5rem;
}
.meta-row .meta-year {
  font-weight: 700;
  flex-shrink: 0;
  min-width: 5.5rem;
  white-space: nowrap;
  text-align: left;
}
.meta-row span:last-child {
  text-align: right;
}

/* ── CATALOG / WORKS LIST ── */
.catalog-list { width: 100%; border-collapse: collapse; }
.catalog-list th {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 0 0.6rem 0.7rem 0;
  border-bottom: 1px solid var(--line);
}
.catalog-list td {
  font-size: 0.88rem;
  padding: 0.75rem 0.6rem 0.75rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  vertical-align: middle;
}
.catalog-list tr:hover td { background: #faf9f6; }
.catalog-num {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.68rem;
  color: var(--muted);
  width: 2.2rem;
}
.catalog-year {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: right;
  width: 4rem;
}
.catalog-medium {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.72rem;
  color: var(--muted);
}

/* ── SEARCH ── */
.search-input-wrap { margin-bottom: 2.5rem; }
.search-input {
  width: 100%;
  border: none;
  border-bottom: 1.5px solid var(--ink);
  background: transparent;
  font-family: 'Libre Baskerville', serif;
  font-size: 1.4rem;
  letter-spacing: -0.04em;
  color: var(--ink);
  padding: 0.5rem 0;
  outline: none;
}
.search-input::placeholder { color: var(--muted); }

.search-results { display: flex; flex-direction: column; }
.search-result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}
.search-result-row .rtitle {
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}
.search-result-row .rmeta {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  white-space: nowrap;
  padding-left: 1.5rem;
}
.search-empty {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.72rem;
  color: var(--muted);
  padding: 1rem 0;
}

/* ── CONTACT ── */
.contact-wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

/* ── INTERACTIVE ENVELOPE ── */
.envelope-stack { display: flex; flex-direction: column; gap: 5rem; flex-shrink: 0; margin-left: 0; }
.envelope-wrap { width: 200px; }
.envelope-card {
  position: relative;
  width: 100%;
  aspect-ratio: 640 / 458;
  cursor: pointer;
  perspective: 1300px;
}
.envelope-body,
.envelope-flap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-image: url('envelope.jpg');
  background-size: 100% 100%;
}
.envelope-body { z-index: 1; }
.envelope-flap {
  z-index: 3;
  clip-path: polygon(0% 0%, 100% 0%, 50% 56%);
  transform-origin: 50% 56%;
  transition: transform 0.7s cubic-bezier(0.45, 0, 0.2, 1);
  transform: rotateX(0deg);
  backface-visibility: hidden;
}
.envelope-card.open .envelope-flap {
  transform: rotateX(-165deg);
}
.envelope-letter {
  position: absolute;
  left: 7%;
  right: 7%;
  top: 60%;
  bottom: 5%;
  z-index: 2;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 0.9rem 1rem;
  opacity: 0;
  transform: translateY(0%);
  transition: opacity 0.4s ease 0.25s, transform 0.55s ease 0.25s;
  overflow: hidden;
}
.envelope-card.open .envelope-letter {
  opacity: 1;
  transform: translateY(-58%);
}
.envelope-info dt {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.15rem;
}
.envelope-info dd {
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 0.8rem;
  margin-bottom: 0.7rem;
  color: var(--ink);
}
.envelope-info dd a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.envelope-info dd a:hover { color: var(--muted); }
.envelope-hint {
  text-align: center;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 5px;
  transition: opacity 0.3s;
}
.envelope-wrap.open .envelope-hint { opacity: 0; }

.contact-right {
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
  width: 380px;
  flex-shrink: 0;
}
.contact-info dt {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.contact-info dd {
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 400;
  letter-spacing: 0;
  font-size: 0.95rem;
  margin-bottom: 1.6rem;
  color: var(--ink);
}
.contact-info a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.contact-info a:hover { color: var(--muted); }

.contact-form { display: flex; flex-direction: column; gap: 1.1rem; }
.contact-form label {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
  display: block;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  font-family: 'Libre Baskerville', serif;
  font-size: 0.9rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  padding: 0.4rem 0;
  outline: none;
  resize: none;
}
.contact-form input:focus,
.contact-form textarea:focus { border-bottom-color: var(--ink); }
.contact-submit {
  margin-top: 0.5rem;
  align-self: flex-start;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--ink);
  border: none;
  padding: 0.65rem 1.4rem;
  cursor: pointer;
  transition: opacity 0.15s;
}
.contact-submit:hover { opacity: 0.8; }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--line);
  padding: 1.2rem 2.5rem;
  display: flex;
  justify-content: space-between;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.01em;
  margin-top: 4px;
}
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--ink); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .works-grid { grid-template-columns: repeat(4, 1fr); }
  .about-wrap { flex-direction: column; gap: 2rem; }
  .about-text { margin-top: 0; max-width: 100%; }
  .contact-wrap { flex-direction: column; gap: 2.5rem; }
  .contact-right { width: 100%; }
  .envelope-wrap { width: 100%; max-width: 260px; }
}
@media (max-width: 600px) {
  .works-grid { grid-template-columns: repeat(3, 1fr); }
  header { padding: 0 0.4rem; }
  .logo, nav a { font-size: 0.56rem; }
  .page-content { padding: 3rem 1.2rem 4rem; }
}
