﻿/* ==========================================================================
   Components: site menu, back-to-top, outline button, contact links,
   project card, tag list, info block, experience, frame card, comment, memory
   ========================================================================== */

/* Fixed controls sit outside .page, so they use a viewport-based pitch.
   They start at column 7 (Figma x = 756); on mobile at column 5 so the
   200px menu panel still fits on screen. */
:root {
  --fixed-pitch: calc((100vw + var(--gutter)) / 12);
  --fixed-col: 5;
}

@media (min-width: 768px) {
  :root { --fixed-col: 7; }
}

/* Site menu: opens on hover (click/tap and keyboard as fallback) ---------- */
.site-menu {
  --panel-h: 191px;
  position: fixed;
  top: 0;
  left: calc(var(--fixed-col) * var(--fixed-pitch));
  z-index: 50;
  display: flex;
  flex-direction: column-reverse; /* toggle is first in the DOM, shown under the panel */
  align-items: flex-start;
  width: 200px;
  transform: translateY(calc(-1 * var(--panel-h)));
  transition: transform 0.4s var(--ease);
}

.site-menu.is-open { transform: none; }

.site-menu__panel {
  align-self: stretch;
  height: var(--panel-h);
  padding: 24px;
  background: var(--color-pink-02);
  visibility: hidden;
  transition: visibility 0s linear 0.4s;
}

.site-menu.is-open .site-menu__panel {
  visibility: visible;
  transition-delay: 0s;
}

.site-menu__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.site-menu__list a {
  color: var(--color-white);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-decoration: none;
}

.site-menu__list a:hover,
.site-menu__list a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.site-menu__list a:focus-visible { outline-color: var(--color-white); }

/* The tab stays put; only the arrow turns (down = closed, up = open). */
.site-menu__toggle {
  display: grid;
  place-items: center;
  width: 48px;
  height: 32px;
  padding: 0;
  border: 0;
  background: var(--color-pink-02);
  cursor: pointer;
}

.site-menu__arrow {
  transform: rotate(90deg);
  transition: transform 0.4s var(--ease);
}

.site-menu.is-open .site-menu__arrow { transform: rotate(-90deg); }

/* Back to top ------------------------------------------------------------ */
.back-to-top {
  position: fixed;
  left: calc(var(--fixed-col) * var(--fixed-pitch));
  bottom: 24px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 32px;
  max-width: 48px;
  padding-inline: 20px;
  overflow: hidden;
  background: var(--color-green-01);
  color: var(--color-white);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition:
    max-width 0.35s var(--ease),
    opacity 0.3s var(--ease),
    transform 0.3s var(--ease),
    visibility 0s linear 0.3s;
}

@media (min-width: 768px) {
  .back-to-top { bottom: 48px; }
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.back-to-top:hover,
.back-to-top:focus-visible { max-width: 160px; }

.back-to-top__arrow {
  flex: none;
  transform: rotate(-90deg);
}

/* Outline button ("see all" / "see more"): spans the last 2 columns
   (4 on mobile) so it never leaves the grid. */
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: calc(4 * var(--pitch) - var(--gutter));
  padding: 14px 8px;
  white-space: nowrap;
  border: 0.5px solid var(--color-line);
  color: var(--color-black);
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}

@media (min-width: 768px) {
  .btn-outline { width: calc(2 * var(--pitch) - var(--gutter)); }
}

.btn-outline:hover,
.btn-outline:focus-visible {
  background: var(--color-black);
  color: var(--color-white);
}

.btn-outline--dark {
  border-color: var(--color-line-dark);
  color: var(--color-on-dark);
  font-weight: 400;
}

.btn-outline--dark:hover,
.btn-outline--dark:focus-visible {
  background: var(--color-on-dark);
  color: var(--color-dark);
}

/* Contact links: one exported Figma graphic (mail + linkedin) with two hit areas */
.contact-links {
  position: relative;
  width: 72px;
  height: 28px;
}

.contact-links a {
  position: absolute;
  top: 0;
  height: 28px;
  transition: background-color 0.2s;
}

.contact-links__mail { left: 0; width: 36px; }
.contact-links__linkedin { left: 44px; width: 28px; }

.contact-links a:hover { background: rgb(255 255 255 / 0.25); }

/* Project card ----------------------------------------------------------- */
.project-card {
  display: flex;
  flex-direction: column;
}

.project-card__image {
  aspect-ratio: 5 / 4;
  transition: opacity 0.3s var(--ease);
}

.project-card:hover .project-card__image { opacity: 0.85; }

.project-card__title {
  margin-top: 16px;
  font-size: 16px;
  font-weight: 500;
  line-height: normal;
}

.project-card__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 308px;
  margin-top: 8px;
  color: var(--color-grey-1);
  font-size: 14px;
  font-weight: 500;
  line-height: normal;
}

/* Tag list: "a / b / c" */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Separator trails each item, so a wrapped line never starts with "/" */
.tag-list li:not(:last-child)::after {
  content: "/";
  margin-left: 8px;
}

/* Info block (about: skills / tools / experiences) ----------------------- */
.info-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
  line-height: normal;
}

.info-block__title {
  color: var(--color-pink-02);
  font-size: 16px;
  font-weight: 500;
}

.info-block__list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 14px;
}

/* Experience ------------------------------------------------------------- */
.experience-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.experience {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  line-height: normal;
}

.experience__heading {
  color: var(--color-green-01);
  font-size: 14px;
  font-weight: 500;
}

.experience__org {
  color: var(--color-on-dark);
  font-weight: 400;
}

.experience__meta {
  color: var(--color-green-01);
  font-size: 12px;
  font-weight: 500;
}

.experience-list--compact { gap: 16px; }
.experience-list--spaced { gap: 24px; }

/* Entries block (about page): the list sits a little further from its title */
.info-block--entries { gap: 24px; }

/* Light variant (about page): org in black, description in grey */
.experience--light .experience__org { color: var(--color-black); }
.experience--light .experience__desc { color: var(--color-grey-1); }

.experience__link {
  align-self: flex-start;
  color: var(--color-grey-1);
  text-decoration: none;
}

.experience__link:hover,
.experience__link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Green link with a trailing arrow ("cv file", "more about me ...") ------- */
.cv-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-green-01);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  text-decoration: none;
}

.cv-link:hover,
.cv-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cv-link__arrow { flex: none; }
.cv-link__arrow--up-right { transform: rotate(-45deg); }
.cv-link__arrow--down { transform: rotate(90deg); }
/* Frame card (playground artboard) --------------------------------------- */
.frame-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.frame-card__label {
  color: var(--color-label);
  font-size: 10px;
  font-weight: 500;
  line-height: normal;
}

.frame-card__body {
  position: relative;
  aspect-ratio: 200 / 250;
  background: var(--color-white);
}

.frame-card__status {
  position: absolute;
  left: 8px;
  bottom: 8px;
  color: var(--color-placeholder-text);
  font-size: 14px;
  font-weight: 500;
  line-height: normal;
}

/* Comment bubble --------------------------------------------------------- */
.comment {
  position: relative;
  width: 240px;
  padding: 14px 14px 12px 46px;
  border-radius: 16px 16px 16px 0;
  background: var(--color-dark-surface);
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.48);
  color: var(--color-on-dark);
  font-size: 11px;
  font-weight: 600;
  line-height: normal;
}

.comment__avatar {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-pink-02);
}

.comment__header {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.comment__author { font-size: 12px; }
.comment__time { color: var(--color-on-dark-muted); }

.comment__text {
  max-width: 180px;
  margin-top: 1px;
  line-height: 16px;
}

/* Memory tile (width set by the memories rail) --------------------------- */
.memory--portrait { aspect-ratio: 200 / 267; }
.memory--near-square { aspect-ratio: 200 / 211.636; }
.memory--landscape { aspect-ratio: 200 / 162; }
.memory--square { aspect-ratio: 200 / 220; }
