:root {
  --accent: #aa88ff;
  --text: #dddddd;
  --muted: #ffffff;
  --chip: #1c1c1c;
  --line: #2a2a2a;
  --mono: "SF Mono", "Menlo", "Consolas", "Liberation Mono", monospace;
}

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

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #000;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.35;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
}

h1, h2, p, ul { margin: 0; padding: 0; font-weight: normal; }

#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

.ui {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.ui a, .ui button, .list { pointer-events: auto; }

.brand, .counter { mix-blend-mode: plus-lighter; }
/* A soft dark halo keeps text readable where it crosses the particle form */
.about, .tags, .meta { text-shadow: 0 0 2px #000, 0 0 6px #000, 0 0 14px rgba(0, 0, 0, .9); }
.about h2, .about .page-title { color: #c2a8ff; }
.chip.is-active, .chip:hover { text-shadow: none; }

/* Brand */
.brand {
  position: absolute;
  top: 24px;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand .mark { display: block; flex: none; }
.brand .name { font-size: 20px; color: #fff; line-height: 1.1; }
.brand .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Counter */
.counter {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #0a0a0a;
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tags */
.tags {
  position: absolute;
  top: 120px;
  left: 24px;
  width: 320px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  appearance: none;
  border: 0;
  border-radius: 0;
  font: inherit;
  font-size: 11px;
  letter-spacing: inherit;
  text-transform: inherit;
  background: var(--chip);
  color: #cfcfcf;
  padding: 5px 9px;
  cursor: pointer;
  transition: background-color .3s, color .3s;
}
.chip:hover { color: var(--accent); }
.chip.is-active { background: #e6e6e6; color: #000; }
.chip:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }

/* Portal links (Web / Mobile) */
.portals { gap: 8px; }
.portals .chip {
  font-size: 13px;
  padding: 9px 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.portals .chip span { color: var(--accent); font-size: 11px; }
.portals .chip:hover { background: #e6e6e6; color: #000; }
.portals .chip.is-active span, .portals .chip:hover span { color: #5a3fc0; }

.brand-link {
  display: flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.page-title { font-size: 13px; color: var(--accent); margin-bottom: 1em; }

.thumb--cta {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #3a3a3a;
  color: var(--accent);
  text-decoration: none;
  transition: background-color .3s, color .3s;
}
.thumb--cta:hover { background: #151020; color: #fff; }

/* Project portal: a dark circle grows from the tap point before opening a project */
.portal-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  background: radial-gradient(circle at var(--px) var(--py), #1a1030 0%, #000 45%);
  clip-path: circle(0px at var(--px) var(--py));
  transition: clip-path .75s cubic-bezier(.7, 0, .3, 1);
}
.portal-overlay.is-open { clip-path: circle(150vmax at var(--px) var(--py)); }
@media (prefers-reduced-motion: reduce) {
  .portal-overlay { transition: none; }
}

/* Views: Index, Web and Mobile live on one page and switch in place */
.view { display: contents; }
html[data-view="home"] .view:not([data-view="home"]),
html[data-view="web"] .view:not([data-view="web"]),
html[data-view="mobile"] .view:not([data-view="mobile"]) { display: none; }
html[data-view="home"] .chip--index { display: none; }
html[data-view="web"] .chip[data-v="web"],
html[data-view="mobile"] .chip[data-v="mobile"] { background: #e6e6e6; color: #000; text-shadow: none; }
html[data-view="web"] .chip[data-v="web"] span,
html[data-view="mobile"] .chip[data-v="mobile"] span { color: #5a3fc0; }

/* Placeholder notice on the Web / Mobile pages */
.note {
  position: absolute;
  top: 184px;
  left: 24px;
  width: 320px;
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--accent);
  text-shadow: 0 0 2px #000, 0 0 6px #000;
}

/* Card list */
.list {
  position: absolute;
  top: 250px;
  left: 24px;
  bottom: 0;
  width: 320px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.list::-webkit-scrollbar { display: none; }

.card {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.card[hidden] { display: none; }
a.card { display: block; color: inherit; text-decoration: none; }
a.card .thumb { transition: opacity .3s; }
a.card:hover .thumb { opacity: .85; }
a.card:hover .meta .l { color: var(--accent); }

/* Live project preview: the real page, scaled down and auto-played like a motion clip */
.thumb--live { position: relative; background-size: cover; background-position: center; }
.thumb--live iframe:not(.ready) { visibility: hidden; }

/* App previews sit in a landscape phone frame */
.thumb--phone {
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 50% 40%, #1d1430, #0a0a0a 70%);
}
.phone {
  position: relative;
  width: 90%;
  aspect-ratio: 844 / 390;
  border: 5px solid #1b1b1f;
  border-radius: 16px;
  overflow: hidden;
  background: #0b0b0c center / cover no-repeat;
  box-shadow: 0 0 0 1px #3a3a42, 0 10px 24px rgba(0, 0, 0, .55);
}
.phone::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 50%;
  width: 7px;
  height: 22%;
  transform: translateY(-50%);
  border-radius: 4px;
  background: #050506;
  z-index: 2;
}
.thumb--phone .phone iframe {
  width: 844px;
  height: 390px;
  transform-origin: 0 0;
  transform: scale(var(--ps, .33));
}
.thumb--live iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 300%;
  height: 300%;
  border: 0;
  transform: scale(.3333);
  transform-origin: 0 0;
  pointer-events: none;
  background: #0b0b0c;
}
.thumb {
  height: 160px;
  border-radius: 2px;
  background: #0a0a0a;
  overflow: hidden;
}
.thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
  font-size: 12px;
}
.meta .l, .meta .r { white-space: pre-line; }
.meta .l { color: #fff; }
.meta .r { color: var(--muted); text-align: right; }

/* Text column */
.about {
  position: absolute;
  right: 90px;
  top: 50%;
  transform: translateY(-50%);
  width: 380px;
}
.about .block + .block { margin-top: 2.2em; }
.about h2 { font-size: 13px; color: var(--accent); margin-bottom: 1em; }
.about p { text-align: justify; margin-bottom: 1em; }
.about ul { list-style: inside; }
.about a {
  display: block;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  margin: 4px 0;
  transition: opacity .3s;
}
.about a:hover { opacity: .7; }

@media (max-width: 1100px) {
  .about { right: 24px; width: 320px; }
}

@media (max-width: 760px) {
  .list { display: none; }
  .tags { top: 92px; width: auto; right: 24px; }
  .about {
    left: 24px;
    right: 24px;
    bottom: 24px;
    top: auto;
    width: auto;
    transform: none;
    max-height: calc(100% - 160px);
    overflow-y: auto;
    pointer-events: auto;
    scrollbar-width: none;
  }
  .about::-webkit-scrollbar { display: none; }
  .about p { text-align: left; }
  .about .block + .block { margin-top: 1.6em; }

  /* Section pages scroll as a single column on phones */
  html:not([data-view="home"]) .ui {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    pointer-events: auto;
    padding: 24px 24px 48px;
    scrollbar-width: none;
  }
  html:not([data-view="home"]) .ui::-webkit-scrollbar { display: none; }
  html:not([data-view="home"]) .brand, html:not([data-view="home"]) .tags, html:not([data-view="home"]) .list, html:not([data-view="home"]) .about {
    position: static;
    width: auto;
    transform: none;
    max-height: none;
    overflow: visible;
  }
  html:not([data-view="home"]) .tags { margin-top: 28px; order: 1; }
  html:not([data-view="home"]) .note { position: static; width: auto; margin-top: 14px; order: 1; }
  html:not([data-view="home"]) .about { margin-top: 32px; order: 2; }
  html:not([data-view="home"]) .list { display: block; margin-top: 24px; order: 3; }
}
