/* Inter (logo) */
@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* Suisse Intl */
@font-face {
  font-family: "Suisse Intl";
  src: url("fonts/SuisseIntl-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Suisse Intl";
  src: url("fonts/SuisseIntl-Book.otf") format("opentype");
  font-weight: 450;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Suisse Intl";
  src: url("fonts/SuisseIntl-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Suisse Intl";
  src: url("fonts/SuisseIntl-SemiBold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Suisse Intl";
  src: url("fonts/SuisseIntl-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-panel: #ffffff;
  --text: #0a0a0a;
  --text-muted: #8a8a8a;
  --frame-bg: rgba(235, 235, 235);
  --pad-frame: 80px;
  --gap-frames: 4px;
  --nav-font-size: 13px;
  --app-height: 100vh;
}

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

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Suisse Intl", system-ui, -apple-system, sans-serif;
  font-weight: 400;
  color: var(--text);
  background: var(--bg-panel);
  -webkit-font-smoothing: antialiased;
}

.portfolio {
  display: flex;
  height: var(--app-height);
  min-height: var(--app-height);
  min-width: 960px;
}

/* Left: scrollable works (scrollbar hidden, still scrollable) */
.works {
  flex: 1;
  min-width: 0;
  height: var(--app-height);
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-panel);
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: crosshair;
}

.works::-webkit-scrollbar {
  display: none;
}

/* Left: map column (Map of me) — #ebebeb via --frame-bg */
.map-main {
  flex: 1;
  min-width: 0;
  height: var(--app-height);
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--frame-bg);
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: default;
}

/* Map column is sized to exactly 100vh with padded vis — no vertical scroll. Horizontal only if graph spills. */
.map-page .map-main {
  overflow-x: auto;
  overflow-y: hidden;
}

.map-main::-webkit-scrollbar {
  display: none;
}

.work-frame {
  position: relative;
  min-height: var(--app-height);
  height: var(--app-height);
  margin-bottom: var(--gap-frames);
  background: var(--frame-bg);
  padding: var(--pad-frame);
  display: flex;
  align-items: center;
  justify-content: center;
}

.work-frame--split {
  padding: 24px;
}

.work-frame__canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  touch-action: none;
  pointer-events: auto;
}

.work-frame.work-frame--tooltip-hover,
.work-frame.work-frame--tooltip-hover .work-frame__canvas {
  cursor: help;
}

.work-tooltip {
  position: fixed;
  z-index: 30;
  max-width: 360px;
  padding: 6px 8px;
  border: 1px solid #282828;
  border-radius: 1px;
  background: #ffffff;
  color: #282828;
  font-size: 10px;
  line-height: 1.35;
  letter-spacing: 0;
  pointer-events: none;
  opacity: 0;
  transform: translate(12px, 12px);
  transition: opacity 0.08s linear;
}

.work-tooltip.is-visible {
  opacity: 1;
}

html.drawing-enabled {
  user-select: none;
  -webkit-user-select: none;
}

.work-frame:last-child {
  margin-bottom: 0;
}

.work-frame__media {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-height: calc(var(--app-height) - 2 * var(--pad-frame));
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.work-frame__media img,
.work-frame__media video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  vertical-align: middle;
  pointer-events: none;
}

.work-frame__media--split {
  justify-content: center;
  gap: 24px;
}

.work-frame__media--split video {
  width: auto;
  height: 100%;
  flex: 0 1 auto;
  max-width: calc((100% - 24px) / 2);
  max-height: 100%;
  object-fit: contain;
}

.work-frame__media--split img {
  width: auto;
  height: 100%;
  flex: 0 1 auto;
  max-width: calc((100% - 24px) / 2);
  max-height: 100%;
  object-fit: contain;
}

/* Right: fixed panel — 28% of viewport width on desktop */
.panel {
  flex: 0 0 28%;
  width: 28%;
  min-width: 328px;
  max-width: 100%;
  height: var(--app-height);
  overflow: hidden;
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 24px;
}

.panel__header {
  display: flex;
  align-items: center;
  align-self: stretch;
  margin-bottom: 48px;
}

.logo {
  flex-shrink: 0;
  font-family: "Inter", system-ui, sans-serif;
  font-size: var(--nav-font-size);
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
  line-height: 1;
}

.logo:hover {
  opacity: 0;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-start;
  margin-left: auto;
  font-size: var(--nav-font-size);
  letter-spacing: 0.02em;
  text-align: left;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav a:hover,
.nav a.is-active {
  color: var(--text);
}

.nav-label-mobile {
  display: none;
}

.panel__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  overflow: hidden;
  text-align: left;
}

.intro {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font-size: 13px;
}

.greeting {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2px;
  width: 100%;
  line-height: 1.2;
  font-weight: 500;
  color: var(--text);
}

.greeting__avatar {
  display: block;
  width: 16px;
  height: 16px;
  object-fit: cover;
  flex-shrink: 0;
}

.lede {
  margin: 0;
  line-height: 1.55;
  font-weight: 400;
  color: #3a3a3a;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-align: left;
}

.intro .lede {
  font-weight: 400;
}

.intro__cv-note {
  margin: 0;
  width: 100%;
  line-height: 1.45;
  font-size: 12px;
  color: #868686;
}

.contact {
  align-self: stretch;
  width: 100%;
}

.contact__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.contact__item {
  margin: 0;
  padding: 0;
}

.contact__email {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: #737377;
  cursor: pointer;
  text-align: left;
  transition: none;
  display: inline-flex;
  align-items: center;
}

.contact__email:hover {
  color: var(--text);
}

.contact__link {
  font-size: 13px;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: #737377;
  text-decoration: none;
  transition: none;
  display: inline-flex;
  align-items: center;
}

.contact__link:hover {
  color: var(--text);
}

.contact__email::before,
.contact__link::before {
  content: "↗";
  flex-shrink: 0;
  min-width: 0;
  max-width: 0;
  margin-right: 0;
  overflow: hidden;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  color: inherit;
  align-self: center;
  transition: max-width 0.12s ease, margin-right 0.12s ease;
}

.contact__email:hover::before,
.contact__link:hover::before {
  max-width: 1.5em;
  margin-right: 2px;
}

.contact__label {
  flex-shrink: 0;
}

.contact__detail {
  flex-shrink: 1;
  min-width: 0;
  max-width: 0;
  margin-left: 0;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #868686;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  box-sizing: border-box;
  opacity: 0;
  transition:
    max-width 0.2s ease,
    margin-left 0.2s ease,
    opacity 0.2s ease;
}

.contact__email:hover .contact__detail,
.contact__email:focus-visible .contact__detail,
.contact__link:hover .contact__detail,
.contact__link:focus-visible .contact__detail {
  max-width: min(28rem, 100%);
  margin-left: 8px;
  opacity: 1;
}

.services {
  margin-top: auto;
  padding-top: 24px;
  align-self: stretch;
  width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.services__copyright {
  margin: 0;
  font-size: var(--nav-font-size);
  letter-spacing: 0.02em;
  line-height: inherit;
  color: #737377;
}

.radio-toggle {
  display: inline-block;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: var(--nav-font-size);
  letter-spacing: 0.02em;
  line-height: inherit;
  color: #737377;
  cursor: pointer;
  text-align: right;
  text-decoration: none;
  transition: color 0.15s ease;
}

.radio-toggle:hover,
.radio-toggle.is-active,
.radio-toggle[aria-pressed="true"] {
  color: var(--text);
}

@media (min-width: 768px) and (max-width: 959px) {
  html,
  body {
    overflow: auto;
  }

  .portfolio {
    min-width: 0;
    width: 100%;
    height: auto;
    min-height: var(--app-height);
    flex-direction: column;
  }

  .panel {
    order: -1;
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    max-width: none;
    height: auto;
    overflow: visible;
    padding-top: 72px;
  }

  .panel__header {
    position: fixed;
    top: 24px;
    left: 24px;
    right: 24px;
    z-index: 20;
    margin-bottom: 0;
    background: transparent;
  }

  .panel__body {
    align-self: stretch;
    width: 100%;
    overflow: visible;
  }

  .intro {
    max-width: 55vw;
  }

  .works,
  .map-main {
    width: 100%;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .services {
    flex-wrap: nowrap;
    justify-content: flex-start;
  }

  .services .radio-toggle {
    margin-left: auto;
    text-align: right;
  }

  .logo:hover,
  .logo:active {
    opacity: 1;
  }
}

@media (max-width: 767px) {
  html,
  body {
    overflow: auto;
  }

  .portfolio {
    min-width: 0;
    width: 100%;
    height: auto;
    min-height: var(--app-height);
    flex-direction: column;
  }

  .panel {
    order: -1;
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    max-width: none;
    height: auto;
    overflow: visible;
    padding: 16px;
    padding-top: 64px;
  }

  .panel__header {
    position: fixed;
    top: 16px;
    left: 16px;
    right: 16px;
    z-index: 20;
    margin-bottom: 0;
    background: transparent;
  }

  .panel__body {
    align-self: stretch;
    width: 100%;
    overflow: visible;
  }

  .intro {
    max-width: none;
    width: 100%;
  }

  .nav-label-desktop {
    display: none;
  }

  .nav-label-mobile {
    display: inline;
  }

  .works,
  .map-main {
    width: 100%;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .work-frame {
    padding: 16px;
  }

  .map-main .map__vis-container {
    padding: 16px;
  }

  .map-page .map-main,
  .map-page .intro {
    display: none;
  }

  .map-page .panel {
    order: 0;
    min-height: var(--app-height);
  }

  .services {
    flex-wrap: nowrap;
    justify-content: flex-start;
  }

  .services .radio-toggle {
    margin-left: auto;
    text-align: right;
  }

  .logo:hover,
  .logo:active {
    opacity: 1;
  }
}
