@font-face { font-family: "EAS VHS"; src: url("assets/eas-vhs.ttf") format("truetype"); font-display: swap; }
body { font-family: "EAS VHS", Space, Arial, sans-serif; }
.portfolio-mark { width:56px; height:48px; object-fit:contain; }
.project-actions { display:flex; flex-wrap:wrap; gap:10px; margin:18px 0; }
.portfolio-dialog { width:min(460px,calc(100% - 24px)); max-height:90dvh; padding:22px; background:#1b2230; color:#f1f3f6; border:1px solid #47717e; border-radius:12px; }
.portfolio-dialog.wide { width:min(850px,calc(100% - 24px)); }
.portfolio-dialog::backdrop { background:#080a12c9; }
.portfolio-dialog header,.manage-toolbar { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:12px; margin-bottom:18px; }
.portfolio-dialog h2 { font:500 clamp(20px,4vw,32px)/1.2 Space,Arial,sans-serif; }
.portfolio-dialog iframe { width:100%; height:65dvh; border:1px solid #465267; background:white; }
.form-pair { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr)); gap:12px; }
.manager-check { display:block; margin-bottom:12px; }
.manager-status { color:#b6fcff; margin-top:10px; }
.pet-walk { width:100%; height:100%; object-fit:contain; image-rendering:pixelated; }
.pet-body.uses-sprite-sheet { background:none; animation:none; }
main h1, main h2, main h3 {
  font-family: Space, Arial, sans-serif;
  font-weight: 500;
  letter-spacing: -.025em;
  line-height: 1.14;
}
.header nav { gap: .3rem; padding: .3rem; border: 1px solid #394254; border-radius: 12px; background: #1a202b; }
.header nav a { display: flex; align-items: center; gap: .55rem; padding: .6rem .85rem; border-radius: 8px; }
.header nav a:hover, .header nav a[aria-current="page"] { color: #b6fcff; background: #235058; }
.header nav a span { color: #65e9ed; font-size: 1.15rem; }
.portfolio-footer { display:flex; flex-wrap:wrap; gap:.6rem 1rem; color:#aab1bf; border-top:1px solid #394254; padding:2rem max(22px,6vw) 150px; }
.portfolio-footer a { color:#f1f3f6; font-weight:700; }
.category-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.category { display:block; min-height:170px; padding:19px; border:1px solid #394254; border-radius:9px; background:#1c2330; }
.category:hover, .entry:hover { border-color:#65e9ed; }
.category h2 { font-size:clamp(16px,2vw,24px); margin:12px 0; letter-spacing:-.025em; }
.category p { font-size:.95rem; }
.category-icon { color:#65e9ed; font-size:26px; }
.category:nth-child(even) .category-icon { color:#ed70c5; }
.catalogue { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr)); gap:16px; }
.entry { padding:24px; background:#1c2330; border:1px solid #394254; border-radius:9px; }
.entry h2 { font-size:25px; margin-bottom:12px; }
.entry span { display:inline-block; margin-top:16px; color:#65e9ed; }
.filter[aria-current="page"] { color:#122027; background:#65e9ed; }
.game-panel { margin:42px 0 64px; padding:24px; border:1px solid #394254; border-radius:12px; background:#1c2330; }
.game-header,.game-controls { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; }
.game-header h2 { font-size:clamp(24px,4vw,36px); margin-bottom:8px; }
.game-score { font-variant-numeric:tabular-nums; color:#65e9ed; }
.game-panel canvas { display:block; width:100%; max-height:330px; margin:18px 0; object-fit:fill; image-rendering:pixelated; touch-action:manipulation; border:1px solid #394254; }
.game-controls { justify-content:flex-start; }
.pet {
  --walk:.9;
  width:min(270px,calc(100vw - 24px));
  position:fixed;
  z-index:40;
  left:calc(12px + var(--walk) * (100vw - 24px - min(270px,100vw - 24px)));
  bottom:10px;
  transition:left .13s linear;
  display:grid;
  justify-items:center;
  pointer-events:none;
}
.pet > * { pointer-events:auto; }
.pet-body { width:104px; height:104px; display:block; padding:0; border:0; background-color:transparent; }
.pet-bubble,.contact-speech {
  color:#18272e;
  background:#d8f6f7;
  clip-path:polygon(0 8px,8px 8px,8px 0,calc(100% - 8px) 0,calc(100% - 8px) 8px,100% 8px,100% calc(100% - 8px),calc(50% + 6px) calc(100% - 8px),calc(50% + 6px) 100%,calc(50% - 6px) 100%,calc(50% - 6px) calc(100% - 8px),0 calc(100% - 8px));
  padding:13px 15px 20px;
}
.pet-bubble { width:100%; animation:bubble-in .18s steps(3,end); }
.pet-bubble p { color:inherit; font-size:14px; }
.pet-caption { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; }
.pet-close { border:0; background:#b9e5e8; color:#17373a; font-size:20px; min-width:30px; }
.pet-form { position:relative; width:100%; height:37px; }
.pet-prompt { display:block; margin:auto; padding:4px 10px; color:#b6fcff; border:1px solid #506277; border-radius:5px; background:#1c2330; font-size:13px; }
.pet-entry { display:none; position:absolute; inset:0; background:#192634; border:1px solid #65e9ed; border-radius:5px; }
.pet-form.writing .pet-entry,.pet-form:focus-within .pet-entry { display:flex; }
.pet-form.writing .pet-prompt,.pet-form:focus-within .pet-prompt { visibility:hidden; }
@media(hover:hover) {
  .pet-form:hover .pet-entry { display:flex; }
  .pet-form:hover .pet-prompt { visibility:hidden; }
}
.pet-entry input { width:100%; min-width:0; padding:6px 8px; border:0; color:white; background:transparent; }
.pet-entry button { border:0; background:#65e9ed; color:#122027; }
.contact-page { padding-bottom:64px; }
.contact-page .page-head h1 { font-size:clamp(36px,6vw,78px); }
.contact-grid { position:relative; align-items:center; overflow:hidden; padding:8px 4px; }
.contact-character { min-width:0; display:grid; justify-items:center; align-self:center; gap:12px; }
.contact-speech { max-width:100%; overflow-wrap:anywhere; min-width:140px; min-height:54px; text-align:center; font-weight:700; }
.contact-robot { width:min(345px,100%); aspect-ratio:1; position:relative; display:grid; place-items:center; }
.contact-portrait {
  position:absolute; inset:0; width:100%; height:100%; object-fit:contain;
  image-rendering:pixelated; transform:rotate(var(--pose,0deg));
  transform-origin:50% 92%; transition:transform .18s steps(3,end);
}
.contact-character.reacting .contact-portrait { animation:portrait-nod .3s steps(3,end); }
@keyframes portrait-nod {
  50% { transform:translateY(-5px) rotate(var(--pose,0deg)); }
}
.contact-character.reacting .contact-speech { animation:bubble-in .24s steps(3,end); }
.carried-letter { display:none; position:absolute; left:62%; top:68%; color:#122027; background:#e2f8f6; border:2px solid #65e9ed; padding:2px 6px; font-size:22px; }
.contact-machine { display:grid; grid-template-areas:"content"; min-width:0; }
.contact-machine > * { grid-area:content; }
.contact-machine .contact-form { background:#171f2d; border:1px solid #47717e; box-shadow:inset 0 3px #65e9ed; }
.contact-machine input,.contact-machine textarea { border-color:#58677d; }
.contact-machine input:focus,.contact-machine textarea:focus { border-color:#65e9ed; outline:1px solid #65e9ed; outline-offset:0; }
.simulation-note { color:#aab1bf; margin:0 0 15px; font-size:14px; }
.envelope { place-self:center; font-size:70px; color:#173140; background:#d8f6f7; border:3px solid #65e9ed; padding:0 24px; opacity:0; transform:scale(.3); }
.folding .contact-form { animation:fold-letter .76s forwards; transform-origin:center; }
.folding .envelope { animation:letter-appear .76s forwards; }
.letter-ready .envelope { visibility:hidden; }
.letter-ready .contact-form { visibility:hidden; }
.letter-ready .contact-portrait { transform:none; }
.letter-ready .carried-letter { display:block; }
.departing .contact-character { animation:depart .95s ease-in forwards; }
.contact-result { padding:22px 0 40px; }
.contact-result button { margin-top:16px; }
@keyframes fold-letter { 30%{transform:perspective(620px) rotateX(-34deg) scale(.93,.68)} 65%{transform:perspective(620px) rotateY(-46deg) scale(.55,.35);opacity:1} 100%{transform:scale(.22,.15);opacity:0} }
@keyframes letter-appear { 0%,65%{opacity:0;transform:scale(.3)} 100%{opacity:1;transform:scale(1)} }
@keyframes depart { to { transform:translateX(110vw); } }
@media(max-width:900px) { .category-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:720px) {
  .header nav { gap:4px; }
  .contact-page .contact-grid { display:flex; flex-direction:column; align-items:stretch; gap:14px; }
  .contact-character { position:sticky; top:0; z-index:2; width:100%; align-self:auto; display:flex; flex-direction:row-reverse; justify-content:flex-end; padding:8px; background:#12151c; }
  .contact-robot { width:104px; flex:none; }
  .contact-speech { padding:10px 12px 16px; }
  .game-panel { padding:14px; }
}
@media(max-width:400px) { .category-grid { gap:8px; } .category { padding:11px; } }
@media(prefers-reduced-motion:reduce) { .pet { transition:none; } .departing .contact-character { visibility:hidden; } }
