/* ============================================================
   STYLES.CSS — Portfolio of Shahar Or
   ============================================================ */

/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg:           #242424;
  --bg-card:      #1e1e1e;
  --bg-card-h:    #2a2a2a;
  --surface:      #1e1e1e;

  --text:         #f4f4f4;
  --text-mid:     #8a8a8a;
  --text-dim:     #484848;

  --accent:       #9e89f8;
  --accent-glow:  rgba(158, 137, 248, 0.1);

  --border:       rgba(255, 255, 255, 0.07);
  --border-h:     rgba(255, 255, 255, 0.14);

  --f-head: 'Poppins', system-ui, sans-serif;
  --f-body: 'Poppins', system-ui, sans-serif;

  --nav-h: 72px;
  --ease:  cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { scroll-behavior: smooth; font-size: 16px; }
body  {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  cursor: none;
}
a    { color: inherit; text-decoration: none; }
img  { display: block; max-width: 100%; height: 100%; object-fit: cover; }
button { cursor: none; }

@media (hover: none) {
  body   { cursor: auto; }
  button { cursor: auto; }
  a      { cursor: auto; }
  .cursor, .cursor-ring { display: none; }
  /* Disable sticky hover on touch — dropdown controlled by JS only */
  .nav-item:hover .nav-dropdown { visibility: hidden; opacity: 0; }
}

/* ── Custom Cursor ─────────────────────────────────────── */
.cursor {
  position: fixed;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
  opacity: 0;
}
.cursor-ring {
  position: fixed;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(196, 162, 106, 0.35);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease), height 0.3s var(--ease),
              border-color 0.3s, opacity 0.3s;
  opacity: 0;
}
body.cursor-ready .cursor,
body.cursor-ready .cursor-ring { opacity: 1; }
body.cursor-hover .cursor-ring {
  width: 56px;
  height: 56px;
  border-color: rgba(196, 162, 106, 0.2);
}
body.cursor-hover .cursor { transform: translate(-50%, -50%) scale(0.5); }

/* ── Navigation ────────────────────────────────────────── */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 80px;
  z-index: 500;
  transition: background 0.5s, border-color 0.5s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(36, 36, 36, 0.9);
  backdrop-filter: blur(16px);
  border-color: var(--border);
}
.nav-logo {
  font-family: var(--f-head);
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  transition: color 0.3s;
}
.nav-logo:hover { color: var(--accent); }
.nav-links { display: flex; gap: 44px; align-items: center; }
.nav-link {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mid);
  transition: color 0.3s;
}
.nav-link:hover { color: var(--text); }

/* ── Nav dropdown ───────────────────────────────────────── */
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
}
.nav-caret {
  font-size: 1.4em;
  vertical-align: -0.05em;
  margin-left: -2px;
  display: inline-block;
  line-height: 1;
  transition: transform 0.2s;
}
.nav-item:hover .nav-caret { transform: rotate(180deg); }
.nav-dropdown::before {
  /* Transparent bridge over the gap — keeps nav-item:hover active */
  content: '';
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  height: 16px;
}
.nav-dropdown {
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.15s;
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 30, 30, 0.97);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 0;
  min-width: 200px;
  z-index: 600;
}
.nav-item:hover .nav-dropdown,
.nav-item.open   .nav-dropdown { visibility: visible; opacity: 1; }
.nav-drop-link {
  display: block;
  padding: 10px 20px;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-mid);
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.nav-drop-link:hover { color: var(--text); background: rgba(255,255,255,0.04); }

/* ── Hero ──────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 0 80px;
  overflow: hidden;
}

.hero-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 2fr;
  align-items: center;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  gap: 20px;
  position: relative;
  z-index: 1;
  padding-top: var(--nav-h);
}

/* Left column */
.hero-text { padding-right: 24px; }

/* Right column: image */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  align-self: stretch;
}
.hero-photo {
  position: relative;
  z-index: 1;
  height: 100%;
  width: 100%;
  object-fit: contain;
  object-position: bottom center;
  display: block;
}



.hero-name {
  font-family: var(--f-head);
  font-size: clamp(36px, 4.6vw, 68px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
  white-space: nowrap;
}
.hero-tagline {
  font-size: clamp(0.95rem, 1.3vw, 1.1rem);
  color: var(--text);
  line-height: 1.7;
  font-weight: 300;
  white-space: nowrap;
}
.hero-tagline .highlight {
  color: var(--accent);
  font-weight: 600;
}

/* Scroll indicator */
.hero-scroll {
  width: 100%;
  margin: 0 auto;
  padding: 18px 0 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1;
}
.scroll-chevrons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.scroll-chev {
  width: 28px;
  height: 14px;
  color: var(--accent);
  opacity: 0;
  animation: chev-fade 1.6s ease-in-out infinite;
}
.scroll-chev:nth-child(1) { animation-delay: 0s; }
.scroll-chev:nth-child(2) { animation-delay: 0.25s; }
@keyframes chev-fade {
  0%   { opacity: 0; transform: translateY(-4px); }
  40%  { opacity: 1; transform: translateY(0);    }
  80%  { opacity: 0; transform: translateY(4px);  }
  100% { opacity: 0; transform: translateY(4px);  }
}

/* ── Sections ──────────────────────────────────────────── */
.section  { padding: 130px 0; }
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 80px;
}
.section-head {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 72px;
}
.section-num {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  color: var(--accent);
}
.section-title {
  font-family: var(--f-head);
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ── About ─────────────────────────────────────────────── */
#about { background: #2d2d2d; }

.about-body {
  display: flex;
  justify-content: center;
}

/* Circular photo */
.about-visual {
  display: none;
}
.about-photo {
  display: block;
  width: 100%;
  max-width: 425px;
  margin: 0 auto;
}

.about-text {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.about-heading {
  font-family: var(--f-head);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 28px;
  letter-spacing: -0.02em;
}
.about-text p {
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.85;
  margin-bottom: 16px;
}
.about-text p:last-child { margin-bottom: 0; }
.nowrap-desktop { white-space: nowrap; }

/* ── Work: category sections ───────────────────────────── */
#work .container { padding: 0 140px; }
.work-category {
  margin-bottom: 88px;
  scroll-margin-top: calc(var(--nav-h) + 24px);
}
.work-category:last-child { margin-bottom: 0; }

.category-heading {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 24px;
  text-align: center;
}

/* ── Masonry Grid ───────────────────────────────────────── */
.bento-grid {
  position: relative; /* JS sets height after images load */
}

/* ── Project Card ──────────────────────────────────────── */
.card {
  position: absolute; /* JS sets top / left / width */
  overflow: hidden;
  background: var(--bg-card);
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
}

.card-media {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.4s ease;
}
.card:hover .card-media {
  transform: scale(1.05);
}

/* Placeholder gradients when no image is set */
.ph-1 { background: linear-gradient(135deg, #111420 0%, #1a2040 100%); }
.ph-2 { background: linear-gradient(135deg, #1a120a 0%, #2d1e0a 100%); }
.ph-3 { background: linear-gradient(135deg, #0b1a14 0%, #0f2010 100%); }
.ph-4 { background: linear-gradient(135deg, #1c1030 0%, #2a1040 100%); }
.ph-5 { background: linear-gradient(135deg, #1a0d0d 0%, #281212 100%); }
.ph-6 { background: linear-gradient(135deg, #0a1220 0%, #102035 100%); }
.ph-7 { background: linear-gradient(135deg, #0e1e1a 0%, #142820 100%); }
.ph-8 { background: linear-gradient(135deg, #1a1505 0%, #2a2010 100%); }
.ph-9 { background: linear-gradient(135deg, #0d1520 0%, #14202e 100%); }

/* Card hover overlay */
.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
    rgba(0,0,0,0.88) 0%,
    rgba(0,0,0,0.2)  45%,
    transparent      70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px 28px 32px;
}
.card:hover .card-overlay { opacity: 1; }

.card-cat {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 7px;
}
.card-title {
  font-family: var(--f-head);
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1.2;
  color: var(--text);
}

/* ── Contact ───────────────────────────────────────────── */
.contact-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.contact-row {
  display: flex;
  align-items: baseline;
  gap: 24px;
}
.contact-lbl {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  width: 72px;
  flex-shrink: 0;
}
.contact-val {
  font-family: var(--f-head);
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-weight: 500;
  color: var(--text);
  transition: color 0.3s;
}
.contact-val:hover { color: var(--accent); }

/* ── Contact form ───────────────────────────────────────── */
#contact { padding-top: 72px; }
#contact .section-head { margin-bottom: 32px; }
.contact-form { margin-top: 24px; }
#contact .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.contact-form {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 640px;
}
.cf-row {
  display: flex;
  gap: 20px;
}
.cf-input {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--f-body);
  font-size: 0.95rem;
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
  box-sizing: border-box;
}
.cf-input::placeholder { color: var(--text-dim); }
.cf-input:focus { border-color: var(--accent); }
.cf-textarea {
  resize: vertical;
  min-height: 140px;
}
.cf-btn {
  align-self: center;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-family: var(--f-head);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 12px 28px;
  transition: opacity 0.2s, transform 0.2s;
}
.cf-btn:hover { opacity: 0.85; transform: translateY(-2px); }

/* ── Footer ────────────────────────────────────────────── */
.footer {
  padding: 28px 80px;
  border-top: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

/* ── Lightbox ──────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.96);
  z-index: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  padding: 80px 52px 100px;
}
.lightbox.open {
  opacity: 1;
  pointer-events: all;
}

.lb-close {
  position: absolute;
  top: 28px;
  right: 40px;
  background: none;
  border: none;
  color: var(--text-mid);
  padding: 8px;
  transition: color 0.3s;
  z-index: 10;
}
.lb-close:hover { color: var(--text); }

.lb-inner {
  display: block;
  width: 100%;
  max-width: 1080px;
  max-height: calc(100vh - 180px);
}
.lb-info { display: none; }

.lb-media {
  max-height: calc(100vh - 180px);
  overflow: hidden;
  border-radius: 2px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-media img {
  max-width: 100%;
  max-height: calc(100vh - 180px);
  width: auto;
  height: auto;
  object-fit: contain;
  touch-action: none;
  user-select: none;
}
.lb-media.zoomed { overflow: visible; }

@keyframes lb-in-right { from { transform: translateX(60px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes lb-in-left  { from { transform: translateX(-60px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.lb-media.slide-next img { animation: lb-in-right 0.28s var(--ease) forwards; }
.lb-media.slide-prev img { animation: lb-in-left  0.28s var(--ease) forwards; }

.lb-cat {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.lb-title {
  font-family: var(--f-head);
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
}
.lb-desc {
  font-size: 0.92rem;
  color: var(--text-mid);
  line-height: 1.75;
}
.lb-year {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}

.lb-nav {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 20px;
}
.lb-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-mid);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  transition: border-color 0.3s, color 0.3s;
}
.lb-btn:hover         { border-color: var(--accent); color: var(--accent); }
.lb-btn:disabled      { opacity: 0.25; pointer-events: none; }
.lb-counter {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--text-mid);
  min-width: 48px;
  text-align: center;
}

/* ── Load animations (hero) ────────────────────────────── */
.load-reveal {
  opacity: 0;
  transform: translateY(22px);
  animation: reveal-up 1s var(--ease) forwards;
  animation-delay: calc(var(--d) * 0.15s);
}
@keyframes reveal-up {
  to { opacity: 1; transform: translateY(0); }
}

/* ── Scroll animations ─────────────────────────────────── */
.scroll-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
}
.scroll-reveal.in { opacity: 1; transform: none; }

/* Card enter animation */
.card {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity   0.65s var(--ease),
    transform 0.65s var(--ease),
    scale     0.45s ease;
}
.card.in       { opacity: 1; transform: none; }
.card.filtered { display: none; }

/* Mobile-only line break */
.mobile-br { display: none; }

/* ── Hamburger button ───────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
  position: relative;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1024px) {
  .bento-grid { grid-template-columns: repeat(4, 1fr); }
  .card[data-size="full"]   { grid-column: span 4; aspect-ratio: 16/9; }
  .card[data-size="large"]  { grid-column: span 4; }
  .card[data-size="normal"] { grid-column: span 2; }
  .lb-inner   { grid-template-columns: 1fr; gap: 32px; }
  .lb-media   { max-height: calc(100vh - 180px); }
}

@media (max-width: 768px), (max-width: 1200px) and (orientation: portrait) {

  .nav, .hero, .footer { padding-left: 28px; padding-right: 28px; }

  /* Nav always has solid background on mobile (readable over any content) */
  .nav {
    background: rgba(36, 36, 36, 0.97);
    backdrop-filter: blur(16px);
    border-color: var(--border);
  }

  /* Mobile-only line break */
  .mobile-br { display: block; }

  /* Nav links always visible on mobile */
  .nav-logo { white-space: nowrap; font-size: 0.95rem; }
  .nav-links { gap: 12px; }
  .nav-links .nav-link { font-size: 0.72rem; letter-spacing: 0.08em; color: var(--text); white-space: nowrap; }
  .nav-drop-link {
    font-size: 0.88rem;
    padding: 8px 14px;
    letter-spacing: 0.08em;
  }

  .hero-scroll { padding: 14px 0 28px; }

  .container    { padding: 0 28px; }
  .section      { padding: 72px 0; }
  .lightbox     { padding: 64px 24px 88px; }
  .lb-close     { top: 16px; right: 16px; background: rgba(0,0,0,0.5); border-radius: 50%; }
  .lb-media     { max-height: calc(100vh - 152px); }
  .lb-media img { max-height: calc(100vh - 152px); }

  /* Tagline wraps on mobile */
  .hero-tagline { white-space: normal; font-size: 1.4rem; font-weight: 400; color: var(--text); }

  /* Hero stacks vertically + text centred */
  .hero-grid {
    grid-template-columns: 1fr;
    padding-top: calc(var(--nav-h) + 24px);
    padding-bottom: var(--nav-h);
    align-content: center;
    gap: 20px;
  }
  .hero-visual {
    height: auto;
    order: -1;
    align-items: center;
    margin-bottom: 0;
    justify-content: center;
  }
  .hero-visual picture {
    display: block;
    width: 100%;
  }
  .hero-photo {
    height: auto;
    width: 92%;
    max-height: 54vh;
    object-fit: contain;
    object-position: center center;
    display: block;
    margin: 0 auto;
  }
  .hero-text {
    padding-right: 0;
    padding-left: 0;
    text-align: center;
    width: 100%;
  }
  .hero-name { font-size: clamp(44px, 10vw, 64px); }

  /* About stacks vertically + text centred */
  .about-body   { grid-template-columns: 1fr; gap: 40px; }
  .about-visual { display: none; }
  .about-text   { text-align: center; }
  .nowrap-desktop { white-space: normal; }

  /* Work grid */
  #work .container    { padding: 0 16px; }
  .work-category      { margin-bottom: 56px; }
  .category-heading   { font-size: clamp(1.8rem, 3vw, 2.6rem); margin-bottom: 20px; }

  /* Contact */
  #contact            { padding-top: 48px; }
  .cf-row             { flex-direction: column; }

  /* Hide custom cursor on touch */
  .cursor, .cursor-ring { display: none; }
}

/* ── Landscape phones ────────────────────────────────────── */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: 100svh;
    padding: 0 20px;
  }
  .hero-grid {
    grid-template-columns: 1fr 1.1fr;
    gap: 0;
    padding-top: var(--nav-h);
    padding-bottom: 0;
    max-width: 680px;
    margin: 0 auto;
    width: 100%;
    transform: translateX(48px);
  }
  .hero-text {
    text-align: left;
    padding-right: 0;
  }
  .hero-name {
    font-size: 32px;
    margin-bottom: 10px;
    white-space: nowrap;
  }
  .hero-tagline {
    font-size: 0.95rem;
    white-space: normal;
  }
  .hero-visual {
    order: 0;
    margin-bottom: 0;
    margin-left: -96px;
    height: calc(100svh - var(--nav-h) - 44px);
    align-self: center;
  }
  .hero-photo {
    max-height: calc(100svh - var(--nav-h) - 44px);
    height: 100%;
    object-position: center center;
  }
  .hero-scroll { padding: 4px 0 10px; }
  .mobile-br   { display: block; }
}

/* ── Short landscape screens (tablets landscape) ── */
@media (min-height: 501px) and (max-height: 800px) and (orientation: landscape) {
  .hero { min-height: auto; }
  .hero-grid {
    grid-template-columns: 1fr 1fr;
    padding-top: calc(var(--nav-h) + 16px);
  }
  .hero-visual {
    align-items: center;
    align-self: center;
  }
  .hero-photo {
    height: auto;
    max-height: calc(100vh - var(--nav-h) - 32px);
    object-position: center center;
  }
}
