* {
  box-sizing: border-box;
}


/* =========================
   COLORS
   ========================= */

:root {
  --bg: #e0e0e0;
  --panel: #eeeeee;
  --chrome: #d4d4d4;

  --line: #1b1b1b;
  --text: #111111;
  --muted: #777777;
}


/* =========================
   GENERAL
   ========================= */

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);

  font-family: Tahoma, Verdana, Arial, sans-serif;
  font-size: 13px;

  -webkit-font-smoothing: antialiased;
}

.topbar,
.statusbar,
.desktop-label,
.window-titlebar,
.window-info h1,
.system-label,
.contact-legal-title {
  font-family: "Courier New", Courier, monospace;
}

button,
a {
  font: inherit;
  color: inherit;
}

a {
  text-decoration: none;
}


/* =========================
   PAGE STRUCTURE
   ========================= */

.desktop-shell {
  min-height: 100vh;

  display: grid;

  grid-template-rows:
    34px
    1fr
    28px;
}


/* =========================
   FIXED HOME SCREEN
   ========================= */

.home-page {
  width: 100%;
  height: 100vh;
  height: 100dvh;

  overflow: hidden;
}

.home-page .desktop-shell {
  width: 100%;
  height: 100vh;
  height: 100dvh;

  min-height: 0;

  overflow: hidden;
}


/* =========================
   TOP / BOTTOM BAR
   ========================= */

.topbar,
.statusbar {
  border-color: var(--line);

  display: flex;
  align-items: center;
  justify-content: space-between;

  text-transform: uppercase;
}

.topbar {
  padding: 0 12px;

  border-bottom: 1px solid var(--line);

  background: var(--chrome);

  font-size: 13px;
}

.topbar-right {
  display: flex;
  gap: 24px;
}

.statusbar {
  padding: 0 12px;

  border-top: 1px solid var(--line);

  background: var(--chrome);

  font-size: 11px;
}


/* =========================
   DESKTOP
   ========================= */

.desktop {
  padding: 44px 38px 70px;
}

.home-page .desktop {
  min-height: 0;

  padding:
    clamp(18px, 3.5vh, 44px)
    clamp(18px, 3vw, 38px);

  display: flex;

  overflow: hidden;
}

.desktop-grid {
  display: grid;

  grid-template-columns:
    repeat(5, minmax(120px, 1fr));

  gap: 48px 42px;

  align-items: start;
}

.home-page .desktop-grid {
  width: 100%;
  height: 100%;

  min-height: 0;

  grid-template-columns:
    repeat(5, minmax(0, 1fr));

  grid-template-rows:
    repeat(2, minmax(0, 1fr));

  gap:
    clamp(10px, 2.5vh, 32px)
    clamp(14px, 2.5vw, 42px);

  align-items: center;
  justify-items: center;
}


/* =========================
   DESKTOP ITEMS
   ========================= */

.desktop-item {
  border: 0;

  background: transparent;

  padding: 0;

  cursor: pointer;

  display: flex;
  flex-direction: column;

  align-items: flex-start;

  justify-self: center;

  width: 132px;
  min-height: 138px;
}

.home-page .desktop-item {
  width: clamp(118px, 11vw, 170px);

  min-height: 0;

  justify-content: center;
  align-self: center;
}


/* =========================
   ICONS
   ========================= */

.desktop-icon {
  width: 120px;
  height: 120px;

  object-fit: contain;

  margin-bottom: 10px;
}

.home-page .desktop-icon {
  width: clamp(105px, 14vh, 150px);
  height: clamp(105px, 14vh, 150px);

  max-width: 100%;
}


/* =========================
   ICON TEXT
   ========================= */

.desktop-label {
  display: inline-block;

  max-width: 132px;

  padding: 2px 4px;

  margin-left: -4px;

  text-align: left;

  line-height: 1.2;

  font-size: 13px;

  overflow-wrap: anywhere;

  align-self: flex-start;
}

.desktop-client {
  display: inline-block;

  margin-top: 3px;

  font-size: 11px;

  line-height: 1.2;

  text-align: left;

  color: var(--muted);

  align-self: flex-start;
}

.desktop-item:hover .desktop-label,
.desktop-item:focus-visible .desktop-label {
  background: var(--text);
  color: var(--panel);
}


/* =========================
   PROJECT OVERLAY
   ========================= */

.window-overlay {
  position: fixed;

  inset: 0;

  z-index: 1000;

  padding: 54px;

  background: rgba(60, 60, 60, 0.72);

  display: none;

  align-items: center;
  justify-content: center;
}

.window-overlay.is-open {
  display: flex;
}


/* =========================
   WINDOWS
   ========================= */

.project-window,
.contact-window {
  background: var(--panel);

  border: 1px solid var(--line);

  box-shadow:
    7px 7px 0 rgba(0, 0, 0, 0.22);
}


/* =========================
   PROJECT WINDOW
   ========================= */

.project-window {
  width: min(1100px, 100%);

  height: min(760px, calc(100vh - 108px));
  height: min(760px, calc(100dvh - 108px));

  max-height: calc(100vh - 108px);
  max-height: calc(100dvh - 108px);

  display: grid;

  grid-template-rows:
    32px
    minmax(0, 1fr);
}


/* =========================
   WINDOW TITLE BAR
   ========================= */

.window-titlebar {
  min-height: 32px;

  border-bottom: 1px solid var(--line);

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding-left: 10px;

  background: var(--chrome);
}

.window-titlebar button,
.window-close-link {
  width: 32px;

  align-self: stretch;

  display: grid;
  place-items: center;

  border: 0;
  border-left: 1px solid var(--line);

  background: transparent;

  cursor: pointer;

  font-size: 20px;
}


/* =========================
   PROJECT WINDOW CONTENT
   ========================= */

.window-content {
  min-height: 0;

  display: grid;

  grid-template-columns:
    minmax(0, 1.5fr)
    minmax(260px, 0.65fr);

  overflow: hidden;
}


/* =========================
   GALLERY
   ========================= */

.window-gallery {
  min-width: 0;
  min-height: 0;

  display: grid;

  grid-template-columns:
    42px
    minmax(0, 1fr)
    42px;

  align-items: center;

  border-right: 1px solid var(--line);

  padding: 20px 8px;

  overflow: hidden;
}

.gallery-nav {
  position: relative;

  border: 0;

  background: transparent;

  cursor: pointer;

  padding: 0;

  width: 100%;
  height: 100%;

  min-height: 40px;

  display: flex;

  align-items: center;
  justify-content: center;

  font-size: 0;
}

.gallery-nav::before {
  content: "";

  display: block;

  width: 10px;
  height: 10px;

  border-top: 1.5px solid var(--text);
  border-left: 1.5px solid var(--text);
}

.gallery-nav--prev::before {
  transform: rotate(-45deg);
}

.gallery-nav--next::before {
  transform: rotate(135deg);
}


/* =========================
   PROJECT IMAGE
   ========================= */

.window-image-wrap {
  min-width: 0;
  min-height: 0;

  width: 100%;
  height: 100%;

  position: relative;

  display: flex;

  align-items: center;
  justify-content: center;

  background: transparent;

  overflow: hidden;
}

.window-image-wrap img {
  display: block;

  width: auto;
  height: auto;

  max-width: 100%;
  max-height: 100%;

  object-fit: contain;

  object-position: center;
}


/* =========================
   IMAGE FALLBACK
   ========================= */

.image-fallback {
  position: absolute;

  inset: 0;

  display: grid;

  place-items: center;

  color: var(--muted);

  font-size: 11px;

  background: transparent;
}


/* =========================
   PROJECT INFORMATION
   ========================= */

.window-info {
  min-height: 0;

  padding: 26px 24px;

  display: flex;
  flex-direction: column;

  overflow-y: auto;
}

.meta-row {
  display: flex;

  justify-content: space-between;

  gap: 20px;

  font-size: 10px;

  margin-bottom: 52px;
}

.window-info h1 {
  margin: 0 0 16px;

  font-size: 30px;

  font-weight: 400;

  letter-spacing: -0.04em;
}

.window-info p {
  margin: 0;
  line-height: 1.55;
  max-width: 360px;
  white-space: pre-line;
}


/* =========================
   PROJECT LINKS
   ========================= */

.project-links {
  margin-top: auto;

  padding-top: 32px;

  display: flex;
  flex-direction: column;

  align-items: flex-start;

  gap: 13px;
}

.project-external-link,
.request-link {
  display: inline-block;

  width: fit-content;

  padding-bottom: 2px;

  border-bottom: 1px solid var(--line);

  font-size: 11px;
}

.project-external-link:hover,
.request-link:hover {
  background: var(--text);

  color: var(--panel);
}


/* =========================
   CONTACT PAGE
   ========================= */

.contact-screen {
  padding: 54px;

  display: grid;

  place-items: center;
}

.contact-window {
  width: min(900px, 100%);
}

.contact-content {
  min-height: 520px;

  display: grid;

  grid-template-columns:
    1fr
    1fr;
}


/* =========================
   CONTACT LEFT
   ========================= */

.contact-portrait-column {
  min-width: 0;

  padding: 38px;

  border-right: 1px solid var(--line);

  display: flex;

  flex-direction: column;
}

.system-label {
  margin: 0 0 35px;

  font-size: 10px;
}

.contact-portrait {
  display: block;

  width: 100%;

  max-width: 370px;

  height: auto;

  object-fit: contain;

  object-position: left top;
}


/* =========================
   CONTACT RIGHT
   ========================= */

.contact-text {
  padding: 38px;

  display: flex;

  flex-direction: column;
}

.contact-intro {
  margin: 0;

  max-width: 430px;

  line-height: 1.55;
}

.contact-mail {
  display: inline-block;

  width: fit-content;

  margin-top: 42px;

  padding-bottom: 2px;

  border-bottom: 1px solid var(--line);
}

.contact-mail:hover {
  background: var(--text);

  color: var(--panel);
}


/* =========================
   IMPRESSUM ON CONTACT PAGE
   ========================= */

.contact-legal {
  margin-top: 70px;

  padding-top: 22px;

  border-top: 1px solid var(--line);

  font-size: 10px;

  line-height: 1.55;

  color: var(--muted);
}

.contact-legal-title {
  margin: 0 0 15px;

  color: var(--text);

  font-size: 11px;
}

.contact-legal p {
  margin: 0;
}

.back-link {
  display: inline-block;

  width: fit-content;

  margin-top: auto;

  padding-top: 50px;

  font-size: 11px;
}


/* =========================
   TABLET
   ========================= */

@media (max-width: 900px) {

  .desktop-grid {
    grid-template-columns:
      repeat(4, minmax(100px, 1fr));

    gap: 40px 28px;
  }


  .home-page .desktop-grid {
    grid-template-columns:
      repeat(4, minmax(0, 1fr));

    grid-template-rows:
      repeat(2, minmax(0, 1fr));

    gap: 12px;
  }


  .window-overlay {
    padding: 24px;
  }


  .project-window {
    height: calc(100vh - 48px);
    height: calc(100dvh - 48px);

    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
  }


  .window-content {
    grid-template-columns: 1fr;

    grid-template-rows:
      minmax(0, 1fr)
      auto;
  }


  .window-gallery {
    min-height: 0;

    border-right: 0;

    border-bottom: 1px solid var(--line);
  }


  .window-info {
    min-height: 210px;
  }


  .meta-row {
    margin-bottom: 24px;
  }


  .project-links {
    margin-top: 28px;
  }
}


/* =========================
   MOBILE
   ========================= */

@media (max-width: 600px) {

  body {
    font-size: 12px;
  }


  /* PAGE */

  .desktop-shell {
    grid-template-rows:
      32px
      1fr
      26px;
  }


  .home-page .desktop-shell {
    height: 100vh;
    height: 100dvh;

    min-height: 0;

    grid-template-rows:
      32px
      minmax(0, 1fr)
      26px;
  }


  /* TOP BAR */

  .topbar {
    padding: 0 8px;

    font-size: 10px;
  }

  .topbar-right span:first-child {
    display: none;
  }


  /* STATUS BAR */

  .statusbar {
    padding: 0 8px;

    font-size: 9px;
  }


  /* PROJECT GRID */

  .desktop {
    padding: 28px 14px 46px;
  }


  .home-page .desktop {
    min-height: 0;

    padding: 8px 10px;

    overflow: hidden;
  }


  .desktop-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    gap: 34px 16px;
  }


  .home-page .desktop-grid {
    width: 100%;
    height: 100%;

    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    grid-template-rows:
      repeat(4, minmax(0, 1fr));

    gap: 4px 10px;

    align-items: center;
    justify-items: center;
  }


  .desktop-item {
    width: 100%;

    min-height: 120px;
  }


  .home-page .desktop-item {
    width: 100%;
    height: 100%;

    min-width: 0;
    min-height: 0;

    align-items: center;
    justify-content: center;

    text-align: center;
  }


  .home-page .desktop-item:last-child {
    grid-column: 1 / -1;

    width: 50%;
  }


  /* ICONS */

  .desktop-icon {
    width: 90px;
    height: 90px;

    margin-bottom: 8px;
  }


  .home-page .desktop-icon {
    width: clamp(96px, 14dvh, 125px);
    height: clamp(96px, 14dvh, 125px);

    max-width: 92%;

    margin-bottom: 5px;
  }


  /* LABELS */

  .desktop-label {
    max-width: 100%;

    font-size: 11px;
  }

  .desktop-client {
    font-size: 8px;
  }


  .home-page .desktop-label {
    margin-left: 0;

    align-self: center;

    text-align: center;

    font-size: 11px;
  }


  .home-page .desktop-client {
    align-self: center;

    text-align: center;

    font-size: 10px;
  }


  /* PROJECT OVERLAY */

  .window-overlay {
    padding: 8px;
  }


  /* PROJECT WINDOW */

  .project-window {
    width: 100%;

    height: calc(100dvh - 16px);

    max-height: calc(100dvh - 16px);
  }


  .window-content {
    min-height: 0;

    grid-template-columns: 1fr;

    grid-template-rows:
      minmax(0, 1fr)
      auto;
  }


  /* GALLERY */

  .window-gallery {
    min-height: 0;

    grid-template-columns:
      30px
      minmax(0, 1fr)
      30px;

    padding: 8px 2px;

    border-right: 0;

    border-bottom: 1px solid var(--line);
  }


  .gallery-nav::before {
    width: 9px;
    height: 9px;
  }


  /* IMAGE */

  .window-image-wrap {
    min-width: 0;
    min-height: 0;

    width: 100%;
    height: 100%;

    background: transparent;
  }

  .window-image-wrap img {
    width: auto;
    height: auto;

    max-width: 100%;
    max-height: 100%;

    object-fit: contain;
  }


  /* PROJECT INFO */

  .window-info {
    max-height: 42vh;

    padding: 18px 16px;

    overflow-y: auto;
  }

  .meta-row {
    margin-bottom: 16px;
  }

  .window-info h1 {
    font-size: 24px;
  }

  .project-links {
    margin-top: 26px;

    padding-top: 0;
  }


  /* CONTACT */

  .contact-screen {
    padding: 10px;
  }

  .contact-window {
    width: 100%;
  }

  .contact-content {
    min-height: calc(100vh - 110px);

    grid-template-columns: 1fr;
  }


  /* CONTACT PORTRAIT */

  .contact-portrait-column {
    padding: 24px 18px;

    border-right: 0;

    border-bottom: 1px solid var(--line);

    align-items: center;
  }

  .contact-portrait {
    width: 100%;

    max-width: 320px;

    height: auto;

    margin-left: auto;
    margin-right: auto;

    object-position: center;
  }

  .system-label {
    margin-bottom: 24px;
  }


  /* CONTACT TEXT */

  .contact-text {
    padding: 24px 18px;
  }

  .contact-mail {
    font-size: 11px;
  }


  /* LEGAL */

  .contact-legal {
    margin-top: 50px;
  }

  .back-link {
    margin-top: 55px;
  }
}


/* =========================
   MOBILE LANDSCAPE BLOCK
   ========================= */

@media (max-width: 900px) and (orientation: landscape) {

  body {
    overflow: hidden;
  }

  body::before {
    content: "PLEASE ROTATE DEVICE";

    position: fixed;
    inset: 0;

    z-index: 999999;

    display: grid;

    place-items: center;

    padding: 30px;

    background: var(--bg);
    color: var(--text);

    font-family: "Courier New", Courier, monospace;
    font-size: 14px;

    text-align: center;
  }

  body > * {
    visibility: hidden;
  }

  body::before {
    visibility: visible;
  }
}
