/* ===== Reset / base ===== */
:root {
  --gutter: clamp(20px, 4vw, 64px);
  --rail-icon: 34px;
  --rail-clearance: 16px;
}
body {
  margin: 0;
  background: #ffffff;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
a {
  color: #0055e9;
  text-decoration: none;
}
a:hover {
  color: #0044bd;
}

/* ===== Animations ===== */
@keyframes dcFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes dcType {
  from { width: 0; }
  to { width: 19ch; }
}
@keyframes dcCaret {
  50% { border-color: transparent; }
}

/* ===== Page shell ===== */
.page {
  position: relative;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--gutter);
  box-sizing: border-box;
  background: #ffffff;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  transition: background-color 480ms cubic-bezier(.2, .7, .25, 1);
}
.site-title {
  margin: 0;
  text-align: center;
  font-size: clamp(32px, 5vw, 62px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.88;
  color: #0055e9;
  transition: color 480ms cubic-bezier(.2, .7, .25, 1);
}

/* ===== Social rail (left side) ===== */
.social-rail {
  position: fixed;
  left: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 5;
}
.social-rail__row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mail-btn {
  display: block;
  flex: none;
  width: 34px;
  height: 34px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: #0055e9;
  transition: opacity 120ms cubic-bezier(.2, .7, .25, 1), color 420ms cubic-bezier(.2, .7, .25, 1);
}
.mail-btn:hover {
  opacity: 0.6;
}
.mail-btn__icon {
  display: block;
}
.email-toast {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid #0055e9;
  background: #ffffff;
  padding: 6px 6px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #0055e9;
  animation: dcType 0.6s steps(19, end) forwards, dcCaret 0.5s step-end infinite;
}
.social-link {
  display: block;
  width: 34px;
  height: 34px;
  background: #0055e9;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  transition: opacity 120ms cubic-bezier(.2, .7, .25, 1), background-color 420ms cubic-bezier(.2, .7, .25, 1);
}
.social-link:hover {
  opacity: 0.6;
}
.social-link--instagram {
  -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/simple-icons@13/icons/instagram.svg);
  mask-image: url(https://cdn.jsdelivr.net/npm/simple-icons@13/icons/instagram.svg);
}
.social-link--behance {
  -webkit-mask-image: url(https://cdn.jsdelivr.net/npm/simple-icons@13/icons/behance.svg);
  mask-image: url(https://cdn.jsdelivr.net/npm/simple-icons@13/icons/behance.svg);
}

/* ===== Mark (About trigger) + speech bubble ===== */
.mark-wrap {
  position: relative;
  align-self: stretch;
  width: 100%;
  flex: 1 1 0;
  height: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mark-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  padding: clamp(28px, 6vh, 80px) 0;
  cursor: pointer;
  transform: scale(1);
  opacity: 1;
  transition: transform 520ms cubic-bezier(.2, .7, .25, 1), opacity 420ms cubic-bezier(.2, .7, .25, 1);
}
.mark-btn:hover {
  transform: scale(1.03);
}
.mark-btn:focus {
  outline: none;
}
.page--about .mark-btn {
  transform: scale(0.12);
  opacity: 0;
  pointer-events: none;
}
.mark-img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(
    78vw,
    var(--mark-width),
    calc((50vw - var(--gutter) - var(--rail-icon) - var(--rail-clearance)) * 2)
  );
  max-height: 100%;
  object-fit: contain;
}
/* ===== About view (page invert) ===== */
.page--about {
  background: #0055e9;
}
.page--about .site-title {
  color: #ffffff;
  cursor: pointer;
}
.page--about .mail-btn {
  color: #ffffff;
}
.page--about .social-link {
  background: #ffffff;
}

.about-view {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 4vw, 64px);
  width: 100%;
  max-width: calc(100vw - 2 * (var(--gutter) + var(--rail-icon) + var(--rail-clearance)));
  margin: 0 auto;
  box-sizing: border-box;
  transform: scale(0.12);
  opacity: 0;
  pointer-events: none;
  transition: transform 520ms cubic-bezier(.2, .7, .25, 1), opacity 420ms cubic-bezier(.2, .7, .25, 1);
}
.page--about .about-view {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}
.about-view__text {
  flex: 1 1 0;
  max-width: 300px;
  margin: 0;
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.5;
  color: #ffffff;
}
.about-view__photo {
  display: block;
  flex: none;
  width: auto;
  height: auto;
  max-width: min(30vw, 380px);
  max-height: 60vh;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 420ms cubic-bezier(.2, .7, .25, 1);
}
.about-view__photo:hover {
  transform: scale(1.03);
}

@media (max-width: 700px) {
  .about-view {
    flex-direction: column;
    max-width: 90vw;
    gap: 20px;
  }
  .about-view__text {
    max-width: 100%;
    text-align: center;
  }
  .about-view__photo {
    max-width: 60vw;
    max-height: 38vh;
  }
}

/* ===== Project nav ===== */
.nav {
  display: flex;
  justify-content: center;
  align-items: end;
  flex-wrap: wrap;
  gap: clamp(32px, 7vw, 120px);
  padding-bottom: clamp(4px, 2vh, 24px);
  opacity: 1;
  visibility: visible;
  transition: opacity 320ms ease, visibility 0s linear 0s;
}
.page--about .nav {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 320ms ease, visibility 0s linear 320ms;
}
.nav-link {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  white-space: nowrap;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(18px, 2.2vw, 35px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0055e9;
  transition: color 120ms cubic-bezier(.2, .7, .25, 1), transform 200ms cubic-bezier(.2, .7, .25, 1);
}
.nav-link:hover {
  color: #0055e9;
  transform: scale(1.44);
}

/* ===== Project overlay ===== */
.project-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: #0055e9;
  overflow: hidden;
  box-sizing: border-box;
  animation: dcFadeIn 200ms cubic-bezier(.2, .7, .25, 1);
}
.project-overlay__back {
  position: absolute;
  top: 24px;
  left: clamp(24px, 4vw, 48px);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 48px;
  font-weight: 700;
  color: #ffffff;
  transition: opacity 120ms cubic-bezier(.2, .7, .25, 1);
}
.project-overlay__back:hover {
  opacity: 0.7;
}
.project-overlay__title {
  position: absolute;
  left: clamp(24px, 7vw, 64px);
  top: 38%;
  margin: 0;
  max-width: 11ch;
  font-size: clamp(60px, 11.5vw, 132px);
  font-weight: 2000;
  letter-spacing: -0.03em;
  line-height: 1.06;
  color: #ffffff;
}
