/* Helen Currie portfolio.
   Warm off-white paper, pastel cloud shapes, serif headings, white cards with straight corners.
   html[data-photos] = "edited" | "original" picks which photo set is visible when both are built. */

:root {
  color-scheme: light;
  --paper: #fbf8f3;
  --card: #ffffff;
  --ink: #2b2522;
  --muted: #7d746d;
  --rule: #eee7dd;
  --c1: #f6dfd8;          /* blush */
  --c2: #f9edd2;          /* butter */
  --c3: #e9e2f3;          /* lilac */
  --font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Inter, Arial, sans-serif;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --gutter: 16px;
  --frame: 12px;          /* Polaroid side margin */
  --frame-bottom: 18px;   /* Polaroid bottom margin before the caption */
}

/* ---- base --------------------------------------------------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--font); overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; margin: 0; letter-spacing: -0.01em; }

/* ---- clouds ------------------------------------------------------------- */
.cloud { position: absolute; width: 260px; height: auto; pointer-events: none; }
.cloud:nth-child(1) { fill: var(--c1); }
.cloud:nth-child(2) { fill: var(--c2); }
.cloud:nth-child(3) { fill: var(--c3); }
.cloud:nth-child(4) { fill: var(--c2); }

.backdrop { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; opacity: .55; }
.backdrop .cloud:nth-child(1) { width: 44vw; right: -14vw; top: 60rem; }
.backdrop .cloud:nth-child(2) { width: 38vw; left: -12vw; top: 110rem; }
.backdrop .cloud:nth-child(3) { width: 42vw; right: -10vw; top: 190rem; }

/* ---- masthead ----------------------------------------------------------- */
.masthead { position: relative; overflow: hidden; z-index: 1; padding: clamp(2rem, 4vw, 3rem) var(--gutter) clamp(1.2rem, 2.5vw, 1.8rem); text-align: center; }
.sky { position: absolute; inset: 0; pointer-events: none; }
.sky .cloud:nth-child(1) { width: clamp(220px, 34vw, 420px); left: -6%; top: 6%; }
.sky .cloud:nth-child(2) { width: clamp(160px, 26vw, 320px); right: -4%; top: 14%; }
.sky .cloud:nth-child(3) { width: clamp(200px, 30vw, 380px); left: -8%; bottom: -45%; }
.sky .cloud:nth-child(4) { width: clamp(120px, 16vw, 220px); right: 18%; bottom: 4%; }
.masthead-inner { position: relative; max-width: 44rem; margin: 0 auto; }
.masthead h1 { font-size: clamp(2.2rem, 4.5vw, 2.9rem); line-height: 1.05; }
.tagline { margin: .4rem 0 0; font-size: 1rem; color: var(--muted); }
.school { margin: .9rem 0 0; font-size: .92rem; color: var(--muted); }
.award { margin: .9rem auto 0; max-width: 36rem; font-family: var(--display); font-size: 1.05rem; }
.award.secondary { margin-top: .25rem; color: var(--muted); font-size: .95rem; }

/* ---- sections ----------------------------------------------------------- */
main { position: relative; z-index: 1; max-width: 76rem; margin: 0 auto; padding: 0 var(--gutter) 4rem; }
.section { padding-top: 1.6rem; }
.section + .section { margin-top: 2.5rem; padding-top: 2.5rem; border-top: 1px solid var(--rule); }
.section h2 { font-size: 1.6rem; }
.section-intro { margin: .5rem 0 0; max-width: 40rem; color: var(--muted); font-size: .95rem; }

/* Every card in a section shares the image window aspect (--aspect, set per section),
   so cards in a row are the same height; the image sits on the card's white, letterboxed invisibly. */
.grid { display: grid; gap: 2.5rem 2rem; margin-top: 1.1rem; grid-template-columns: 1fr; align-items: stretch; }
@media (min-width: 760px)  { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* on wide screens: two pieces sit two-up at two-thirds width; four pieces go four across, so no orphan row */
@media (min-width: 1200px) {
  .grid:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 66%; }
  .grid:has(> :nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.5rem 1.5rem; }
}

/* ---- card --------------------------------------------------------------- */
.piece { position: relative; background: var(--card); padding: var(--frame) var(--frame) var(--frame-bottom); display: flex; flex-direction: column; }
.window { position: relative; aspect-ratio: var(--aspect); overflow: hidden; }
.window picture, .window img { position: absolute; inset: 0; width: 100%; height: 100%; }
.window img { object-fit: contain; }
.window picture[hidden] { display: none; }

.angles { list-style: none; margin: .7rem 0 0; padding: 0 0 .2rem; display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; }
.angles::-webkit-scrollbar { display: none; }
.angles li { flex: 0 0 auto; }
.angles button { width: 64px; text-align: center; font-size: .7rem; color: var(--muted); line-height: 1.15; }
.angles picture { display: block; }
.angles img { width: 64px; height: 64px; object-fit: contain; background: #fff; opacity: .7; border: 2px solid transparent; transition: opacity .15s; }
.angles button:hover img, .angles button.is-current img { opacity: 1; }
.angles button.is-current img { border-color: #d9b5a9; }
.angles button:focus-visible img { outline: 2px solid var(--ink); outline-offset: 2px; }
.angles span { display: block; margin-top: .25rem; }

.caption { margin-top: .9rem; }
.caption h3 { font-size: 1.3rem; }
.meta { margin: .2rem 0 0; color: var(--muted); font-size: .9rem; }
.note { margin: .5rem 0 0; font-size: .95rem; }

.colophon { position: relative; z-index: 1; text-align: center; color: var(--muted); font-size: .8rem; padding: 2rem var(--gutter) 3rem; }

/* ---- card: straight corners, hairline border, light shadow (Scott: style 1, locked 10/28) ---- */
.piece {
  border: 1px solid #e8e1d6;
  box-shadow: 0 1px 2px rgba(60, 40, 20, .05), 0 8px 24px rgba(60, 40, 20, .06);
}

/* ---- photo set toggle (only built while both sets exist) ---------------- */
.lightbox .photo-pick { bottom: max(.8rem, env(safe-area-inset-bottom)); }
.photo-pick { position: fixed; right: .8rem; bottom: max(.8rem, env(safe-area-inset-bottom)); z-index: 40; display: flex; gap: .25rem; align-items: center; padding: .3rem .4rem .3rem .8rem; border-radius: 999px; background: rgba(255, 255, 255, .94); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 6px 18px rgba(0, 0, 0, .08); font-size: .75rem; color: var(--muted); }
.photo-pick button { padding: .35rem .7rem; border-radius: 999px; font-weight: 600; font-size: .78rem; color: var(--ink); }
html[data-photos="edited"] .photo-pick button[data-photos="edited"],
html[data-photos="original"] .photo-pick button[data-photos="original"] { background: var(--ink); color: #fff; }

/* both sets are in the page and loaded; only the chosen one is visible, so the switch is instant */
html[data-photos="edited"] picture[data-v="original"],
html[data-photos="original"] picture[data-v="edited"] { visibility: hidden; }
.angles .thumb { position: relative; display: block; width: 64px; height: 64px; }
.angles .thumb picture { position: absolute; inset: 0; }

@media (prefers-reduced-motion: no-preference) {
  .sky .cloud { animation: drift 40s ease-in-out infinite alternate; }
  .sky .cloud:nth-child(2) { animation-duration: 55s; }
  .sky .cloud:nth-child(3) { animation-duration: 48s; animation-direction: alternate-reverse; }
  @keyframes drift { from { transform: translateX(0); } to { transform: translateX(28px); } }
}

/* ---- phone -------------------------------------------------------------- */
@media (max-width: 600px) {
  .masthead { padding-top: 2.6rem; padding-bottom: 1.6rem; }
  .masthead h1 { font-size: 2.3rem; }
  .school { margin-top: 1rem; font-size: .9rem; }
  .award { margin-top: 1rem; font-size: 1rem; }
  .section { padding-top: 1.6rem; }
  .grid { margin-top: 1rem; gap: 2rem; }
  .sky .cloud:nth-child(1) { width: 240px; left: -34%; top: -4%; }
  .sky .cloud:nth-child(2) { width: 200px; right: -30%; top: 26%; }
  .sky .cloud:nth-child(3) { display: none; }
  .sky .cloud:nth-child(4) { width: 150px; right: -14%; bottom: -8%; }
}

/* ---- scale row: the tiny paintings beside a credit-card outline, same scale ---- */
.scale { --k: .5; margin-top: .9rem; }   /* painting + card must fit a normal card column */
.scale-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: calc(.35in * var(--k)); }
.actual { position: relative; flex: 0 0 auto; }
.actual-item { width: calc(var(--pw) * 1in * var(--k)); height: calc(var(--ph) * 1in * var(--k)); box-shadow: 0 1px 2px rgba(0, 0, 0, .15), 0 4px 10px rgba(0, 0, 0, .08); }
.actual-item[hidden] { display: none; }
.actual-item picture, .actual-item img { display: block; width: 100%; height: 100%; }
.actual-item img { object-fit: cover; }
.card-ref { flex: 0 0 auto; width: calc(3.375in * var(--k)); height: calc(2.125in * var(--k)); border: 1.5px dashed #c9bfb3; border-radius: calc(.125in * var(--k)); display: flex; align-items: flex-end; justify-content: flex-end; padding: .35rem .5rem; color: #a89d92; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; }
.scale-note { margin: .5rem 0 0; color: var(--muted); font-size: .8rem; }
@media (max-width: 1199px) { .scale { --k: .6; } }
@media (max-width: 600px)  { .scale { --k: .52; } }

/* ---- lightbox ----------------------------------------------------------- */
.window { cursor: zoom-in; }
.window:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
body.lb-open { overflow: hidden; }
.lightbox { border: 0; padding: 0; margin: auto; background: transparent; color: #fff;
  width: 96vw; height: 94vh; max-width: none; max-height: none; overflow: visible; }
.lightbox[open] { display: flex; flex-direction: column; align-items: center; }
.lightbox::backdrop { background: rgba(32, 26, 22, .72); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.lightbox:focus { outline: none; }
.lb-stage { flex: 1; min-height: 0; width: 100%; position: relative; }
.lb-stage picture { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.lb-stage picture[hidden] { display: none; }
.lb-stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; cursor: default;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3); }
.lb-angles { flex: 0 0 auto; margin-top: .9rem; max-width: 100%; }
.lb-angles .angles { margin: 0; justify-content: center; }
.lb-angles .angles button { color: rgba(255, 255, 255, .75); }
.lb-angles .angles img { opacity: .55; }
.lb-angles .angles button:hover img, .lb-angles .angles button.is-current img { opacity: 1; }
.lb-angles .angles button.is-current img { border-color: #fff; }
.lb-caption { flex: 0 0 auto; margin-top: .7rem; padding-bottom: max(.2rem, env(safe-area-inset-bottom)); text-align: center; max-width: 44rem; }
.lb-caption h3 { font-size: 1.4rem; color: #fff; }
.lb-caption .meta { color: rgba(255, 255, 255, .7); }
.lb-caption .note { color: rgba(255, 255, 255, .88); font-size: .95rem; }
.lb-close { position: fixed; top: max(.8rem, env(safe-area-inset-top)); right: 1rem; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(0, 0, 0, .32); color: #fff; font-size: 1.7rem; line-height: 1; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.lb-close:hover { background: rgba(0, 0, 0, .5); }
.lb-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lb-prev, .lb-next { position: fixed; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%;
  background: rgba(0, 0, 0, .32); color: #fff; font-size: 2rem; line-height: 1; display: flex; align-items: center; justify-content: center; padding-bottom: 4px; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.lb-prev { left: .8rem; } .lb-next { right: .8rem; }
.lb-prev:hover, .lb-next:hover { background: rgba(0, 0, 0, .5); }
.lb-prev:disabled, .lb-next:disabled { opacity: .25; cursor: default; }
.lb-prev:focus-visible, .lb-next:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (max-width: 600px) {
  .lightbox { width: 100vw; height: 100dvh; padding: 3.2rem 12px .6rem; }
  .lb-prev, .lb-next { width: 38px; height: 38px; font-size: 1.7rem; background: rgba(0, 0, 0, .28); }
  .lb-prev { left: .4rem; } .lb-next { right: .4rem; }
  .lb-caption h3 { font-size: 1.15rem; }
  .lb-caption .note { display: none; }   /* room for the picture; the note is on the card */
}
