/* ============================================================
   JHAZ — portfolio
   Pixel-exact rebuild matching the Figma file 1:1
   (5q3xPjtONZV89haWZmWxcD — "Jhaz UX/UI Portfolio").

   Cover, About, both Footers and the Contact hero are real
   flattened exports straight out of Figma (in /assets), scaled
   with plain `width:100%; height:auto`, so there is zero
   dependency on any external asset server and 1:1 fidelity is
   guaranteed (it IS the design, pixel for pixel). A few small
   invisible buttons/links sit on top at percentage-based
   coordinates for the interactive bits (mailto, mail-modal).

   The Work section is the one place that needs real markup
   instead of a flat image, because the "WORK" wordmark must stay
   pinned on screen (position:sticky) while the project rows
   scroll over it. It uses a `calc(100vw/1440 * px)` custom
   property to get the same 1:1 scaling without a transform.
   ============================================================ */

* { box-sizing: border-box; }

:root {
  --ink: #121212;
  --cream: #faf9f6;
  --muted: #9e998f;
  --pink: #ff3d8a;
  --line: rgba(255,255,255,0.14);
  --font-mono: 'Space Mono', ui-monospace, monospace;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --nav-h: 98px;
}

html, body { margin: 0; padding: 0; }
body { background: var(--ink); color: var(--cream); font-family: var(--font-body); overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: none; }

/* ===== Nav — fixed, transparent over the hero, white once scrolled ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 64px;
  z-index: 50;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.nav.is-scrolled { background: #fff; box-shadow: 0 1px 0 rgba(0,0,0,0.06); }

.logo { position: relative; width: 122px; height: 42px; display: block; }
.logo img { position: absolute; inset: 0; width: 122px; height: 42px; transition: opacity 0.3s ease; }
.logo-black { opacity: 0; }
.nav.is-scrolled .logo-white { opacity: 0; }
.nav.is-scrolled .logo-black { opacity: 1; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.5px;
  color: #fff;
  transition: color 0.3s ease;
}
.nav.is-scrolled .nav-links { color: var(--ink); }
.nav-links a:hover { color: var(--pink); }

.nav-toggle { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: #fff; transition: color 0.3s ease; }
.nav.is-scrolled .nav-toggle { color: var(--ink); }

@media (max-width: 1100px) {
  .nav { padding: 20px 24px; }
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0; background: #fff;
    flex-direction: column; align-items: flex-start; gap: 0; padding: 0 24px;
    max-height: 0; overflow: hidden; transition: max-height 0.25s ease, padding 0.25s ease;
    color: var(--ink);
  }
  .nav.open .nav-links { max-height: 260px; padding: 10px 24px 24px; }
  .nav-links a { padding: 10px 0; width: 100%; border-bottom: 1px solid #eee; }
}

/* ===== Flattened Figma exports (Cover/About/Footer/Contact hero) ===== */
.flat { position: relative; width: 100%; display: block; background: var(--ink); }
.flat > img { width: 100%; height: auto; display: block; }
.flat-hotspot {
  position: absolute;
  border: none; background: transparent; cursor: pointer; padding: 0;
  /* left/top/width/height set inline per instance, as % of the 1440-wide original */
}

/* ===== Work — desktop: pixel-perfect 2-column canvas, CSS-only 1:1 scale
   via --s, matching the Figma file exactly (unchanged from the original
   design). Overridden below max-width:1100px for a single stacked column
   on phones/tablets — see the media query further down. ===== */
.work {
  position: relative;
  width: 100%;
  background: var(--ink);
  --s: calc(100vw / 1440);
  height: calc(var(--s) * 4408);
}
.work-heading {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 0;
}
.work-wordmark { width: calc(var(--s) * 1322); height: calc(var(--s) * 282); display: block; }
.work-rows { position: absolute; inset: 0; z-index: 1; }
.work-row, .work-info {
  position: absolute;
  left: calc(var(--s) * var(--l));
  top: calc(var(--s) * var(--t));
  width: calc(var(--s) * var(--w));
}
.work-row { height: calc(var(--s) * var(--h)); overflow: hidden; }
.work-info { height: calc(var(--s) * var(--h)); }
.work-info img { width: 100%; height: 100%; display: block; }
.work-media { position: relative; width: 100%; height: 100%; overflow: hidden; }
.work-media img, .work-media video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ===== Work — mobile/tablet (<=1100px): text and video go full width and
   readable instead of shrinking to a tiny fraction of their design size, but
   the WORK wordmark stays sticky in the background exactly like on desktop —
   .work-heading keeps its base position:sticky/height:100vh, only .work-rows
   switches from the absolute pixel-perfect canvas to a normal stacked flow
   that scrolls over it. HTML order already puts each project's media before
   its own caption, so this just needs to lay that DOM order out normally. ===== */
@media (max-width: 1100px) {
  .work { height: auto; }
  .work-wordmark { width: min(100%, 380px); height: auto; }
  .work-rows {
    position: relative; z-index: 1;
    display: flex; flex-direction: column; gap: 40px;
    padding: 72px 20px 40px;
  }
  .work-row, .work-info {
    position: static; width: 100% !important; height: auto !important;
    left: auto; top: auto;
  }
  .work-row { aspect-ratio: var(--w) / var(--h); border-radius: 12px; }
  .work-info img { width: 100%; height: auto; }
}

/* ===== Real, responsive About / Footer / Contact-hero (replace the
   flattened Figma exports for these — those baked all copy into a
   1440px-wide raster image with `width:100%`, so on a phone the whole
   image just shrank proportionally and the text became unreadably
   small instead of reflowing). Copy and layout match the Figma file
   1:1; only the sizing is now fluid via clamp(). ===== */

.s-section { background: var(--ink); padding: clamp(48px, 9vw, 96px) clamp(24px, 6vw, 64px); }
.s-label {
  display: block; font-family: var(--font-mono); font-weight: 700; font-size: 12px;
  letter-spacing: 1.5px; color: var(--cream); text-transform: uppercase; margin: 0 0 18px;
}

.s-about-heading {
  display: block; width: min(100%, 520px); height: auto; margin: 0 0 clamp(20px, 4vw, 28px);
}
.s-about-text {
  font-family: var(--font-mono); font-size: clamp(14px, 1.6vw, 17px); line-height: 1.65;
  color: #d8d5cd; max-width: 900px; margin: 0;
}

.s-contact { padding-top: clamp(140px, 20vw, 220px); }
.s-contact-heading {
  display: block; width: min(100%, 640px); height: auto; margin: 0 0 clamp(28px, 5vw, 44px);
}
.s-contact-cta {
  display: inline-flex; align-items: center; gap: 12px; background: var(--pink); color: var(--ink);
  font-family: var(--font-mono); font-weight: 700; font-size: clamp(13px, 2vw, 15px);
  letter-spacing: 0.5px; padding: 16px 24px; border-radius: 14px; border: none; cursor: pointer;
}
.s-contact-cta:hover { opacity: 0.9; }
.s-contact-address {
  font-family: var(--font-mono); font-size: clamp(13px, 1.8vw, 16px); line-height: 1.8;
  color: #d8d5cd; margin: clamp(28px, 5vw, 40px) 0 0;
}
.s-contact-address a { border-bottom: 1px solid transparent; }
.s-contact-address a:hover { color: var(--pink); border-bottom-color: var(--pink); }

/* ---- Footer (shared partial, used on both pages) ---- */
.s-footer { padding: clamp(48px, 8vw, 64px) clamp(24px, 6vw, 64px) 24px; }
.s-footer-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 32px; padding-bottom: clamp(36px, 6vw, 62px);
}
.s-footer-logo { height: clamp(32px, 5vw, 48px); width: auto; flex-shrink: 0; align-self: center; }
.s-footer-tagline {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.3px;
  color: var(--muted); align-self: center; line-height: 1.5;
}
.s-footer-status { text-align: center; }
.s-footer-status img { display: inline-block; width: min(100%, 200px); height: auto; }
.s-footer-connect { text-align: right; }
.s-footer-connect .s-connect-title {
  display: inline-block; width: min(100%, 190px); height: auto; margin-bottom: 14px;
}
.s-footer-cta {
  display: inline-block; background: var(--pink); border: none;
  padding: 13px 22px; border-radius: 12px; cursor: pointer; line-height: 0;
}
.s-footer-cta img { display: block; height: 11px; width: auto; }
.s-footer-cta:hover { opacity: 0.9; }
.s-footer-divider { border: none; border-top: 1px solid var(--line); margin: 0 0 20px; }
.s-footer-bottom {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; color: var(--muted);
}
.s-footer-bottom .s-socials { display: flex; gap: 24px; }
.s-footer-bottom .s-socials a:hover { color: var(--pink); }

@media (max-width: 1100px) {
  .s-footer-top { flex-direction: column; align-items: flex-start; text-align: left; gap: 24px; }
  .s-footer-logo { align-self: flex-start; }
  .s-footer-tagline { align-self: flex-start; }
  .s-footer-status, .s-footer-connect { text-align: left; }
  .s-footer-bottom { flex-direction: column; align-items: flex-start; }
  .s-footer-bottom .s-socials { gap: 20px; }
}

/* ===== Contact modal (opens only when the mail button is pressed) ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: none; align-items: center; justify-content: center;
  z-index: 100; padding: 24px;
}
.modal-overlay.is-open { display: flex; }
.modal-card {
  background: var(--ink); border: 1px solid var(--line); border-radius: 16px;
  width: 100%; max-width: 440px; padding: 32px; position: relative;
}
.modal-close {
  position: absolute; top: 16px; right: 16px; background: none; border: none;
  color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--cream); }
.modal-title { font-family: 'Archivo Black', sans-serif; font-size: 22px; margin: 0 0 6px; color: var(--cream); }
.modal-sub { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin: 0 0 24px; }
.contact-form .form-field { margin-bottom: 18px; }
.contact-form label { display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: 1px; color: var(--muted); margin-bottom: 6px; }
.contact-form input, .contact-form textarea {
  width: 100%; background: transparent; border: none; border-bottom: 1px solid var(--line);
  color: var(--cream); font-family: var(--font-body); font-size: 15px; padding: 8px 0; outline: none;
}
.contact-form input:focus, .contact-form textarea:focus { border-bottom-color: var(--pink); }
.contact-form textarea { min-height: 80px; resize: vertical; }
.contact-form-submit {
  border: none; background: var(--pink); color: var(--ink); font-family: var(--font-mono); font-weight: 700;
  font-size: 13px; letter-spacing: 0.5px; padding: 14px 28px; border-radius: 12px; cursor: pointer; margin-top: 4px;
}
.contact-form-submit:hover { opacity: 0.9; }
.contact-form-submit:disabled { cursor: default; opacity: 0.6; }
.form-status { font-family: var(--font-mono); font-size: 13px; font-weight: 700; margin: 14px 0 0; min-height: 1em; }
.form-status.is-success { color: #7fd99a; }
.form-status.is-error { color: var(--pink); }
