/* ============================================
   Portfolio — Clean, polished web-app feel
   ============================================ */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --text: #111;
  --text-secondary: #444;
  --text-muted: #8a8a8a;
  --bg: #fdfdfc;
  --bg-alt: #f6f5f4;
  --border: #e8e8e6;
  --border-light: #f0efee;
  --max-width: 1280px;
  --font: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}

::selection {
  background: var(--text);
  color: var(--bg);
}

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

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

/* ---- Layout ---- */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

section {
  padding: 5rem 0;
}

section + section {
  border-top: none;
}

/* ---- Typography ---- */

h1 {
  font-size: 2.75rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  text-wrap: balance;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
  text-wrap: balance;
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
  text-wrap: balance;
}

p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.65;
  letter-spacing: 0.006em;
  max-width: 640px;
  text-wrap: pretty;
}

/* ---- Header ---- */

.site-header {
  padding: 1.75rem 0;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-header .logo {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text);
}

.header-contact {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.header-contact:hover {
  color: var(--text);
}

.contact-drawer {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.contact-drawer button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  z-index: 1;
}

.contact-drawer-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  overflow: hidden;
  max-width: 0;
  opacity: 0;
  transform: translateX(1rem);
  transition: max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-drawer.open .contact-drawer-links {
  max-width: 24rem;
  opacity: 1;
  transform: translateX(0);
}

.contact-drawer-links a {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}

.contact-drawer-links a:hover {
  color: var(--text);
}

/* ---- Hero ---- */

.hero {
  padding: 12rem 0 8rem;
}

.hero h1 {
  margin-bottom: 1.75rem;
  opacity: 0;
  transform: translateY(24px);
  animation: heroReveal 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.1s forwards;
}

.hero p {
  font-size: 0.9375rem;
  line-height: 1.6;
  letter-spacing: 0.008em;
  margin-bottom: 1rem;
  opacity: 0;
  transform: translateY(16px);
}

.hero p:nth-of-type(1) {
  animation: heroReveal 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.35s forwards;
}

.hero p:nth-of-type(2) {
  animation: heroReveal 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.5s forwards;
}

.hero p:nth-of-type(3) {
  animation: heroReveal 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.65s forwards;
}

.hero p:last-child {
  margin-bottom: 0;
}

@keyframes heroReveal {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1.5px dashed var(--border);
  transition: border-color 0.2s;
}

.hero a:hover {
  border-color: var(--text);
}

/* ---- Section Label ---- */

.section-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  margin-bottom: 4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-label .arrow {
  font-size: 0.75rem;
}

/* ---- Selected Work ---- */

.work-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.work-item + .work-item {
  border-top: 0.5px solid var(--border);
  padding-top: 6rem;
  margin-top: 6rem;
}

.work-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.work-item:nth-child(even) {
  direction: rtl;
}

.work-item:nth-child(even) > * {
  direction: ltr;
}

.work-media {
  aspect-ratio: 16 / 11;
  overflow: hidden;
  border-radius: 10px;
  background: var(--bg-alt);
  border: 0.5px solid var(--border);
}



.work-media img,
.work-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* Phone mockup layouts */
.work-media-phones {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.phone-mock {
  flex: 1;
  aspect-ratio: 9 / 19.5;
  background: var(--border-light);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.phone-mock video,
.phone-mock img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Desktop gallery layout */
.work-media-gallery {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  aspect-ratio: auto;
  background: none;
  border: none;
  border-radius: 0;
}

.work-media-gallery img {
  width: 100%;
  display: block;
  border-radius: 10px;
  border: 0.5px solid var(--border);
}

.gallery-secondary {
  display: flex;
  gap: 0.75rem;
}

.gallery-secondary img {
  flex: 1;
  min-width: 0;
  object-fit: cover;
}

.work-media-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: var(--bg-alt);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.work-content {
  padding-top: 0.25rem;
}

.work-content h3 {
  margin-bottom: 0.375rem;
}

.work-outcome {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.4;
  letter-spacing: 0.005em;
  margin-bottom: 1.5rem;
}

.work-body {
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.008em;
  max-width: 540px;
  margin-bottom: 1rem;
}

.work-link {
  font-size: 0.9375rem;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1.5px dashed var(--border);
  transition: border-color 0.2s;
}

.work-link:hover {
  border-color: var(--text);
}


/* ---- Footer ---- */

.site-footer {
  padding: 4rem 0 3rem;
  border-top: 0.5px solid var(--border);
}

.footer-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-left p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.footer-right {
  display: flex;
  gap: 1.5rem;
}

.footer-right a {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-right a:hover {
  color: var(--text);
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
  .container {
    padding: 0 1.5rem;
  }

  section {
    padding: 3.5rem 0;
  }

  .contact-drawer {
    position: relative;
  }

  .contact-drawer-links {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    max-width: none;
    max-height: 0;
    transform: translateY(-0.5rem);
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .contact-drawer.open .contact-drawer-links {
    max-width: none;
    max-height: 6rem;
    transform: translateY(0);
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  /* Hero — take up ~85vh so the first work item peeks in */
  .hero {
    min-height: calc(85vh - 60px);
    display: flex;
    align-items: flex-end;
    padding: 0 0 3rem;
  }

  .hero .container {
    width: 100%;
  }

  .hero h1 {
    margin-bottom: 1.25rem;
  }

  .hero p {
    font-size: 0.875rem;
    letter-spacing: 0.015em;
    line-height: 1.6;
  }

  /* Work */
  h3 {
    font-size: 1.25rem;
  }

  .work-outcome {
    font-size: 0.875rem;
    margin-bottom: 1.125rem;
  }

  .work-body {
    font-size: 0.875rem;
    letter-spacing: 0.015em;
    line-height: 1.6;
  }

  .work-link {
    font-size: 0.875rem;
  }

  .work-grid {
    gap: 0;
  }

  .work-item + .work-item {
    padding-top: 4rem;
    margin-top: 4rem;
  }

  .work-item,
  .work-item:nth-child(even) {
    grid-template-columns: 1fr;
    direction: ltr;
    gap: 1.25rem;
  }

  .work-media-phones {
    gap: 0.625rem;
  }

  .work-item:hover .work-media img,
  .work-item:hover .work-media video {
    transform: none;
  }

  /* Footer */
  .footer-main {
    flex-direction: column;
    gap: 1.5rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.75rem;
  }

  .site-header .container {
    gap: 1rem;
  }
}
