/* ============================================
   [Y] Portfolio — Shared Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;700&display=swap');

:root {
  --bg: #ffffff;
  --ink: #302F2F;
  --ink-soft: #302F2F;
  --panel: #2b2b2b;
  --panel-text: #d8d8d8;
  --line: #e4e4e4;
  --max-w: 1600px;
  --side-pad: 8vw;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.nav-link {
  text-decoration: none;
}

.resume-link {
  text-decoration: underline;
  text-underline-offset: 4px;
}

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

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 80px var(--side-pad) 0;
  gap: 24px;
  font-size: 18px;
}

.logo {
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.main-nav .sep { color: var(--ink-soft); }

.header-right {
  white-space: nowrap;
  text-align: right;
}

/* ---------- Hero (home page) ---------- */
.hero-wrap {
  min-height: calc(100vh - 100px);
  display: flex;
  flex-direction: column;
  padding: 0 var(--side-pad);
}

.hero-spacer { flex: 6 1 auto; }
.hero-spacer-small { flex: 0.1 1 auto; min-height: 1vh; }

.hero {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  flex-wrap: wrap;
}

.hero-title,
.hero-desc {
  font-size: 18px;
  line-height: 1.4;
}

.hero-desc {
  max-width: 420px;
}

.scroll-cue {
  flex: 0 0 auto;
  text-align: center;
  font-size: 18px;
  color: var(--ink-soft);
}

.scroll-cue a { text-decoration: none; }

/* ---------- Work / project list (museum style) ---------- */
.work-section {
  padding: 0 var(--side-pad) 6vh;
}

.project-entry {
  display: block;
  padding: 11vh 0;
  text-decoration: none;
}

/* thin frame + mat around each piece, like a gallery placard */
.project-frame {
  border: none;
  padding: 0;
}

.project-thumb {
  background: var(--panel);
  color: var(--panel-text);
  width: 100%;
  max-width: 620px;
  aspect-ratio: 16 / 8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.project-thumb img,
.project-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* museum wall-label caption */
.project-plaque {
  margin-top: 20px;
  max-width: 620px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 16px;
}

.plaque-number {
  color: var(--ink-soft);
}

.plaque-title {
  font-size: 16px;
}

.plaque-sub {
  font-size: 16px;
}

/* ---------- Simple grid: all projects, equal size ---------- */
.simple-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  row-gap: 28px;
  column-gap: 28px;
}

.simple-grid .project-entry {
  padding: 0;
}

.simple-grid .project-thumb {
  width: 100%;
  aspect-ratio: 21 / 9;
}

.simple-grid .project-thumb img,
.simple-grid .project-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.simple-grid .project-plaque {
  margin-top: 8px;
  font-size: 16px;
}

@media (max-width: 700px) {
  .simple-grid { grid-template-columns: 1fr; gap: 40px; }
}

/* ---------- Bookshelf: each project as a colored book spine ---------- */
.bookshelf {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 18px;
  padding: 10vh 0 0;
  min-height: 46vh;
}

.book {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 110px;
  height: 42vh;
  padding-bottom: 24px;
  border-radius: 3px 3px 0 0;
  color: #f4f1ea;
  text-decoration: none;
  transform: rotate(var(--tilt, 0deg));
  transform-origin: bottom center;
  transition: transform 0.35s ease, height 0.35s ease, box-shadow 0.35s ease;
  box-shadow: -6px 0 12px rgba(0,0,0,0.08);
  cursor: pointer;
}

.book:hover,
.book:focus-visible {
  transform: rotate(0deg) translateY(-14px);
  height: 46vh;
  box-shadow: 0 20px 30px rgba(0,0,0,0.18);
}

.book-title {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 15px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.book-balance  { background: #2b2b2b; --tilt: -3deg; }
.book-rehand   { background: #c97b6b; --tilt: 2deg; }
.book-stranger { background: #2255a4; --tilt: -1.5deg; }
.book-pilates  { background: #6b5842; --tilt: 3deg; }

.bookshelf-ledge {
  max-width: 900px;
  margin: 0 auto;
  height: 10px;
  background: var(--ink);
  border-radius: 1px;
}

@media (max-width: 700px) {
  .bookshelf { gap: 10px; padding-top: 6vh; min-height: 34vh; }
  .book { width: 64px; height: 30vh; padding-bottom: 14px; }
  .book:hover, .book:focus-visible { height: 33vh; }
  .book-title { font-size: 12px; }
}
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 40px;
}

.bento-grid .project-entry {
  padding: 0;
}

.bento-balance   { grid-column: 1 / 9; }
.bento-rehand    { grid-column: 9 / 13; }
.bento-stranger  { grid-column: 1 / 5; }
.bento-pilates   { grid-column: 5 / 13; }

.bento-grid .project-thumb {
  max-width: 100%;
  aspect-ratio: 4 / 3;
}

.bento-balance .project-thumb { aspect-ratio: 16 / 9; }
.bento-rehand .project-thumb { aspect-ratio: 4 / 5; }
.bento-stranger .project-thumb { aspect-ratio: 4 / 5; }
.bento-pilates .project-thumb { aspect-ratio: 16 / 8; }

@media (max-width: 900px) {
  .bento-grid { grid-template-columns: 1fr; gap: 60px; }
  .bento-balance, .bento-rehand, .bento-stranger, .bento-pilates {
    grid-column: 1 / -1;
  }
}

/* gentle rise-and-fade reveal as pieces enter view */
.reveal {
  opacity: 1;
}

.playground-link {
  display: inline-block;
  margin-top: 10px;
  text-decoration: underline;
  text-underline-offset: 4px;
  font-size: 16px;
  color: var(--ink-soft);
}

.playground-standalone {
  text-align: center;
  padding: 3vh var(--side-pad) 3vh;
  color: var(--ink-soft);
  font-size: 18px;
}

.playground-standalone a {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- About page ---------- */
.about-main {
  padding: 0 var(--side-pad) 4vh;
}

.about-hero-wrap {
  min-height: calc(100vh - 150px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.about-photo {
  max-width: 320px;
  margin: 2vh auto 2vh;
}

.about-photo img {
  width: 100%;
  height: auto;
}

.about-scroll-cue {
  text-align: center;
  color: var(--ink-soft);
  font-size: 18px;
  margin-top: 1vh;
  margin-bottom: 5vh;
}

.about-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.about-columns p {
  font-size: 18px;
  line-height: 1.6;
  margin: 0 0 24px;
}

@media (max-width: 900px) {
  .about-columns { grid-template-columns: 1fr; gap: 0; }
}

/* ---------- Project detail page ---------- */
.project-main {
  padding: 12vh var(--side-pad) 10vh;
}

.project-main h1 {
  font-size: 22px;
  font-weight: 400;
  margin: 0 0 8px;
}

.project-sub {
  color: var(--ink-soft);
  font-size: 16px;
  margin-bottom: 6vh;
}

.project-hero-image {
  width: 100%;
  background: var(--panel);
  aspect-ratio: 16/9;
  margin-bottom: 6vh;
  overflow: hidden;
}

.project-hero-image img,
.project-hero-image video { width: 100%; height: 100%; object-fit: cover; }

.project-body {
  max-width: 680px;
  font-size: 18px;
}

.project-body p { margin: 0 0 24px; }

.back-link {
  display: block;
  text-align: left;
  margin-top: 6vh;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- Project page: meta row + centered container ---------- */
.project-meta-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 6vh var(--side-pad) 4vh;
  font-size: 18px;
  gap: 20px;
}

.project-meta-row .meta-center {
  text-align: center;
}

.project-meta-row .meta-right {
  text-align: right;
}

.project-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px var(--side-pad);
}

.project-container img,
.project-container video {
  width: 100%;
  display: block;
}

.project-headline {
  font-size: 18px;
  line-height: 1.6;
  margin: 8vh 0 6vh;
}

/* Hero video: truly edge-to-edge */
.project-hero-media {
  width: 100%;
  aspect-ratio: 2 / 1;
  overflow: hidden;
}

.project-hero-media video,
.project-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Secondary media: ~81% width (1040/1280), centered, independent of the text column */
.project-media-narrow {
  width: 81.25%;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.project-media-narrow video,
.project-media-narrow img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-section {
  margin-bottom: 0;
}

.project-text-stack {
  max-width: 640px;
  margin: 0 auto;
  text-align: left;
}

.project-text-stack p {
  font-size: 18px;
  line-height: 1.6;
  margin: 0 0 24px;
}

.works-index {
  background-image: repeating-linear-gradient(
    90deg,
    #fceee6 0px, #fceee6 60px,
    transparent 60px, transparent 120px
  );
  padding: 6vh var(--side-pad);
  margin-top: 4vh;
  text-align: center;
  font-size: 18px;
  line-height: 1.8;
}

.works-index a {
  text-decoration: none;
}

.works-index a:hover {
  text-decoration: underline;
}

.project-image-pair {
  width: 81.25%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.project-image-pair img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

@media (max-width: 700px) {
  .project-image-pair { grid-template-columns: 1fr; }
}

.playground-entry {
  max-width: 900px;
  margin: 0 auto 10vh;
  padding: 0 var(--side-pad);
}

.playground-entry .entry-heading {
  font-size: 18px;
  max-width: 480px;
}

.playground-entry .entry-desc {
  font-size: 18px;
  line-height: 1.6;
  max-width: 480px;
  margin-top: 12px;
}

.playground-intro {
  padding: 4vh var(--side-pad) 0;
  max-width: 616px;
}

.playground-intro .entry-heading {
  font-size: 18px;
}

.playground-intro .entry-desc {
  font-size: 18px;
  line-height: 1.6;
  margin-top: 12px;
}

.icon-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  max-width: 1040px;
  padding: 0 var(--side-pad);
  margin: 6vh auto 3vh;
}

.icon-row img {
  width: 220px;
  height: 220px;
  object-fit: contain;
}

.playground-entry .entry-caption {
  font-size: 16px;
  color: var(--ink-soft);
}

.playground-entry .entry-media {
  margin-top: 4vh;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
}

.playground-entry .entry-media video,
.playground-entry .entry-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.playground-entry .entry-body {
  font-size: 18px;
  line-height: 1.6;
  margin-top: 4vh;
}

.project-diagram {
  width: 81.25%;
  margin: 0 auto;
}

.project-diagram img {
  width: 100%;
  height: auto;
}
.site-footer {
  padding: 6vh var(--side-pad) 5vh;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 24px;
  font-size: 18px;
  margin-top: 2vh;
}

.footer-left { line-height: 1.6; }

.footer-name-link { text-decoration: none; }

.footer-center {
  color: var(--ink-soft);
  text-align: center;
  white-space: nowrap;
}

.footer-right {
  text-align: right;
  line-height: 1.6;
}

.footer-right a { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-wrap { min-height: 60vh; }
  .hero { flex-direction: column; gap: 24px; }
  .hero-desc { max-width: 100%; }
  .project-row { grid-template-columns: 1fr; gap: 40px; }
  .site-footer { grid-template-columns: 1fr; text-align: left; }
  .footer-center { text-align: left; }
  .footer-right { text-align: left; }
}

@media (max-width: 560px) {
  :root { --side-pad: 6vw; }
  body { font-size: 15px; }
  .main-nav, .header-right, .logo { font-size: 14px; }
  .hero-title, .hero-desc { font-size: 17px; }
  .project-thumb .phonetic { font-size: 26px; }
  .site-header { flex-wrap: wrap; row-gap: 12px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
