/* Shared styles — portfolio */

/* ===========================
   IVY MODE FONT FACES
=========================== */
@font-face {
  font-family: 'Ivy Mode';
  src: url('fonts/IvyMode-Thin.woff2') format('woff2');
  font-weight: 100;
  font-style: normal;
  font-display: fallback;
}
@font-face {
  font-family: 'Ivy Mode';
  src: url('fonts/IvyMode-ThinItalic.woff2') format('woff2');
  font-weight: 100;
  font-style: italic;
  font-display: fallback;
}
@font-face {
  font-family: 'Ivy Mode';
  src: url('fonts/IvyMode-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: fallback;
}
@font-face {
  font-family: 'Ivy Mode';
  src: url('fonts/IvyMode-LightItalic.woff2') format('woff2');
  font-weight: 300;
  font-style: italic;
  font-display: fallback;
}

/* ===========================
   RESET & BASE
=========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:               #ffffff;
  --text:             #0a0a0a;
  --text-2:           #3a3a3a;
  --text-3:           #767676;
  --border:           #d0d0d0;
  --border-light:     #ebebeb;
  --hero-bg:          #f9f8f5;
  --hero-border:      #eeeeee;
  --cs-text-muted:    #6f6e63;
  --surface:          #f4f4f4;
  --surface-hover:    #e8e8e8;
  --tag-bg:           #ededed;
  --tag-text:         #2a2a2a;
  --font-display:     'Ivy Mode', 'Cormorant Garamond', Georgia, serif;
  --font-text:        'Red Hat Text', system-ui, sans-serif;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-text);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* ===========================
   LAYOUT
=========================== */
.wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 48px;
}

@media (max-width: 768px) {
  .wrap { padding: 0 24px; }
}

/* ===========================
   SITE NAV
=========================== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
}

.site-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  padding-bottom: 20px;
}

.site-nav-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--text);
}

.site-nav-brand:hover { opacity: 0.65; }
.site-nav-brand:focus {
  outline: 0px solid var(--text);
  outline-offset: 3px;
}

.site-nav-logo-lg { display: block; height: 17px; width: auto; }
.site-nav-logo-sm { display: none;  height: 24px; width: auto; }

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav-link {
  font-family: var(--font-text);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.15s;
}

.site-nav-link:hover { color: var(--text); }
.site-nav-link:focus {
  outline: 0px solid var(--text);
  outline-offset: 2px;
}

.site-nav-link img { width: 26px; height: 22px; display: block; }

.site-nav-link[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: .8px;
  text-underline-offset: 0.6em;
}

.site-nav-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

@media (max-width: 768px) {
  .site-nav-inner { padding: 20px 24px; }
  .site-nav-logo-lg { display: none; }
  .site-nav-logo-sm { display: block; }
  .site-nav-links { gap: 20px; }
}

/* ===========================
   SITE FOOTER
=========================== */
.site-footer {
  border-top: 1px solid var(--border-light);
}

.site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  padding-bottom: 24px;
}

.site-footer-label {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.site-footer-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-footer-link {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  transition: color 0.15s;
}

.site-footer-link:hover { color: var(--text); }

/* ===========================
   MODAL
=========================== */
.modal-scrim {
  position: fixed;
  inset: 0;
  background: rgba(247, 244, 240, 0.8);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.modal-scrim.is-open {
  opacity: 1;
  pointer-events: all;
}

.modal-dialog {
  background: #ffffff;
  width: 90%;
  max-width: 1200px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(40px);
  transition: transform 400ms cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  outline: none;
  box-shadow: 0 8px 40px rgba(0,0,0,0.12);
}

.modal-scrim.is-open .modal-dialog {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 1;
}

.modal-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.modal-title-client {
  font-family: var(--font-text);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  flex-shrink: 0;
}

.modal-title-project {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 300;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-close {
  font-family: var(--font-text);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
  flex-shrink: 0;
}

.modal-close:hover { color: var(--text); }
.modal-close:focus {
  outline: 0px solid var(--text);
  outline-offset: 2px;
  border-radius: 1px;
}

.modal-images {
  background-color: #ffffff;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Case-study iframe variant — larger modal, iframe body */
.modal-scrim.is-cs .modal-dialog {
  width: 94vw;
  max-width: 1440px;
  height: 92vh;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

/* Full-screen on mobile so the case study isn't cramped */
@media (max-width: 768px) {
  .modal-scrim.is-cs .modal-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    box-shadow: none;
  }
}

/* Let the images container grow to fill remaining dialog height */
.modal-scrim.is-cs .modal-images {
  flex: 1;
  padding: 0;
  min-height: 0;
  gap: 0;
}

.modal-cs-frame {
  flex: 1;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: var(--border-light);
}
