/* ============================================
   Omer Viner portfolio
   ============================================ */

:root {
  --accent: #20a58e;        /* brand teal: headings, links, active state */
  --accent-dark: #167a69;   /* teal for boxes with white text (passes 4.5:1) */
  --text: #333;
  --muted: #5f5f5f;
  --line: #e5e5e5;
  --bg: #fff;
  --sidebar-w: 260px;
  --content-w: 960px;
}


/* "fallback": wait up to 100 ms for the font (instant when cached), so text doesn't flash between pages */
@font-face { font-family: Raleway; src: url(/assets/fonts/raleway-400.woff2) format("woff2"); font-weight: 400; font-display: fallback; }
@font-face { font-family: Raleway; src: url(/assets/fonts/raleway-700.woff2) format("woff2"); font-weight: 700; font-display: fallback; }
@font-face { font-family: OpenSans; src: url(/assets/fonts/opensans-400.woff2) format("woff2"); font-weight: 400; font-display: fallback; }
@font-face { font-family: OpenSans; src: url(/assets/fonts/opensans-700.woff2) format("woff2"); font-weight: 700; font-display: fallback; }

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: OpenSans, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

h1, h2, h3, .sidebar, .back-link {
  font-family: Raleway, system-ui, sans-serif;
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

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

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip-link {
  position: absolute; left: -9999px; top: 8px;
  background: var(--accent-dark); color: #fff; padding: 8px 12px; z-index: 2000;
}
.skip-link:focus { left: 8px; }

/* ---------- Sidebar ---------- */

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  padding: 40px 24px 24px 40px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.sidebar a { color: #555; }
.sidebar a:hover { color: var(--accent); text-decoration: none; }
/* No focus ring after a click: the active link is already bold. Keyboard focus gets an underline. */
.sidebar a:focus { outline: none; }
.sidebar a:focus-visible { outline: none; text-decoration: underline; }
.sidebar a.chosen { color: var(--accent); font-weight: 700; }

.sidebar-name { font-size: 1.4em; font-weight: 700; color: #444 !important; margin-bottom: 32px; }

.sidebar ul { list-style: none; margin: 0; padding: 0; }
.nav-main li { font-size: 1.2em; padding: 4px 0; }
.nav-projects li { font-size: 0.92em; padding: 3px 0; }

.sidebar hr { width: 7em; margin: 20px 0; border: 0; border-top: 1px solid var(--line); }

.nav-category { color: var(--accent); font-weight: 700; font-size: 1.1em; margin: 8px 0 6px; }
.nav-category a { color: var(--accent); }

.sidebar-footer { margin-top: auto; padding-top: 24px; font-size: 0.85em; color: var(--muted); }

/* ---------- Main ---------- */

.main {
  margin-left: var(--sidebar-w);
  padding: 48px 48px 96px;
  max-width: 1800px;  /* fills the window; padding keeps the edges */
  container-type: inline-size;  /* lets wide media (the panorama) use the full width */
}

.topbar, .overlay { display: none; }

/* ---------- Home ---------- */

.intro { font-family: Raleway, system-ui, sans-serif; font-size: 1.3em; color: #444; margin: 0 0 32px; max-width: none; }

/* Project tiles: image only, name shows on hover (as in the original site) */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.tiles-small { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

.tile { position: relative; display: block; aspect-ratio: 2 / 1; overflow: hidden; background: #f2f2f2; color: #fff; }
.tile:hover { text-decoration: none; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-hover {
  position: absolute; inset: 0; padding: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  background: rgba(32, 165, 142, .92); color: #fff;
  opacity: 0; transition: opacity .2s ease-in-out;
}
.tile:hover .tile-hover, .tile:focus-visible .tile-hover { opacity: 1; }
.tile-title { font-family: Raleway, system-ui, sans-serif; font-weight: 700; font-size: 1.55em; line-height: 1.2; }
.tile-label { font-size: .88em; margin-top: 4px; }
.tiles-small .tile-title { font-size: 1.1em; }
.tiles-small .tile-label { font-size: .78em; }

/* A project without a thumbnail: its name on a teal block */
.tile-text { background: var(--accent-dark); }
.tile-text .tile-hover { opacity: 1; background: transparent; }
.tile-text:hover .tile-hover { background: rgba(0, 0, 0, .12); }

.archive-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 72px 0 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.archive-head h2 { margin: 0; font-size: 1em; color: var(--accent); }
.archive-head span { font-size: .9em; color: var(--muted); }

/* ---------- Project page ---------- */

.project, .about { max-width: var(--content-w); }
.about > p { max-width: 42em; }

.back-link { display: inline-block; font-size: 0.95em; margin-bottom: 16px; color: var(--muted); }

.project-title { color: var(--accent); font-size: 2.6em; line-height: 1.15; margin: 0 0 8px; }
.project-summary { font-size: 1.2em; color: var(--muted); margin: 0 0 28px; max-width: 38em; }

.project-hero { width: 100%; margin: 0 0 28px; }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px 32px;
  margin: 0 0 28px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.facts dt { font-family: Raleway, sans-serif; font-weight: 700; font-size: 0.8em; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.facts dd { margin: 2px 0 0; }

.project-description { max-width: 40em; }

.outcome { background: var(--accent-dark); color: #fff; padding: 20px 24px; margin: 24px 0; }

.project-links { margin: 16px 0 32px; font-weight: 700; }

.project-body h2, .about h2 { font-size: 1.5em; margin: 48px 0 12px; color: #444; }
.project-body ul, .about ul { padding-left: 1.2em; }
.project-body li { margin-bottom: 6px; }
.project-body > img, .project-body img { width: 100%; margin-top: 56px; }
.project-body iframe { width: 100%; border: 0; margin-top: 56px; }

/* Classes carried over from the original project pages */
.project-body .noPadding { margin-top: 16px; }
.project-body .imageDescription { color: var(--muted); font-size: 0.95em; padding: 8px 0 0; }
.project-body .smallImageDescription { text-align: center; }
.project-body .smallPageImage { width: 60%; margin-left: auto; margin-right: auto; }
.project-body .smallImageFloat { width: calc(25% - 8px); float: left; margin-right: 8px; }
.project-body .projectHeader, .project-body .secHeader { font-family: Raleway, sans-serif; font-weight: 700; font-size: 1.5em; color: #444; margin: 56px 0 0; }
.project-body .projectDesc, .project-body .projectTec { margin: 40px 0 0; max-width: 40em; }
.project-body .imageSpacer { height: 24px; }
.project-body .smallSpacer { height: 12px; }
.project-body .videoWrapper { position: relative; padding-bottom: 56.25%; height: 0; margin-top: 56px; }
.project-body .videoWrapper iframe { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; }

.prev-next {
  display: flex; justify-content: space-between; gap: 16px;
  margin-top: 80px; padding-top: 24px; border-top: 1px solid var(--line);
  font-family: Raleway, sans-serif; font-weight: 700;
}

.timeline div { display: grid; grid-template-columns: 140px 1fr; gap: 16px; margin-bottom: 16px; }
.timeline dt { color: var(--muted); font-size: 0.95em; }
.timeline dd { margin: 0; }

/* ---------- Tablet ---------- */

@media (max-width: 1100px) {
  .main { padding: 40px 32px 80px; }
}

/* ---------- Phone ---------- */

@media (max-width: 767px) {
  body { font-size: 16px; }

  .topbar {
    display: flex; align-items: center; gap: 8px;
    position: sticky; top: 0; z-index: 900;
    height: 56px; padding: 0 8px;
    background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .menu-toggle {
    min-width: 44px; min-height: 44px;
    border: 0; background: transparent; font-size: 1.5em; color: #444; cursor: pointer;
  }
  .topbar-name { font-family: Raleway, sans-serif; font-weight: 700; font-size: 1.2em; color: #444; }

  .sidebar {
    z-index: 1000;
    width: 80%; max-width: 300px;
    padding: 32px 24px;
    transform: translateX(-100%);
    transition: transform .25s ease;
  }
  .sidebar.open { transform: none; box-shadow: 2px 0 12px rgba(0,0,0,.12); }
  .overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 950; }
  .overlay[hidden] { display: none; }

  .main { margin-left: 0; padding: 24px 16px 64px; }

  .intro { font-size: 1.15em; margin-bottom: 24px; }
  .archive-head { margin-top: 48px; }

  /* No hover on touch screens: show the name under each tile */
  .tiles { grid-template-columns: 1fr; gap: 20px; }
  .tiles-small { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; }
  .tile { aspect-ratio: auto; overflow: visible; background: none; color: var(--text); }
  .tile img { aspect-ratio: 2 / 1; height: auto; background: #f2f2f2; }
  .tile-hover { position: static; opacity: 1; background: none; color: var(--text); padding: 8px 0 0; align-items: flex-start; text-align: left; }
  .tile-title { font-size: 1.1em; }
  .tile-label { color: var(--muted); margin-top: 0; }
  .tiles-small .tile-title { font-size: .95em; }
  .tile-text { background: none; }
  .tile-text::before { content: ""; display: block; aspect-ratio: 2 / 1; background: var(--accent-dark); }

  .project-title { font-size: 2em; }
  .project-summary { font-size: 1.05em; }
  .project-body .smallPageImage { width: 100%; }
  .project-body .smallImageFloat { width: calc(50% - 8px); }
  .project-body > img, .project-body img, .project-body iframe { margin-top: 32px; }

  .timeline div { grid-template-columns: 1fr; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
/* Smooth page-to-page navigation in browsers that support it (Chrome, Edge, Safari 18+) */
@view-transition { navigation: auto; }
.sidebar { view-transition-name: sidebar; }

/* Image grid inside project pages, with credits */
.project-body .shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 32px; }
.project-body .shots img { margin-top: 0; }
.project-body figure { margin: 56px 0 0; }
.project-body .shots figure { margin: 0; }
.project-body figure img { margin-top: 0; }
.project-body figcaption { color: var(--muted); font-size: 0.9em; padding-top: 8px; }
@media (max-width: 767px) { .project-body .shots { grid-template-columns: 1fr; } }

/* ---------- Digital Postcards panorama ---------- */
.pano { margin-top: 16px; width: 100cqw; max-width: 100%; }
.project .pano { max-width: none; }
.pano-frame {
  position: relative; overflow: hidden; aspect-ratio: 16 / 7; background: #2a3e6b;
  cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.pano-frame.dragging { cursor: grabbing; }
.pano-frame:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.pano-layer { position: absolute; top: 0; left: 0; height: 100%; will-change: transform; }
.pano-layer img { position: absolute; top: 0; left: 0; height: 100%; max-width: none; margin: 0 !important; pointer-events: none; }
.pano-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #fff; color: var(--accent-dark); cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18); transition: background .2s, color .2s;
}
.pano-arrow svg { width: 22px; height: 22px; display: block; }
.pano-arrow:hover { background: var(--accent-dark); color: #fff; }
.pano-prev { left: 16px; }
.pano-next { right: 16px; }
.pano-hint {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 2;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 14px; padding: 4px 12px; border-radius: 99px;
  transition: opacity .4s; pointer-events: none;
}
.pano-used .pano-hint { opacity: 0; }
.pano-stops { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 8px; padding: 0; margin: 12px 0 0; }
.pano-stops button {
  font: inherit; font-size: 15px; border: 1px solid var(--line); background: #fff; color: var(--text);
  border-radius: 99px; padding: 4px 14px; cursor: pointer; min-height: 36px;
}
.pano-stops button:hover { border-color: var(--accent); color: var(--accent-dark); }
.pano-stops button.on { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
@media (max-width: 767px) {
  .pano-frame { aspect-ratio: 4 / 3; }
  .pano-arrow { width: 40px; height: 40px; }
  .pano-arrow svg { width: 18px; height: 18px; }
}

/* ---------- Feature rows (Batch Studio) ---------- */
.project-body .features { width: 100cqw; }
.project-body .feature {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px 40px; align-items: center; margin-top: 56px;
}
.project-body .feature-portrait { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.project-body .feature-media video, .project-body .feature-media img {
  display: block; width: 100%; height: auto; margin: 0; background: #f2f2f2;
}
.project-body .feature-portrait .feature-media video { max-width: 340px; margin: 0 auto; }
.project-body .feature-text { max-width: 34em; }
.project-body .feature-text h3 { margin: 0 0 8px; font-size: 1.25em; color: #444; }
.project-body .feature-text p { margin: 0 0 10px; }
.project-body .phone-stills { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; margin-top: 40px; align-items: end; }
.project-body .phone-stills figure { margin: 0; }
@media (max-width: 1100px) {
  .project-body .feature, .project-body .feature-portrait { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .project-body .phone-stills { grid-template-columns: 1fr; }
}
.project-body figure video { display: block; width: 100%; height: auto; background: #f2f2f2; }
.project-body .responsive-shots { display: grid; grid-template-columns: minmax(0, 1510fr) minmax(0, 493fr); gap: 16px; margin-top: 32px; align-items: end; }
.project-body .responsive-shots figure { margin: 0; }
.project-body .postcards { width: 100cqw; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 24px; margin-top: 24px; }
.project-body .postcards figure { margin: 0; }
.project-body .postcards img { border-radius: 14px; box-shadow: 0 2px 6px rgba(0, 0, 0, .08), 0 10px 28px rgba(0, 0, 0, .12); }
@media (max-width: 767px) { .project-body .postcards { grid-template-columns: 1fr; } }

/* ---------- Book page: rounded gallery, awards, campaign ---------- */
.project-body .gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 20px; margin-top: 24px; }
.project-body .gallery figure { margin: 0; }
.project-body .gallery img { border-radius: 14px; box-shadow: 0 2px 6px rgba(0, 0, 0, .08), 0 8px 22px rgba(0, 0, 0, .1); }
.project-body .awards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 28px; text-align: center; }
.project-body .awards figure { margin: 0; }
.project-body .awards img { width: 112px; height: 112px; margin: 0 auto; }
.project-body .awards figcaption { margin-top: 8px; font-size: .9em; color: var(--muted); line-height: 1.35; }
.project-body .campaign { margin-top: 32px; max-width: 520px; }
.project-body .campaign img { border-radius: 10px; border: 1px solid var(--line); }
.project-body .credits { margin-top: 48px; }
@media (max-width: 767px) {
  .project-body .gallery { grid-template-columns: 1fr; }
  .project-body .awards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.project-body .gallery-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.project-body .gallery-4 img { box-shadow: 0 2px 6px rgba(0, 0, 0, .08), 0 6px 16px rgba(0, 0, 0, .1); }
.project-body .model { max-width: 640px; }
@media (max-width: 767px) { .project-body .gallery-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.project-body .sheet { margin-top: 28px; }
.project-body .sheet img { border-radius: 10px; border: 1px solid var(--line); }
.project-body .icons { max-width: none; }
.project-body .icons figcaption { text-align: center; line-height: 1.35; }
.project-body .gallery { align-items: start; }
.project-body .gallery-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.project-body .gallery .wide { grid-column: 1 / -1; }
.project-body .wide-figure { margin: 24px 0 0; }
.project-body .wide-figure img { border-radius: 10px; box-shadow: 0 2px 6px rgba(0, 0, 0, .08), 0 8px 22px rgba(0, 0, 0, .1); }
@media (max-width: 767px) { .project-body .gallery-3 { grid-template-columns: 1fr; } }
.project-body .wide-figure.fit { text-align: center; }
.project-body .wide-figure.fit img { width: auto; max-width: 100%; max-height: 85vh; display: inline-block; }
.project-body .wide-figure.fit figcaption { text-align: left; }

/* ---------- Batch Studio: big clips and tiles ---------- */
.project-body .big { margin-top: 64px; }
.project-body .big video {
  display: block; width: 100%; height: auto; border-radius: 12px; background: #f2f2f2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .08), 0 10px 28px rgba(0, 0, 0, .12);
}
.project-body .big h3, .project-body .features-h { margin: 22px 0 6px; font-size: 1.3em; color: #444; }
.project-body .big p { max-width: 40em; margin: 0; }
.project-body .features-h { margin-top: 72px; }
.project-body .clip-tiles { display: grid; gap: 28px; margin-top: 20px; }
.project-body .clip-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.project-body .clip-tile { margin: 0; }
.project-body .clip-tile video {
  display: block; width: 100%; height: auto; border-radius: 10px; background: #f2f2f2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .08), 0 8px 22px rgba(0, 0, 0, .1);
}
.project-body .clip-tile-portrait video { max-width: 300px; margin: 0 auto; }
.project-body .clip-tile figcaption { margin-top: 12px; font-size: .95em; color: #555; }
@media (max-width: 767px) { .project-body .clip-tiles { grid-template-columns: 1fr; } }
.project-body figure.clip-tile-portrait video { max-width: 300px; aspect-ratio: 480 / 780; margin: 0 auto; }
.project-body .big video { width: auto; max-width: 100%; max-height: 78vh; }
.project-body .clip-tile video { max-height: 70vh; }
.project-body .big { margin-top: 80px; padding-top: 28px; border-top: 1px solid #e4e4e4; }
.project-body .big h3 { margin: 0 0 6px; }
.project-body .big p { margin: 0 0 22px; }
.project-body .features > .big:first-child { margin-top: 48px; }
.project-body .big video, .project-body .clip-tile video, .project-body .feature-media video {
  border-radius: 0; box-shadow: none; background: transparent;
}
.project-contact { margin: 72px 0 0; padding-top: 24px; border-top: 1px solid #e4e4e4; color: #555; }
