/* ============================================
   Kai Lien Adamchak — Portfolio
   ============================================ */

/*-----------FONTS-------------*/

/*Gambetta*/

@font-face {
  font-family: "Gambetta";
  src: url("../fonts/Gambetta-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Gambetta"; 
  src: url("../fonts/Gambetta-BoldItalic.woff2") format("woff2");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Gambetta"; 
  src: url("../fonts/Gambetta-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Gambetta"; 
  src: url("../fonts/Gambetta-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Gambetta"; 
  src: url("../fonts/Gambetta-Semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/*TAY*/

@font-face {
  font-family: "Bang!"; 
  src: url("../fonts/TAYBang!.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Birdie"; 
  src: url("../fonts/TAYBirdieRegular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/*YoungSerif*/

@font-face {
  font-family: "YoungSerif"; 
  src: url("../fonts/YoungSerif-MediumItalic.woff") format("woff");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "YoungSerif"; 
  src: url("../fonts/YoungSerif-RegularItalic.woff") format("woff");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --ink: #2b1a0e;          /* dark brown text + outlines */
  --paper: #ffffff;        /* page background */
  --cream: #fbf8ea;        /* card background */
  --accent: #e8a33a;       /* active nav (orange) */
  --link: #5aa9c4;         /* email link (teal) */
  --photo-fallback: #e9e2d0;

  --font-display: "Gambetta", Georgia, serif;      /* name, section titles */
  --font-italic: "YoungSerif", Georgia, serif;     /* nav, tagline, card headings (italic only) */
  --font-body: "Gambetta", Georgia, serif;         /* paragraphs, lists */
  --font-script: "Bang!", "YoungSerif", serif;     /* sign-off, footer "Adamchak" */

  --shadow: 4px 4px 0 var(--ink);
  --wide: min(92vw, 1400px);   /* width of nav, footer and painting photo */
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.45;
  overflow-x: hidden;
}

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

a { color: inherit; }

.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 40px 48px;
  position: relative;
}

/* Wide elements break out of the page column to span most of the browser:
   the nav, the footer and the homepage painting photo.
   Change --wide in one place to resize all three. */
.site-nav,
.site-footer,
.feature-photo {
  width: var(--wide);
  max-width: none;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}

/* color: transparent hides alt text while photos are still missing */
.photo { background: var(--photo-fallback); object-fit: cover; color: transparent; }

/* ---------- Nav ---------- */
.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
}

.nav-group { display: flex; gap: 48px; }

.site-nav a {
  font-family: var(--font-italic);
  font-style: italic;
  font-size: 22px;
  text-decoration: none;
  transition: color .2s;
}

.site-nav a:hover,
.site-nav a.active { color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  text-align: center;
  padding: 56px 0 40px;
}

.name { margin: 0; font-weight: 400; line-height: 1; }

.name-first {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(44px, 7vw, 72px);
  letter-spacing: .02em;
}

.name-last {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(24px, 3.4vw, 34px);
  letter-spacing: .04em;
  margin-top: 4px;
}

.tagline {
  font-family: var(--font-italic);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(30px, 4.6vw, 46px);
  margin: 10px 0 6px;
  line-height: 1.1;
}

.subtag { margin: 0; font-size: 19px; }


/* ---------- About ---------- */
.about {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;
  align-items: start;
  padding: 40px 0 80px;
}

.collage {
  position: relative;
  margin-top: 20px;
  padding-bottom: 10%;      /* room for the small photo to hang below */
}

/* Shown at its natural proportions, so nothing is cropped */
.photo-main {
  position: relative;
  width: 66%;
  height: auto;
  margin-left: auto;
}

.photo-small {
  position: absolute;
  left: 0; bottom: 0;
  width: 38%;
  height: auto;
  z-index: 1;
}

.sticker { position: absolute; z-index: 2; pointer-events: none; overflow: visible; }

.sticker-flowers { width: 30%; right: -6%; bottom: -6%; }

/* ---------- Cards ---------- */
.card {
  background: var(--cream);
  box-shadow: var(--shadow);
  padding: 22px 26px;
}

.hi-card { position: relative; z-index: 1; }

.hi-card h2 {
  font-family: var(--font-italic);
  font-style: italic;
  font-weight: 500;
  font-size: 40px;
  line-height: 1;
  margin: 0 0 14px;
}

.hi-card p { margin: 0 0 16px; }

.hi-card a { color: var(--link); }

.hi-card .signoff {
  font-family: var(--font-script);
  font-size: 24px;
  transform: rotate(-2deg);
  margin: 22px 0 0;
}


/* ---------- More about me ---------- */
.more { position: relative; padding-bottom: 80px; }

.section-title {
  position: relative;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 32px;
  margin: 0 0 32px;
}

.more-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 32px;
  align-items: start;
}

.more-col { display: flex; flex-direction: column; gap: 28px; }

.skill-card h3 {
  font-family: var(--font-italic);
  font-style: italic;
  font-weight: 400;
  font-size: 26px;
  line-height: 1.1;
  margin: 0 0 16px;
}

.skill-card.analog { width: 70%; margin-left: 6%; }
.skill-card.digital { margin-top: 24px; width: 82%; }

.list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 14px;
  font-size: 16px;
  line-height: 1.5;
}

.list li::before { content: "·"; margin-right: 10px; }

.list.two-col { columns: 2; column-gap: 24px; }

/* ---------- Feature photo ---------- */
.feature { position: relative; }

/* aspect-ratio sets how much is cropped; object-position keeps the
   paintings and easel in view (lower % = keep more of the top). */
.feature-photo {
  aspect-ratio: 2 / 1;
  object-position: 50% 45%;
}


/* ---------- Footer ---------- */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 56px 0 0;
}

/* Left side: name, email and icons stacked with 12px of visible space between each line
   (the gap below). The fonts carry different amounts of empty space above and below their
   letters, so the email and icons are pulled up to make the gaps between the actual letters
   match; change only the gap to resize both. */
.site-footer > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.footer-name,
.footer-email { line-height: 1; }
.footer-email { margin-top: -10.4px; }   /* bottom of the name's capitals -> top of the email */
.socials { margin-top: -2.8px; }         /* email's baseline -> top of the icons */

.footer-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  margin: 0;
}

.footer-name span {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: 24px;
}

.footer-email { font-size: 15px; text-decoration: none; }
.footer-email:hover { text-decoration: underline; }

.socials { display: flex; gap: 10px; }
.socials svg { width: 18px; height: 18px; display: block; }
.socials a:hover { color: var(--accent); }

.footer-photo {
  display: block;
  width: 122px;
  aspect-ratio: 1 / 1;            /* square: the photo is a bit tall, so... */
  object-fit: cover;
  object-position: 50% 100%;      /* ...the extra is trimmed off the top only */
  background: var(--photo-fallback);
}

/* ============================================
   Mobile
   ============================================ */
@media (max-width: 720px) {
  body { font-size: 15px; }

  .page { padding: 20px 16px 32px; }

  /* Phone: drop the left/right grouping so all four links spread evenly */
  .nav-group { display: contents; }
  .site-nav a { font-size: 18px; }

  .hero { padding: 40px 0 24px; }
  .subtag { font-size: 16px; }

  .about {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px 0 56px;
  }
  .collage { margin-top: 0; }

  .hi-card { padding: 18px 20px; }

  .section-title { font-size: 26px; }

  .more-grid { grid-template-columns: 1fr; gap: 24px; }
  .skill-card.analog,
  .skill-card.digital { width: auto; margin: 0; }


  .site-footer { padding-top: 32px; }
  .footer-photo { width: 84px; }
}

/* ============================================
   Projects page
   ============================================ */
.page-title {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 5vw, 48px);
  letter-spacing: .02em;
  margin: 28px 0 36px;
}

.project-list { display: flex; flex-direction: column; gap: 22px; }

/* Whole card is one link that opens the project's pop-up */
.project-card {
  display: grid;
  grid-template-columns: 22% 1fr;
  background: var(--cream);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}

.project-card:hover,
.project-card:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}

.project-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* Thumbnails are cropped to fill the left side of the card, like the mockup */
/* height: 0 + min-height: 100% lets the text set the card's height,
   and the photo fills that space without stretching the card */
.project-thumb { width: 100%; height: 0; min-height: 100%; }

/* Shift a thumbnail's crop to frame its subject: 50% = centered,
   lower % = shows more of the top, higher % = shows more of the bottom */
.thumb-band-merch { object-position: 50% 36%; }

.project-body { padding: 26px 40px 24px 48px; min-height: 190px; }

.project-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 30px;
  line-height: 1.1;
  margin: 0 0 8px;
}

.project-num {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: .85em;
  margin-right: 4px;
}

.project-body p { margin: 0 0 18px; font-size: 15px; line-height: 1.4; }

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0;
  padding: 0;
}

.tags li {
  font-family: "Birdie", var(--font-body);
  font-size: 10px;
  letter-spacing: .06em;
  border: 1px solid var(--ink);
  background: var(--paper);
  /* Birdie sits low in its line box, so the top padding is smaller than the bottom to
     centre the capitals. letter-spacing leaves a gap after the last letter, so the left
     padding gets that same .06em to balance it. */
  padding: 1.5px 8px 3.5px calc(8px + .06em);
  line-height: 1.3;
}

.page-projects .site-footer { padding-top: 64px; }

/* ---------- Project pop-up ---------- */
html:has(.project-modal[open]) { overflow: hidden; }   /* stop the page scrolling behind it */

.project-modal {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 36px 40px 40px;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  overflow-y: auto;
}

.project-modal::backdrop { background: rgba(43, 26, 14, .55); }

.modal-close {
  position: sticky;
  top: 0;
  float: right;
  margin: -16px -20px 0 0;
  width: 40px;
  height: 40px;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}
.modal-close:hover { background: var(--accent); }

/* Pop-up photos keep their own shape (no cropping) */
.modal-hero { width: 100%; height: auto; margin-bottom: 24px; }

.project-modal .project-title { font-size: 34px; margin-bottom: 12px; }
.project-modal .tags { margin-bottom: 20px; }
.project-modal p { margin: 0 0 16px; }

.project-modal h3 {
  font-family: var(--font-italic);
  font-style: italic;
  font-weight: 400;
  font-size: 24px;
  margin: 28px 0 8px;
}

.project-modal .placeholder { opacity: .6; font-family: var(--font-italic); font-style: italic; }


/* ---------- Case-study pop-up (KingMaker layout) ---------- */
.project-modal.case { width: min(960px, calc(100vw - 32px)); padding: 36px 48px 48px; }

/* Photo spot: blank box labelled with its filename until the photo loads */
.ph {
  position: relative;
  margin: 0;
  aspect-ratio: var(--ar, 4 / 3);
  background: var(--photo-fallback);
  overflow: hidden;
}
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
.ph::after {
  content: attr(data-label);
  position: absolute;
  inset: auto 6px 6px;
  font-size: 11px;
  line-height: 1.2;
  opacity: .55;
  word-break: break-all;
}
.ph.has-image { aspect-ratio: auto; background: none; }
.ph.has-image::after { content: none; }
.ph.has-image img { position: static; display: block; height: auto; opacity: 1; }

.case-head { text-align: center; max-width: 640px; margin: 0 auto 32px; }
.project-modal.case .project-title { font-size: clamp(34px, 5vw, 48px); margin-bottom: 0; }
.case-sub {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(22px, 3vw, 30px);
  margin: 0 0 16px !important;
}
.case-head .tags { justify-content: center; }
.case-intro { font-size: 15px; }

.case-section { margin-top: 48px; }
.project-modal.case h3 { margin-top: 0; }
.case-callout { font-family: var(--font-italic); font-style: italic; font-weight: 500; }

/* Rows of photos that run to the pop-up's edges and scroll sideways if they don't fit */
.case-strip {
  display: flex;
  gap: 12px;
  margin: 0 -48px;
  padding: 0 48px 6px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}
.case-strip .ph { flex: 0 0 auto; height: 240px; scroll-snap-align: center; }
.case-strip .ph.has-image img { height: 100%; width: auto; }
.case-hero { justify-content: safe center; }
.case-cards { margin-top: 32px; background: var(--accent); padding-block: 16px; }
.case-cards .ph { height: 200px; }

/* Logo sits centred on the yellow rounded rectangle (rectangle.png) */
.case-logo {
  width: min(480px, 86%);
  aspect-ratio: 967 / 436;
  margin: 40px auto 0;
  padding: 0 11%;
  display: flex;
  align-items: center;
  background: url("../images/projects/kingmaker/rectangle.png") center / 100% 100% no-repeat;
  filter: drop-shadow(4px 4px 0 var(--ink));
}
.case-logo .ph { width: 100%; }

.brand { display: grid; grid-template-columns: 1fr 1.2fr; gap: 32px; align-items: center; }
.palette { display: grid; grid-template-columns: 1fr 1fr; }
.palette span {
  background: var(--c);
  aspect-ratio: 2 / 1;
  display: flex;
  align-items: flex-end;
  padding: 6px 8px;
  font-size: 11px;
  color: #fff;
  text-shadow: 0 0 2px rgba(0, 0, 0, .5);
}
.type-fonts { width: 100%; max-width: 280px; height: auto; margin-bottom: 18px; }
.ui-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 360px; }
.ui-buttons img { width: 100%; height: auto; }

.case-split { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: center; margin-bottom: 28px; }
.case-split.reverse > :first-child { order: 2; }

.case-cardgrid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; align-items: start; margin-bottom: 28px; }
.case-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Rounded corners on every game card (character strip, 2x2 card grid, event cards).
   7% / 5% gives evenly curved corners on a 5:7 card; raise both to round them more. */
.case-cards .ph,
.case-mini .ph,
.token-card-back,
.token-card-front { border-radius: 7% / 5%; overflow: hidden; }

/* Tokens cluster: left/top/width are % of the square; rotate tilts each piece */
.tokens { position: relative; aspect-ratio: 20 / 17; }
.tokens img { position: absolute; height: auto; filter: drop-shadow(3px 3px 0 rgba(43, 26, 14, .35)); }
.token-card-back  { left: 36%; top: 7%;  width: 36%; rotate: -8deg; }
.token-card-front { left: 60%; top: 26%; width: 36%; rotate: 9deg; }
.token-coin-front { left: 2%;  top: 16%; width: 34%; }
.token-coin-back  { left: 16%; top: 56%; width: 34%; z-index: 1; }

.case-overlap { position: relative; padding-bottom: 18%; }
.case-overlap .ph:first-child { width: 78%; margin-left: auto; }
.case-overlap .ph:last-child { position: absolute; left: 0; bottom: 0; width: 44%; z-index: 1; }

.case-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 0 -48px 24px;
  padding: 32px 48px;
  background: var(--accent);
}

.project-modal.case .case-subhead { margin: 32px 0 16px; }   /* header inside a section */

.case-collage { position: relative; display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 12px; }
/* Final photo sits below the two testing photos (no overlap), nudged left of the second
   one's edge. Raise or lower the -6% to shift it more or less. */
.case-collage .ph:last-child { grid-column: 2 / 4; margin-left: -6%; box-shadow: var(--shadow); z-index: 1; }

/* "crop" photo spots keep the box's shape and trim the photo to fill it */
.ph.crop.has-image { aspect-ratio: var(--ar, 4 / 3); }
.ph.crop.has-image img { position: absolute; height: 100%; object-fit: cover; }

/* Band Merch pieces */
.case-feature { width: 72%; margin-left: -48px; }           /* big photo hugging the left edge */
.case-logo-panel {
  width: min(560px, 76%);
  margin: 32px auto 0;
  padding: 24px;
  display: flex;
  justify-content: center;
  background: #ede0b8;            /* same cream as cattledogs-logo.png */
  border-radius: 24px;
}
.case-logo-panel .ph { width: min(240px, 60%); }
.case-aside { width: 50%; margin: 24px 0 32px auto; }    /* text block on the right half */
.case-note { width: 55%; margin-top: 24px; }               /* text block on the left half */

.case-row3 { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 10px; margin: 0 -48px; }
.case-row3.even { grid-template-columns: repeat(3, 1fr); }
.case-row3.gallery-row { margin: 0; gap: 16px; align-items: center; }

.case-banner { position: relative; margin: 0 -48px 32px; }
.case-banner-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  width: 34%;
  background: #fff;
  padding: 8px;
}

@media (max-width: 720px) {
  .project-modal.case { padding: 28px 20px 32px; }
  .case-feature { width: 88%; margin-left: -20px; }
  .case-logo-panel { width: 100%; }
  .case-aside,
  .case-note { width: auto; }
  .case-row3 { margin: 0 -20px; gap: 6px; }
  .case-row3.gallery-row { margin: 0; gap: 10px; }
  .case-banner { margin: 0 -20px 24px; }
  .case-banner-logo { width: 46%; }
  .case-strip { margin-inline: -20px; padding: 0 20px 6px; }
  .type-fonts { max-width: 220px; margin: 16px 0 24px; }
  .type-spec { margin-bottom: 16px; }
  .case-cards { padding-block: 12px; }
  .case-strip .ph { height: 170px; }
  .case-cards .ph { height: 140px; }
  .case-band { margin: 0 -20px 20px; padding: 20px; gap: 10px; }
  .brand,
  .case-split { grid-template-columns: 1fr; gap: 20px; }
  .case-split.reverse > :first-child { order: 0; }
  .case-cardgrid { grid-template-columns: 1fr 1fr; }
  .case-mini { grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr); }
  .case-collage { grid-template-columns: 1fr 1fr; }
  .case-collage .ph:last-child { grid-column: 1 / -1; margin-left: 0; }
}

@media (max-width: 720px) {
  .project-card { grid-template-columns: 1fr; }
  .project-thumb { aspect-ratio: 16 / 10; height: auto; min-height: 0; }
  .thumb-lotus { object-position: 50% 28%; }   /* phone only: show the top petals */
  .project-body { padding: 20px 20px 22px; }
  .project-title { font-size: 24px; }

  .project-modal { padding: 28px 20px 28px; }
  .modal-close { margin: -12px -6px 0 0; }
  .project-modal .project-title { font-size: 26px; }
}

/* ---------- Lotus pop-up pieces ---------- */
.lotus-pair { display: grid; grid-template-columns: 1fr 1.5fr; gap: 14px; align-items: end; }
.lotus-pair.even { grid-template-columns: 1fr 1fr; }
.lotus-pair + .case-split { margin-top: 14px; }   /* same gap as between the two photos */
.lotus-models { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: center; margin: 28px 0; }
.lotus-mech { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: center; }

/* Pink rounded panel: photo on the left, render spilling over its right edge */
.lotus-band {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  align-items: center;
  margin: 48px 0;
  padding: 24px;
  background: #f2b8b5;
  border-radius: 24px;
}
.lotus-band .ph:last-child { margin: -14% -10% -14% 0; }

.lotus-petals { align-items: start; }
.lotus-stack { display: grid; gap: 20px; justify-items: center; }
.lotus-stack .ph { width: 100%; }
.lotus-stack .ph:last-child { width: 75%; }

@media (max-width: 720px) {
  .lotus-models { gap: 10px; }
  .lotus-band { grid-template-columns: 1fr; padding: 16px; margin: 32px 0; }
  .lotus-band .ph:last-child { width: 70%; margin: 0 auto; }
}

/* ============================================
   Art gallery page
   ============================================ */
.gallery {
  columns: 3;
  column-gap: 16px;
  max-width: 860px;
  margin: 0 auto;
}

.art {
  position: relative;
  margin: 0 0 16px;
  break-inside: avoid;
  background: var(--photo-fallback);   /* blank spot until a photo is added */
  overflow: hidden;
  cursor: default;
}

/* Invisible until it loads, so missing photos show a clean blank tile.
   (Not display:none — lazy-loaded images that aren't rendered never load.) */
.art img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }

.art.has-image { aspect-ratio: auto !important; background: none; }
.art.has-image img { position: static; display: block; width: 100%; height: auto; opacity: 1; }

/* Hover / keyboard focus: shade over the piece and show its title */
.art figcaption {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  background: rgba(255, 255, 255, 0.8);
  color: #000;
  font-family: var(--font-display);
  font-style: normal;
  font-size: 24px;
  line-height: 1.15;
  opacity: 0;
  transition: opacity .25s ease;
}

.art:hover figcaption,
.art:focus-visible figcaption { opacity: 1; }

.art:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.page-gallery .site-footer { padding-top: 64px; }

@media (max-width: 720px) {
  .gallery { columns: 2; column-gap: 12px; }
  .art { margin-bottom: 12px; }
  .art figcaption { font-size: 18px; }
}

/* ============================================
   Contact page
   ============================================ */
.contact-title { font-weight: 600; letter-spacing: 0; margin-bottom: 28px; }

.contact {
  display: grid;
  grid-template-columns: 300px minmax(0, 400px);
  justify-content: center;
  gap: 32px 40px;
  align-items: start;
}

/* Blank placeholder until the photo loads, then the photo's own shape */
.contact-photo-frame { aspect-ratio: 5 / 7; background: var(--photo-fallback); }
.contact-photo { display: none; }
.contact-photo-frame.has-image { aspect-ratio: auto; background: none; }
.contact-photo-frame.has-image .contact-photo { display: block; width: 100%; height: auto; }

.contact-links {
  list-style: none;
  display: flex;
  gap: 16px;
  margin: 20px 0 22px 18px;   /* left edge lines up with .contact-card below */
  padding: 0;
}

.contact-links a { display: block; transition: transform .15s ease; }
.contact-links a:hover,
.contact-links a:focus-visible { transform: translateY(-3px); }
.contact-links svg { width: 36px; height: 36px; display: block; }

.contact-card { margin-left: 18px; padding: 20px 22px 26px; }

.contact-card p {
  margin: 0;
  font-family: var(--font-italic);
  font-style: italic;
  font-size: 17px;
  line-height: 1.3;
}

.page-contact .site-footer { padding-top: 48px; }

@media (max-width: 720px) {
  .contact { grid-template-columns: 1fr; }
  .contact-photo-frame { width: 80%; margin: 0 auto; }
  /* Phone: icons move below the text box */
  .contact-info { display: flex; flex-direction: column; }
  .contact-links { order: 2; justify-content: flex-end; margin: 24px 0 0; }
  .contact-card { margin-left: 0; }
}
