/* "Computer window" that opens from the homepage work links.
   Folders = companies, sub-folders = case studies, right pane = the page itself (iframe). */

.ww-open { overflow: hidden; }
.ww-window [hidden], .ww-window[hidden], .ww-backdrop[hidden] { display: none !important; }

/* Dark mode: softer borders and folder icons */
.ww-window { --ww-line: var(--line); --ww-icon: var(--text-strong); --ww-dim: #484848; --ww-pick: #ece2da;
  /* homepage background (#f8f4f0), see-through */
  --ww-glass: linear-gradient(155deg, rgba(248, 244, 240, .94) 0%, rgba(248, 244, 240, .86) 100%);
  --ww-sheen: rgba(255, 255, 255, .8); }
:root[data-theme="dark"] .ww-window { --ww-line: #34374d; --ww-icon: var(--muted); --ww-dim: #b6b8cf; --ww-pick: color-mix(in srgb, var(--sparkle) 16%, transparent);   /* soft tint of the open-folder lavender */
  /* a shade lighter than the dark homepage background (#10131e), see-through */
  --ww-glass: linear-gradient(155deg, rgba(34, 38, 56, .9) 0%, rgba(34, 38, 56, .82) 100%);
  --ww-sheen: rgba(255, 255, 255, .08); }

.ww-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(16, 19, 30, .28);
  opacity: 0; transition: opacity .2s ease;
}
:root[data-theme="dark"] .ww-backdrop { background: rgba(0, 0, 0, .85); }
.ww-backdrop.is-in { opacity: 1; }

.ww-window {
  position: fixed; z-index: 101;
  top: 50%; left: 50%;
  width: min(1120px, calc(100vw - 48px));
  height: min(1200px, calc(100vh - 48px));   /* grows with tall screens, keeping a 24px margin top and bottom */
  height: min(1200px, calc(100dvh - 48px));
  display: flex; flex-direction: column;
  /* frosted glass: the page behind shows through, blurred (title bar + folder list) */
  background: var(--ww-glass);
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
          backdrop-filter: blur(28px) saturate(1.5);
  color: var(--text);
  border: 1px solid var(--ww-line);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 var(--ww-sheen), 0 30px 80px rgba(16, 19, 30, .22);
  overflow: hidden;
  font-family: var(--sans);
  transform: translate(-50%, -50%) scale(.6);
  opacity: 0;
  transition: transform .26s cubic-bezier(.2, .8, .2, 1), opacity .18s ease;
}
.ww-window.is-in { transform: translate(-50%, -50%) scale(1); opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .ww-window, .ww-backdrop { transition: opacity .12s linear; }
  .ww-window { transform: translate(-50%, -50%); }
}

/* Title bar */
.ww-titlebar {
  flex: none;
  display: flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 8px 0 20px;
  border-bottom: 1px solid var(--ww-line);
}
:root[data-theme="dark"] .ww-titlebar { border-bottom-color: #0b0d15; }   /* dark line under the title bar */
.ww-title {
  flex: 1 1 auto; min-width: 0; margin: 0;
  font-family: var(--sans); font-size: 15px; font-weight: 400; letter-spacing: .5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text-strong); font-weight: 700;
}
.ww-title { display: flex; align-items: center; }
.ww-title-root { flex: none; }
.ww-crumb, .ww-trail { display: none; }   /* "Open project list" + trail are phone-only */
.ww-btn {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 36px; height: 36px; padding: 0 8px;
  border: 0; border-radius: 6px; background: none; cursor: pointer;
  color: var(--text-strong); font: inherit; font-size: 14px; text-decoration: none;
}
.ww-btn:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
.ww-btn:focus-visible { outline: 2px solid var(--highlight); outline-offset: 1px; }
.ww-btn svg { width: 20px; height: 20px; }

/* Body: sidebar + content */
.ww-body { flex: 1 1 auto; min-height: 0; display: flex; position: relative; }
.ww-side {
  flex: 0 0 264px;
  overflow: auto;
  padding: 16px 12px;
  border-right: 1px solid var(--ww-line);
  background: transparent;
}
.ww-pane { flex: 1 1 auto; min-width: 0; position: relative; background: #fff; }
:root[data-theme="dark"] .ww-pane { background: #0b0d15; }
.ww-pane iframe { display: block; width: 100%; height: 100%; border: 0; background: transparent; }

/* Tree */
.ww-tree, .ww-tree ul { list-style: none; margin: 0; padding: 0; }
.ww-tree > li + li { margin-top: 6px; }
.ww-tree ul { margin-left: 18px; }
.ww-tree ul > li { position: relative; padding-left: 16px; }
.ww-tree ul > li::before {              /* └ / ├ connector */
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  border-left: 1px solid var(--rail);
}
.ww-tree ul > li:last-child::before { bottom: auto; height: 18px; }
.ww-tree ul > li::after {
  content: ""; position: absolute; left: 0; top: 18px; width: 11px;
  border-top: 1px solid var(--rail);
}
.ww-folder {
  display: flex; align-items: center; gap: 10px;
  min-height: 36px; padding: 6px 10px;
  font-family: var(--sans); font-size: 15px; font-weight: 700; line-height: 1.3; letter-spacing: .3px;
  color: var(--text-strong);
  cursor: default; user-select: none;
}
.ww-folder svg { flex: none; width: 20px; height: 18px; color: var(--ww-icon); }
.ww-folder .ww-folder-open { display: none; }          /* the folder you're in shows open, the rest closed */
.ww-folder.is-open .ww-folder-closed { display: none; }
.ww-folder.is-open .ww-folder-open { display: block; }
.ww-folder.is-open .ww-folder-body { fill: #9fc3f2; }   /* soft blue */
.ww-folder.is-open .ww-folder-front { fill: #bcd6f7; }  /* open folder: lighter front flap, deeper blue inside */
:root[data-theme="dark"] .ww-folder.is-open .ww-folder-body { fill: #7fa3e3; }
:root[data-theme="dark"] .ww-folder.is-open .ww-folder-front { fill: #a3bff0; }
:root[data-theme="dark"] .ww-folder.is-open .ww-folder-open { color: #0b0d15; }   /* dark outline on the blue open folder */
.ww-item {
  display: block;
  width: 100%; min-height: 36px; padding: 8px 10px;
  border: 0; border-radius: 6px; background: none; cursor: pointer;
  text-align: left; font-family: var(--sans); font-size: 15px; line-height: 1.3; letter-spacing: .3px;
  color: var(--text);
}
.ww-item-locked { display: flex; align-items: center; gap: 6px; color: var(--muted, inherit); }
.ww-lock-icon { width: 16px; height: 16px; flex: none; }   /* same padlock as the password box */
.ww-tree li[hidden] { display: none; }
.ww-item:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.ww-item[aria-current="true"] { background: var(--ww-pick); color: var(--text-strong); font-weight: 700; }   /* soft tint, no border */
.ww-item:focus-visible { outline: 2px solid var(--highlight); outline-offset: -2px; }

/* Phone: full screen, folders become a drawer */
@media (max-width: 760px) {
  .ww-window {
    inset: 8px;                                  /* a little inset so it still reads as a window */
    width: auto; height: auto;
    border-radius: 12px;
    transform: translateY(24px);
  }
  .ww-window.is-in { transform: none; }
  .ww-titlebar { padding: 0 2px 0 8px; gap: 2px; }
  .ww-titlebar .ww-close { min-width: 32px; padding: 0 6px; }
  .ww-title { font-size: 13px; letter-spacing: 0; gap: 1px; }
  .ww-title-root { display: none; }           /* the button takes its place on phones */
  .ww-title { gap: 8px; }
  .ww-crumb {
    display: inline-flex; align-items: center; gap: 2px;
    flex: none; height: 30px; margin: 0; padding: 0 9px 0 8px;
    border: 1px solid color-mix(in srgb, var(--text) 14%, transparent); border-radius: 6px; box-sizing: border-box;   /* same as the selected project in the side panel */
    background: color-mix(in srgb, var(--text) 5%, transparent); cursor: pointer;
    font: inherit; font-weight: 400; letter-spacing: inherit; color: var(--text-strong);
  }
  .ww-crumb-item { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; }
  .ww-crumb:hover, .ww-crumb[aria-expanded="true"] { background: color-mix(in srgb, var(--text) 11%, transparent); }
  .ww-crumb-menu { flex: none; display: block; margin-right: 3px; color: var(--text-strong); }
  .ww-crumb-menu svg { display: block; width: 14px; height: 14px; }
  .ww-crumb:focus-visible { outline: 2px solid var(--highlight); outline-offset: 1px; }
  .ww-trail { display: flex; align-items: center; gap: 2px; flex: 1 1 auto; min-width: 0; white-space: nowrap; }
  .ww-trail-folder { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; font-weight: 400; color: var(--ww-dim); }
  .ww-trail-sep { flex: none; color: var(--muted); }
  .ww-trail-sep svg { display: block; width: 12px; height: 12px; }
  .ww-trail-item { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 700; color: var(--text-strong); }
  .ww-side {
    position: absolute; z-index: 2; top: 0; bottom: 0; left: 0;
    width: min(300px, 84vw);
    background: var(--ww-glass);                 /* frosted over the case study */
    -webkit-backdrop-filter: blur(28px) saturate(1.5);
            backdrop-filter: blur(28px) saturate(1.5);
    transform: translateX(-102%); visibility: hidden;
    transition: transform .22s ease, visibility 0s linear .22s;
  }
  .ww-window.is-drawer .ww-side { transform: none; visibility: visible; transition: transform .22s ease; }
}

/* ---------------------------------------------------------------------------
   Liquid glass: the title bar + folder list are one piece of glass (same layout as before).
   Clearer than frosted: lets more of the page through, boosts its colour, and has
   bright specular rims along the edges.
   --------------------------------------------------------------------------- */
.ww-window {
  --ww-glass:
    radial-gradient(90% 70% at 0% 0%, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, 0) 50%),   /* shine in the top-left corner */
    linear-gradient(170deg, rgba(255, 255, 255, .55) 0%, rgba(248, 244, 240, .38) 100%);
  --ww-line: rgba(255, 255, 255, .7);              /* rims instead of grey lines */
  -webkit-backdrop-filter: blur(22px) saturate(1.9) brightness(1.05);
          backdrop-filter: blur(22px) saturate(1.9) brightness(1.05);
  border-color: rgba(255, 255, 255, .65);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, .95),      /* bright top edge */
    inset 1px 0 1px rgba(255, 255, 255, .5),
    inset 0 0 18px rgba(255, 255, 255, .25),       /* light caught inside thick glass */
    0 30px 80px rgba(16, 19, 30, .22),
    0 2px 6px rgba(16, 19, 30, .08);
}
:root[data-theme="dark"] .ww-window {
  --ww-glass:
    radial-gradient(90% 70% at 0% 0%, rgba(255, 255, 255, .12) 0%, rgba(255, 255, 255, 0) 50%),
    linear-gradient(170deg, rgba(60, 66, 92, .55) 0%, rgba(34, 38, 56, .5) 100%);
  --ww-line: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .16);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, .25),
    inset 1px 0 1px rgba(255, 255, 255, .08),
    inset 0 0 18px rgba(255, 255, 255, .04),
    0 30px 80px rgba(0, 0, 0, .5);
}
:root[data-theme="dark"] .ww-titlebar { border-bottom-color: rgba(255, 255, 255, .12); }
.ww-titlebar { box-shadow: 0 1px 0 rgba(255, 255, 255, .35); }                      /* glassy edge under the title bar */
.ww-side { box-shadow: inset -1px 0 0 rgba(255, 255, 255, .25); }                     /* and along the folder list */
:root[data-theme="dark"] .ww-titlebar, :root[data-theme="dark"] .ww-side { box-shadow: none; }
.ww-pane { border-top-left-radius: 0; }
