/* mosbee — portfolio */

:root {
  --bg: #030303;
  --card: #0e0e0e;
  --line: #434343;
  --line-soft: #1f1f1f;
  --text: #ffffff;
  --muted: #c2c2c2;
  --dim: #8a8a8a;

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --pad: clamp(20px, 5vw, 64px);
  --gap: clamp(24px, 4vw, 48px);
  --header-h: 70px;

  --font: "TikTok Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    linear-gradient(to right, rgba(67, 67, 67, .55) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(67, 67, 67, .55) 1px, transparent 1px);
  background-size: 46.6px 46.6px;
  background-position: center top;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 900; letter-spacing: -0.01em; }
ul, ol { margin: 0; padding: 0; list-style: none; }

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

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- type ---------- */

.label {
  font-size: 10px;
  font-weight: 200;
  letter-spacing: 3px;
  line-height: 1.5;
  color: var(--muted);
  text-transform: lowercase;
}

.h-xl {
  font-size: clamp(44px, 7vw, 100px);
  line-height: 1;
}

.h-lg {
  font-size: clamp(36px, 5vw, 70px);
  line-height: 1;
}

.text {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.45;
  color: var(--muted);
  max-width: 34em;
}

.dim { color: var(--dim); }

/* ---------- layout ---------- */

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

.section {
  position: relative;
  margin-top: var(--gap);
  padding: var(--pad);
  background: var(--bg);
  border: 1px solid var(--line);
}

.section-head {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px 32px;
  margin-bottom: var(--gap);
}

.section-head .label { padding-top: .9em; }
.section-head .text { margin-top: 20px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
}

/* ---------- header ---------- */

/* header is a block of content width (as on the old site), not a full-width bar;
   it is fixed and overlaps the first block */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
}

.header__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(100% - 2 * var(--gutter), var(--wrap) - 40px);
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.logo { display: inline-flex; width: 200px; }
.logo img { width: 100%; height: auto; }

.nav { display: flex; gap: 32px; }
.nav .nav__contact { display: none; }

.nav a,
.lang a {
  font-size: 15px;
  font-weight: 300;
  letter-spacing: 1.5px;
  color: var(--muted);
  transition: color .2s;
}

.nav a:hover,
.lang a:hover,
.lang a[aria-current] { color: var(--text); }

.header__right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 24px;
}

.lang { display: flex; gap: 10px; }
.lang a { font-size: 13px; letter-spacing: 2px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 24px;
  font-size: 15px;
  font-weight: 300;
  letter-spacing: 1.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  transition: color .2s, border-color .2s, background .2s;
}

.btn:hover { color: var(--bg); background: var(--text); border-color: var(--text); }

.burger {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
}

.burger span,
.burger span::before,
.burger span::after {
  display: block;
  width: 16px;
  height: 1px;
  margin: 0 auto;
  background: currentColor;
  transition: transform .25s, opacity .25s;
}

.burger span { position: relative; }
.burger span::before,
.burger span::after { content: ""; position: absolute; left: 0; }
.burger span::before { top: -5px; }
.burger span::after { top: 5px; }

.header.is-open .burger span { background: transparent; }
.header.is-open .burger span::before { transform: translateY(5px) rotate(45deg); }
.header.is-open .burger span::after { transform: translateY(-5px) rotate(-45deg); }

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1fr;
  margin-top: 0;
  min-height: min(100svh, 900px);
  padding-top: calc(var(--header-h) + clamp(40px, 8vw, 110px));
  overflow: hidden;
}

.hero__content { position: relative; z-index: 2; max-width: 820px; }
.hero__name { font-size: 15px; margin-bottom: 20px; }

.hero__lead {
  margin-top: clamp(28px, 4vw, 56px);
  max-width: 18em;
  font-size: clamp(22px, 2.7vw, 39px);
  font-weight: 300;
  line-height: 1.15;
}

.hero__remote { margin-top: 20px; font-size: 13px; }

.hero__side {
  position: absolute;
  top: calc(var(--header-h) + clamp(40px, 8vw, 110px));
  right: 20px;
  z-index: 2;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 13px;
}

.hero__logo {
  position: absolute;
  z-index: 1;
  right: 2%;
  bottom: 6%;
  width: min(62%, 720px);
  aspect-ratio: 384 / 230;
}

.mosbee-3d-logo-frame {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

.mosbee-3d-logo-stage { position: absolute; inset: 0; }
.mosbee-3d-logo-stage canvas { width: 100% !important; height: 100% !important; }

/* ---------- cases ---------- */

.cases { display: grid; gap: 16px; }

.case {
  display: grid;
  grid-template-columns: 1fr minmax(0, 460px);
  min-height: 428px;
  overflow: hidden;
}

.case__body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: clamp(24px, 4vw, 40px);
}

.case__title { margin-top: auto; }
.case__body .text { max-width: 30em; }

.case__media {
  position: relative;
  border-left: 1px solid var(--line);
  background: #1a1a1a;
}

.case__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .8s cubic-bezier(.2, .7, .2, 1);
}

.case:hover .case__media img { transform: scale(1.03); }

/* card link to the case page: the whole card is clickable */
.case { position: relative; }

.case__link {
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 2px;
  color: var(--text);
}

.case__link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.case__link:hover,
.case__link:focus-visible { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- case page ---------- */

.case-page {
  display: grid;
  gap: 20px;
  margin-top: 0;
  padding-top: calc(var(--header-h) + clamp(40px, 8vw, 110px));
}

.case-page__back { color: var(--muted); transition: color .2s; width: max-content; }
.case-page__back:hover { color: var(--text); }
.case-page__title { margin-top: 12px; }

.case-page__lead {
  max-width: 26em;
  font-size: clamp(20px, 2.2vw, 30px);
  font-weight: 300;
  line-height: 1.2;
}

/* small covers stay at their own size instead of being stretched blurry */
.case-page__cover { display: grid; place-items: center; padding: 0; overflow: hidden; background: var(--card); }
.case-page__cover img { width: 100%; height: auto; }

.case-page__block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: var(--gap);
}

.case-page__block-text .text { margin-top: 20px; }
.case-page__images { display: grid; gap: 16px; }
.case-page__images img { width: 100%; height: auto; border: 1px solid var(--line); }

.case-page__next {
  display: grid;
  gap: 16px;
  transition: background .2s;
}

.case-page__next:hover { background: #0b0b0b; }

/* ---------- pre-design ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  padding: 1px 0 0 1px; /* offsets the -1px overlap of card borders */
}

.step {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 148px;
  padding: 20px;
  margin: -1px 0 0 -1px;
}

.step__num {
  margin-bottom: 14px;
  font-size: 20px;
  font-weight: 300;
  letter-spacing: 3px;
  color: var(--muted);
}

.step__num b { font-weight: 700; color: var(--text); }
.step .label { font-weight: 700; color: var(--text); }
.step .text { font-size: 13px; }

/* ---------- tools ---------- */

.tools-marquee {
  height: 150px;
  margin: 0 calc(-1 * var(--pad)) 32px;
  border-block: 1px solid var(--line-soft);
}

#tools3dMarquee {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  contain: layout paint size;
}

#tools3dMarquee .tools3dMarquee__stage,
#tools3dMarquee canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
  padding: 20px;
}

.tools .label { width: 100%; font-weight: 700; color: var(--text); }

.tools li {
  font-size: 13px;
  font-weight: 200;
  letter-spacing: 2px;
  color: var(--muted);
}

/* wide screens: one row spread edge to edge with equal gaps (auto layout) */
@media (min-width: 1200px) {
  .tools { justify-content: space-between; }
}

/* ---------- experience ---------- */

.clients { display: grid; }

.client {
  display: grid;
  grid-template-columns: 220px 1fr 200px;
  align-items: center;
  gap: 8px 24px;
  min-height: 54px;
  padding: 12px 20px;
  margin-top: -1px;
  transition: background .2s;
}

.client:hover { background: #161616; }

.client__name { font-size: 18px; font-weight: 600; }
.client__status { text-align: right; }
.client__status.is-active { color: var(--text); }

/* ---------- contact ---------- */

.contact {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: var(--gap);
  padding-block: clamp(48px, 8vw, 96px);
}

.contact .label { margin-bottom: 16px; }

.contact__email {
  display: inline-block;
  margin-top: 28px;
  font-size: clamp(22px, 3vw, 42px);
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}

.contact__email:hover { border-color: currentColor; }

.socials { display: flex; flex-direction: column; gap: 14px; }

.socials a {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  transition: transform .2s;
}

.socials a:hover { transform: scale(1.08); }
.socials img { width: 50px; height: 50px; }

/* ---------- footer ---------- */

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-block: 28px 40px;
}

/* ---------- reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1);
}

.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ================= tablet ================= */

@media (max-width: 980px) {
  .header__inner { grid-template-columns: 1fr auto; }
  .logo { width: 160px; }
  .burger { display: block; }
  .header__right .btn { display: none; }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px 20px 24px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .2s, transform .2s, visibility .2s;
  }

  .nav a {
    padding: 16px 0;
    font-size: 20px;
    border-bottom: 1px solid var(--line-soft);
  }

  .nav .nav__contact { display: block; }

  .header.is-open .nav { visibility: visible; opacity: 1; transform: none; }

  .section-head { grid-template-columns: 1fr; }
  .section-head .label { padding-top: 0; }

  .case { grid-template-columns: 1fr 1fr; min-height: 0; }

  .client { grid-template-columns: 1fr auto; }
  .client__tags { grid-column: 1 / -1; order: 3; }
}

/* ================= mobile ================= */

@media (max-width: 640px) {
  :root { --header-h: 56px; }

  body { background-size: 32px 32px; }

  .section { margin-top: 16px; }

  .hero {
    margin-top: 0;
    min-height: 0;
    padding-top: calc(var(--header-h) + 24px);
    overflow: visible;
  }

  /* order: name → title → 3D logo → lead */
  .hero__content { display: contents; }
  .hero__name { order: 1; }
  .hero .h-xl { order: 2; }
  .hero__logo { order: 3; }
  .hero__lead { order: 4; margin-top: 8px; padding-right: 32px; }
  .hero__remote { order: 5; padding-right: 32px; }

  .hero__side {
    top: auto;
    right: 8px;
    bottom: var(--pad);
    font-size: 11px;
  }

  /* logo slightly wider than the frame, but 4px inside the screen edges */
  .hero__logo {
    position: relative;
    right: auto;
    bottom: auto;
    width: calc(100vw - 8px);
    margin: 8px 0 0 calc(50% - 50vw + 4px);
  }

  .case { grid-template-columns: 1fr; }
  .case-page { padding-top: calc(var(--header-h) + 24px); }
  .case-page__block { grid-template-columns: 1fr; }
  .case__media {
    order: -1;
    aspect-ratio: 460 / 330;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }
  .case__title { margin-top: 8px; }

  .steps { grid-template-columns: 1fr; }
  .step { min-height: 0; }

  .tools-marquee { height: 110px; }
  .tools { gap: 10px 18px; }
  .tools li { font-size: 13px; letter-spacing: 2px; }

  .client { grid-template-columns: 1fr; gap: 6px; padding: 14px 16px; }
  .client__name { font-size: 16px; }
  .client__status { text-align: left; order: 2; }

  .contact { grid-template-columns: 1fr; }
  .contact__email { word-break: break-all; }
  .socials { flex-direction: row; }

  .footer { flex-direction: column-reverse; align-items: flex-start; }
}
