@font-face {
  font-family: "Departure Mono";
  src: url("/fonts/DepartureMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --font-pixel: "Departure Mono", ui-monospace, Menlo, monospace;
  --font-mono: "Geist Mono", ui-monospace, Menlo, monospace;
  --ground: #10111a;
  --light: #f2efe9;
  --muted: #a7a2a3;
  --gold: #f9d5a5;
  --gutter: clamp(24px, 5vw, 88px);
  --desktop-gutter: clamp(2.25rem, 7vw, 8rem);
  --icon-size: clamp(3.5rem, 4.7vw, 4.5rem);
  --type-wordmark: clamp(2.25rem, 3.1vw, 3.5rem);
  --type-app-name: 1.3125rem;
  --type-description: 1rem;
  --type-secondary-link: 0.875rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ground); color: var(--light); font-family: var(--font-mono); }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 1px solid var(--gold); outline-offset: 6px; }
::selection { color: var(--ground); background: var(--gold); }
h1, ul { margin: 0; padding: 0; font-weight: 400; }

.home { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
.stage {
  position: relative; display: flex; align-items: center; min-height: 100svh;
  isolation: isolate; padding: 48px var(--desktop-gutter);
  background: linear-gradient(135deg, #1a1a28, var(--ground));
}
.stage::before {
  content: ""; position: absolute; inset: 0 0 0 33%; z-index: -2; pointer-events: none;
  background: url("/nebula.svg") center / 100% 100% no-repeat;
  opacity: .16;
}
#tree {
  position: absolute; inset: 0 0 0 auto; z-index: -1; width: 70%; height: 100%;
  cursor: grab; touch-action: pan-y; mix-blend-mode: screen;
  /* Fade the composited canvas edge before it passes behind the glass tiles. */
  mask-image: linear-gradient(to right, transparent, #000 16%);
}
#tree.is-dragging { cursor: grabbing; }
.no-tree #tree { display: none; }
.studio { position: relative; width: max-content; margin-bottom: 5vh; }
.mark { display: inline-flex; align-items: center; gap: .28em; color: #ccb58e; font-size: var(--type-wordmark); font-weight: 300; line-height: 1.05; letter-spacing: 0.01em; }
.brand-symbol { position: relative; display: block; flex: none; width: .7em; height: .7em; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.brand-symbol::after { content: ""; position: absolute; width: 44px; height: 44px; left: 50%; top: 50%; translate: -50% -50%; }
.brand-symbol img, .brand-symbol canvas { display: block; width: 100%; height: 100%; }
.brand-symbol canvas, .brand-symbol.is-ready img { display: none; }
.brand-symbol.is-ready canvas { display: block; }
.brand-symbol:focus-visible { outline: 1px solid var(--gold); outline-offset: 6px; border-radius: 2px; }
.mark > a { white-space: nowrap; }
.mark em { font-style: normal; font-weight: 200; color: #a4a5b6; }
.work-jump { display:none; }
.projects { margin-top: 40px; contain: inline-size; }
.work { position: relative; display: flex; justify-content: space-between; gap: .75rem; width: 100%; min-height: var(--icon-size); list-style: none; }
.app-icon {
  position: relative; display: grid; place-items: center; width: var(--icon-size); aspect-ratio: 1;
  padding: 0; border: 1px solid #ffffff0a; border-radius: 27%; cursor: pointer;
  background:
    radial-gradient(120% 100% at 22% 0%, #ffffff1f, #ffffff05 46%, transparent 72%),
    linear-gradient(160deg, #dfe4ff12, #b9c2ea05 58%, #cbd0ff0d);
  box-shadow: inset 0 1px 0 #ffffff24, inset 0 -8px 16px #ffffff05, 0 6px 16px #0000002e;
  transition: transform .24s ease-out, border-color .24s, opacity .24s;
}
.app-icon img { display: block; width: 65%; height: 65%; object-fit: contain; filter: grayscale(1) brightness(.65) contrast(.65) brightness(1.95); opacity: .8; transition: filter .2s, opacity .2s; }
.app-icon img[src$="slirc.svg"] { width:82%; height:82%; }
.app-icon img[src$="shibumi-glyph.png"] { width:70%; height:70%; }
.app-icon[aria-expanded=true] img { filter: none; opacity: 1; }
.work:has([aria-expanded=true]) .app-icon[aria-expanded=false] { opacity: .67; }
.app-icon[aria-expanded=true] { transform: scale(1.075); border-color: #ffffff1c; }
.app-icon:focus-visible { outline: 2px solid #bac2de; outline-offset: 4px; }
.app-card { position: absolute; top: 100%; left: 0; width: min(320px, 88vw); padding: 22px 0 4px; }
.app-card h2 { margin: 0; font-size: var(--type-app-name); font-weight: 570; line-height: 1.4; letter-spacing: -.025em; color: #e1e2ea; }
.app-card p { margin: 5px 0; color: #b6b7c8; font-size: var(--type-description); line-height: 1.55; text-wrap: pretty; }
.app-card .alt { font-size: var(--type-secondary-link); color: #b4bde0; }
.app-card a:hover { text-decoration: underline; text-underline-offset: 3px; }
.app-card a::after {
  content: ""; display: inline-block; width: .7em; height: .7em; margin-left: .35em;
  vertical-align: .04em; background: currentColor; opacity: .65;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M7 7h10v10'/%3E%3C/svg%3E") center / contain no-repeat;
}
@media (prefers-reduced-motion: no-preference) {
  .app-card h2 { transform-origin: top center; animation: reveal-card 420ms ease-in-out; }
  .app-card p, .app-card .alt { animation: reveal-detail 620ms ease-in-out 380ms backwards; }
  .app-card .alt:focus-visible { animation: none; }
  @keyframes reveal-detail { from { opacity: 0; } to { opacity: 1; } }
  @keyframes reveal-card {
    from { opacity: 0; transform: perspective(600px) rotateX(-5deg); }
    to { opacity: 1; transform: perspective(600px) rotateX(0); }
  }
}
@media (prefers-reduced-motion: reduce) { .app-icon, .app-icon img { transition:none; } }
.contact {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  gap: 13px;
  position: absolute;
  bottom: 2rem;
  right: var(--desktop-gutter);
  z-index: 1;
}
.contact > a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--light);
  opacity: .5;
  transition: opacity .2s ease;
}
.contact > a:hover, .contact > a:focus-visible { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .contact > a { transition: none; } }
.contact svg { display: block; width: 24px; height: 24px; }
.contact a[aria-label="GitHub"] svg { width: 19px; height: 19px; }
.contact a[aria-label="x.com"] svg { width: 22px; height: 22px; }
.tooltip {
  position: fixed; inset: auto; margin: 0; border: 0; border-radius: 100vw;
  padding: .3rem .75rem; background: #0003; color: #fff; backdrop-filter: blur(1rem);
  font: 500 var(--type-secondary-link)/1.5 system-ui, sans-serif;
  white-space: nowrap; pointer-events: none;
}

@media (max-width: 760px) {
  .contact { right: var(--gutter); bottom: max(1.5rem, env(safe-area-inset-bottom)); }
  .stage { display:block; padding: clamp(4rem, 9svh, 6rem) var(--gutter) 0; }
  .studio { margin: 0; width: auto; --icon-size: clamp(3.125rem, 14.9vw, 3.625rem); --type-wordmark: clamp(1.75rem, 9.5vw, 2.75rem); }
  .masthead { text-align: center; }
  .projects { margin-top: 2.5rem; contain: none; }
  .work { width: fit-content; margin-inline: auto; gap: clamp(1.125rem, 5vw, 1.75rem); }
  .app-card {
    top: calc(100% + 1.5rem); left: 50%; translate: -50% 0;
    background: #14151f99; border: 1px solid #ffffff0a; border-radius: 12px; padding: 18px;
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  }
  #tree { inset: clamp(14rem, 29svh, 18rem) 0 auto; width:100%; height:calc(100svh - clamp(14rem, 29svh, 18rem)); mask-image: none; }
}
.lost { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 32px var(--gutter); }
.lost h1 { font-family: var(--font-pixel); font-size: clamp(22px, 5vw, 44px); }
.lost em { display: block; font-style: normal; }
.lost .back { margin-top: 44px; font-size: 11px; color: var(--muted); }
