:root {
  color-scheme: light dark;

  --thumb-h: 150px;
  --thumb-gap: 2px;
  --title-gap: 8px;

  --nav-heading: 1.05rem;
  --nav-item: 0.9rem;
  --bg: #ffffff;
  --fg: #111111;
  --accent: #FF9300;
  --muted: #555555;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111517;
    --fg: #e8e6e3;
    --accent: #0096FF;
    --muted: #aaaaaa;
  }
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100svh;
  display: block;
  font-family: "Avenir Next", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
}

a {
  font-family: "Avenir Next", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
}

.logo {
  display: block;
  height: auto;
  color: var(--fg);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (hover: hover) {
  .page-description a:hover,
  .footer-links a:hover {
    color: var(--accent);
    text-decoration: underline;
  }
}

.page-description a,
.footer-links a {
  color: var(--fg);
  text-decoration: none;
}

.contact {
  display: flex;
  gap: 16px;
  margin: 0 0 20px;
  font-size: 2rem;
  line-height: 1;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.contact a {
  text-decoration: none;
  display: inline-block;
  transition: transform 0.15s ease;
}

@media (hover: hover) {
  .contact a:hover {
    transform: scale(1.14);
  }
}

.contact a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

.page-footer {
  padding-top: 40px;
  padding-right: var(--page-pad);
  text-align: right;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 20px;
  margin: 0;
  font-size: var(--nav-item);
}

.copyright {
  margin: 10px 0 0;
  font-size: var(--nav-item);
  color: var(--muted);
}

.page-description {
  margin: 0;
  font-size: var(--nav-item);
  color: var(--muted);
}

.pronunciation {
  margin: 0;
  font-size: var(--nav-item);
  color: var(--muted);
}

.project {
  transition: opacity 300ms ease, transform 300ms ease;
  transform-origin: left top;
}

.project.is-hidden {
  opacity: 0;
  transform: scale(0.97);
  pointer-events: none;
}

.project.is-collapsed {
  display: none;
}

.project-title {
  display: inline-block;
  margin: 0 0 var(--title-gap);
  padding: 0;
  line-height: 1.3;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fg);
  transition: color 0.12s ease;
}

.project.is-selected .project-title {
  color: var(--accent);
}

.video-row-clip {
  overflow: hidden;
}

.video-row {
  display: flex;
  gap: var(--thumb-gap);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  --end-spacer: 0px;
}

.video-row::-webkit-scrollbar {
  display: none;
}

.video-row::after {
  content: "";
  flex: 0 0 var(--end-spacer);
  pointer-events: none;
}

.video-row .video-item {
  flex: 0 0 auto;
}

.logo-reset {
  cursor: pointer;
}

.logo-reset:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .project {
    transition: none;
  }
  .project.is-hidden {
    transform: none;
  }
}

.video-wrapper {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 10px;
  background: var(--bg);
  transform: translateZ(0);
  transition: transform 0.15s ease;
}

.video-item {
  --ar: 9 / 16;
  width: calc(var(--thumb-h) * (var(--ar)));
}

.video-item.horizontal { --ar: 16 / 9; }
.video-item.square     { --ar: 1 / 1; }
.video-item.scope      { --ar: 1920 / 800; }

.video-item .video-wrapper {
  width: 100%;
  height: var(--thumb-h);
  border-radius: 6px;
  cursor: pointer;
}

.video-item .video-wrapper:has(:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.thumb-container {
  position: absolute;
  inset: 0;
  cursor: inherit;
  overflow: hidden;
}

.video-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;

  opacity: 0;
  transition: opacity 200ms ease;
}

.video-thumb.is-loaded {
  opacity: 1;
}

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

@media (max-width: 599.98px) {
  html.is-video-modal-open,
  html.is-video-modal-open body { overflow: hidden; }
}

.video-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.video-modal-iframe {
  border: none;
  display: block;
  pointer-events: auto;
  background: #000;
  color-scheme: light;
}

.video-modal {
  --arrow-w: 22px;
  --arrow-h: 44px;
  --arrow-edge: 18px;
  --arrow-gap: 16px;
  --arrow-pad: 12px;
  --video-gutter: calc(var(--arrow-edge) + var(--arrow-w) + var(--arrow-gap));

  --video-max-h: 75vh;
}

.video-modal[data-aspect="vertical"] { --video-max-h: 62vh; }

.video-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: calc(var(--arrow-w) + var(--arrow-pad) * 2);
  height: var(--arrow-h);
  padding: 0 var(--arrow-pad);
  border: none;
  background: none;
  color: #e8e6e3;
  cursor: pointer;
  transition: color 0.2s ease;
}

.video-modal-nav svg {
  display: block;
  width: 100%;
  height: 100%;
}

.video-modal-nav.prev  { left:  calc(var(--arrow-edge) - var(--arrow-pad)); }
.video-modal-nav.next  { right: calc(var(--arrow-edge) - var(--arrow-pad)); }

@media (hover: hover) {
  .video-modal-nav:hover { color: var(--accent); }
}

@media (max-width: 599.98px) {
  .video-modal {
    --arrow-w: 17px;
    --arrow-h: 34px;
    --arrow-edge: 10px;
    --arrow-gap: 12px;
    --arrow-pad: 10px;
  }
}

.video-modal-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 85vw;
}

.video-modal-meta {
  width: var(--video-w, min(85vw, 560px));
  color: #e8e6e3;
  cursor: default;
}

.video-modal-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.video-modal-desc {
  margin: 4px 0 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #a8a5a1;
}

.video-modal-desc a {
  color: #e8e6e3;
  text-decoration: underline;
}

@media (hover: hover) {
  .video-modal-desc a:hover {
    color: var(--accent);
  }
}
