/* ============================================================
   DANIEL WANG — portfolio
   Pixel-font retro-OS UI: purple title bars, lilac windows,
   plain black background.
   ============================================================ */

/* Zutomayo's actual pixel face, self-hosted (M+ licence, see fonts/PixelMplus-LICENSE.txt) */
@font-face {
  font-family: "PixelMplus12";
  src: url("fonts/PixelMplus12-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "PixelMplus12";
  src: url("fonts/PixelMplus12-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --black:      #000000;
  --accent:     #ff5a00;   /* title bars, borders */
  --accent-hi:  #ff7a1a;   /* nav hover bar */
  --tint:       #ffe4cc;   /* window bodies */
  --grey:       #dbdad1;   /* content areas, list rows */
  --accent-soft:#ff9c4a;   /* link hover */
  --shadow:     #a3826b;   /* hard window shadow */
  --white:      #ffffff;

  --px: "PixelMplus12", "DotGothic16", "MS Gothic", monospace;
  /* Latin: neo-grotesque sans. CJK characters fall through to Source Han Serif (Google Fonts ships it as Noto Serif JP/SC). */
  --cjk: "Noto Serif JP", "Noto Serif SC", "Source Han Serif", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --body: "Inter", "Helvetica Neue", Arial, "Noto Serif JP", "Noto Serif SC", "Source Han Serif", sans-serif;

  --panel-w: 300px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-columns: var(--panel-w) 1fr;
  background: var(--black);
  color: var(--white);
  font-family: var(--body);
  font-weight: 700;
}

::selection { background: var(--accent); color: var(--white); }

:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--accent);
  color: var(--white);
  font-family: var(--px);
  font-size: 12px;
  padding: 8px 12px;
}
.skip:focus { left: 0; }


/* ---------- LEFT PANEL ---------------------------------------- */

.panel {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  padding: 30px 0 20px;
  background: var(--black);
  overflow: hidden;
}
.panel > * { position: relative; z-index: 1; }

.panel__top { padding: 0 32px; }

.burger {
  display: none;
  width: 30px;
  height: 24px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}
.burger span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--white);
}

.panel__name {
  margin: 0;
  font-family: var(--body);
  font-weight: 700;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--white);
}

.panel__name--logo {
  display: flex;
  align-items: center;
  gap: 6px;
}

.panel__stamp {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: invert(1);          /* black stamp -> white */
  image-rendering: auto;
}

.panel__en {
  margin: 12px 0 0;
  padding: 0 32px;
  font-family: var(--body);
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--white);
}

.panel__role {
  margin: 6px 0 0;
  padding: 0 32px;
  font-family: var(--px);
  font-size: 10px;
  letter-spacing: 0.1rem;
  color: var(--grey);
}

/* stacked pixel nav with a purple bar that grows on hover ------- */

.nav {
  flex: 1;
  min-height: 0;
  padding: 60px 0 24px 32px;
}
.nav__list { margin: 0; padding: 0; list-style: none; }
.nav__list li { margin-bottom: 3px; }

.nav__item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--white);
  font-family: var(--px);
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0.1rem;
  text-transform: uppercase;
}
.nav__item::before {
  content: "";
  position: absolute;
  left: 5px;
  bottom: -5px;
  width: 0;
  height: 10px;
  background: var(--accent-hi);
  transition: width 0.3s ease;
  z-index: -1;
}
.nav__item:hover::before,
.nav__item:focus-visible::before,
.nav__item.is-active::before { width: 100%; }

.nav__icon {
  display: inline-flex;
  width: 0;
  opacity: 0;
  transition: opacity 0.3s ease, width 0.3s ease;
}
.nav__icon svg { height: 1em; width: auto; display: block; }
.nav__item:hover .nav__icon,
.nav__item:focus-visible .nav__icon,
.nav__item.is-active .nav__icon { width: 1em; opacity: 1; }

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

.panel__foot { padding: 0 32px; }

.clock {
  margin: 0 0 8px;
  font-family: var(--px);
  font-size: 10px;
  color: var(--white);
}

.copy {
  margin: 0;
  font-family: var(--px);
  font-size: 10px;
  color: var(--white);
}

/* ---------- STAGE --------------------------------------------- */

.stage {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ---------- WINDOWS ------------------------------------------- */

.win {
  position: absolute;
  z-index: 10;
  width: 380px;
  max-width: calc(100% - 32px);
  background: var(--tint);
  border: 1px solid var(--accent);
  box-shadow: 3px 3px 0 var(--shadow);
  overflow: hidden;
  transition: height 0.3s ease;
}
.win--menu { width: 230px; }

.win__bar {
  display: flex;
  align-items: center;
  height: 46px;
  padding: 10px;
  background: var(--accent);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.win__bar:active { cursor: grabbing; }

.win__title {
  flex: 1;
  margin: 0;
  font-family: var(--px);
  font-weight: 400;
  font-size: 20px;
  line-height: 26px;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.win__controls { display: flex; gap: 4px; }

.win__btn {
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  background: var(--tint);
  border: 1px solid var(--black);
  color: var(--black);
  cursor: pointer;
}
.win__btn:hover { background: var(--accent-soft); }
.win__btn svg { display: block; width: 12px; height: 12px; }

.win__body {
  padding: 13px 8px 16px;
  max-height: 58vh;
  overflow: auto;
  color: var(--black);
  font-size: 13px;
  line-height: 1.75;
}
.win__body p { margin: 0 0 0.9em; }
.win__body p:last-child { margin-bottom: 0; }

.win.is-mini { height: 46px; }
.win.is-mini .win__body { overflow: hidden; }

/* page-title label, as on their inner pages -------------------- */

.pagelabel {
  display: inline-block;
  margin: 0 8px 12px;
  padding: 4px 10px;
  background: var(--black);
  color: var(--white);
  font-family: var(--px);
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0.05rem;
}

/* list items (menu + work list) -------------------------------- */

.list { margin: 0; padding: 0; list-style: none; }

.list__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: calc(100% - 2rem);
  margin: 8px 1rem;
  padding: 0;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  color: var(--black);
  font-family: var(--px);
  font-size: 22px;
  line-height: 1.2;
}
.list__item:hover { color: var(--accent-soft); }
.list__item svg { height: 1em; width: auto; flex: none; }

.list__row {
  display: block;
  width: calc(100% - 2rem);
  margin: 8px 1rem;
  padding: 8px 10px;
  background: var(--grey);
  border: 1px solid var(--accent);
  text-align: left;
  cursor: pointer;
  color: var(--black);
}
.list__row:hover { background: var(--tint); }
.list__row:hover .list__row-title { color: var(--accent-soft); }

.list__row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--px);
  font-size: 22px;
  line-height: 1.2;
}
.list__row-title svg { height: 1em; width: auto; flex: none; }
.list__row-meta {
  margin-top: 4px;
  font-family: var(--px);
  font-size: 10px;
  color: #4a4a4a;
}

/* project window ---------------------------------------------- */

.meta {
  margin: 0 8px 10px;
  font-family: var(--px);
  font-size: 12px;
  color: var(--black);
}

.slot {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 10;
  margin: 0 8px 12px;
  background: var(--grey);
  border: 1px dashed var(--accent);
  font-family: var(--px);
  font-size: 12px;
  color: #6a6a6a;
}
.slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slot--filled { border-style: solid; }

.prose { margin: 0 8px; }

.btnrow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 8px 0;
  padding: 0;
  list-style: none;
}

.pill {
  display: inline-block;
  padding: 3px 12px;
  background: var(--white);
  border: 1px solid var(--black);
  color: var(--black);
  font-family: var(--px);
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: 0.05rem;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.pill:hover { background: var(--black); color: var(--white); }

/* news-style pinned notes -------------------------------------- */

.win--note {
  width: 180px;
  height: 82px;
}
.win--note .win__controls { display: none; }
.win--note .win__bar {
  height: 20px;
  padding: 0 6px;
}
.win--note .win__title {
  font-size: 10px;
  line-height: 20px;
}
.win--note .win__body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 62px;
  padding: 5px 8px 6px;
  max-height: none;
  overflow: hidden;
}

.win__body .note__head {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: none;
  height: 28px;
  margin: 0;
  font-family: var(--px);
  font-size: 10px;
  line-height: 1.4;
  color: var(--black);
}
.note__head span { display: inline; }
.note__head svg {
  display: inline-block;
  height: 1em;
  width: auto;
  margin-right: 4px;
  vertical-align: -1px;
  color: var(--accent-soft);
}

.note__buttons {
  display: flex;
  justify-content: center;
  gap: 6px;
}
.note__buttons .pill { padding: 1px 8px; font-size: 10px; }

@media (min-width: 1200px) {
  .win--note {
    transform: scale(1.5);
    transform-origin: 100% 100%;
  }
}

/* ---------- MOBILE -------------------------------------------- */

@media (max-width: 767px) {
  body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .panel {
    border-bottom: 1px solid var(--accent);
    padding: 14px 0 12px;
  }
  .panel__top {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 16px;
  }
  .burger { display: block; }
  .panel__name { font-size: 22px; }
  .panel__stamp { width: 34px; height: 34px; }
  .panel__role, .panel__en { display: none; }

  .nav { display: none; }

  .panel__foot {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px 0;
  }
  .clock { display: none; }
  .copy { margin-left: auto; }

  .stage {
    justify-content: flex-start;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .stage__windows {
    position: relative;
    z-index: 1;
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 26px 16px 40px;
  }

  .win {
    position: static !important;
    width: 100% !important;
    max-width: none;
    transform: none !important;
  }
  .win--note { min-height: 0; }
  .win__bar { cursor: default; }
  .win__body { max-height: none; }
}

/* ---------- MOTION -------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; }
}
