/* Kiki Yen Portfolio — rebuilt from the Adobe Portfolio theme (values measured from the live site) */

:root {
  --ink: #1c1c1c;          /* headings, nav, titles */
  --ink-hover: #6a6a6a;    /* nav / logo hover */
  --muted: #757575;        /* body copy, dates, footer */
  --line: #dddddd;         /* form borders */
  --bg: #ffffff;
  --placeholder: rgba(0, 0, 0, 0.03);
  --font: Arial, "Helvetica Neue", Helvetica, sans-serif;

  --gutter: 3%;            /* site side margin */
  --header-h: 120px;
  --cover-gap: 15px;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* ---------- header ---------- */
.site-header {
  position: relative; z-index: 3;
  display: grid; grid-template-columns: 1fr 30% 1fr; align-items: center;
  height: var(--header-h); padding: 0 var(--gutter);
}
.nav a, .mobile-nav a {
  font-size: 16px; line-height: 24px; text-transform: uppercase; color: var(--ink);
  transition: color .2s ease;
}
.nav a + a { margin-left: 20px; }
.nav a:hover { color: var(--ink-hover); }
.nav a.active, .mobile-nav a.active { font-weight: 700; color: var(--ink); }
.logo { justify-self: center; }
.logo img { max-height: var(--header-h); width: auto; height: auto; }
.hamburger { display: none; justify-self: end; width: 24px; padding: 30px 0; }
.hamburger i { display: block; height: 2px; margin-bottom: 4px; background: #282828; }
.hamburger i:last-child { margin-bottom: 0; }

.mobile-nav {
  position: fixed; inset: 0; z-index: 10; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.mobile-nav[hidden] { display: none; }
.mobile-nav nav a { display: block; text-align: center; font-size: 22px; line-height: 32px; padding-bottom: 30px; }
.mobile-nav__close { position: fixed; top: 40px; right: 5%; width: 20px; height: 20px; }
.mobile-nav__close::before, .mobile-nav__close::after, .lightbox__close::before, .lightbox__close::after {
  content: ""; position: absolute; left: 50%; top: 0; width: 2px; height: 20px; background: #282828;
}
.mobile-nav__close::before, .lightbox__close::before { transform: rotate(45deg); }
.mobile-nav__close::after, .lightbox__close::after { transform: rotate(-45deg); }

.site-content { margin: 0 var(--gutter); }

/* ---------- work: masthead ---------- */
.masthead { max-width: 700px; margin: 0 auto; padding: 55px 0 105px; text-align: center; } /* 75px + the original's empty 30px buttons row */
.masthead h1 { margin: 0 0 20px; font-size: 22px; line-height: 42px; font-weight: 600; color: var(--ink); }
.masthead p { margin: 0; font-size: 12px; line-height: 24px; color: var(--muted); white-space: pre-line; }

/* ---------- work: covers ---------- */
.covers { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: var(--cover-gap); }
.cover { position: relative; display: block; margin-bottom: var(--cover-gap); aspect-ratio: 3 / 4; overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; background: var(--placeholder); }
.cover::after {
  content: ""; position: absolute; inset: 0; background: #fff; opacity: 0;
  transition: opacity .2s ease;
}
.cover__details {
  position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; justify-content: center;
  padding: 8%; text-align: center; opacity: 0; transition: opacity .15s ease;
}
.cover:hover::after, .cover:focus-visible::after { opacity: .97; }
.cover:hover .cover__details, .cover:focus-visible .cover__details { opacity: 1; }
.cover__title { font-size: 17px; line-height: 22px; font-weight: 600; text-transform: uppercase; color: var(--ink); }
.cover__date { padding-top: 12px; font-size: 14px; line-height: 18px; color: var(--muted); }

/* ---------- project pages ---------- */
.page { max-width: 1400px; margin: 0 auto; }
.page-header { max-width: 750px; margin: 0 auto; padding: 40px 0 70px; text-align: center; }
.page-header h1 { margin: 0; padding-bottom: 25px; font-size: 24px; line-height: 30px; font-weight: 700; text-transform: uppercase; color: var(--ink); }
.page-header__description { margin: 0; padding-bottom: 20px; font-size: 18px; line-height: 24px; color: var(--muted); }

.module { margin: 0; padding-bottom: 20px; }
.module--image img { width: 100%; height: auto; background: var(--placeholder); cursor: zoom-in; }
.module--image figcaption { padding-top: 10px; font-size: 14px; color: var(--muted); text-align: center; }

.module--text { max-width: 800px; margin: 0 auto; padding: 20px 0 40px; font-size: 18px; line-height: 24px; color: var(--ink); }
.module--text > div, .module--text p { margin: 0; padding: 10px 0; }
.module--text.align-left { text-align: left; }
.module--text.align-center { text-align: center; }
.module--text.align-right { text-align: right; }

.video { margin: 0 auto; }
.video__ratio { position: relative; height: 0; }
.video__ratio iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* justified photo grid: each item's width & flex-grow = aspect ratio × row height */
.grid { display: flex; flex-wrap: wrap; margin: 0 -4px; }
.grid__item { position: relative; padding: 4px; }
.grid__item i { display: block; }
.grid__item img { position: absolute; inset: 4px; object-fit: cover; cursor: zoom-in; background: var(--placeholder); }

/* contact form */
.module--form { max-width: 600px; margin: 1px auto 60px; padding: 0; }
.field { display: block; }
.field span { display: block; margin-bottom: 10px; font-size: 14px; line-height: 14px; font-weight: 700; color: var(--ink); }
.field input, .field textarea {
  display: block; width: 100%; margin: 0 0 30px; padding: 0 10px;
  font: 15px/42px var(--font); color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 3px; outline: none;
}
.field input { height: 42px; }
.field textarea { height: 132px; padding: 13px 10px; line-height: normal; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--ink-hover); }
.contact-form button {
  height: 40px; padding: 0 25px; border-radius: 20px;
  font-size: 14px; line-height: 40px; font-weight: 700; color: #fff; background: var(--ink);
  transition: opacity .2s ease;
}
.contact-form button:hover { opacity: .85; }
.visually-hidden { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-form__sent { font-size: 18px; text-align: center; color: var(--ink); }

/* ---------- footer, back to top, lightbox ---------- */
.site-footer { padding: 50px 0 100px; font-size: 16px; line-height: 20px; text-align: center; color: var(--muted); }

.back-to-top {
  position: fixed; right: 40px; bottom: 40px; z-index: 3; width: 60px; height: 60px; border-radius: 60px;
  background: rgba(0, 0, 0, .1); opacity: 0; pointer-events: none; transition: opacity .2s ease, background .2s ease;
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { background: rgba(0, 0, 0, .2); }
.back-to-top svg { position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; transform: translate(-50%, -50%); fill: #000; opacity: .3; }
.back-to-top:hover svg { opacity: .5; }

.lightbox { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 60px 40px; background: rgba(255, 255, 255, .97); cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox__close { position: fixed; top: 30px; right: 30px; width: 20px; height: 20px; }

/* ---------- tablet (≤932px) ---------- */
@media (max-width: 932px) {
  .site-header { grid-template-columns: 1fr auto; padding: 0 5%; height: 120px; }
  .nav { display: none; }
  .logo { justify-self: start; }
  .logo img { max-height: 60px; }
  .hamburger { display: block; }
  .site-content { margin: 0; }
  .masthead { padding: 25px 5% 33px; }
  .masthead h1 { font-size: 14px; line-height: 27px; margin-bottom: 14px; }
  .covers { grid-template-columns: repeat(2, 1fr); }
  .cover { margin-bottom: 11px; }
  .cover__title { font-size: 14px; line-height: 18px; }
  .cover__date { padding-top: 10px; line-height: 20px; }
  .page-header { padding-left: 5%; padding-right: 5%; }
  .module--text { padding-left: 5%; padding-right: 5%; }
  .module--form { padding: 0 5%; }
  .site-footer { padding: 24px 5% 40px; font-size: 14px; }
  .back-to-top { display: none; }
}

/* ---------- phone (≤540px) ---------- */
@media (max-width: 540px) {
  .masthead { padding: 22px 16px 29px; }
  .masthead h1 { line-height: 20px; margin-bottom: 13px; }
  .covers { grid-template-columns: 1fr; }
  .cover { margin-bottom: 10px; }
  .cover__title { line-height: 20px; }
  .site-footer { padding: 21px 16px 34px; }
}
