@layer reset, base, components;
@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }
  body,
  h1,
  h2,
  p {
    margin: 0;
  }
  button,
  input,
  select {
    font: inherit;
  }
  button,
  a,
  input {
    -webkit-tap-highlight-color: transparent;
  }
  button {
    cursor: pointer;
  }
  a {
    color: inherit;
    text-decoration: none;
  }
  img,
  svg {
    display: block;
  }
  button {
    color: inherit;
  }
}
@layer base {
  :root {
    color-scheme: light;
    --bg: #fafaf9;
    --surface: #fff;
    --raised: #f0f0ed;
    --text: #222320;
    --muted: #777974;
    --line: #e3e4df;
    --strong: #20211f;
    --on-strong: #fff;
    --focus: #558076;
    --error: #b73737;
    --canvas: #eeefeb;
    --accent: #6b8b73;
    font-family:
      Inter,
      -apple-system,
      BlinkMacSystemFont,
      'Segoe UI',
      sans-serif;
    font-size: 16px;
    line-height: 1.5;
    background: var(--bg);
    color: var(--text);
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
  }
  :root[data-theme='dark'] {
    color-scheme: dark;
    --bg: #131412;
    --surface: #191b18;
    --raised: #242722;
    --text: #eceee7;
    --muted: #9da296;
    --line: #30342d;
    --strong: #e5e9dd;
    --on-strong: #1b1e17;
    --focus: #a8c3ad;
    --error: #ee9999;
    --canvas: #1c1f1a;
    --accent: #a6b596;
  }
  body {
    min-width: 320px;
  }
  button,
  input {
    touch-action: manipulation;
  }
  button:disabled {
    opacity: 0.6;
    cursor: wait;
  }
  a:focus-visible,
  button:focus-visible,
  input:focus-visible,
  select:focus-visible,
  [tabindex]:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 4px;
  }
  ::selection {
    background: var(--focus);
    color: var(--bg);
  }
  h1,
  h2 {
    font-weight: 500;
    letter-spacing: -0.035em;
  }
  h1 {
    font-size: 2.5rem;
    line-height: 1.15;
  }
  h2 {
    font-size: 1.125rem;
    line-height: 1.4;
  }
  button {
    border: 0;
    background: none;
  }
  input {
    min-width: 0;
  }
  input[type='range'] {
    accent-color: var(--text);
    width: 100%;
    height: 44px;
    margin: 0;
    cursor: pointer;
  }
  input[type='checkbox'] {
    accent-color: var(--text);
    width: 18px;
    height: 18px;
  }
  a:hover {
    text-decoration: none;
  }
  input[type='search']::-webkit-search-cancel-button {
    cursor: pointer;
  }
}
@layer components {
  .site-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 36px;
  }
  .site-header {
    height: 112px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
  }
  .brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: -0.02em;
  }
  .brand > span {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 11px;
  }
  .brand > svg {
    flex-shrink: 0;
  }
  .brand-divider {
    color: var(--line);
    font-weight: 400;
  }
  .brand-secondary {
    color: var(--muted);
    font-weight: 400;
  }
  .header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
  }
  .icon-button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
  }
  .icon-button:hover {
    background: var(--raised);
  }
  .icon-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.3;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .text-button {
    padding: 10px 0;
    color: var(--muted);
    font-size: 0.875rem;
    min-height: 44px;
  }
  .text-button:hover {
    color: var(--text);
  }
  .eyebrow {
    font-size: 0.6875rem;
    letter-spacing: 0.14em;
    font-weight: 500;
    color: var(--muted);
  }
  .gallery-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 54px 0 42px;
  }
  .gallery-heading h1 {
    font-size: 3.5rem;
    letter-spacing: -0.055em;
    margin: 12px 0 12px;
  }
  .heading-period {
    color: var(--accent);
  }
  .gallery-heading p {
    color: var(--muted);
    font-size: 1rem;
  }
  .private-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 0.8125rem;
    padding-bottom: 6px;
    white-space: nowrap;
  }
  .private-label svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.2;
  }
  .gallery-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-top: 1px solid var(--line);
    padding: 24px 0 28px;
  }
  .tag-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }
  .tag-filter {
    padding: 0 15px;
    min-height: 44px;
    color: var(--muted);
    font-size: 0.875rem;
    border-radius: 6px;
  }
  .tag-filter:hover {
    color: var(--text);
  }
  .tag-filter.active {
    background: var(--raised);
    color: var(--text);
  }
  .search-field {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 230px;
    max-width: 100%;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 7px;
    padding: 0 12px;
    flex-shrink: 0;
  }
  .search-field svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: var(--muted);
    stroke-width: 1.4;
    flex-shrink: 0;
  }
  .search-field input {
    width: 100%;
    height: 44px;
    border: 0;
    background: none;
    outline-offset: 8px;
    color: var(--text);
    font-size: 0.875rem;
  }
  .search-field input::placeholder {
    color: var(--muted);
  }
  .prototype-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 42px 28px;
  }
  .prototype-card {
    min-width: 0;
    display: block;
  }
  .prototype-thumbnail {
    aspect-ratio: 8/5;
    overflow: hidden;
    background: var(--canvas);
    border: 1px solid var(--line);
    border-radius: 10px;
    position: relative;
  }
  .prototype-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
  }
  .theme-image-dark {
    display: none;
  }
  :root[data-theme='dark'] .theme-image-dark {
    display: block;
  }
  :root[data-theme='dark'] .theme-image-light {
    display: none;
  }
  .thumbnail-fallback {
    display: grid;
    place-items: center;
    height: 100%;
    font-size: 0.875rem;
    color: var(--muted);
    background: radial-gradient(var(--line) 1px, transparent 1px) 0 0/16px 16px;
  }
  .card-open {
    position: absolute;
    bottom: 16px;
    right: 16px;
    font-size: 0.8125rem;
    padding: 9px 13px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 5px;
    opacity: 0;
    transform: translateY(5px);
    transition:
      opacity 0.2s,
      transform 0.2s;
  }
  .prototype-card:hover .card-open,
  .prototype-card:focus-visible .card-open {
    opacity: 1;
    transform: none;
  }
  .prototype-card:hover img {
    transform: scale(1.025);
  }
  .card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
  }
  .card-heading h2 {
    font-size: 1.125rem;
    font-weight: 500;
    letter-spacing: -0.025em;
  }
  .visibility-label {
    font-size: 0.6875rem;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 2px 7px;
    flex-shrink: 0;
  }
  .prototype-card > p {
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 7px 0 12px;
    max-width: 45ch;
  }
  .card-tags {
    font-size: 0.6875rem;
    letter-spacing: 0.05em;
    color: var(--muted);
  }
  .hidden-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8125rem;
    color: var(--muted);
    width: max-content;
    margin-top: 40px;
    min-height: 44px;
    cursor: pointer;
  }
  .hidden-toggle input {
    margin: 0;
  }
  .site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 72px;
    border-top: 1px solid var(--line);
    padding: 24px 0 32px;
    color: var(--muted);
    font-size: 0.75rem;
  }
  .site-footer a:hover {
    color: var(--text);
  }
  .no-results {
    grid-column: 1/-1;
    padding: 64px 0;
    color: var(--muted);
  }
  .no-results h2 {
    color: var(--text);
  }
  .no-results p {
    margin: 8px 0 20px;
  }
  .loading-state {
    padding: 60px 0;
    color: var(--muted);
  }
  .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 17px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: 6px;
    white-space: nowrap;
    transition: background 0.15s;
  }
  .button.primary {
    background: var(--strong);
    color: var(--on-strong);
  }
  .button.primary:hover {
    opacity: 0.88;
  }
  .button.secondary {
    background: var(--surface);
    border-color: var(--line);
  }
  .button.secondary:hover {
    background: var(--raised);
  }
  .login-layout {
    max-width: 1128px;
    margin: auto;
    min-height: 100svh;
    padding: 42px 36px 28px;
    display: flex;
    flex-direction: column;
  }
  .login-brand {
    align-self: flex-start;
  }
  .login-card {
    width: 100%;
    max-width: 388px;
    align-self: center;
    margin: auto;
    padding: 80px 0;
  }
  .login-card h1 {
    font-size: 3rem;
    letter-spacing: -0.055em;
    margin: 17px 0;
  }
  .login-intro {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--muted);
    margin-bottom: 36px;
    max-width: 30ch;
  }
  .login-card label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 10px;
  }
  .password-field {
    display: flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
    overflow: hidden;
  }
  .password-field:focus-within {
    border-color: var(--focus);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--focus) 15%, transparent);
  }
  .password-field input {
    height: 50px;
    flex: 1;
    width: 100%;
    border: 0;
    outline: none;
    color: var(--text);
    background: none;
    padding: 0 14px;
  }
  .password-reveal {
    height: 44px;
    padding: 0 14px;
    font-size: 0.75rem;
    color: var(--muted);
  }
  .login-submit {
    width: 100%;
    margin-top: 16px;
    height: 48px;
  }
  .login-note {
    font-size: 0.75rem;
    line-height: 1.6;
    color: var(--muted);
    margin-top: 24px;
    max-width: 43ch;
  }
  .login-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    color: var(--muted);
    font-size: 0.75rem;
  }
  .login-footer a:hover {
    color: var(--text);
  }
  .form-error {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 12px;
    line-height: 1.5;
  }
  .empty-page {
    max-width: 600px;
    padding: 60px 24px;
    margin: 0 auto;
  }
  .empty-page h1 {
    margin-top: 100px;
  }
  .empty-page > p {
    color: var(--muted);
    margin: 20px 0 32px;
  }
  .prototype-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 38px 0 34px;
  }
  .prototype-heading h1 {
    font-size: 2.25rem;
    margin: 12px 0 10px;
  }
  .prototype-heading p {
    color: var(--muted);
    font-size: 0.9375rem;
    max-width: 50ch;
  }
  .back-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 0.8125rem;
    color: var(--muted);
  }
  .back-link:hover {
    color: var(--text);
  }
  .experiment-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 264px;
    gap: 24px;
    align-items: start;
  }
  .experiment-subject {
    min-width: 0;
  }
  .experiment-canvas {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 1.2;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--canvas);
  }
  .experiment-canvas canvas {
    display: block;
    width: 100%;
    height: 100%;
  }
  .experiment-caption {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-top: 16px;
    color: var(--muted);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
  }
  .control-panel {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    padding: 22px 20px;
  }
  .panel-heading {
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
  }
  .panel-heading h2 {
    font-size: 0.9375rem;
    letter-spacing: -0.02em;
  }
  .panel-heading > span {
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
    margin-top: 4px;
  }
  .control-fields {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 24px 0;
  }
  .range-control {
    display: block;
  }
  .range-control > span {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.8125rem;
  }
  .range-control output {
    font-family: ui-monospace, SFMono-Regular, monospace;
    color: var(--muted);
    font-size: 0.75rem;
  }
  .control-label {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.8125rem;
  }
  .control-label select {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 5px;
    min-height: 44px;
    padding: 8px 12px;
  }
  .panel-actions {
    display: flex;
    gap: 8px;
    border-top: 1px solid var(--line);
    padding-top: 20px;
  }
  .panel-actions .button {
    flex: 1;
    padding: 10px 9px;
    font-size: 0.8125rem;
  }
  .pause-button {
    width: 100%;
  }
  .motion-note {
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.6;
  }
  .share-wrap {
    position: relative;
    align-self: center;
  }
  .share-popover {
    position: absolute;
    z-index: 10;
    top: calc(100% + 10px);
    right: 0;
    width: min(320px, calc(100vw - 48px));
    padding: 20px;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 9px;
    box-shadow: 0 10px 40px #0002;
  }
  .share-popover strong {
    font-size: 0.875rem;
    font-weight: 500;
  }
  .share-popover p {
    color: var(--muted);
    font-size: 0.8125rem;
    margin: 8px 0 16px;
  }
  .share-popover input {
    width: 100%;
    font-size: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 5px;
    height: 44px;
    padding: 0 10px;
    background: var(--bg);
    color: var(--text);
  }
  .share-popover > .button {
    width: 100%;
    margin-top: 10px;
  }
  .gallery-note {
    font-size: 0.75rem;
    color: var(--muted);
  }
  @media (min-width: 1280px) {
    .site-container {
      padding: 0 40px;
    }
  }
  @media (max-width: 760px) {
    .site-container {
      padding: 0 24px;
    }
    .site-header {
      height: 90px;
    }
    .brand {
      font-size: 0.8125rem;
      gap: 9px;
    }
    .brand > span {
      gap: 8px;
    }
    .brand svg {
      width: 21px;
      height: 21px;
    }
    .header-actions {
      gap: 12px;
    }
    .gallery-heading {
      padding: 38px 0 32px;
      align-items: start;
      flex-direction: column;
      gap: 18px;
    }
    .gallery-heading h1 {
      font-size: 2.75rem;
    }
    .private-label {
      font-size: 0.75rem;
    }
    .gallery-toolbar {
      align-items: stretch;
      flex-direction: column;
      gap: 18px;
      padding-top: 20px;
    }
    .search-field {
      width: 100%;
    }
    .prototype-grid {
      gap: 32px 20px;
    }
    .card-heading {
      gap: 6px;
      align-items: start;
    }
    .card-heading h2 {
      font-size: 1rem;
    }
    .prototype-card > p {
      font-size: 0.8125rem;
    }
    .site-footer {
      margin-top: 52px;
      align-items: start;
      flex-direction: column;
      gap: 12px;
    }
    .prototype-heading {
      padding: 22px 0 28px;
      gap: 16px;
    }
    .prototype-heading h1 {
      font-size: 1.75rem;
    }
    .prototype-heading p {
      font-size: 0.875rem;
    }
    .experiment-layout {
      grid-template-columns: 1fr;
    }
    .experiment-canvas {
      aspect-ratio: 1.1;
    }
    .control-panel {
      padding: 22px;
    }
    .login-layout {
      padding: 30px 24px 24px;
    }
    .login-footer {
      flex-direction: column;
      gap: 8px;
    }
    .login-card {
      padding: 65px 0;
    }
    .login-card h1 {
      font-size: 2.5rem;
    }
  }
  @media (max-width: 500px) {
    .prototype-grid {
      grid-template-columns: 1fr;
    }
    .brand-secondary {
      display: none;
    }
    .brand-divider {
      display: none;
    }
    .gallery-heading .eyebrow {
      font-size: 0.625rem;
    }
    .sign-out {
      font-size: 0.75rem;
    }
    .prototype-heading .button {
      padding: 8px 13px;
    }
    .prototype-heading {
      align-items: center;
    }
    .private-label {
      padding: 0;
    }
    .tag-filter {
      padding: 0 12px;
    }
    .prototype-thumbnail {
      border-radius: 8px;
    }
    .card-heading h2 {
      font-size: 1.125rem;
    }
    .prototype-card > p {
      font-size: 0.875rem;
    }
    .visibility-label {
      font-size: 0.6875rem;
    }
  }
  @media (pointer: coarse) {
    .card-open {
      opacity: 1;
      transform: none;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation: none !important;
      transition: none !important;
      scroll-behavior: auto !important;
    }
  }
}
