/* =============================================================
   BRYAN RUIZ — PORTFOLIO
   Stylesheet — generated from Figma design (node 1682:2023)
   Design canvas: 1638px wide | Tech: Vanilla HTML/CSS/JS
   ============================================================= */

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* ---------------------------------------------------------------
   DESIGN TOKENS
--------------------------------------------------------------- */
:root {
  /* Colors */
  --color-bg: #0c0c0c;
  --color-text: #f1f1f1;
  --color-text-nav: #f5f5f5;
  --color-cream: #fffbf7;
  --color-white: #ffffff;

  /* Fonts */
  --font-logo: 'Jost', 'Futura', 'Century Gothic', sans-serif;
  --font-heading: 'Overused Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Fluid type scale (design base: 1638px) */
  --text-logo: clamp(26px, 2.93vw, 48px);
  --text-nav: clamp(14px, 1.59vw, 26px);
  --text-hero-name: clamp(36px, 4.88vw, 80px);
  --text-hero-title: clamp(13px, 1.47vw, 24px);
  --text-section-h: clamp(52px, 8.55vw, 140px);
  --text-section-body: clamp(16px, 2.2vw, 36px);
  --text-btn: clamp(20px, 2.93vw, 48px);
  --text-apps-h: clamp(22px, 3.54vw, 58px);

  /* Spacing */
  --nav-h: 104px;
  --page-x: clamp(24px, 5.5vw, 90px);
}

/* ---------------------------------------------------------------
   NAVIGATION
--------------------------------------------------------------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 40px 0;
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
}

.nav--scrolled {
  background-color: rgba(12, 12, 12, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 20px 0;
}

.nav__inner {
  max-width: 1638px;
  margin: 0 auto;
  padding: 0 var(--page-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-family: var(--font-logo);
  font-weight: 500;
  font-size: var(--text-logo);
  letter-spacing: -0.08em;
  color: var(--color-text-nav);
  line-height: 1;
  transition: opacity 0.2s ease;
}

.nav__logo:hover {
  opacity: 0.7;
}

.nav__menu {
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.93vw, 48px);
}

.nav__link {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-nav);
  letter-spacing: -0.01em;
  color: var(--color-text-nav);
  transition: opacity 0.2s ease;
}

.nav__link:hover {
  opacity: 0.6;
}

.nav__link--active {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

/* ---------------------------------------------------------------
   HERO
--------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  /* height matches design banner (766px) + top padding for fixed nav */
  min-height: clamp(520px, 50vw, 810px);
  padding-top: var(--nav-h);
  display: flex;
  align-items: stretch;
}

.hero__container {
  max-width: 1638px;
  width: 100%;
  margin: 0 auto;
  padding: 0 clamp(24px, 9.77vw, 160px);
  display: flex;
  align-items: stretch;
  justify-content: center;
  position: relative;
}

/* Ambient glow behind the photo */
.hero__glow {
  position: absolute;
  width: clamp(160px, 16.85vw, 276px);
  height: clamp(160px, 16.85vw, 276px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 0%, transparent 70%);
  filter: blur(50px);
  top: 31%;
  left: 50%;
  transform: translate(-30%, -50%);
  pointer-events: none;
  z-index: 0;
}

/* Profile photo wrapper — centered in the viewport */
.hero__photo-wrap {
  width: clamp(260px, 39vw, 639px);
  align-self: flex-end;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.hero__photo {
  width: 100%;
  height: clamp(380px, 45.5vw, 746px);
  object-fit: cover;
  object-position: top center;
  display: block;
}

/* Text block — absolutely positioned on the right so the photo stays centered */
.hero__text-outer {
  position: absolute;
  right: clamp(32px, 13.43vw, 220px);
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
}

.hero__text {
  width: clamp(180px, 22.83vw, 374px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(12px, 1.83vw, 30px);
  position: relative;
  z-index: 2;
}

.hero__name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-hero-name);
  letter-spacing: -0.08em;
  color: var(--color-text);
  line-height: 1;
  white-space: nowrap;
}

.hero__title {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-hero-title);
  letter-spacing: -0.08em;
  color: var(--color-text);
  text-align: right;
}

/* ---------------------------------------------------------------
   SHARED SECTION STYLES
--------------------------------------------------------------- */
.section {
  padding: clamp(80px, 7.3vw, 120px) 0;
}

.section__container {
  max-width: 1638px;
  margin: 0 auto;
  /* Horizontal padding: ~5vw maps to ~82px at 1638px design width */
  padding: 0 clamp(20px, 5vw, 82px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(30px, 5.5vw, 90px);
  /* Prevent overflowing flex children from clipping left edge */
  overflow: hidden;
}

.section__content {
  /* Grow to fill available space; max-width caps at design value */
  flex: 1 1 auto;
  min-width: 0;
  max-width: 858px;
}

.section__heading {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: var(--text-section-h);
  /* Product Design: -5.6px / 140px = -4% | Visuals: -8.4px / 140px = -6% */
  letter-spacing: -0.05em;
  color: var(--color-text);
  line-height: 0.95;
  margin-bottom: clamp(18px, 1.89vw, 31px);
}

.section--visuals .section__heading {
  letter-spacing: -0.06em;
}

.section__body {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: var(--text-section-body);
  letter-spacing: -0.02em;
  color: var(--color-text);
  line-height: 1.3;
  max-width: 555px;
  margin-bottom: clamp(28px, 2.93vw, 48px);
}

/* ---------------------------------------------------------------
   BUTTON — Outlined pill
--------------------------------------------------------------- */
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: clamp(12px, 1.22vw, 20px) clamp(20px, 2.44vw, 40px);
  border: 1px solid var(--color-white);
  border-radius: 99px;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: var(--text-btn);
  letter-spacing: -0.04em;
  color: var(--color-text);
  min-width: clamp(180px, 24.24vw, 397px);
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.btn-outline:hover {
  background-color: var(--color-white);
  color: var(--color-bg);
}

.btn-outline svg {
  flex-shrink: 0;
  width: clamp(14px, 1.34vw, 22px);
  height: auto;
  transition: transform 0.2s ease;
}

.btn-outline:hover svg {
  transform: translate(2px, -2px);
}

/* ---------------------------------------------------------------
   FOLDER ILLUSTRATION (Product Design)
--------------------------------------------------------------- */
.folder-wrap {
  /* 421px / 1638px = 25.7% */
  flex-shrink: 0;
}

.folder {
  position: relative;
  width: clamp(140px, 19.27vw, 316px);
  padding: 10px 10px 10px 10px;
}

.folder__photo {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  max-height: 70%;
  object-fit: cover;
  object-position: center bottom;
  z-index: 0;
}

.folder .folder__photo,
.visuals-folder .folder__photo {
  position: absolute;
  width: 70%;
  height: 60%;
  object-fit: cover;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
}

.folder__bg {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  z-index: 1;
  clip-path: url(#folder-shape);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  background: rgba(255, 255, 255, 0.15);
}

.folder__bg>svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Screen mockup positioned inside the folder opening */
.folder__screen {
  position: absolute;
  /* Values derived from Figma: screen at x≈10.67, y≈61 within the 421x340 folder */
  left: 2.5%;
  top: 17.9%;
  width: 41.6%;
  /* 175px / 421px */
  height: 70.3%;
  /* 239px / 340px */
  overflow: hidden;
  border-radius: 3px;
  z-index: 2;
}

.folder__screen img {
  width: 185%;
  height: 185%;
  object-fit: cover;
  transform: rotate(15deg) translateX(-20%) translateY(-15%);
  filter: blur(1.5px) brightness(0.95);
}

/* "Explore →" label on folder */
.folder__label {
  position: absolute;
  /* Aligned to the right side of the folder: x≈279, y≈0, within the 384px inner width */
  right: 2.5%;
  top: 17%;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(13px, 1.47vw, 24px);
  color: var(--color-white);
  letter-spacing: -0.05em;
  z-index: 3;
  white-space: nowrap;
}

.folder__label--sm {
  font-size: clamp(11px, 1.22vw, 20px);
}

.folder__label-line {
  position: absolute;
  right: 2.5%;
  top: calc(17% + clamp(18px, 2vw, 32px));
  width: clamp(70px, 6.52vw, 107px);
  height: 1.5px;
  background-color: var(--color-white);
  z-index: 3;
}

.folder__label-line--sm {
  width: clamp(60px, 5.49vw, 90px);
  top: calc(17% + clamp(16px, 1.83vw, 30px));
}

/* ---------------------------------------------------------------
   VISUALS GALLERY (scattered photos)
--------------------------------------------------------------- */
.visuals-gallery {
  position: relative;
  flex: 0 1 clamp(220px, 44.93vw, 736px);
  min-width: 220px;
  /* Gallery occupies x: 932–1668 (736px), y: 90–812 (722px) in design */
  width: clamp(220px, 44.93vw, 736px);
  height: clamp(280px, 44.08vw, 722px);
}

/* Folder illustration in visuals section */
.visuals-folder {
  position: absolute;
  /* Folder at x=1010, y=2169 → relative to gallery: x=(1010-932)=78, y=(2169-1870-99)=200 */
  /* As % of gallery: left=78/736=10.6%, top=200/722=27.7% */
  left: 10.6%;
  top: 27.7%;
  width: clamp(140px, 19.27vw, 316px);
  /* ~43% of gallery width at design scale */
  z-index: 3;
  padding: 40px 20px 20px 20px;
}

.visuals-folder img {
  width: 100%;
  height: auto;
  display: block;
}

/* Scattered screenshots — positions derived from Figma coordinates */
/* All positions relative to gallery origin (x=932, y=1870+99=1969 approx) */

/* Screenshot 1 (190x290): x=932, y=1975 → left=0%, top=0.8% */
.visuals-img {
  position: absolute;
  object-fit: cover;
  border-radius: clamp(8px, 0.73vw, 12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.visuals-img--1 {
  width: clamp(72px, 11.6vw, 190px);
  /* aspect-ratio approx 190:290 = 0.655 */
  aspect-ratio: 190 / 290;
  left: 0%;
  top: 0.8%;
  z-index: 1;
}

/* Screenshot 2 (232x301): x=1282, y=2381 → left=(1282-932)/736=47.6%, top=(2381-1969)/722=57% */
.visuals-img--2 {
  width: clamp(88px, 14.16vw, 232px);
  aspect-ratio: 232 / 301;
  left: 47.6%;
  top: 57%;
  z-index: 2;
}

/* Screenshot 3 (234x267): x=1434, y=1960 → left=(1434-932)/736=68.2%, top=(1960-1969)/722=0% */
.visuals-img--3 {
  width: clamp(90px, 14.28vw, 234px);
  aspect-ratio: 234 / 267;
  right: 0%;
  top: 0%;
  z-index: 2;
}

/* Image 27 (rotated, shown 261x343): x=1049, y=2228 → left=(1049-932)/736=15.9%, top=(2228-1969)/722=35.9% */
.visuals-img--4 {
  width: clamp(100px, 15.92vw, 261px);
  aspect-ratio: 261 / 343;
  left: 15.9%;
  top: 35.9%;
  z-index: 2;
}

/* ---------------------------------------------------------------
   APPS SECTION
--------------------------------------------------------------- */
.apps {
  padding: clamp(80px, 9.16vw, 150px) 0 clamp(100px, 10vw, 160px);
}

.apps__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--page-x);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(48px, 6.11vw, 100px);
}

.apps__heading {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: var(--text-apps-h);
  letter-spacing: -0.04em;
  color: var(--color-cream);
  text-align: center;
  line-height: 1.2;
}

.apps__grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.1vw, 18px);
  flex-wrap: wrap;
}

.app-icon {
  width: clamp(64px, 7.08vw, 116px);
  height: clamp(64px, 7.08vw, 116px);
  border-radius: clamp(14px, 1.47vw, 24px);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.app-icon:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Light background icons (Slack, Linear, Notion, Firebase) */
.app-icon--light {
  background-color: var(--color-white);
  padding: clamp(12px, 1.1vw, 18px);
}

.app-icon--light img {
  object-fit: contain;
}

/* ---------------------------------------------------------------
   CONTACT DRAWER
   Slides in from the right — full-height fixed panel
--------------------------------------------------------------- */

/* Shared shimmer animation (also used in work.css for .work-info__cta) */
@keyframes cta-shimmer {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.contact-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.contact-backdrop--open {
  opacity: 1;
  pointer-events: all;
}

.contact-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: clamp(300px, 30vw, 460px);
  background: var(--color-bg);
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 201;
  display: flex;
  flex-direction: column;
  padding: clamp(36px, 3.5vw, 60px) clamp(28px, 2.8vw, 48px);
  transform: translateX(100%);
  transition: transform 0.42s cubic-bezier(0.32, 0.72, 0, 1);
  overflow-y: auto;
  scrollbar-width: none;
}

.contact-drawer::-webkit-scrollbar {
  display: none;
}

.contact-drawer--open {
  transform: translateX(0);
}

/* Close button */
.contact-drawer__close {
  position: absolute;
  top: clamp(20px, 2vw, 32px);
  right: clamp(20px, 2vw, 32px);
  width: clamp(34px, 2.71vw, 44px);
  height: clamp(34px, 2.71vw, 44px);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  transition: background-color 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.contact-drawer__close:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.6);
}

.contact-drawer__close svg {
  width: clamp(10px, 0.85vw, 14px);
  height: auto;
}

/* Label */
.contact-drawer__label {
  font-family: var(--font-body);
  font-size: clamp(10px, 0.73vw, 12px);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: clamp(20px, 2vw, 32px);
  margin-top: clamp(8px, 1vw, 16px);
}

/* Heading */
.contact-drawer__heading {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(52px, 5.5vw, 88px);
  letter-spacing: -0.02em;
  color: var(--color-text);
  line-height: 0.92;
  margin-bottom: clamp(20px, 2.2vw, 36px);
}

/* Body copy */
.contact-drawer__body {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(13px, 1.1vw, 18px);
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.6;
  margin-bottom: clamp(28px, 3vw, 48px);
}

/* Divider */
.contact-drawer__divider {
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin-bottom: clamp(24px, 2.5vw, 40px);
  flex-shrink: 0;
}

/* Email row */
.contact-drawer__email-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: clamp(12px, 1.2vw, 20px);
}

.contact-drawer__email {
  font-family: var(--font-body);
  font-size: clamp(11px, 0.95vw, 15px);
  font-weight: 400;
  color: var(--color-text);
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Copy button */
.contact-drawer__copy {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 99px;
  background: none;
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--font-body);
  font-size: clamp(10px, 0.73vw, 12px);
  font-weight: 400;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.contact-drawer__copy:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.5);
  color: var(--color-white);
}

.contact-drawer__copy svg {
  width: 11px;
  height: auto;
  flex-shrink: 0;
}

/* Copied! feedback state */
.contact-drawer__copy--copied {
  border-color: rgba(118, 201, 129, 0.6) !important;
  color: #76c981 !important;
}

/* CTA button — same gradient as work-info__cta */
.contact-drawer__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: clamp(14px, 1.3vw, 20px) clamp(20px, 2vw, 32px);
  background: linear-gradient(78deg, #758c69, #2b575e, #758c69);
  background-size: 200% 100%;
  border: 0.5px solid rgba(255, 255, 255, 0.7);
  border-radius: 99px;
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(14px, 1.1vw, 18px);
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  animation: cta-shimmer 3s ease-in-out infinite;
  transition: box-shadow 0.25s ease, filter 0.25s ease;
  margin-top: clamp(8px, 0.8vw, 12px);
}

.contact-drawer__cta:hover {
  box-shadow: 0 0 20px 4px rgba(43, 87, 94, 0.5);
  filter: brightness(1.12);
}

.contact-drawer__cta svg {
  flex-shrink: 0;
  width: clamp(13px, 1vw, 16px);
  height: auto;
  transition: transform 0.2s ease;
}

.contact-drawer__cta:hover svg {
  transform: translate(2px, -2px);
}

/* Spacer to push CTA to bottom when drawer is tall enough */
.contact-drawer__spacer {
  flex: 1;
  min-height: clamp(24px, 3vw, 48px);
}

/* ---------------------------------------------------------------
   RESPONSIVE — Tablet (≤ 900px)
--------------------------------------------------------------- */
@media (max-width: 900px) {

  /* Hero: stack vertically */
  .hero__container {
    flex-direction: column;
    align-items: center;
    padding: 0 24px;
    min-height: auto;
  }

  .hero__photo-wrap {
    width: 70%;
    margin-right: 0;
    align-self: center;
  }

  .hero__photo {
    height: auto;
    max-height: 60vw;
  }

  .hero__text-outer {
    position: static;
    width: 100%;
    justify-content: flex-end;
  }

  .hero__text {
    width: 100%;
    align-items: flex-end;
    padding-bottom: 40px;
  }

  .hero__name {
    white-space: normal;
  }

  /* Sections: stack vertically */
  .section__container,
  .section__container--reverse {
    flex-direction: column;
    align-items: center;
    padding: 0 24px;
    gap: 48px;
  }

  .section__content {
    width: 100%;
    max-width: 580px;
  }

  .folder-wrap {
    align-self: center;
  }

  .folder {
    width: min(320px, 70vw);
  }

  .visuals-gallery {
    width: 100%;
    max-width: 500px;
    height: 420px;
    align-self: center;
  }
}

/* ---------------------------------------------------------------
   RESPONSIVE — Mobile (≤ 600px)
--------------------------------------------------------------- */
@media (max-width: 600px) {
  .hero__photo-wrap {
    width: 85%;
  }

  .section__body {
    max-width: 100%;
  }

  .btn-outline {
    min-width: 0;
    width: 100%;
  }

  .apps__grid {
    gap: 10px;
  }

  .visuals-gallery {
    height: 320px;
  }
}