/* R YOOO Portfolio — light theme (Weebly-style) */
:root {
  --bg: #ffffff;
  --text: #2a2a2a;
  --text-muted: #666666;
  --border: #d9d9d9;
  --footer-bg: #2a2a2a;
  --footer-text: #cccccc;
  --btn-bg: #2a2a2a;
  --btn-text: #ffffff;
  --hero-overlay: rgba(0, 0, 0, 0.35);
  --maxw: 960px;
  --wide: 1100px;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei",
    system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { opacity: 0.85; }

img { max-width: 100%; height: auto; display: block; }

/* ---------- Hero banner (all pages) ---------- */
.hero-banner {
  position: relative;
  min-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  overflow: visible;
}

.hero-banner__bg {
  position: absolute;
  inset: 0;
  background: url("../images/top.jpg") center top / cover no-repeat;
  z-index: 0;
}

.hero-banner__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-overlay);
}

.hero-mail {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  transition: background 0.15s;
}

.hero-mail:hover {
  background: rgba(0, 0, 0, 0.55);
  opacity: 1;
}

.hero-banner__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--wide);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
}

.hero-banner__title {
  margin: 0 0 10px;
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

/* Nav inside hero */
.hero-nav {
  width: 100%;
  margin-top: 0;
  padding-bottom: 0;
}

.nav-toggle {
  display: none;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #fff;
  padding: 8px 14px;
  font-size: 1.1rem;
  cursor: pointer;
  margin-bottom: 8px;
}

.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 0;
}

.menu > li { position: relative; }

.menu a,
.menu .sub-toggle {
  display: block;
  padding: 10px 18px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s;
}

.menu a:hover,
.menu .sub-toggle:hover {
  border-bottom-color: rgba(255, 255, 255, 0.6);
  opacity: 1;
}

.menu a.active,
.menu .sub-toggle.active {
  border-bottom-color: #fff;
}

.has-sub > .sub-toggle::after {
  content: " ▾";
  font-size: 0.75em;
  letter-spacing: 0;
  text-transform: none;
}

.submenu {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  background: rgba(30, 30, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
  z-index: 100;
  text-align: left;
}

.has-sub:hover .submenu,
.has-sub:focus-within .submenu,
.submenu.open {
  opacity: 1;
  visibility: visible;
}

.submenu a {
  padding: 8px 16px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: none;
  border-bottom: none;
  white-space: nowrap;
}

.submenu a:hover { background: rgba(255, 255, 255, 0.08); }
.submenu a.active { background: rgba(255, 255, 255, 0.12); font-weight: 700; }

/* ---------- Main content ---------- */
main { background: var(--bg); }

.page-content {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 24px 48px;
}

.home-section,
section.block {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 32px 24px;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 400;
  margin: 0 0 20px;
  color: var(--text);
  letter-spacing: 0.02em;
}

.section-title a { color: inherit; }
.section-title a:hover { text-decoration: underline; }

.page-head {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 36px 24px 8px;
}

.page-head h1 {
  font-size: 1.75rem;
  font-weight: 400;
  margin: 0 0 6px;
}

.page-head .sub { color: var(--text-muted); margin: 0; font-size: 0.95rem; }

section.block h2 {
  font-size: 1.4rem;
  font-weight: 400;
  margin: 24px 0 12px;
  padding: 0;
  border: none;
  letter-spacing: 0.02em;
}

section.block p { margin: 8px 0; color: var(--text); }
section.block p strong { font-weight: 700; }

.divider {
  max-width: var(--wide);
  margin: 0 auto;
  border: none;
  border-top: 1px solid var(--border);
}

/* two-column layouts */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

.two-col--about-preview { align-items: center; }

.about-preview__text h2 {
  font-size: 1.6rem;
  margin: 0 0 8px;
  font-weight: 700;
}

.about-preview__text .portfolio-line {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0 0 4px;
}

.about-preview__text .skills-line {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0 0 20px;
  line-height: 1.6;
}

.about-preview__photo img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
}

/* label + content rows (About page) */
.label-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  padding: 20px 0;
  max-width: var(--wide);
  margin: 0 auto;
}

.label-row .label {
  font-size: 1rem;
  font-weight: 700;
  padding-top: 2px;
}

.label-row .content p { margin: 0; }

.about-intro {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  padding: 36px 24px;
  max-width: var(--wide);
  margin: 0 auto;
  align-items: start;
}

.about-intro .portrait img { width: 100%; }

/* buttons */
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }

.btn {
  display: inline-block;
  padding: 8px 22px;
  background: var(--btn-bg);
  color: var(--btn-text);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: none;
  transition: background 0.15s;
}

.btn:hover {
  background: #444;
  color: #fff;
  opacity: 1;
}

/* home job / project cards */
.card-item {
  display: flex;
  flex-direction: column;
}

.card-item .video,
.card-item .card-thumb {
  margin-bottom: 12px;
  background: #f5f5f5;
}

.card-item h3 {
  font-size: 1.1rem;
  font-weight: 400;
  margin: 0 0 10px;
}

.card-item .card-thumb img { width: 100%; }

/* media + gallery */
figure { margin: 0; }

figure.media {
  max-width: 100%;
  margin: 16px 0;
}

figure.media img { width: 100%; }

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.g-item {
  overflow: hidden;
  background: #f8f8f8;
}

.g-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  transition: opacity 0.2s;
}

a.g-item:hover img { opacity: 0.88; }

.video {
  position: relative;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
}

.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.g-item.video-cell {
  grid-column: 1 / -1;
  background: transparent;
}

@media (min-width: 700px) {
  .g-item.video-cell { grid-column: span 2; }
}

/* project cards (projects page) */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin: 16px 0;
}

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow 0.15s;
}

.card:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1); }

.card .thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #f0f0f0;
}

.card .thumb img { width: 100%; height: 100%; object-fit: cover; }

.card .body { padding: 14px 16px; }

.card .body h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 600;
}

.card .body p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* footer */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 24px 20px;
  text-align: center;
  font-size: 0.88rem;
}

.site-footer a { color: #fff; }
.site-footer .social { margin-bottom: 6px; }

/* job page layout */
.job-page .section-title {
  font-size: 1.75rem;
  margin-bottom: 4px;
}

.job-subtitle {
  margin: 0 0 24px;
  font-size: 1rem;
}

.job-layout {
  align-items: start;
  margin-bottom: 20px;
}

.job-hint {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 8px 0 16px;
}

.job-buttons {
  gap: 16px;
}

.job-buttons .btn {
  min-width: 140px;
  text-align: center;
}

/* projects page layout */
.projects-page .section-title {
  font-size: 1.75rem;
  margin-bottom: 4px;
}

.projects-subtitle {
  margin: 0 0 20px;
  font-size: 1rem;
}

.projects-layout {
  align-items: start;
}

.projects-text p {
  margin: 8px 0;
}

.projects-hint {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 16px;
}

.projects-gallery {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.projects-gallery__item {
  margin: 0;
  overflow: hidden;
  background: #f8f8f8;
}

.projects-gallery__item img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.2s;
}

a.projects-gallery__item:hover img {
  opacity: 0.88;
}

/* ---------- Interaction page ---------- */
.interaction-main {
  background: #fff;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 20px 56px;
}

.interaction-page .page-head {
  padding: 32px 0 24px;
  border-bottom: none;
}

.interaction-page .page-head h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
}

.interaction-layout {
  align-items: start;
  gap: 32px;
}

.interaction-lead {
  margin: 0 0 16px;
  font-size: 1rem;
}

.interaction-list {
  margin: 0 0 20px;
  padding-left: 1.2em;
  line-height: 1.75;
}

.interaction-list li {
  margin-bottom: 10px;
}

.interaction-list li::marker {
  content: "● ";
}

.interaction-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.interaction-photo {
  margin: 0;
}

.interaction-photo img {
  width: 100%;
  height: auto;
  display: block;
}

/* ---------- Draw page ---------- */
.draw-main {
  background: #fff;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 20px 48px;
}

.draw-page .page-head {
  padding: 32px 0 24px;
  border-bottom: none;
}

.draw-page .page-head h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.draw-section {
  margin-bottom: 40px;
}

.draw-section__title {
  margin: 0 0 12px;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
}

.draw-section__title--lg {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
}

.draw-intro {
  margin: 0 0 20px;
  line-height: 1.7;
  color: var(--text);
}

.draw-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 32px 0 40px;
}

/* ACG — four columns, two stacked images each (mixed natural sizes) */
.draw-acg-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 20px;
}

.draw-acg-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.draw-acg-col .draw-thumb--plain img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.draw-grid {
  min-width: 0;
}

.draw-thumb {
  display: block;
  overflow: hidden;
  background: #f5f5f5;
  line-height: 0;
}

.draw-thumb img {
  display: block;
  width: 100%;
  transition: opacity 0.2s;
}

a.draw-thumb:hover img {
  opacity: 0.88;
}

/* 原創 / 二創·同人 — uniform 3-col landscape grid */
.draw-grid--cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.draw-grid--cols .draw-thumb {
  aspect-ratio: 4 / 3;
  background: #fff;
}

.draw-grid--cols .draw-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.88);
  cursor: zoom-out;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__img {
  max-width: min(96vw, 1200px);
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: default;
}

.lightbox__close {
  position: absolute;
  top: 16px;
  right: 20px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

/* responsive */
@media (max-width: 768px) {
  .hero-banner,
  .hero-banner__inner {
    min-height: 42vh;
  }

  .two-col,
  .about-intro,
  .label-row {
    grid-template-columns: 1fr;
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-toggle { display: inline-block; }

  .menu {
    display: none;
    flex-direction: column;
    align-items: stretch;
    background: rgba(20, 20, 20, 0.92);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 0;
  }

  .menu.open { display: flex; }

  .menu a,
  .menu .sub-toggle {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .menu a.active,
  .menu .sub-toggle.active {
    border-bottom-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.08);
  }

  .submenu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    display: none;
    background: rgba(0, 0, 0, 0.3);
    border: none;
  }

  .submenu.open { display: block; }

  .has-sub:hover .submenu { display: none; }
  .has-sub .submenu.open { display: block; }

  .draw-acg-cols {
    grid-template-columns: repeat(2, 1fr);
  }

  .draw-grid--cols {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .gallery { grid-template-columns: 1fr; }

  .draw-acg-cols {
    grid-template-columns: repeat(2, 1fr);
  }

  .draw-grid--cols {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- Effects page ---------- */
.effects-main {
  background: #fff;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 20px 56px;
}

.effects-page .page-head {
  padding: 32px 0 16px;
  border-bottom: none;
}

.effects-page .page-head h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
}

.effects-intro {
  margin-bottom: 28px;
}

.effects-intro__line {
  margin: 0 0 4px;
  color: #9db2c0;
  font-size: 0.92rem;
  line-height: 1.6;
}

.effect-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 36px 0;
}

.effect-project {
  margin-bottom: 8px;
}

.effect-project__top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 32px;
  align-items: start;
  margin-bottom: 20px;
}

.effect-project__name {
  margin: 0 0 10px;
  font-size: 1.2rem;
  font-weight: 800;
  color: #2b6cb0;
}

.effect-project__meta,
.effect-project__line {
  margin: 0 0 8px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.effect-project__note {
  margin: 10px 0;
  color: #b1b1b1;
  font-size: 0.9rem;
  line-height: 1.5;
}

.effect-project__list {
  margin: 0 0 10px;
  padding-left: 0;
  list-style: none;
}

.effect-project__list li {
  position: relative;
  padding-left: 1em;
  margin-bottom: 4px;
  line-height: 1.55;
  font-size: 0.95rem;
}

.effect-project__list li::before {
  content: "-";
  position: absolute;
  left: 0;
}

.effect-project__media {
  min-width: 0;
}

.effect-project__video .video {
  width: 100%;
}

.effect-project__media .effect-project__video + .effect-project__video {
  margin-top: 12px;
}

.effect-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.effect-gallery__item {
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #fff;
  line-height: 0;
}

.effect-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.effect-gallery--3 {
  grid-template-columns: repeat(3, 1fr);
}

.effect-gallery--stack {
  grid-template-columns: 1fr;
  margin-top: 8px;
}

.effect-gallery--stack .effect-gallery__item {
  aspect-ratio: auto;
}

.effect-gallery__item--video {
  aspect-ratio: auto;
  background: #000;
}

.effect-gallery__item--video .video {
  width: 100%;
}

.effect-project__pair .effect-gallery {
  min-width: 0;
}

.effect-project__pair + .effect-project__pair {
  margin-top: 12px;
}

.effect-gallery + .effect-gallery,
.effect-gallery + .effect-project__video,
.effect-project__video + .effect-project__video {
  margin-top: 12px;
}

.effect-gallery__item--dark {
  background: #000;
}

.effect-gallery__item--dark img,
.effect-gallery__item--contain img {
  object-fit: contain;
}

.effect-project__info--block {
  margin-bottom: 20px;
}

.effect-project__pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 32px;
  align-items: start;
}

.effect-project__thumb {
  margin: 0;
  overflow: hidden;
  background: #000;
  line-height: 0;
}

.effect-project__thumb img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 768px) {
  .effect-project__top {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .effect-gallery,
  .effect-gallery--3 {
    grid-template-columns: 1fr;
  }

  .effect-project__pair {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ---------- Spine page ---------- */
.spine-page .g-item {
  background: #000;
}

.spine-page .g-item img {
  object-fit: contain;
  aspect-ratio: auto;
  display: block;
}

.spine-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0;
  align-items: stretch;
}

.spine-row--full {
  grid-template-columns: 1fr;
}

.spine-row > .g-item,
.spine-row > .video-cell {
  margin: 0;
  min-width: 0;
}

.spine-row .gallery {
  margin: 0;
}

.gallery--grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.gallery--spine-chars {
  grid-template-columns: repeat(2, 1fr);
}

.gallery--spine-chars .video-cell {
  grid-column: 1 / -1;
}

.gallery--spine-bg-videos {
  grid-template-columns: repeat(2, 1fr);
}

.gallery--spine-bg-videos .video-cell {
  grid-column: span 1;
}

.gallery--spine-stack {
  grid-template-columns: 1fr;
}

.gallery--spine-stack .g-item img {
  width: 100%;
  height: auto;
}

.gallery--spine-bigwin {
  grid-template-columns: repeat(2, 1fr);
}

.gallery--spine-bigwin .g-item img {
  width: 100%;
  height: auto;
}

.gallery--spine-videos-3 {
  grid-template-columns: repeat(3, 1fr);
}

.gallery--spine-videos-3 .video-cell {
  grid-column: span 1;
}

.spine-row .video-cell,
.gallery--grid-2 .video-cell,
.gallery--spine-bg-videos .video-cell,
.gallery--spine-videos-3 .video-cell {
  grid-column: span 1;
}

.spine-symbol__set + .spine-symbol__set {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.spine-symbol__set .g-item img {
  width: 100%;
  height: auto;
}

@media (max-width: 700px) {
  .spine-row {
    grid-template-columns: 1fr;
  }

  .gallery--spine-chars,
  .gallery--spine-bg-videos,
  .gallery--spine-bigwin,
  .gallery--spine-videos-3 {
    grid-template-columns: 1fr;
  }

  .gallery--grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}
