:root {
  --portfolio-sky: #2b9ce7;
  --portfolio-deep: #123f65;
  --portfolio-paper: #fffdf2;
  --portfolio-paper-bright: #fffef8;
  --portfolio-ink: #173044;
  --portfolio-muted: #597083;
  --portfolio-white: #fffef5;
}

body.portfolio-page,
body.project-editorial-page {
  position: relative;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  isolation: isolate;
  color: var(--portfolio-white);
  background: var(--portfolio-sky);
  font-family: "Avenir Next", Avenir, "Trebuchet MS", sans-serif;
}

body.project-editorial-page {
  --portfolio-shell-width: min(980px, calc(100% - clamp(28px, 7vw, 112px)));
}

.portfolio-landscape,
.portfolio-atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.portfolio-landscape {
  z-index: -2;
  background: url("images/sky-meadow-landscape.jpg") center bottom / cover no-repeat;
  transform: scale(1.02);
  animation: portfolio-breathe 18s ease-in-out infinite alternate;
}

.portfolio-atmosphere {
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(7, 72, 135, 0.12), rgba(11, 86, 145, 0.02) 42%, rgba(20, 78, 28, 0.16)),
    radial-gradient(circle at 56% 22%, rgba(255, 255, 255, 0.1), transparent 34%);
}

.portfolio-header {
  position: relative;
  z-index: 3;
  display: flex;
  min-height: 88px;
  padding: max(26px, env(safe-area-inset-top)) clamp(24px, 5.2vw, 104px) 20px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: transparent;
}

.portfolio-header > a,
.portfolio-header nav a,
.portfolio-header h1 {
  color: var(--portfolio-white);
  text-shadow: 0 2px 8px rgba(4, 48, 86, 0.35);
}

.portfolio-header > a {
  width: fit-content;
  font-size: 18px;
}

.portfolio-header h1 {
  font-size: 18px;
}

.portfolio-header nav ul {
  display: flex;
  margin: 0;
  padding: 0;
  gap: clamp(18px, 2.4vw, 34px);
  list-style: none;
}

.portfolio-header nav li {
  margin: 0;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.045em;
}

.portfolio-header nav a {
  font-size: 13px;
  text-decoration: none;
  transition: opacity 180ms ease;
}

.portfolio-header nav a:hover,
.portfolio-header nav a:focus-visible {
  outline: none;
  opacity: 1;
  color: var(--portfolio-white);
  text-decoration: underline;
  text-decoration-color: var(--portfolio-white);
  text-underline-offset: 5px;
}

.portfolio-header nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.portfolio-header #hamburger {
  color: var(--portfolio-white);
}

.portfolio-page .portfolio {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - clamp(48px, 10.4vw, 208px)));
  margin: 0 auto;
  padding: clamp(52px, 9vh, 104px) 0 80px;
  text-align: left;
  background: transparent;
}

.portfolio-page .portfolio h2 {
  margin: 0;
  color: var(--portfolio-white);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(46.4px, 6.4vw, 89.6px);
  line-height: 0.9;
  letter-spacing: -0.055em;
  text-shadow: 0 3px 18px rgba(5, 63, 110, 0.3);
}

.portfolio-page .portfolio .subtitle {
  width: min(620px, 100%);
  margin: clamp(24px, 4vh, 38px) 0 0;
  color: rgba(255, 254, 245, 0.86);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(14.4px, 1.6vw, 20px);
  line-height: 1.45;
  text-shadow: 0 3px 18px rgba(5, 63, 110, 0.3);
}

.portfolio-page .tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: clamp(48px, 7vh, 78px) 0 28px;
}

.portfolio-page .tag-filter .tag {
  margin: 0;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 999px;
  color: var(--portfolio-white);
  background: rgba(9, 53, 87, 0.14);
  font-family: inherit;
  font-size: 9.6px;
  font-weight: 750;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}

.portfolio-page .tag-filter .tag:hover,
.portfolio-page .tag-filter .tag:focus-visible,
.portfolio-page .tag-filter .tag.active {
  outline: none;
  background: rgba(9, 53, 87, 0.5);
  transform: translateY(-2px);
}

.portfolio-page .project-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(22px, 3vw, 34px);
}

.portfolio-page .project-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 2px;
  color: var(--portfolio-ink);
  background: var(--portfolio-paper);
  box-shadow: 0 24px 60px rgba(9, 60, 96, 0.24);
  transform: rotate(-0.28deg);
  transition: box-shadow 220ms ease, transform 220ms ease;
}

.portfolio-page a.project-card {
  display: block;
  text-decoration: none;
}

.portfolio-page a.project-card:focus-visible {
  outline: 3px solid rgba(255, 254, 245, 0.95);
  outline-offset: 6px;
}

.portfolio-page .project-card:nth-child(even) {
  transform: rotate(0.24deg);
}

.portfolio-page .project-card:hover,
.portfolio-page .project-card:focus-within {
  box-shadow: 0 31px 72px rgba(7, 54, 88, 0.3);
  transform: translateY(-5px) rotate(-0.28deg);
}

.portfolio-page .project-card:nth-child(even):hover,
.portfolio-page .project-card:nth-child(even):focus-within {
  transform: translateY(-5px) rotate(0.24deg);
}

.portfolio-page .project-card img,
.portfolio-page .project-card-video,
.portfolio-page .project-card-media-empty {
  display: block;
  width: 100%;
  aspect-ratio: 1200 / 630;
  height: auto;
  object-fit: cover;
}

.portfolio-page .project-info {
  padding: clamp(24px, 3vw, 38px);
  background: var(--portfolio-paper);
}

.portfolio-page .project-info h3 {
  margin: 0;
  color: var(--portfolio-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(21.6px, 2.4vw, 31.2px);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.portfolio-page .project-info p {
  margin: 18px 0 0;
  color: #405b70;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(12.8px, 1.24vw, 15.2px);
  line-height: 1.5;
}

.portfolio-page .project-info .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.portfolio-page .project-info .tags .tag {
  margin: 0;
  padding: 0;
  color: var(--portfolio-muted);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.portfolio-footer {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(1120px, calc(100% - clamp(48px, 10.4vw, 208px)));
  margin: 12px auto 0;
  padding: 24px 0 max(28px, env(safe-area-inset-bottom));
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.34);
  color: rgba(255, 254, 245, 0.82);
  background: transparent;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.075em;
  text-shadow: 0 2px 8px rgba(4, 48, 86, 0.3);
}

.portfolio-footer .footer-name,
.portfolio-footer p {
  margin: 0;
  color: inherit;
  font-size: inherit;
}

.portfolio-footer nav,
.portfolio-footer .footer-socials {
  display: flex;
  align-items: center;
  gap: 18px;
}

.portfolio-footer nav a,
.portfolio-footer .footer-socials a {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  color: var(--portfolio-white);
  text-decoration: none;
}

.portfolio-footer nav a:hover,
.portfolio-footer nav a:focus-visible,
.portfolio-footer .footer-socials a:hover,
.portfolio-footer .footer-socials a:focus-visible {
  outline: none;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.portfolio-footer .footer-socials a {
  font-size: 15px;
}

/* The Studying the Masters detail page uses the same editorial paper treatment. */
.project-editorial-page .project-details {
  position: relative;
  z-index: 1;
  width: var(--portfolio-shell-width);
  max-width: none;
  margin: 0 auto;
  padding: 0;
  color: var(--portfolio-ink);
  background: var(--portfolio-paper-bright);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 30px 80px rgba(5, 53, 86, 0.28);
}

.project-editorial-page .project-header {
  margin: 0;
  padding: clamp(48px, 9vw, 104px) clamp(28px, 9vw, 106px) clamp(42px, 7vw, 76px);
  text-align: left;
  border-bottom: 1px solid rgba(25, 69, 101, 0.16);
}

.project-editorial-page .project-header h2 {
  margin: 0;
  color: var(--portfolio-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(36px, 5.68vw, 65.6px);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.project-editorial-page .project-header .project-details-thumbnail {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  margin: clamp(32px, 5vw, 58px) 0 0;
}

.project-editorial-page .project-tags {
  margin: 24px 0 0;
  color: #2875a6;
  font-size: 8.8px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.project-editorial-page .project-content {
  display: block;
}

.project-editorial-page .project-description {
  width: min(680px, calc(100% - 56px));
  margin: 0 auto;
  padding: clamp(52px, 8vw, 90px) 0 clamp(64px, 10vw, 110px);
  color: var(--portfolio-ink);
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(14.4px, 1.36vw, 16.8px);
  line-height: 1.74;
}

.project-editorial-page .project-description h3 {
  margin: 2.35em 0 0.7em;
  color: var(--portfolio-ink);
  font-size: clamp(24px, 3.2vw, 34.4px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.project-editorial-page .project-description h3:first-child {
  margin-top: 0;
}

.project-editorial-page .project-description p {
  margin: 0 0 1.45em;
  color: var(--portfolio-ink);
  font: inherit;
}

.project-editorial-page .project-description iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 0;
}

/* Keep dense project tables comfortably readable without enlarging the body copy. */
.project-editorial-page .project-description table {
  font-size: 0.9em;
}

.project-editorial-page .project-description table th,
.project-editorial-page .project-description table td {
  font-size: inherit;
}

.project-editorial-page .project-description ol,
.project-editorial-page .project-description ul {
  margin: 0 0 1.65em;
  padding-left: 1.25em;
}

.project-editorial-page .project-description li {
  margin: 0 0 0.65em;
  padding-left: 0.25em;
}

.project-editorial-page .project-description li::marker {
  color: #2b83bb;
}

.project-editorial-page .project-description .project-details-thumbnail {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 2.6em 0 0;
  border: 1px solid rgba(24, 48, 67, 0.16);
}

/* Keep the Flo booking prompt in the same compact landscape treatment as the
   shared portfolio return action. */
.project-editorial-page .flo-call-cta {
  display: flex;
  max-width: none;
  margin: 32px 0 0;
  padding: 28px 0 4px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid rgba(25, 69, 101, 0.16);
}

.project-editorial-page .flo-call-cta p {
  margin: 0;
  color: var(--portfolio-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: inherit;
}

.project-editorial-page .flo-call-cta .cta {
  display: inline-flex;
  flex: 0 0 auto;
  width: 200px;
  height: 48px;
  min-height: 48px;
  padding: 8px 16px;
  box-sizing: border-box;
  border: 1px solid rgba(255, 254, 245, 0.72);
  border-radius: 4px;
  align-items: center;
  justify-content: center;
  color: var(--portfolio-white);
  background-image: linear-gradient(105deg, rgba(11, 52, 82, 0.78), rgba(25, 93, 133, 0.46)), url("images/sky-meadow-landscape.jpg");
  background-position: center 68%;
  background-size: cover;
  font-size: 11.2px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow: 0 2px 0 rgba(23, 48, 68, 0.16);
  text-shadow: 0 2px 8px rgba(4, 48, 86, 0.35);
  transition: transform 180ms ease, color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.project-editorial-page .flo-call-cta .cta::after {
  margin-left: 9px;
  content: "→";
  transition: transform 180ms ease;
}

.project-editorial-page .flo-call-cta .cta:hover,
.project-editorial-page .flo-call-cta .cta:focus-visible {
  outline: none;
  border-color: var(--portfolio-white);
  color: var(--portfolio-white);
  background-image: linear-gradient(105deg, rgba(11, 52, 82, 0.62), rgba(25, 93, 133, 0.32)), url("images/sky-meadow-landscape.jpg");
  box-shadow: 0 5px 0 rgba(23, 48, 68, 0.2);
  transform: translateY(-2px);
}

.project-editorial-page .flo-call-cta .cta:hover::after,
.project-editorial-page .flo-call-cta .cta:focus-visible::after {
  transform: translateX(3px);
}

.project-editorial-page .back-to-portfolio {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 0;
  padding: 28px clamp(28px, 9vw, 106px);
  box-sizing: border-box;
  align-items: center;
  border-top: 1px solid rgba(25, 69, 101, 0.16);
  background: var(--portfolio-paper-bright);
  text-align: center;
}

.project-editorial-page .back-to-portfolio p {
  margin: 0 0 16px;
  color: var(--portfolio-muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14.4px;
  text-align: center;
}

.project-editorial-page .cta-back {
  display: inline-flex;
  width: 200px;
  height: 48px;
  min-height: 48px;
  padding: 8px 16px;
  box-sizing: border-box;
  border: 1px solid rgba(255, 254, 245, 0.72);
  border-radius: 4px;
  align-items: center;
  justify-content: center;
  color: var(--portfolio-white);
  background-image: linear-gradient(105deg, rgba(11, 52, 82, 0.78), rgba(25, 93, 133, 0.46)), url("images/sky-meadow-landscape.jpg");
  background-position: center 68%;
  background-size: cover;
  font-size: 11.2px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow: 0 2px 0 rgba(23, 48, 68, 0.16);
  text-shadow: 0 2px 8px rgba(4, 48, 86, 0.35);
  transition: transform 180ms ease, color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.project-editorial-page .cta-back::after {
  margin-left: 9px;
  content: "→";
  transition: transform 180ms ease;
}

.project-editorial-page .cta-back:hover,
.project-editorial-page .cta-back:focus-visible {
  outline: none;
  border-color: var(--portfolio-white);
  color: var(--portfolio-white);
  background-image: linear-gradient(105deg, rgba(11, 52, 82, 0.62), rgba(25, 93, 133, 0.32)), url("images/sky-meadow-landscape.jpg");
  box-shadow: 0 5px 0 rgba(23, 48, 68, 0.2);
  transform: translateY(-2px);
}

.project-editorial-page .cta-back:hover::after,
.project-editorial-page .cta-back:focus-visible::after {
  transform: translateX(3px);
}

@keyframes portfolio-breathe {
  from { transform: scale(1.02) translate3d(-0.12%, 0, 0); }
  to { transform: scale(1.035) translate3d(0.12%, -0.14%, 0); }
}

@media (max-width: 820px) {
  .portfolio-page .project-cards {
    grid-template-columns: 1fr;
  }

  .portfolio-footer {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .portfolio-header nav ul {
    display: none;
    position: absolute;
    top: 76px;
    right: 20px;
    flex-direction: column;
    gap: 16px;
    min-width: 170px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    background: rgba(9, 53, 87, 0.78);
    box-shadow: 0 12px 28px rgba(4, 48, 86, 0.24);
    backdrop-filter: blur(10px);
  }

  .portfolio-header nav ul.show {
    display: flex;
  }

  .portfolio-header #hamburger {
    display: block;
    font-size: 24px;
    cursor: pointer;
  }

  .portfolio-page .portfolio {
    width: calc(100% - 40px);
    padding-top: 48px;
  }

  .portfolio-page .portfolio h2 {
    font-size: clamp(46.4px, 16vw, 67.2px);
  }

  .portfolio-footer {
    width: calc(100% - 40px);
    flex-direction: column;
    gap: 14px;
  }

  .project-editorial-page .project-details {
    width: calc(100% - 24px);
  }

  .project-editorial-page .back-to-portfolio {
    width: 100%;
  }

  .project-editorial-page .project-header {
    padding: 44px 24px 38px;
  }

  .project-editorial-page .project-header h2 {
    font-size: clamp(34.4px, 10.56vw, 48px);
  }

  .project-editorial-page .project-description {
    width: calc(100% - 48px);
  }

  .project-editorial-page .back-to-portfolio {
    padding: 24px;
  }

  .project-editorial-page .flo-call-cta {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-landscape {
    animation: none;
  }
}
