/* =========================================================
   Jasmine S.C. Chou — Portfolio
   Minimal · black & white · a bit hand-made
   Shared styles for index + project pages
   ========================================================= */

:root {
  --bg:        #f6f3ec;   /* warm ivory                  */
  --ink:       #16150f;   /* warm near-black text        */
  --ink-soft:  #635e52;   /* secondary / intro text      */
  --ink-faint: #beb9ab;   /* light serif list + captions */
  --frame:     #e7e2d5;   /* warm paper placeholder fill */
  --line:      #ddd6c8;   /* hairlines                   */
  --mark:      #2a2619;   /* corner registration marks   */

  --sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  --serif: "Newsreader", "Times New Roman", Georgia, serif;
  --mono: "Space Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --pad: clamp(1.25rem, 3vw, 2.75rem);
}

/* ---------- reset-ish ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  /* faint hand-made paper grain across the whole page */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ol, ul { margin: 0; }
img { display: block; max-width: 100%; }

/* =========================================================
   INDEX / LANDING
   ========================================================= */
.page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(250px, 30%) 1fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  padding: var(--pad);
}

/* ----- sidebar ----- */
.sidebar { display: flex; flex-direction: column; }

.name {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1.6rem;
}

.intro p {
  color: var(--ink-soft);
  max-width: 34ch;
  margin-bottom: 1rem;
}

.links {
  margin: 1.6rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.links a { width: fit-content; }
.links a:hover { opacity: 0.55; }
.arrow { font-size: 0.85em; }

.rw-label {
  font-weight: 600;
  margin-top: 0.4rem;
  margin-bottom: 0.6rem;
}

.rw-list {
  list-style: none;
  counter-reset: rw;
  padding: 0;
}
.rw-list li {
  counter-increment: rw;
  font-family: var(--serif);
  font-size: clamp(1.1rem, 1.5vw, 1.4rem);
  line-height: 1.55;
  color: var(--ink-faint);
  transition: color 0.2s ease;
}
.rw-list li::before {
  content: counter(rw) " .";
  display: inline-block;
  width: 2.1em;
  color: inherit;
}
.rw-list a { display: inline; }
.rw-list li:hover,
.rw-list li.active { color: var(--ink); }

.footer {
  margin-top: auto;
  padding-top: 2.5rem;
  color: var(--ink-faint);
  font-size: 0.85rem;
}

/* ----- feature (right) ----- */
.feature { display: flex; flex-direction: column; }

.image-frame {
  position: relative;
  flex: 1;
  min-height: 58vh;
  /* grainy halftone over warm paper — shows behind placeholders,
     a real <img> sits on top and stays clean */
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='0.08'/%3E%3C/svg%3E") repeat,
    var(--frame);
  overflow: hidden;
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* hand-drawn corner brackets — the hand-made detail
   (a slightly wobbly ink stroke, rotated into each corner) */
.mark {
  position: absolute;
  width: 26px;
  height: 26px;
  background: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%231a1a1a'%20stroke-width='1.3'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M3.4%2013%20C3%209%203%205.4%203.6%203.4%20C5.6%203%209.2%203%2013%203.3'/%3E%3C/svg%3E") center / contain no-repeat;
  pointer-events: none;
}
.mark.tl { top: 26px;    left: 26px;  transform: rotate(0deg);   }
.mark.tr { top: 26px;    right: 26px; transform: rotate(90deg);  }
.mark.br { bottom: 26px; right: 26px; transform: rotate(180deg); }
.mark.bl { bottom: 26px; left: 26px;  transform: rotate(270deg); }

.placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #cfcecb;
}
.placeholder svg { width: 54px; height: 54px; }

/* caption under the feature image */
.caption {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1.4rem;
}
.caption-title {
  font-size: clamp(1.1rem, 1.5vw, 1.35rem);
  font-weight: 700;
}
.caption-meta dl {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: -0.01em;
  display: grid;
  gap: 0.2rem;
}
.caption-meta .row {
  display: grid;
  grid-template-columns: 5.4em 1fr;
  gap: 0.5rem;
}
.caption-meta .k {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  font-weight: 400;
}
.caption-desc {
  font-family: var(--serif);
  color: var(--ink-faint);
  margin-top: 1rem;
  max-width: 46ch;
}
.view {
  display: inline-block;
  margin-top: 1.1rem;
  font-weight: 500;
}
.view:hover { opacity: 0.55; }

/* =========================================================
   PROJECT PAGES
   ========================================================= */
.proj-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--pad);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.proj-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding-bottom: 2.5rem;
}
.back { font-weight: 600; }
.back:hover { opacity: 0.55; }

.proj-index {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-family: var(--serif);
  color: var(--ink-faint);
}
.proj-index a:hover { color: var(--ink); }
.proj-index .current { color: var(--ink); }

.proj-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
  padding-bottom: 2rem;
}
.proj-title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.02;
  max-width: 16ch;
}
.proj-meta .row {
  display: grid;
  grid-template-columns: 5.8em 1fr;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}
.proj-meta .k {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  font-weight: 400;
}
.proj-meta .desc {
  font-family: var(--serif);
  color: var(--ink-soft);
  margin-top: 1.2rem;
  max-width: 46ch;
}

.proj-hero {
  min-height: 62vh;
  margin-bottom: 2.5rem;
}

.proj-body {
  max-width: 68ch;
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}
.proj-body p {
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--ink);
  margin-bottom: 1.4rem;
}
.proj-body h2 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin: 2.5rem 0 1rem;
}

.proj-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin: 2rem 0 3rem;
}
.proj-gallery .image-frame { min-height: 40vh; }

.proj-footer {
  margin-top: auto;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  color: var(--ink-faint);
  font-size: 0.85rem;
}
.proj-footer a:hover { color: var(--ink); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 820px) {
  .page { grid-template-columns: 1fr; }
  .image-frame { min-height: 52vh; }
  .caption,
  .proj-top { grid-template-columns: 1fr; }
  .proj-gallery { grid-template-columns: 1fr; }
  .footer { padding-top: 2rem; }
  .mark { width: 22px; height: 22px; }
  .mark.tl, .mark.tr { top: 18px; }
  .mark.bl, .mark.br { bottom: 18px; }
  .mark.tl, .mark.bl { left: 18px; }
  .mark.tr, .mark.br { right: 18px; }
}
