:root {
  color-scheme: light;
  --ink: #1e292c;
  --muted: #50575a;
  --focus: #183c4b;
  --cream: #fffaf2;
}

* { box-sizing: border-box; }

html { min-width: 280px; min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background-color: #d5ad65;
  background-image:
    radial-gradient(ellipse at 13% 12%, rgb(255 246 213 / 88%), transparent 42%),
    radial-gradient(ellipse at 91% 75%, rgb(255 237 186 / 75%), transparent 42%),
    linear-gradient(124deg, #ac7835 0%, #e2bc73 24%, #f1d49a 43%, #cb994e 72%, #edca85 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page-width { width: calc(100% - 96px); max-width: 1760px; margin-inline: auto; }

.site-header { padding-block: clamp(32px, 4vw, 64px) 32px; }
.wordmark { margin: 0; font-size: clamp(27px, 2.5vw, 36px); font-weight: 750; letter-spacing: -0.055em; line-height: 1.15; }
.wordmark span { font-weight: 400; }

main { margin-block: auto !important; padding-block: 14px 32px; }
.projects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: clamp(20px, 1.75vw, 32px); align-items: stretch; }

.project-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: visible;
  border: 2px solid rgb(255 251 239 / 92%);
  border-radius: 24px;
  background: linear-gradient(135deg, #fffdf8, #faf2e6);
  box-shadow: 0 6px 0 #c7aa7b, 0 10px 0 -2px rgb(133 91 36 / 32%), 0 22px 30px -12px rgb(84 49 9 / 43%);
  transition: transform 240ms ease, box-shadow 240ms ease;
}

[hidden] { display: none !important; }
.gallery { min-width: 0; padding: 13px 13px 0; perspective: 1000px; }
.preview-frame {
  position: relative;
  aspect-ratio: 8 / 5;
  overflow: hidden;
  border: 1px solid rgb(255 250 232 / 90%);
  border-radius: 15px;
  background: #5f2437;
  box-shadow: 0 4px 0 #b49c77, 0 13px 20px -8px rgb(61 36 11 / 50%), 0 0 0 1px rgb(89 59 20 / 12%);
  transform: translateY(-4px) rotateX(1.5deg);
  transition: transform 280ms ease, box-shadow 280ms ease;
  touch-action: pan-y;
}
.project-preview { display: block; width: 100%; height: 100%; position: absolute; inset: 0; animation: preview-reveal 400ms ease both; }
.project-preview img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.preview-sunnybe { background: #2d2118; }
.preview-yestodays { background: #38382f; }
@keyframes preview-reveal { from { opacity: .3; transform: scale(1.015); } to { opacity: 1; transform: scale(1); } }
.gallery-controls { padding: 15px 5px 0; }
.gallery-caption { display: flex; justify-content: space-between; gap: 8px; color: #60513c; font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.gallery-count { font-variant-numeric: tabular-nums; font-weight: 400; }
.gallery-navigation { display: flex; align-items: center; justify-content: space-between; gap: 3px; margin-top: 4px; }
.gallery button { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; padding: 0; border: 1px solid transparent; border-radius: 50%; color: #5f4620; background: transparent; cursor: pointer; touch-action: manipulation; }
.gallery .gallery-arrow { font: 30px/1 Arial, sans-serif; }
.gallery .gallery-play { font: 15px/1 Arial, sans-serif; }
.gallery-dots { display: flex; align-items: center; justify-content: center; }
.gallery .gallery-dot { width: 28px; }
.gallery-dot span { width: 6px; height: 6px; border-radius: 10px; background: #b8a587; transition: width 200ms, background 200ms; }
.gallery-dot[aria-current] span { width: 20px; background: #80591e; }
.gallery button:hover { background: #eee1c9; }
.gallery button:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.project-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 15px clamp(22px, 2.1vw, 38px) clamp(22px, 2.1vw, 38px);
}
h2 { margin: 0; font-size: clamp(27px, 2.3vw, 43px); line-height: 1.15; font-weight: 750; letter-spacing: -0.035em; }
.project-content p { margin: 14px 0 30px; color: var(--muted); font-size: clamp(17px, 1.55vw, 25px); line-height: 1.45; }

.gold-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-height: 62px;
  margin-top: auto;
  padding: 13px 18px;
  border: 1px solid #bd8b32;
  border-radius: 999px;
  color: #211d13;
  background: linear-gradient(180deg, #fff1c1 0%, #f7d78a 20%, #d6a448 58%, #e2b75d 83%, #ffe6a0 100%);
  box-shadow:
    inset 0 2px 1px rgb(255 255 242 / 95%),
    inset 0 -2px 2px rgb(163 110 25 / 26%),
    0 3px 0 #b68128,
    0 5px 0 1px #ffedb4,
    0 10px 17px -5px rgb(178 113 17 / 46%),
    0 0 16px rgb(245 190 74 / 22%);
  text-decoration: none;
  text-align: center;
  font-size: clamp(20px, 1.7vw, 29px);
  font-weight: 730;
  line-height: 1.2;
  text-shadow: 0 1px 0 rgb(255 247 217 / 48%);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

a { touch-action: manipulation; -webkit-tap-highlight-color: rgb(153 103 28 / 16%); }
a:focus-visible { outline: 3px solid var(--focus); outline-offset: 5px; }
.project-preview:focus-visible { outline: 5px solid #fff2c5; outline-offset: -7px; }
.project-card:focus-within { box-shadow: 0 18px 36px -10px rgb(84 49 9 / 44%); }

@media (hover: hover) and (pointer: fine) {
  .project-card:hover { transform: translateY(-5px); box-shadow: 0 26px 40px -14px rgb(84 49 9 / 43%), 0 4px 10px rgb(84 49 9 / 9%); }
  .project-card:hover .preview-frame { transform: translateY(-7px) rotateX(2deg) rotateY(-1deg); box-shadow: 0 5px 0 #b49c77, 0 18px 24px -8px rgb(61 36 11 / 48%); }
  .gold-button:hover {
    transform: translateY(-2px);
    filter: brightness(1.035);
    box-shadow: inset 0 2px 1px #fffbed, inset 0 -2px 2px rgb(163 110 25 / 26%), 0 4px 0 #b68128, 0 6px 0 1px #ffedb4, 0 12px 21px -5px rgb(178 113 17 / 50%), 0 0 23px rgb(245 190 74 / 40%);
  }
}
.gold-button:active { transform: translateY(3px); filter: brightness(0.98); box-shadow: inset 0 3px 6px rgb(118 76 15 / 24%), inset 0 -1px 1px #fff0bd, 0 1px 0 #b68128, 0 3px 8px rgb(178 113 17 / 20%); }

.site-footer { padding-block: 16px 28px; color: #51402a; text-align: center; font-size: 13px; line-height: 1.5; }
.site-footer p { margin: 0; }
.skip-link { position: fixed; z-index: 10; top: 12px; left: 16px; transform: translateY(-180%); padding: 12px 20px; border-radius: 8px; background: var(--cream); color: var(--ink); font-weight: 650; }
.skip-link:focus { transform: translateY(0); }

@media (max-width: 1099px) {
  .page-width { width: calc(100% - 64px); }
  .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  h2 { font-size: clamp(27px, 3.1vw, 34px); }
  .project-content p { font-size: 19px; }
  .project-content { padding: 15px 26px 26px; }
  .gold-button { font-size: 23px; }
}

@media (max-width: 699px) {
  .page-width { width: calc(100% - 32px); max-width: 500px; }
  .site-header { padding-block: 30px 24px; }
  .wordmark { font-size: 30px; }
  main { padding-block: 6px 20px; }
  .projects { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .project-card { border-radius: 21px; }
  .project-content { padding: 15px 24px 24px; }
  h2 { font-size: clamp(26px, 7vw, 34px); }
  .project-content p { margin-top: 12px; margin-bottom: 28px; font-size: 18px; }
  .gold-button { min-height: 58px; font-size: 22px; }
  .site-footer { padding-block: 14px 24px; }
}

@media (max-width: 359px) {
  .gallery .gallery-dot { width: 24px; }
  .gallery-controls { padding-inline: 0; }
  .project-content { padding: 15px 20px 20px; }
  .project-content p { font-size: 17px; }
  h2 { font-size: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .preview-frame, .project-card:hover .preview-frame, .project-card:hover, .gold-button:hover, .gold-button:active { transform: none; }
}

@media (forced-colors: active) {
  .project-card, .gold-button, .gallery button { border: 2px solid ButtonText; }
  .gallery-dot span { background: ButtonText; }
  .gallery-dot[aria-current] { outline: 2px solid Highlight; }
  .project-preview:focus-visible { outline-color: Highlight; }
}

@media print {
  .gallery-controls { display: none; }
  .preview-frame { transform: none; box-shadow: none; }
  body { background: white; }
  .page-width { width: 100%; }
  .projects { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .project-card { box-shadow: none; break-inside: avoid; }
  .gold-button { box-shadow: none; }
  .project-content { padding: 14px; }
  h2 { font-size: 20px; }
  .project-content p { font-size: 13px; }
}
