/* ==========================================================================
   Site design (Figma file robertmihai.design)

   Shared by every page built from the Figma frames: the top bar, the Menu with
   the desktop icons, dividers, footer, contact block, plus the styles of each
   page (homepage, product design catalogue, secrets, placeholders). The case
   study has its own file, css/case-study.css.

   Loaded after styles.css, which still provides the fonts, the colour variables
   and the box-sizing reset. Sizes are the Figma values: a 900px column with 12px
   inner padding, 14px Inter, #000 / #777 / #aaa text, #ebebeb lines.
   ========================================================================== */

/* ---------- Page ---------- */

.page_wrapper.site {
  /* styles.css gives every page wrapper width:100vw + overflow:hidden, which
     would stop the top bar from sticking. */
  width: auto;
  overflow: visible;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 120px;
  padding-bottom: 80px;

  color: #000;
  font-family: Inter, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: normal;
}

.page_wrapper.site--home {
  gap: 80px;
}

.site-column {
  width: min(900px, 100% - 16px);
}

.site-muted {
  color: #aaa;
}

.site a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Top bar ---------- */

.site-bar {
  position: sticky;
  top: 0;
  z-index: 10; /* above the icons, also when the menu is open */
  align-self: stretch;
  display: flex;
  justify-content: center;
  padding: 12px 0;
  pointer-events: none; /* only the buttons catch clicks, not the strip between them */
}

.site-bar__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-button {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  border: 1px solid #ededed;
  border-radius: 8px;
  background-color: #fff;
  padding: 5px 11px; /* 6px 12px in Figma, where the border sits inside */
  color: #000;
  font: 500 14px/normal Inter, sans-serif;
  cursor: pointer;
  pointer-events: auto;
  transition: background-color 0.2s;
}

.site-button:hover {
  background-color: #f7f7f7;
}

/* "← Back": the outward arrow turned to point left */
.site-button__back-arrow {
  width: 11.314px;
  height: 11.314px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-button__back-arrow img {
  display: block;
  width: 8px;
  height: 8px;
  transform: rotate(-135deg);
}

/* ---------- Desktop icons + Menu ----------
   On the homepage the icons sit on the photo. On every other page the same
   arrangement waits in .menu-stage, just above the top of the screen, so the
   icons drop in from there. js/menu.js toggles .menu-open on <html>, fades out
   everything marked data-menu-fade and animates the icons into one row. */

.menu-icons {
  font-family: Inter, sans-serif;
  position: absolute;
  inset: 0;
  z-index: 1;
  container-type: inline-size;
}

.menu-stage {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 100%; /* sits right above the screen */
  z-index: 9;
  width: min(876px, 100% - 40px); /* same size as the homepage photo */
  aspect-ratio: 876 / 568.15;
  margin-inline: auto;
  visibility: hidden;
}

.menu-stage.is-active {
  visibility: visible;
}

/* --x/--y are Figma positions on the 876px-wide photo, --w the icon's width
   and --aw its drawing's slot, in Figma pixels. --u is one Figma pixel at the
   current size, so the arrangement shrinks with the photo on small screens. */
.menu-icon {
  --u: calc(100cqw / 876);
  position: absolute;
  left: calc(var(--x) * var(--u));
  top: calc(var(--y) * var(--u));
  width: calc(var(--w, 84) * var(--u));
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(2 * var(--u)) calc(2 * var(--u)) calc(6 * var(--u));
  border-radius: 8px;
  transition: background-color 0.2s;
}

.menu-icon__art {
  width: calc(var(--aw, 80) * var(--u));
  height: calc(80 * var(--u));
  display: flex;
  justify-content: center; /* 80px-wide drawings overflow the 60px slots evenly */
  align-items: center;
}

.menu-icon__art img {
  flex: none;
  display: block;
  width: auto;
  max-width: none;
  height: calc(80 * var(--u));
}

.menu-icon__label {
  color: #000;
  font-size: max(9px, calc(14 * var(--u)));
  font-weight: 500;
  line-height: normal;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 0 calc(15 * var(--u)) transparent;
  transition: color 0.5s, text-shadow 0.5s;
}

/* White labels on the homepage photo */
.home-hero .menu-icon__label {
  color: #fff;
  text-shadow: 0 0 calc(15 * var(--u)) #000;
}

.menu-icon:hover {
  background-color: rgb(255 255 255 / 0.12);
}

.menu-icon:focus-visible {
  outline: 2px solid #4c9bff;
  outline-offset: 0;
}

/* Menu open: only the icons, in a centred row, black labels */

.menu-open {
  overflow: hidden;
}

.menu-open .menu-icons {
  position: fixed;
  inset: 0 0 80px; /* centred in the screen minus 80px, as in Figma */
  z-index: 9;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-content: center;
  align-items: flex-start;
  row-gap: 24px;
  padding: 0 max(16px, (100% - 900px) / 2);
}

.menu-open .menu-icon {
  --u: 1px;
  position: static;
}

.menu-open .home-hero .menu-icon__label,
.menu-open .menu-icon__label {
  color: #000;
  text-shadow: 0 0 15px transparent;
}

.menu-open .menu-icon:hover {
  background-color: rgb(0 0 0 / 0.05);
}

@media (max-width: 639px) {
  .menu-open .menu-icons {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-items: center;
    align-content: center;
  }
}

/* ---------- Dividers + footer ---------- */

.site-divider {
  align-self: stretch;
  height: 1px;
  margin: 0;
  border: 0;
  background-color: #ebebeb;
}

/* The divider and footer at the end of a page, 80px apart */
.site-end {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 80px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 0 12px;
  line-height: 1.4;
}

.site-footer p {
  margin: 0;
}

.site-footer__updated {
  flex: none;
  text-align: right;
}

.site-footer__updated strong {
  display: block;
  color: #000;
  font-weight: 500;
}

/* ---------- Links with the outward arrow ---------- */

.site-link {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  transition: opacity 0.2s;
}

.site-link img {
  display: block;
  width: 10px;
  height: 10px;
}

a.site-link:hover,
a:hover > .site-link,
a:hover .contact-meeting__text .site-link {
  opacity: 0.6;
}

/* ---------- Contact block (homepage and /contact) ---------- */

.contact__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px 20px;
  padding: 40px 12px;
}

.contact-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.contact-status__dot {
  width: 12px;
  height: 12px;
  border: 1px solid #24db00;
  border-radius: 6px;
  background-color: #4eff2b;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.contact__or {
  margin: 0;
  padding: 20px;
  text-align: center;
}

.contact-meeting {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 16px 0 16px 12px;
  overflow: hidden;
  filter: drop-shadow(0 0 5px rgb(187 187 187 / 0.05));
}

.contact-meeting__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 500;
}

.contact-meeting__text p {
  margin: 0;
}

/* The screenshot is tilted 2.1° in a 387.7 × 285.7 box whose right edge runs
   ~10px past the column, where the block clips it, as in Figma. */
.contact-meeting__shot {
  flex: none;
  width: 387.7px;
  max-width: 100%;
  aspect-ratio: 387.7 / 285.66;
  margin-right: -9.96px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-meeting__shot img {
  display: block;
  width: 97.5%; /* 378 of 387.7 */
  max-width: none;
  height: auto;
  aspect-ratio: 378 / 272;
  transform: rotate(2.1deg);
}

@media (max-width: 639px) {
  .contact-meeting {
    flex-direction: column;
    align-items: flex-start;
    padding-right: 12px;
  }

  .contact-meeting__shot {
    margin-right: 0;
  }
}

/* /contact: the block on its own, centred in the screen minus 80px as in Figma
   (the bar floats over the top of this area). */
.page_wrapper.site--contact {
  gap: 0;
}

.contact-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - 80px);
  margin-top: -53px; /* start under the bar */
}

/* ---------- Homepage ---------- */

.home-hero {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 31px; /* the Figma section is 653px tall */
}

.home-hero__media {
  position: relative;
  margin: 0 12px;
}

.home-hero__frame {
  position: relative;
  overflow: hidden;
}

/* Figma draws this border inside the photo, on top of it */
.home-hero__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid #ebebeb;
  pointer-events: none;
}

.home-hero__frame img {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  aspect-ratio: 700 / 454;
  object-fit: cover;
  object-position: bottom;
}

.home-hero__caption {
  margin: 0;
  padding: 0 12px;
  text-align: center;
}

.home-hero__caption strong {
  color: #000;
  font-weight: 400;
}

@media (max-width: 931px) {
  .home-hero__caption br {
    display: none;
  }
}

.home-about {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0 12px;
}

.home-about h1,
.home-about h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: normal;
}

.home-about__text {
  color: #777;
  line-height: 1.4;
}

.home-about__text p {
  margin: 0;
}

.home-about__text p + p {
  margin-top: 1.4em; /* one empty line between paragraphs */
}

/* ---------- Product Design: case study catalogue (/work) ---------- */

.cases {
  display: flex;
  flex-direction: column;
  gap: 60px;
  padding: 0 12px;
}

.case {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.case__media {
  position: relative;
  border: 1px solid #ebebeb;
  overflow: hidden;
  background: linear-gradient(#fff, #f6f6f6 50%, #ededed);
}

.case__media img {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  aspect-ratio: var(--ratio);
  object-fit: var(--fit, contain);
}

/* Tags bottom-left, action bottom-right, drawn over the image border */
.case__overlay {
  position: absolute;
  left: -1px;
  right: -1px;
  bottom: -1px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.case__tags {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.case__tag,
.case__action {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #ebebeb;
  background-color: #fff;
  padding: 5px 11px; /* 6px 12px with the border inside */
  font-weight: 500;
  white-space: nowrap;
}

.case__tag + .case__tag {
  margin-top: -1px; /* neighbouring borders overlap */
}

.case__action img {
  display: block;
  width: 10px;
  height: 10px;
}

a.case {
  cursor: pointer;
}

a.case .case__action {
  transition: background-color 0.2s;
}

a.case:hover .case__action {
  background-color: #f7f7f7;
}

.case__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px;
}

.case__text h2,
.case__text p {
  margin: 0;
  font-size: 14px;
  line-height: normal;
}

.case__text h2 {
  font-weight: 500;
}

.case__text p {
  color: #777;
}

@media (max-width: 639px) {
  .case__overlay {
    position: static;
    margin: -1px;
  }
}

/* ---------- About (/about-me) ----------
   Figma frame "about-me" (2194:2660): the about text, then Experience, Education
   and Skills / Tools as rows of pills joined by thin lines. */

.cv {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 0 12px;
}

.cv__label {
  margin: 0;
  padding-left: 12px;
  font-size: 14px;
  font-weight: 500;
  line-height: normal;
}

.cv-entries {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.cv-entry {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cv-row {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* The role and its line take a fixed 202px, so every company pill lines up */
.cv-role {
  flex: 0 0 202px;
  display: flex;
  align-items: center;
}

.cv-line {
  flex: 1;
  min-width: 12px;
  height: 1px;
  background-color: #ededed;
}

.cv-pill {
  flex: none;
  border: 1px solid #ededed;
  border-radius: 6px;
  background-color: #fff;
  padding: 3px 7px; /* 4px 8px with the border inside: 25px tall */
  font-weight: 500;
  line-height: normal;
  white-space: nowrap;
}

.cv-entry__text {
  margin: 0;
  padding-left: 12px;
  color: #777;
  line-height: 1.4;
}

.cv-skills {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (max-width: 639px) {
  .cv-row {
    flex-wrap: wrap;
    gap: 8px 6px;
  }

  .cv-role {
    flex-basis: auto;
  }

  .cv-line {
    display: none;
  }
}

/* ---------- Placeholder pages ---------- */

.site-placeholder {
  min-height: calc(100vh - 53px - 120px - 80px - 120px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.site-placeholder h1 {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 500;
  line-height: normal;
}

.site-placeholder p {
  margin: 0;
}

.site-placeholder a {
  margin-top: 12px;
}

/* ---------- Utilities ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Secrets (/secrets) ----------
   Layout from the Figma frame "secrets" (2189:889). */

.secrets-intro {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0 12px;
  min-height: 46px; /* Figma block height */
}

.secrets-intro h1,
.secrets-intro p {
  margin: 0;
  font-size: 14px;
  line-height: normal;
}

.secrets-intro h1 {
  font-weight: 500;
}

.secrets-intro p {
  color: #777;
  line-height: 1.4;
}

.secrets-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 60px;
}

.secrets-pill {
  margin: 0;
  border: 1px solid #ebebeb;
  background-color: #fff;
  padding: 3px 7px; /* 4px 8px with the border inside */
  font-size: 14px;
  font-weight: 500;
  line-height: normal;
}

.secrets-list,
.secrets-grid {
  align-self: stretch;
  padding: 0 12px;
}

.secrets-list {
  display: flex;
  flex-direction: column;
  gap: 60px;
}

.secrets-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 60px 40px;
}

.secrets-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
}

.secrets-item img,
.secrets-item video {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  object-fit: cover;
  background-color: #f6f6f6;
}

.secrets-item figcaption {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.secrets-item strong {
  font-weight: 500;
}

.secrets-item figcaption span {
  color: #777;
}

.secrets-item--album {
  gap: 20px;
}

.secrets-item--album figcaption {
  gap: 4px;
  text-align: center;
}

.secrets-item--photo {
  gap: 20px;
}

.secrets-item--book {
  gap: 12px;
}

.secrets-item--book figcaption {
  gap: 4px;
}

@media (max-width: 639px) {
  .secrets-grid {
    gap: 40px 16px;
  }
}

/* Older pages (About Me) keep their own layout; their wrapper can't hold a
   sticky bar, so the bar is fixed there instead. */
.site-bar--fixed {
  position: fixed;
  left: 0;
  right: 0;
}
