
  :root {
    --wallpaper-1: #7C93C9;
    --wallpaper-2: #C9A9E0;
    --wallpaper-3: #F2B880;
    --ink: #000000;
    --ink-soft: #525252;
    --paper: #F7F7F7;
    --glass: rgba(255, 255, 255, 1);
    --accent: #E0894E;
    --border: rgba(0, 0, 0, 0.10);
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }

  html, body { height: 100%; overscroll-behavior: none; }

  body {
    font-family: 'Inter', -apple-system, sans-serif;
    font-optical-sizing: auto;
    color: var(--ink);
    position: fixed;
    inset: 0;
    overflow: hidden;
    background: linear-gradient(rgba(0,0,0,0.15), rgba(0,0,0,0.15)), url("images/bg.webp") center center / cover no-repeat;
  }

  body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.045;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }

  /* ---------- Desktop layout ---------- */

  .desktop {
    position: relative;
    height: 100%;
    padding: 40px;
  }

  .header {
    position: absolute;
    top: 32px;
    left: 40px;
    right: 40px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
  }

  .header .name {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: var(--paper);
    text-shadow: 0 1px 12px rgba(27,35,56,0.25);
  }

  .header .tag {
    font-size: 13px;
    color: var(--paper);
    opacity: 0.85;
    text-shadow: 0 1px 12px rgba(27,35,56,0.25);
  }

  .icon-grid {
    position: relative;
    width: 100%;
    height: 100%;
  }

  .icon {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 96px;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
  }

  .icon .thumb {
    width: 96px;
    aspect-ratio: 8 / 6;
    height: auto;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.5);
    box-shadow: 0 10px 24px -10px rgba(27,35,56,0.35);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  .icon .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
    border-radius: 8px;
  }

  .icon:hover .thumb,
  .icon:focus-visible .thumb {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 16px 32px -12px rgba(27,35,56,0.45);
  }

  .icon .thumb svg { opacity: 0.55; }

  .icon .label {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--paper);
    text-shadow: 0 1px 10px rgba(27,35,56,0.3);
    text-align: center;
  }

  .icon { cursor: grab; }

  .icon.dragging-icon {
    cursor: grabbing;
    z-index: 50;
    transition: none;
  }

  .icon.dragging-icon .thumb {
    box-shadow: 0 20px 40px -12px rgba(27,35,56,0.5);
    transform: scale(1.06);
  }

  .icon.locked { cursor: default; opacity: 0.75; }
  .icon.locked .thumb { box-shadow: none; }
  .icon.locked:hover .thumb { transform: none; }

  /* placement */
  #icon-1 { top: 40%; left: 36%; }
  #icon-2 { top: 22%; left: 20%; }
  #icon-3 { top: 32%; right: 26%; }
  #icon-4 { top: 56%; left: 17%; }
  #icon-5 { top: 13%; right: 32%; }
  #icon-6 { top: 54%; right: 28%; }

  .dock {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.20);
  }

  .dock .dock-item {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: default;
    transition: transform 0.15s ease;
  }

  .dock .dock-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.18);
    display: block;
  }

  .dock a.dock-item {
    cursor: pointer;
  }

  .dock a.dock-item:hover,
  .dock button.dock-item:hover {
    transform: translateY(-3px) scale(1.1);
  }

  .dock .divider {
    width: 1px;
    height: 26px;
    background: rgba(255,255,255,0.25);
  }

  /* ---------- Window ---------- */

  .overlay {
    position: fixed;
    inset: 0;
    background: rgba(27, 35, 56, 0.28);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 10;
  }

  .overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  .window {
    width: 100%;
    max-width: 760px;
    max-height: 84vh;
    background: var(--glass);
    backdrop-filter: blur(28px);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.6);
    box-shadow: 0 50px 100px -20px rgba(27, 35, 56, 0.5);
    display: flex;
    flex-direction: column;
    transform: translateY(18px) scale(0.97);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, max-width 0.3s ease, max-height 0.3s ease;
  }

  .overlay.open .window {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  .window.expanded {
    max-width: 90vw;
    max-height: 90vh;
    width: 90vw;
    height: 90vh;
  }

  .titlebar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    cursor: grab;
  }

  .window.expanded .titlebar { cursor: default; }

  .window.dragging {
    transition: none;
  }

  .dot { width: 11px; height: 11px; border-radius: 50%; border: none; padding: 0; cursor: pointer; }
  .dot.red { background: #EC6A5E; cursor: pointer; }
  .dot.yellow { background: #F4BF4F; }
  .dot.green { background: #61C454; }

  .titlebar-label {
    flex: 1;
    text-align: left;
    font-size: 12.5px;
    color: var(--ink-soft);
    letter-spacing: 0.02em;
  }

  .window-body {
    overflow-y: auto;
    padding: 24px;
  }

  .eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
  }

  .eyebrow::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
  }

  h1 {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 30px;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin-bottom: 30px;
  }

  .dek {
    font-size: 15.5px;
    color: var(--ink-soft);
    line-height: 1.6;
    max-width: 52ch;
    margin-bottom: 42px;
  }

  .frame {
    border-radius: 12px;
    margin-bottom: 42px;
    overflow: hidden;
    background: #e8e8e8;
    display: block;
  }

  .frame:has(span) {
    background: linear-gradient(135deg, #EFE9DE 0%, #E3DCCE 100%);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .frame img {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid var(--border);
    outline: none;
  }

  .gallery-mobile img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    border: 1px solid var(--border);
  }

  .frame span {
    font-size: 13px;
    color: var(--ink-soft);
  }

  .meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 24px 0 32px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 42px;
  }

  .meta-item .label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-soft);
    margin-bottom: 5px;
  }

  .meta-item .value {
    font-size: 14px;
    font-weight: 500;
  }

  .section { margin-bottom: 30px; margin-top: 30px; }

  .section h2 {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 20px;
    line-height: 1.4;
    margin-bottom: 8px;
  }

  .section p {
    font-size: 14px;
    line-height: 1.4;
    color: var(--ink-soft);
    max-width: 85%;
    margin-bottom: 10px;
  }

  .section ul {
    margin: 6px 0 0 18px;
    max-width: 85%;
  }

  .section li {
    font-size: 14px;
    line-height: 1.4;
    color: var(--ink-soft);
    margin-bottom: 6px;
  }

  .gallery-mobile {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 42px;
  }

  .gallery-mobile img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
  }

  .gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 10px;
  }

  .gallery img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
    border: 1px solid var(--border);
  }

  .next-project {
    margin-top: 12px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
  }

  .next-project h2.next-title {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 20px;
    line-height: 1.2;
    margin-bottom: 42px;
  }

  .next-frame {
    cursor: pointer;
    background-image: repeating-linear-gradient(
      45deg,
      #D8D8D6,
      #D8D8D6 10px,
      #E4E4E2 10px,
      #E4E4E2 20px
    );
  }

  .next-frame:hover {
    filter: brightness(0.97);
  }

  .tldr {
    margin-bottom: 42px;
  }

  .tldr p {
    font-size: 14px;
    line-height: 1.4;
    color: var(--ink-soft);
    max-width: 85%;
    margin-bottom: 10px;
  }

  .tldr p:last-child { margin-bottom: 0; }

  /* ---------- Mobile ---------- */

  @media (max-width: 640px) {
    .desktop { padding: 24px 20px; height: 100dvh; }

    .header {
      top: 20px;
      left: 20px;
      right: 20px;
      flex-direction: column;
      align-items: flex-start;
      gap: 2px;
    }

    /* scattered absolute icons don't work on small screens —
       switch to a static 2-column grid instead */
    .icon-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 32px 16px;
      position: static;
      margin-top: 84px;
      padding-bottom: 110px;
      height: auto;
    }

    .icon,
    .icon.locked {
      position: static;
      width: auto;
    }

    .icon .thumb {
      width: 50%;
      aspect-ratio: 1 / 1;
      height: auto;
      border-radius: 22px;
    }

    .icon .thumb img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: top;
      border-radius: 22px;
    }

    .icon .label { font-size: 13px; }

    .dock {
      bottom: 18px;
      padding: 9px 14px;
      gap: 10px;
    }

    .dock .dock-item { width: 36px; height: 36px; font-size: 14px; }

    /* project detail becomes a full-screen page on mobile,
       not a floating window — matches native app navigation */
    .overlay {
      padding: 0;
      align-items: stretch;
      background: none;
      backdrop-filter: none;
    }

    .window {
      max-width: 100%;
      width: 100%;
      height: 100dvh;
      max-height: none;
      border-radius: 0;
      transform: translateX(100%);
      background: var(--paper);
    }

    .overlay.open .window {
      transform: translateX(0);
    }

    /* replace macOS-style titlebar with a back button on mobile */
    .titlebar {
      border-bottom: none;
      padding: 20px 20px 0;
    }

    .titlebar .dot.yellow,
    .titlebar .dot.green,
    .titlebar-label {
      display: none;
    }

    .titlebar .dot.red {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background: var(--glass);
      border: 1px solid var(--border);
      position: relative;
    }

    .titlebar .dot.red::before {
      content: "";
      position: absolute;
      top: 50%;
      left: 55%;
      width: 8px;
      height: 8px;
      border-left: 1.6px solid var(--ink);
      border-bottom: 1.6px solid var(--ink);
      transform: translate(-50%, -50%) rotate(45deg);
    }

    .window-body { padding: 24px 22px 48px; }
    h1 { font-size: 26px; }
    .meta { grid-template-columns: 1fr 1fr; row-gap: 18px; gap: 30px; }
    .frame { margin-bottom: 42px; }
  }

  @media (prefers-reduced-motion: reduce) {
    body { animation: none; }
    .overlay, .window { transition: none; }
  }
  /* ---------- Notes window ---------- */
  .notes-window { width: 720px; max-width: 720px; height: 620px; max-height: 620px; display: flex; flex-direction: column; overflow: hidden; background: #FFFFFF; }

  .notes-window .titlebar {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .notes-body {
    display: flex;
    align-items: stretch;
    flex: 1;
    overflow: hidden;
    min-height: 0;
    background: #FFFFFF;
  }

  .notes-sidebar {
    width: 220px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    padding: 8px 0;
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    min-height: 0;
  }

  .notes-item {
    padding: 16px;
    cursor: pointer;
    border-radius: 8px;
    margin: 0 8px;
    flex-shrink: 0;
  }

  .notes-item:hover { background: rgba(0,0,0,0.04); }

  .notes-item.active {
    background: #FFE390;
  }

  .notes-item-title {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ink);
    margin-bottom: 3px;
  }

  .notes-item-meta {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    line-height: 1.4;
    color: var(--ink-soft);
  }

  .notes-date { margin-right: 6px; }

  .notes-preview {
    color: var(--ink-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .notes-item.active .notes-preview { color: rgba(0,0,0,0.5); }

  .notes-content {
    flex: 1;
    padding: 24px 32px 30px;
    background: #FFFFFF;
    overflow-y: auto;
    min-height: 0;
  }

  .notes-timestamp {
    font-size: 12px;
    color: #999;
    text-align: center;
    margin-bottom: 42px;
  }

  .notes-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 24px;
    line-height: 1.2;
    color: var(--ink);
    margin-bottom: 14px;
  }

  .notes-strong {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ink);
    margin-bottom: 6px;
  }

  .notes-list {
    margin: 0 0 0 18px;
    padding: 0;
  }

  .notes-list li {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: var(--ink);
    margin-bottom: 6px;
  }

  .notes-list li:last-child {
    margin-bottom: 36px;
  }

  .notes-p {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: var(--ink);
    margin-bottom: 14px;
  }

  .note-page > .notes-p:last-of-type {
    margin-bottom: 44px;
  }

  .notes-item-title {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ink);
    margin-bottom: 3px;
  }

  .notes-item-meta {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    line-height: 1.4;
    color: var(--ink-soft);
  }

  @media (max-width: 640px) {
    /* Notes opens as a floating card inset from all edges — dock and desktop stay visible around it */
    #overlay-notes {
      padding: 0;
    }

    body.notes-sheet-open .dock {
      z-index: 11;
    }

    .notes-window {
      position: absolute;
      left: 20px;
      right: 20px;
      top: 80px;
      bottom: 96px;
      width: auto;
      height: auto;
      max-width: none;
      max-height: none;
      border-radius: 24px;
      opacity: 0;
      transform: translateY(18px) scale(0.97);
    }

    #overlay-notes.open .notes-window {
      opacity: 1;
      transform: translateY(0) scale(1);
    }

    #overlay-notes .titlebar {
      justify-content: flex-end;
      border-bottom: 1px solid var(--border);
      padding: 10px;
    }

    #overlay-notes .titlebar .dot.red {
      width: 40px;
      height: 40px;
    }

    #overlay-notes .titlebar .dot.red::before {
      content: none;
    }

    #overlay-notes .titlebar .dot.red::before,
    #overlay-notes .titlebar .dot.red::after {
      content: "";
      position: absolute;
      top: 50%;
      left: 50%;
      width: 16px;
      height: 1.8px;
      border: none;
      border-radius: 1px;
      background: var(--ink);
    }

    #overlay-notes .titlebar .dot.red::before { transform: translate(-50%, -50%) rotate(45deg); }
    #overlay-notes .titlebar .dot.red::after { transform: translate(-50%, -50%) rotate(-45deg); }

    .notes-body {
      flex-direction: column;
      overflow-y: auto;
    }

    .notes-sidebar {
      width: 100%;
      flex-direction: column;
      border-right: none;
      overflow-y: visible;
      padding: 16px 16px 0;
      gap: 8px;
    }

    .notes-item {
      margin: 0;
      padding: 14px;
      border-radius: 14px;
    }

    .notes-content { padding: 16px; }

    .notes-timestamp { display: none; }
  }

  /* ---------- Lock screen ---------- */

  .lock-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background-color: #E2E2E2;
    background-image: linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0.35)), url("images/bg.webp");
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    backdrop-filter: blur(0px);
    transition: opacity 0.5s ease, visibility 0.5s ease;
  }

  .lock-screen.unlocking {
    opacity: 0;
    pointer-events: none;
  }

  .lock-screen.hidden {
    display: none;
  }

  .lock-time {
    font-family: 'Inter', sans-serif;
    font-size: 48px;
    font-weight: 600;
    color: var(--paper);
    margin-top: 64px;
    text-shadow: 0 2px 20px rgba(0,0,0,0.3);
    line-height: 1.1;
  }

  .lock-date {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 500;
    color: var(--paper);
    opacity: 0.9;
    text-shadow: 0 1px 12px rgba(0,0,0,0.3);
  }

  .lock-bottom {
    margin-top: auto;
    padding-bottom: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .lock-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    margin-bottom: 12px;
  }

  .lock-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .lock-name {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--paper);
    text-shadow: 0 1px 10px rgba(0,0,0,0.3);
    margin-bottom: 16px;
  }

  .lock-form {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .lock-input-wrap {
    position: relative;
    width: 220px;
  }

  .lock-input {
    width: 100%;
    height: 36px;
    padding: 0 36px 0 14px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    color: var(--paper);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    outline: none;
  }

  .lock-input::placeholder { color: rgba(255,255,255,0.7); }

  .lock-input:focus {
    border-color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.22);
  }

  .lock-submit {
    position: absolute;
    right: 3px;
    top: 3px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.9);
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
  }

  .lock-input:not(:placeholder-shown) ~ .lock-submit {
    opacity: 1;
    pointer-events: auto;
  }

  .lock-submit:hover { background: #fff; }

  .lock-error {
    margin-top: 14px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: var(--paper);
    text-shadow: 0 1px 10px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
  }

  .lock-error.show {
    opacity: 1;
    visibility: visible;
  }

  .lock-permission {
    margin-top: 12px;
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.15s ease;
  }

  .lock-permission:hover {
    color: var(--paper);
  }

  .lock-request-link {
    margin-top: 12px;
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.15s ease;
  }

  .lock-request-link:hover {
    color: var(--paper);
  }

  .lock-form.shake {
    animation: lock-shake 0.4s ease;
  }

  @keyframes lock-shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
  }

  @media (max-width: 640px) {
    .lock-time { font-size: 64px; margin-top: 48px; }
    .lock-date { font-size: 16px; }
  }

