/*
 * enhancements.css
 * Styles for everything the JavaScript adds (shared by the simple and the
 * advanced version), plus mobile layout fixes for the Webflow export.
 * Every class here starts with "fl-" so it can never clash with Webflow's
 * auto-generated class names (div-block-9, section-7, ...).
 */

:root {
  --fl-ink: #1a1b1f;
  --fl-paper: #fff;
  --fl-muted: #6b6d76;
  --fl-line: #e4e4e7;
  --fl-accent: #22c55e;
  --fl-overlay: rgba(12, 12, 15, 0.92);
  --fl-radius: 14px;
  --fl-ease: cubic-bezier(.22, 1, .36, 1);
  --fl-shadow: 0 10px 40px rgba(0, 0, 0, .18);
}

/* Webflow sets a 100vw navbar, which causes sideways scrolling on some
   screens. "clip" (unlike "hidden") doesn't break position: sticky. */
html, body { overflow-x: clip; }

/* Visible focus ring for keyboard users only (mouse clicks don't show it) */
:focus-visible {
  outline: 2px solid var(--fl-accent);
  outline-offset: 3px;
}

/* Scroll lock while a dialog is open. It goes on <html>, not <body>: with
   overflow-x set on <html> above, body's overflow no longer controls the page.
   The padding replaces the vanished scrollbar so nothing jumps sideways. */
html.fl-scroll-locked { overflow: hidden; padding-right: var(--fl-scrollbar-gap, 0px); }

kbd {
  font: 600 11px/1 Montserrat, sans-serif;
  padding: 3px 6px;
  border: 1px solid var(--fl-line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #fafafa;
}

/* ---------- Scroll progress bar ---------- */
.fl-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 1000;
  background: var(--fl-accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

/* ---------- Nav links: hover animation ----------
   Replaces Webflow's hover background image with a thin underline that
   draws in from the left and the other links dimming slightly. */
.nav-menu .link-button,
.nav-menu .link-button:hover {
  background-image: none;
  background-color: transparent;
  border-radius: 0;
}
.nav-menu .link-button { transition: opacity .3s ease, color .3s ease; }
.nav-menu .link-button:hover,
.nav-menu .link-button:focus-visible { color: #fff; } /* Webflow's global a:hover would turn it dark grey */
.nav-menu:hover .link-button:not(:hover) { opacity: .55; }
.nav-menu .link-button::after {
  content: "";
  position: absolute;
  left: 30px;
  right: 30px;
  bottom: 22px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform .45s var(--fl-ease);
}
.nav-menu .link-button:hover::after,
.nav-menu .link-button:focus-visible::after,
.nav-menu .link-button.fl-is-active::after {
  transform: scaleX(1);
  transform-origin: left center;
}
/* Advanced version: one shared underline glides between links instead */
.nav-menu.fl-nav--glide .link-button::after { display: none; }
.fl-nav-indicator {
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  border-radius: 2px;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transition: transform .5s var(--fl-ease), width .5s var(--fl-ease), opacity .3s ease;
}

/* ---------- Search button in the nav (advanced) ---------- */
.fl-search-btn {
  float: right;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 32px 30px 0 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background-color .25s, border-color .25s, transform .25s var(--fl-ease);
}
.fl-search-btn:hover { background-color: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .6); transform: scale(1.06); }
.fl-search-btn svg { transition: transform .35s var(--fl-ease); }
.fl-search-btn:hover svg { transform: rotate(-12deg) scale(1.08); }

/* ---------- Back to top ---------- */
.fl-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 900;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--fl-ink);
  color: var(--fl-paper);
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--fl-shadow);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity .3s, transform .3s var(--fl-ease);
}
.fl-to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- Toasts ---------- */
.fl-toast,
.fl-toasts > * {
  font: 500 14px/1.4 Montserrat, sans-serif;
  background: var(--fl-ink);
  color: var(--fl-paper);
  padding: 12px 18px;
  border-radius: 999px;
  box-shadow: var(--fl-shadow);
}
.fl-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1100;
  transform: translate(-50%, 24px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s var(--fl-ease);
}
.fl-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* advanced version: a stack of toasts */
.fl-toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1100;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}
.fl-toasts > * { animation: fl-toast-in .35s var(--fl-ease); }
.fl-toasts > .is-leaving { animation: fl-toast-out .25s ease forwards; }
@keyframes fl-toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes fl-toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------- "Open to work" pill ---------- */
/* Sits just after the hero box; the negative margin pulls it up under the buttons */
.fl-hire-wrap { position: relative; z-index: 2; margin-top: -80px; margin-bottom: 40px; }
.fl-hire-pill {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 18px;
  border: 1px solid var(--fl-line);
  border-radius: 999px;
  font: 500 14px/1.4 Montserrat, sans-serif;
  color: var(--fl-ink);
  text-decoration: none;
  background: var(--fl-paper);
  transition: border-color .2s, box-shadow .2s;
}
.fl-hire-pill:hover { border-color: var(--fl-ink); box-shadow: 0 4px 18px rgba(0, 0, 0, .08); color: var(--fl-ink); }
.fl-hire-pill__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--fl-accent);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, .6);
  animation: fl-pulse 2s infinite;
}
.fl-hire-pill__time { color: var(--fl-muted); }
@keyframes fl-pulse { 70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

/* ---------- Footer ---------- */
.footer-wrap { flex-direction: column; gap: 4px; padding-bottom: 90px; }
.fl-footer-note {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 20px;
  color: var(--fl-muted);
  text-align: center;
}

/* ---------- Reveal on scroll ----------
   Only hidden when JS has added .fl-js to <html>; no JS = always visible. */
.fl-js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s var(--fl-ease), transform .8s var(--fl-ease);
}
.fl-js [data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- Lightbox ----------
   Base styles are shared. The simple version uses a plain <div> with an
   image and caption; the advanced version adds the --rich layout below. */
[data-lightbox] { cursor: zoom-in; }

.fl-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 24px;
  border: 0;
  background: var(--fl-overlay);
  color: var(--fl-paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  cursor: zoom-out;
  overscroll-behavior: contain;
}
.fl-lightbox[hidden], dialog.fl-lightbox:not([open]) { display: none; }
dialog.fl-lightbox::backdrop { background: transparent; }

/* simple version: fade the overlay in and grow the image slightly */
div.fl-lightbox:not([hidden]) { animation: fl-fade .3s ease; }
div.fl-lightbox:not([hidden]) .fl-lightbox__img { animation: fl-zoom-in .45s var(--fl-ease); }
@keyframes fl-fade { from { opacity: 0; } }
@keyframes fl-zoom-in { from { opacity: 0; transform: scale(.94); } }

.fl-lightbox__img {
  display: block;
  max-width: min(1400px, 100%);
  max-height: calc(100% - 80px);
  width: auto;
  height: auto;
  filter: drop-shadow(0 24px 50px rgba(0, 0, 0, .45));
  user-select: none;
}
.fl-lightbox__caption { margin: 0; font: 500 14px/1.4 Montserrat, sans-serif; opacity: .85; text-align: center; }
.fl-lightbox__close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s, transform .3s var(--fl-ease);
}
.fl-lightbox__close:hover { background: rgba(255, 255, 255, .22); transform: rotate(90deg); }

/* advanced version: screenshot on the left, project text on the right */
.fl-lightbox--rich {
  display: grid;
  place-items: center;
  padding: 32px 40px;
  background: transparent;
  cursor: default;
}
.fl-lightbox__bg {
  position: absolute;
  inset: 0;
  background: rgba(12, 12, 15, .96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px); /* the page behind shouldn't compete with the project text */
  cursor: zoom-out;
}
.fl-lightbox__stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 440px);
  align-items: center;
  gap: 56px;
  width: min(1320px, 100%);
  max-height: 100%;
  pointer-events: none; /* clicks on empty space fall through to the backdrop = close */
}
.fl-lightbox__media { display: flex; justify-content: center; align-items: center; min-width: 0; }
.fl-lightbox__frame {
  display: flex;
  max-width: 100%;
  transform: translateX(var(--fl-shift, 0%)); /* centers off-center mockups, see lightbox.js */
  pointer-events: auto;
  touch-action: pan-y;
}
.fl-lightbox--rich .fl-lightbox__img { max-width: 100%; max-height: min(78vh, 760px); }
.fl-lightbox__panel { pointer-events: auto; font-family: Montserrat, sans-serif; }
.fl-lightbox__counter { margin: 0 0 14px; font-size: 12px; font-weight: 600; letter-spacing: .2em; opacity: .55; }
.fl-lightbox__title { margin: 0 0 18px; font-size: 34px; line-height: 1.15; font-weight: 600; color: #fff; }
.fl-lightbox__text {
  max-height: 52vh;
  margin: 0;
  overflow-y: auto;
  font-size: 15px;
  line-height: 1.75;
  color: rgba(255, 255, 255, .78);
}
.fl-lightbox__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 28px; }
.fl-lightbox__step {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.fl-lightbox__step:hover { background: rgba(255, 255, 255, .12); border-color: #fff; }
.fl-lightbox__cta {
  margin-left: 6px;
  padding: 14px 20px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--fl-ink);
  font: 600 14px/1 Montserrat, sans-serif;
  cursor: pointer;
  transition: transform .25s var(--fl-ease), box-shadow .25s;
}
.fl-lightbox__cta:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }

/* ---------- Contact dialog (advanced) ---------- */
.fl-dialog {
  width: min(560px, calc(100% - 32px));
  max-height: calc(100dvh - 32px); /* never taller than the screen; scrolls inside only on tiny screens */
  overscroll-behavior: contain;
  padding: 0;
  border: 0;
  border-radius: var(--fl-radius);
  color: var(--fl-ink);
  background: var(--fl-paper);
  box-shadow: 0 30px 100px rgba(0, 0, 0, .35);
  font-family: Montserrat, sans-serif;
}
.fl-dialog::backdrop { background: rgba(12, 12, 15, .55); backdrop-filter: blur(3px); }
.fl-dialog[open] { animation: fl-pop .35s var(--fl-ease); }
@keyframes fl-pop { from { opacity: 0; transform: translateY(16px) scale(.98); } }

.fl-dialog__inner { padding: 26px 28px 22px; }
.fl-dialog__title { margin: 0 0 4px; font-size: 24px; line-height: 1.2; font-weight: 600; }
.fl-dialog__lead { margin: 0 0 14px; color: var(--fl-muted); font-size: 14px; line-height: 1.5; }
.fl-dialog__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
}
.fl-dialog__close:hover { background: #f2f2f3; }

.fl-quick-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.fl-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border: 1px solid var(--fl-line);
  border-radius: 999px;
  background: #fff;
  color: var(--fl-ink);
  font: 500 13px/1 Montserrat, sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.fl-chip:hover { border-color: var(--fl-ink); background: #fafafa; color: var(--fl-ink); }

.fl-form { display: grid; gap: 12px; }
.fl-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fl-field { display: grid; gap: 6px; min-width: 0; }
.fl-field label { margin: 0; font-size: 11px; line-height: 1; color: var(--fl-muted); }
.fl-field input,
.fl-field textarea,
.fl-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--fl-line);
  border-radius: 10px;
  font: 400 15px/1.4 Montserrat, sans-serif;
  color: var(--fl-ink);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.fl-field textarea { min-height: 96px; resize: vertical; }
.fl-field input:focus, .fl-field textarea:focus, .fl-field select:focus {
  outline: none;
  border-color: var(--fl-ink);
  box-shadow: 0 0 0 3px rgba(26, 27, 31, .08);
}
.fl-field[data-invalid] input,
.fl-field[data-invalid] textarea { border-color: #dc2626; }
.fl-field__error { font-size: 12px; line-height: 16px; color: #dc2626; }
.fl-field__meta { display: flex; justify-content: space-between; gap: 8px; }
.fl-field__meta:not(:has(:not(:empty))) { display: none; } /* no error, no counter → take no space */
.fl-field__count { font-size: 12px; line-height: 16px; color: var(--fl-muted); }
.fl-honeypot { position: absolute; left: -9999px; }

.fl-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border: 0;
  border-radius: 10px;
  background: var(--fl-ink);
  color: #fff;
  font: 600 15px/1 Montserrat, sans-serif;
  cursor: pointer;
  transition: transform .15s, opacity .2s;
}
.fl-button:active { transform: scale(.98); }
.fl-button[disabled] { opacity: .6; cursor: progress; }
.fl-form__note { margin: 0; font-size: 12px; line-height: 1.5; color: var(--fl-muted); }

/* ---------- Command palette (advanced) ---------- */
.fl-palette {
  width: min(560px, calc(100% - 32px));
  margin: 12vh auto auto;
  padding: 0;
  border: 0;
  border-radius: var(--fl-radius);
  background: #fff;
  color: var(--fl-ink);
  box-shadow: 0 30px 100px rgba(0, 0, 0, .35);
  font-family: Montserrat, sans-serif;
  overflow: hidden;
}
.fl-palette::backdrop { background: rgba(12, 12, 15, .45); }
.fl-palette[open] { animation: fl-pop .25s var(--fl-ease); }
.fl-palette__input {
  width: 100%;
  padding: 18px 20px;
  border: 0;
  border-bottom: 1px solid var(--fl-line);
  font: 400 17px/1.3 Montserrat, sans-serif;
  outline: none;
}
.fl-palette__list { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow-y: auto; }
.fl-palette__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 15px;
  line-height: 1.3;
  cursor: pointer;
}
.fl-palette__item[aria-selected="true"] { background: #f2f2f3; }
.fl-palette__item mark { background: none; color: inherit; font-weight: 700; text-decoration: underline; }
.fl-palette__hint { font-size: 12px; color: var(--fl-muted); }
.fl-palette__empty { padding: 16px 14px; color: var(--fl-muted); font-size: 14px; }
.fl-palette__footer { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--fl-line); font-size: 12px; color: var(--fl-muted); }

/* ---------- Magnetic buttons (advanced) ---------- */
[data-magnetic] { transition: transform .4s var(--fl-ease), background-color .3s, padding .3s; }

/* ---------- Easter egg (advanced) ---------- */
.fl-party { animation: fl-party 1.2s var(--fl-ease); }
@keyframes fl-party { 30% { filter: hue-rotate(160deg) saturate(2); transform: rotate(-1deg) scale(1.01); } 60% { transform: rotate(1deg); } }

/* ============================================================
   MOBILE FIXES for the Webflow export
   ============================================================ */
@media screen and (max-width: 991px) {
  .section-7 { padding: 80px 48px; }
  .section-4 { margin-left: 24px; margin-right: 24px; }
}

@media screen and (max-width: 767px) {
  /* Hero: the dark gradient stays behind the header; all hero text is dark on white */
  .image-2 { inset: 0 0 auto 0; width: 100%; height: 300px; object-fit: cover; object-position: 50% 100%; }
  .w-nav-button { color: #fff; }
  .w-nav-button.w--open { background-color: var(--fl-ink); }
  .section-2 { margin-top: 250px; margin-bottom: 40px; }
  .name-text.first { color: var(--fl-ink); font-size: 44px; line-height: 1.1; text-align: left; }
  .name-text.last-name { font-size: clamp(44px, 15vw, 115px); letter-spacing: 1px; margin-bottom: .4rem; }
  .div-block-7 { flex-wrap: wrap; column-gap: .3em; }
  .div-block-11 { flex-wrap: wrap; align-items: baseline; margin-bottom: 1rem; min-height: 60px; }
  .heading-jumbo { font-size: 30px; line-height: 40px; }
  .rotating-text { bottom: auto; margin-left: 30px; } /* sit next to the "A" on phones */
  .heading-4 { margin: 10px 0 0; padding: 0; font-size: 30px; line-height: 40px; } /* same baseline as the "A" */
  .div-block-12 { margin-top: 2rem; }
  .div-block-9 { margin-right: 0; }
  .div-block-12 .contact { margin: 14px 0; padding: 4px 0; font-size: 1.2rem; }
  .fl-hire-wrap { margin: -60px 15px 40px; }
  .fl-hire-pill { font-size: 13px; }

  /* Projects: the desktop sideways-scrolling showcase becomes a vertical list */
  .section.scroll-anim { height: auto; margin: 60px 0 0; overflow: visible; }
  .section-5 + .section-5, .section-5 .div-block-13 ~ .div-block-13, .div-block-3 { display: none; }
  .section-5 { margin-top: 0; }
  .div-block-13 { position: static; margin-top: 0; transform: none !important; opacity: 1 !important; }
  .name-text.work { font-size: 56px; line-height: 1.1; transform: none !important; }
  .div-block-6 { display: none; }
  .div-block {
    position: static;
    width: auto;
    margin: 0 16px;
    padding-top: 32px;
    flex-direction: column;
    gap: 64px;
    transform: none !important;
    z-index: auto;
  }
  .div-block-2 { width: 100%; margin-right: 0; z-index: auto; opacity: 1 !important; transform: none !important; }
  .caurosel-image { width: 100%; height: auto; }
  .subheading { font-size: 26px; line-height: 1.3; }

  /* Experience */
  .section-7 { margin-top: 80px; padding: 64px 20px; }
  .heading-7 { font-size: 34px; line-height: 1.2; }
  .work-experience-grid { align-items: stretch; }

  .fl-search-btn { margin: 9px 6px 0 0; border-color: transparent; }
  .fl-dialog__inner { padding: 22px 18px 18px; }
  .fl-form__row { grid-template-columns: 1fr; }

  .fl-lightbox--rich { display: block; padding: 0; overflow-y: auto; }
  .fl-lightbox__bg { position: fixed; }
  .fl-lightbox__stage { grid-template-columns: 1fr; gap: 20px; max-height: none; padding: 72px 20px 32px; }
  .fl-lightbox--rich .fl-lightbox__img { max-height: 40vh; }
  .fl-lightbox__title { font-size: 26px; }
  .fl-lightbox__text { max-height: none; overflow: visible; }
  .fl-lightbox__close { position: fixed; top: 12px; right: 12px; }
}

/* Respect people who turn off animations in their OS settings */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .fl-js [data-reveal] { opacity: 1; transform: none; }
}
