/* =============================================
   Portfolio, inspired by danielautry.com
   ============================================= */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

@media (min-width: 1440px) {
  html { font-size: 24px; }
}

@media (min-width: 2200px) {
  html { font-size: 32px; }
}

body {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 300;
  margin: 0;
  padding: 0;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6, p {
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
  padding: 0;
}

button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
  margin: 0;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---- Theme ---- */

.body-dark,
.dark {
  background-color: #121212;
  color: #d5d5d5;
}

.light {
  background-color: #e9e9e9;
  color: #121212;
}

.dark .nav-domain,
.dark .body-text,
.dark .nav-meta {
  color: #c3c3c3;
}

.dark .hero-title,
.dark h2,
.dark h3,
.dark .contact-title {
  color: #d5d5d5;
}

.dark .border-bottom,
.dark .border-right {
  border-color: #2d2d2d;
}

.dark .icon {
  fill: #c3c3c3;
}

.dark .logo-box {
  background: #c3c3c3;
}

.dark .logo-box .logo-text {
  color: #121212;
}

.dark .text-link {
  color: #8bafd6;
}

.dark .text-link:visited {
  color: #c3c3c3;
}

.dark .nav-label {
  color: rgba(255, 255, 255, 0.6);
}

.dark .nav-overlay-link.inactive {
  color: #3a3a3a;
}

.dark .arrow-link {
  border-color: #2d2d2d;
  color: #d5d5d5;
}

.dark .arrow-link:hover {
  background: #1f1f1f;
}

.dark .arrow-link.inactive {
  color: #3a3a3a;
  border-color: #3a3a3a;
  pointer-events: none;
}

.dark .nav-link:hover,
.dark .menu-btn:hover {
  color: #999;
}

.dark .theme-btn:hover .icon {
  fill: #aaa;
}

/* Light theme overrides */
.light .nav-domain,
.light .body-text,
.light .nav-meta {
  color: #0a0a0a;
}

.light .hero-title,
.light h2,
.light h3,
.light .contact-title {
  color: #050505;
}

.light .border-bottom,
.light .border-right {
  border-color: #c3c3c3;
}

.light .icon {
  fill: none;
  stroke: #0a0a0a;
  stroke-width: 20;
}

.light .current-icon {
  fill: #0a0a0a;
  stroke: none;
}

.light .logo-box {
  background: #121212;
}

.light .logo-box .logo-text {
  color: #fafafa;
}

.light .text-link:visited {
  color: #0a0a0a;
}

.light .nav-label {
  color: rgba(0, 0, 0, 0.5);
}

.light .nav-overlay-link.inactive {
  color: #c3c3c3;
}

.light .arrow-link {
  border-color: #c3c3c3;
  color: #121212;
}

.light .arrow-link:hover {
  background: #d5d5d5;
}

.light .nav-link:hover,
.light .menu-btn:hover {
  color: #6a6a6a;
}

.light .nav-overlay {
  background-color: #e9e9e9;
}

.dark .nav-overlay {
  background-color: #121212;
}

/* ---- Layout ---- */

.container {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  min-height: 100vh;
}

.animation-wrapper {
  animation: fadeInHome 1s ease-in forwards;
  opacity: 0;
  width: 100%;
}

@keyframes fadeInHome {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.row {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
}

.row-split {
  align-items: stretch;
}

/* ---- Navigation ---- */

.nav {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 4rem 4rem 2rem;
}

.nav-left,
.nav-right {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  font-size: 1.25rem;
}

.nav-left span,
.nav-right span {
  padding-right: 1rem;
}

.nav-domain {
  padding-right: 1rem;
}

.nav-link {
  cursor: pointer;
  transition: color 0.2s ease;
}

.menu-btn {
  padding-right: 1rem;
}

.theme-btn {
  display: flex;
  align-items: center;
}

.icon {
  display: block;
}

.icon-sm {
  width: 2.25rem;
  height: 2.25rem;
}

.icon-md {
  width: 3rem;
  height: 3rem;
}

.icon-xsm {
  width: 1.5rem;
  height: 1.5rem;
  margin-left: 0.5rem;
}

/* ---- Menu Overlay ---- */

.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  opacity: 0;
  overflow: hidden;
  z-index: 1000;
  transition: opacity 0.5s ease-in, height 0.5s ease-in-out;
}

.nav-overlay.open {
  height: 100%;
  opacity: 1;
  overflow-y: auto;
}

.nav-overlay-content {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: calc(100% - 8rem);
}

.nav-overlay-block {
  padding: 1rem 4rem 4rem;
  display: flex;
  flex-direction: column;
}

.nav-overlay-main {
  width: 34%;
}

.nav-overlay-work {
  width: 66%;
}

.nav-label {
  font-size: 1rem;
  text-transform: uppercase;
  margin-bottom: 2rem;
  letter-spacing: 0.05em;
}

.nav-overlay-link {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}

.nav-overlay-link:hover:not(.inactive) {
  color: #999;
}

.nav-overlay-link.inactive {
  pointer-events: none;
}

.nav-hint {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.45);
  margin: -1rem 0 2rem;
  max-width: 20rem;
}

.light .nav-hint {
  color: rgba(0, 0, 0, 0.45);
}

.nav-work-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  max-width: 28rem;
  padding: 1.25rem 0;
  border: none;
  border-top: 1px solid #2d2d2d;
  background: none;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.2s ease;
}

.nav-work-item:last-child {
  border-bottom: 1px solid #2d2d2d;
}

.light .nav-work-item {
  border-color: #c3c3c3;
}

.nav-work-item:hover {
  color: #999;
}

.nav-work-title {
  font-size: 1.25rem;
  margin-bottom: 0.35rem;
}

.nav-work-meta {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 0.75rem;
}

.light .nav-work-meta {
  color: rgba(0, 0, 0, 0.45);
}

.nav-work-action {
  font-size: 1rem;
  color: #8bafd6;
}

.light .nav-work-action {
  color: #0a0a0a;
}

/* ---- Work / Portfolio section ---- */

.portfolio-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.portfolio-section .work-card + .work-card {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid #2d2d2d;
}

.light .portfolio-section .work-card + .work-card {
  border-color: #c3c3c3;
}

.portfolio-section .work-card {
  width: 100%;
  padding: 0;
  border: none;
  background: none;
}

.portfolio-section .work-card-inner {
  padding-top: 0;
}

.section-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.45);
  margin: 0 0 1rem;
}

.light .section-label {
  color: rgba(0, 0, 0, 0.45);
}

.work-card {
  display: block;
  width: 100%;
  text-align: left;
  font-family: inherit;
  color: inherit;
}

.work-card-inner {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
  gap: 2rem;
}

.work-card-text {
  max-width: 40rem;
}

.work-card-tag {
  display: inline-block;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 1rem;
}

.light .work-card-tag {
  color: rgba(0, 0, 0, 0.45);
}

.work-card-title {
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1.2;
  margin: 0;
}

.work-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.work-card-case-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.4rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 5rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.work-card-info-icon {
  width: 0.9rem;
  height: 0.9rem;
  display: block;
  flex-shrink: 0;
}

.work-card-case-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.4);
  color: rgba(255, 255, 255, 0.9);
}

.light .work-card-case-btn {
  border-color: rgba(0, 0, 0, 0.2);
  color: rgba(0, 0, 0, 0.55);
}

.light .work-card-case-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.35);
  color: rgba(0, 0, 0, 0.85);
}

.work-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 1.25rem;
}

.work-card-cta {
  display: inline-block;
  font-size: 1.25rem;
  color: #c99700;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.work-card-cta:hover {
  text-decoration: underline;
}

.light .work-card-cta {
  color: #a67c00;
}

.work-card-arrow {
  flex-shrink: 0;
  pointer-events: none;
}

@media (max-width: 450px) {
  .work-card-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .work-card-arrow {
    margin-top: 1rem;
  }
}

/* ---- Blocks / Grid ---- */

.block {
  padding: 4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.block-full {
  width: 100%;
}

.block-half {
  width: 50%;
}

.block-third {
  width: 33.333%;
}

.border-bottom {
  border-bottom: 1px solid;
}

.border-right {
  border-right: 1px solid;
}

.block-inner {
  width: 90%;
}

.block-content {
  margin-bottom: 3rem;
}

.block-text {
  max-width: 40rem;
}

.block-text-wide {
  max-width: 40rem;
  margin-bottom: 2rem;
}

.block-split {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.block-split.reverse {
  flex-direction: row-reverse;
}

.block-illustration {
  width: 33%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.illustration {
  width: 15rem;
  height: auto;
  color: #c3c3c3;
}

.light .illustration {
  color: #121212;
}

/* ---- Profile & Hero ---- */

.profile-wrap {
  margin-bottom: 1.5rem;
}

.profile-img {
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 100%;
  object-fit: cover;
  filter: grayscale(100%);
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 300;
  line-height: 1.1;
}

.name {
  font-weight: inherit;
}

/* ---- Typography ---- */

h2 {
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1.2;
  max-width: 40rem;
}

.body-text {
  font-size: 1.25rem;
  line-height: 1.5;
  margin-top: 0.75rem;
  max-width: 40rem;
}

.body-text + .body-text {
  margin-top: 1.25rem;
}

.block-half h2 {
  margin-bottom: 0;
}

.block-half .body-text:first-of-type {
  margin-top: 1rem;
}

.footer-label {
  font-size: 1.75rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
}

.contact-title {
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1.3;
  max-width: 40rem;
  margin-bottom: 1.5rem;
}

.footer-note {
  font-size: 1.25rem;
  line-height: 1.5;
  color: #c3c3c3;
  max-width: 40rem;
}

.light .footer-note {
  color: #0a0a0a;
}

/* ---- Logos ---- */

.logo-wrap {
  margin-bottom: 1.5rem;
}

.logo-box {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-text {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ---- Arrow Links ---- */

.arrow-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border: 1px solid;
  border-radius: 5rem;
  padding: 0.5rem 2rem;
  width: fit-content;
  transition: all 0.3s ease;
  margin-top: auto;
  font-family: inherit;
}

button.arrow-link,
button.portfolio-open.nav-overlay-link,
button.work-card {
  cursor: pointer;
}

.nav-overlay-link.portfolio-open {
  background: none;
  border: none;
  text-align: left;
  width: 100%;
}

/* ---- Portfolio modal ---- */

body.portfolio-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

.portfolio-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.portfolio-modal.open {
  opacity: 1;
  visibility: visible;
}

.portfolio-modal-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #000;
  transform: translateY(8px);
  transition: transform 0.35s ease;
}

.portfolio-modal.open .portfolio-modal-panel {
  transform: translateY(0);
}

.portfolio-modal-float-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.portfolio-modal-float-close:hover {
  background: rgba(0, 0, 0, 0.75);
  border-color: rgba(255, 255, 255, 0.45);
}

.light .portfolio-modal-float-close {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.15);
  color: #121212;
}

.portfolio-modal-iframe {
  flex: 1;
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}

/* ---- Case study modal ---- */

.case-study-modal {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.case-study-modal.open {
  opacity: 1;
  visibility: visible;
}

.case-study-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(0, 0, 0, 0.65);
  cursor: pointer;
}

.light .case-study-backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.case-study-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 38rem;
  max-height: min(85vh, 40rem);
  overflow-y: auto;
  padding: 2rem 2rem 1.75rem;
  background: #1a1a1a;
  border: 1px solid #2d2d2d;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.3s ease;
}

.case-study-modal.open .case-study-panel {
  transform: translateY(0) scale(1);
}

.light .case-study-panel {
  background: #f0f0f0;
  border-color: #c3c3c3;
}

.case-study-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.15rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.case-study-close:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.35);
}

.light .case-study-close {
  border-color: rgba(0, 0, 0, 0.15);
}

.light .case-study-close:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.25);
}

.case-study-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.45);
  margin: 0 0 0.75rem;
}

.light .case-study-label {
  color: rgba(0, 0, 0, 0.45);
}

.case-study-title {
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.25;
  margin: 0 0 1.25rem;
  padding-right: 2rem;
}

.case-study-body .body-text {
  margin-bottom: 1rem;
}

.case-study-body .body-text:last-child {
  margin-bottom: 0;
}

.case-study-lead {
  font-size: 1.1rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.85);
}

.light .case-study-lead {
  color: rgba(0, 0, 0, 0.8);
}

.case-study-list {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  font-size: inherit;
  line-height: 1.5;
}

.case-study-list li {
  margin-bottom: 0.45rem;
}

.case-study-list li:last-child {
  margin-bottom: 0;
}

/* ---- Utilities ---- */

.u-hide-mobile {
  display: flex;
  flex-direction: row;
  align-items: center;
}

/* ---- Responsive ---- */

@media (max-width: 767px) {
  .u-hide-mobile {
    display: none;
  }
}

@media (max-width: 450px) {
  .nav {
    padding: 1.5rem 1.5rem 0;
  }

  .block {
    padding: 1.5rem;
  }

  .block-half,
  .block-third {
    width: 100%;
  }

  .border-right {
    border-right: none;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .block-split,
  .block-split.reverse {
    flex-direction: column;
    align-items: flex-start;
  }

  .block-illustration {
    width: 100%;
    margin-top: 2rem;
  }

  .illustration {
    width: 5rem;
  }

  .profile-img {
    width: 4rem;
    height: 4rem;
  }

  .nav-overlay-main,
  .nav-overlay-work {
    width: 100%;
  }

  .nav-overlay-block {
    padding: 1.5rem;
  }

  .nav-overlay-content {
    flex-direction: column;
    height: auto;
  }

  h2 {
    line-height: 1.1;
  }

  .body-text,
  .footer-note {
    max-width: 100%;
  }
}
