/* ROOT VARIABLES */
:root {
  --cream: #f5f0e8;
  --parchment: #ede6d6;
  --parchment2: #e4dac8;
  --terracotta: #c4714a;
  --terra-light: #d4886a;
  --sage: #7a9e8a;
  --warm-brown: #4a3728;
  --mid-brown: #7a5c47;
  --text: #3a2e24;
  --text-light: #8a7060;
  --border: rgba(122, 92, 71, 0.18);
  --border-strong: rgba(122, 92, 71, 0.30);
  --shadow: rgba(58, 46, 36, 0.16);
  --tab-h: 36px;
  --win-radius: 10px;
}

/* RESET */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Lora', Georgia, serif;
  background: var(--cream);
  color: var(--text);
  user-select: none;
}

/* Grain */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  pointer-events: none;
  z-index: 9000;
  opacity: 0.5;
}

/* Vignette */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(74,55,40,0.12) 100%);
  pointer-events: none;
  z-index: 9001;
}

/* RAIN */
#rain-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

/* HOME SCREEN */
#home-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  pointer-events: none;
}

#home-center {
  text-align: center;
  pointer-events: all;
}

#home-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 400;
  color: var(--warm-brown);
  line-height: 1.15;
  margin-bottom: 0.55rem;
}

#home-title em {
  color: var(--terracotta);
  font-style: italic;
}

#home-sub {
  font-size: clamp(0.88rem, 2vw, 1.08rem);
  color: var(--text-light);
  letter-spacing: 0.04em;
  margin-bottom: 3.2rem;
}

/* ICON NAV */
#home-nav {
  display: flex;
  gap: 2.2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.nav-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 0.3rem;
  transition: transform 0.2s ease;
  color: var(--mid-brown);
}

.nav-icon-btn:hover {
  transform: translateY(-5px);
  color: var(--terracotta);
}

.nav-icon-img {
  width: 78px;
  height: 78px;
  border-radius: 20px;
  background: rgba(237, 230, 214, 0.85);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px var(--shadow);
  transition: all 0.2s ease;
}

.nav-icon-img svg {
  width: 36px;
  height: 36px;
}

.nav-icon-btn:hover .nav-icon-img {
  background: rgba(196, 113, 74, 0.12);
  border-color: rgba(196, 113, 74, 0.4);
  box-shadow: 0 8px 24px rgba(196, 113, 74, 0.2);
}

.nav-icon-label {
  font-family: 'Lora', serif;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: inherit;
}

/* SOCIAL DOCK */
#social-dock {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  display: flex;
  gap: 0.7rem;
  z-index: 9500;
}

.dock-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(237, 230, 214, 0.88);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mid-brown);
  text-decoration: none;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
  cursor: pointer;
  font-size: 1.1rem;
}

.dock-icon svg { width: 22px; height: 22px; }

.dock-icon:hover {
  background: var(--terracotta);
  color: var(--cream);
  border-color: var(--terracotta);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(196, 113, 74, 0.28);
}

.music-dock {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  border-radius: 50%;
  width: 54px;
  height: 54px;
  z-index: 9500;
}

/* SOUND TOGGLE */
#sound-toggle {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 9500;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(237, 230, 214, 0.88);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: var(--mid-brown);
}

#sound-toggle:hover {
  background: var(--terracotta);
  color: var(--cream);
  border-color: var(--terracotta);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(196, 113, 74, 0.28);
}

#sound-toggle svg { width: 22px; height: 22px; }

#sound-toggle .icon-sound-on  { display: none; }
#sound-toggle.active .icon-sound-off { display: none; }
#sound-toggle.active .icon-sound-on  { display: block; }

/* WINDOW — POP ANIMATION */
/*
  Windows animate from a transform-origin set by JS to the
  position at which they land. We use a CSS keyframe triggered
  by adding the .open class.
*/
@keyframes win-open {
  0%   { opacity: 0; transform: scale(0.5); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes win-close {
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.35); }
}

.win {
  position: fixed;
  width: 680px;
  max-width: calc(100vw - 1rem);
  height: auto;
  max-height: min(88vh, 700px);
  background: var(--cream);
  border: 1px solid var(--border-strong);
  border-radius: var(--win-radius);
  box-shadow: 0 20px 60px var(--shadow), 0 4px 12px rgba(58,46,36,0.08);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
  resize: both;
  min-width: 360px;
  min-height: 200px;
}

.win.open {
  display: flex;
  animation: win-open 0.26s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.win.closing {
  animation: win-close 0.18s ease-in forwards;
}

.win.focused {
  box-shadow: 0 28px 80px rgba(58,46,36,0.22), 0 4px 16px rgba(58,46,36,0.1);
}

.win-small {
  width: 440px;
  height: auto;
}

/* SIMPLE TAB BAR */
.win-tabbar {
  height: var(--tab-h);
  background: var(--parchment2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 0.5rem 0 0.8rem;
  gap: 0.5rem;
  cursor: grab;
  flex-shrink: 0;
  user-select: none;
}

.win-tabbar:active { cursor: grabbing; }

.win-tab-title {
  flex: 1;
  font-family: 'Lora', serif;
  font-size: 0.9rem;
  color: var(--mid-brown);
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.win-close-btn {
  background: none;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.7rem;
  color: var(--text-light);
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}

.win-close-btn:hover {
  background: rgba(196, 113, 74, 0.15);
  color: var(--terracotta);
}

/* WINDOW CONTENT */
.win-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.4rem 1.6rem;
  background: var(--cream);
  user-select: text;
}

.win-content::-webkit-scrollbar { width: 4px; }
.win-content::-webkit-scrollbar-track { background: transparent; }
.win-content::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }

.win-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.45rem;
  font-weight: 400;
  color: var(--warm-brown);
  margin-bottom: 1rem;
}

.win-sub {
  font-size: 0.74rem;
  color: var(--text-light);
  margin-bottom: 1.1rem;
  letter-spacing: 0.03em;
}

/* ABOUT */
.about-layout {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.about-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
}

.about-intro {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-items: center;
}

.about-intro .win-section-title {
  margin-bottom: 0;
  font-size: 1.8rem;
}

.about-tagline {
  font-size: 0.83rem;
  line-height: 1.65;
  color: var(--text-light);
  user-select: text;
}

@media (min-width: 769px) {
  .about-top {
    flex-direction: row;
    justify-content: center;
    text-align: left;
    gap: 1.4rem;
  }

  .about-intro {
    align-items: flex-start;
  }
}

.about-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: var(--parchment);
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  overflow: hidden;
  box-shadow: 0 4px 20px var(--shadow);
  flex-shrink: 0;
}

.about-avatar.img { object-fit: cover; }

.about-badge {
  background: var(--parchment);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  text-align: center;
  font-size: 0.68rem;
  color: var(--text-light);
  line-height: 1.65;
  width: 100%;
}

.about-badge strong {
  color: var(--sage);
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.72rem;
}

.about-body p {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 0.8rem;
  user-select: text;
}

.about-body a, .about-tagline a {
  color: var(--terracotta);
  text-decoration: none;
  border-bottom: 1px solid rgba(196,113,74,0.3);
}

.about-body a:hover, .about-tagline a:hover { border-color: var(--terracotta); }

.about-section { margin-top: 1rem; }
.about-section p { margin-bottom: 0; }

.about-cta { margin-top: 1rem; font-size: 0.9rem; }

.about-list {
  list-style: disc;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  line-height: 1.9;
  color: var(--text);
}


/* PROJECTS */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1rem;
  align-content: start;
}

.proj-card {
  background: var(--parchment);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  user-select: none;
}

.proj-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px var(--shadow);
}

.proj-thumb {
  width: 100%;
  height: 110px;
  background: linear-gradient(135deg, #d4c5b0, #c8b89a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  overflow: hidden;
}

.proj-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center center; }

.proj-body { padding: 0.8rem 0.9rem; }

.proj-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.45rem; }

.proj-tag {
  background: rgba(196,113,74,0.1);
  color: var(--terracotta);
  border-radius: 12px;
  padding: 0.15rem 0.55rem;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.proj-name {
  font-family: 'Playfair Display', serif;
  font-size: 0.97rem;
  font-weight: 500;
  color: var(--warm-brown);
  margin-bottom: 0.3rem;
}

.proj-desc {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-light);
}

.proj-footer {
  display: flex;
  justify-content: space-between;
  padding: 0.45rem 0.9rem;
  border-top: 1px solid var(--border);
  font-size: 0.65rem;
  color: var(--text-light);
}

/* SKILLS */
.skill-group { margin-bottom: 1.2rem; }

.skill-label {
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 0.55rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}

.skill-pills { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.skill-pill {
  background: var(--parchment);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  color: var(--mid-brown);
  transition: all 0.18s;
}

.skill-pill:hover {
  border-color: var(--terracotta);
  color: var(--terracotta);
  background: rgba(196,113,74,0.06);
}

/* LINKS */
.win-content.links-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 1.4rem 1rem;
  width: 100%;
}

.link-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--mid-brown);
  padding: 0.5rem;
  border-radius: 16px;
  transition: transform 0.2s ease, color 0.2s ease;
  cursor: pointer;
  background: none;
  border: none;
}

.link-tile:hover {
  transform: translateY(-5px);
  color: var(--terracotta);
}


.lt-icon {
  width: 72px; height: 72px;
  border-radius: 18px;
  background: rgba(237, 230, 214, 0.85);
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px var(--shadow);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.lt-icon svg { width: 32px; height: 32px; }

.link-tile:hover .lt-icon {
  background: rgba(196, 113, 74, 0.12);
  border-color: rgba(196, 113, 74, 0.4);
  box-shadow: 0 8px 24px rgba(196, 113, 74, 0.2);
}

.lt-name {
  font-family: 'Lora', serif;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  color: inherit;
}

.links-note {
  font-size: 0.7rem;
  color: var(--text-light);
  font-style: italic;
  letter-spacing: 0.02em;
  text-align: center;
}

/* CONTACT */
.contact-content { display: flex; flex-direction: column; gap: 0.9rem; }
.contact-blurb { font-size: 0.9rem; line-height: 1.75; color: var(--text-light); user-select: text; }
.contact-email-line { font-size: 0.92rem; line-height: 1.7; color: var(--text); user-select: text; }
.contact-email-line strong { color: var(--warm-brown); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--terracotta);
  color: var(--cream);
  border: none;
  border-radius: 8px;
  padding: 0.58rem 1.2rem;
  font-family: 'Lora', serif;
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
  width: fit-content;
}
.btn-primary:hover { background: var(--terra-light); }

.btn-secondary {
  background: none;
  color: var(--text-light);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 0.58rem 1.2rem;
  font-family: 'Lora', serif;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
  width: fit-content;
}
.btn-secondary:hover { border-color: var(--terracotta); color: var(--terracotta); }

.v1-note {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}
.v1-note p { font-size: 0.72rem; color: var(--text-light); font-style: italic; margin-bottom: 0.3rem; }
.v1-link { font-size: 0.72rem; color: var(--terracotta); text-decoration: none; border-bottom: 1px solid rgba(196,113,74,0.3); }

/* MUSIC */
.music-list { display: flex; flex-direction: column; margin-bottom: 1rem; }

.music-item {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
}

.music-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.65rem 0;
}

.music-play-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--terracotta);
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.music-play-btn svg {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
}

.music-play-btn.active svg {
  transform: rotate(180deg);
}

.music-play-btn:hover {
  background: rgba(196,113,74,0.12);
}

.music-play-btn.active {
  background: var(--terracotta);
  color: white;
  border-color: var(--terracotta);
}

.music-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
}

.music-song {
  font-size: 0.9rem;
  color: var(--warm-brown);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.musical-name { font-size: 0.75rem; color: var(--text-light); }

.music-embed {
  display: none;
  padding-bottom: 0.75rem;
}

.music-embed.open {
  display: block;
}

.music-note { font-size: 0.7rem; color: var(--text-light); font-style: italic; }

/* LIGHTBOX */
#lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(58,46,36,0.6);
  backdrop-filter: blur(6px);
  z-index: 9900;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

#lightbox-overlay.open { opacity: 1; pointer-events: all; }

#lightbox {
  background: var(--cream);
  border-radius: 14px;
  max-width: 600px;
  width: calc(100% - 2rem);
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.94);
  transition: transform 0.28s ease;
  box-shadow: 0 30px 80px rgba(58,46,36,0.28);
}

#lightbox-overlay.open #lightbox { transform: scale(1); }

#lb-close {
  position: absolute;
  top: 0.8rem; right: 0.8rem;
  background: rgba(245,240,232,0.92);
  border: 1px solid var(--border);
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 0.78rem;
  cursor: pointer;
  color: var(--warm-brown);
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}

/* LIGHTBOX GALLERY */
.lb-gallery-frame {
  border-radius: 14px 14px 0 0;
  overflow: hidden;
  background: #1e1208;
  flex-shrink: 0;
}

.lb-gallery {
  display: flex;
  gap: 6px;
  padding: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
  min-height: 180px;
  align-items: center;
}

.lb-gallery::-webkit-scrollbar { display: none; }
.lb-gallery.dragging { cursor: grabbing; }

.lb-img-wrap {
  flex-shrink: 0;
  height: 210px;
  border-radius: 8px;
  overflow: hidden;
  cursor: zoom-in;
  transition: opacity 0.18s;
}

.lb-img-wrap:hover { opacity: 0.85; }

.lb-img-wrap img {
  height: 100%;
  width: auto;
  display: block;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.lb-no-img {
  width: 100%;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(245,240,232,0.3);
  letter-spacing: 0.06em;
  padding: 1rem;
}

/* LIGHTBOX BODY */
.lb-body {
  padding: 1.3rem 1.5rem 1.7rem;
  user-select: text;
}

.lb-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

#lb-year {
  font-family: 'Lora', serif;
  font-size: 0.75rem;
  color: var(--text-light);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

#lb-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }

#lb-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--warm-brown);
  margin-bottom: 0.65rem;
}

#lb-desc {
  font-size: 0.86rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 1.2rem;
}

#lb-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; }

/* IMAGE VIEWER */
#img-viewer {
  position: fixed;
  inset: 0;
  background: rgba(20, 14, 10, 0.92);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  backdrop-filter: blur(4px);
  overflow: hidden;
}

#img-viewer.open { display: flex; }

#img-viewer img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.6);
  cursor: default;
}

.img-viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(245, 240, 232, 0.12);
  border: 1px solid rgba(245, 240, 232, 0.22);
  color: rgba(245, 240, 232, 0.9);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s, border-color 0.18s;
  z-index: 2;
}

.img-viewer-nav svg { width: 20px; height: 20px; }
.img-viewer-nav:hover { background: rgba(245, 240, 232, 0.26); border-color: rgba(245,240,232,0.4); }
.img-viewer-nav.hidden { display: none; }

#img-viewer-prev { left: 1.4rem; }
#img-viewer-next { right: 1.4rem; }





/* MOBILE SHEET */
#mobile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(58, 46, 36, 0.45);
  backdrop-filter: blur(4px);
  z-index: 9800;
}
#mobile-backdrop.open { display: block; }

@keyframes sheet-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes sheet-down {
  from { transform: translateY(0); }
  to   { transform: translateY(100%); }
}

.win-mobile-close {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--mid-brown);
  padding: 0.2rem;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.win-mobile-close svg { width: 20px; height: 20px; }
.win-mobile-close:hover { color: var(--terracotta); }

@media (max-width: 768px) {
  /* Override the responsive block's sizing for sheets */
  .win.mobile-sheet {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 92vh !important;
    max-height: 92vh !important;
    border-radius: 20px 20px 0 0 !important;
    z-index: 9850 !important;
    resize: none !important;
    animation: sheet-up 0.32s cubic-bezier(0.22, 1, 0.36, 1) forwards !important;
  }

  .win.mobile-sheet.mobile-auto-h {
    height: auto !important;
  }

  .win.mobile-sheet.closing {
    animation: sheet-down 0.24s ease-in forwards !important;
  }

  .win.mobile-sheet .win-tabbar {
    cursor: default !important;
    height: 56px;
    padding: 0 1.2rem;
  }

  .win.mobile-sheet .win-tab-title {
    font-size: 1rem;
  }

  .win.mobile-sheet .win-close-btn { display: none; }
  .win.mobile-sheet .win-mobile-close { display: flex; }
}

/* RESPONSIVE */
@media (max-width: 600px) {
  .win { width: calc(100vw - 0.5rem); height: calc(100vh - 4rem); }
  .win-small { width: calc(100vw - 0.5rem); height: 65vh; }
  .about-top { gap: 0.9rem; }
  .about-avatar { width: 110px; height: 110px; font-size: 2rem; }
  #home-nav { gap: 1.4rem; }
  .nav-icon-img { width: 64px; height: 64px; }
  .nav-icon-img svg { width: 28px; height: 28px; }
}

#img-viewer img {
  transition: opacity 0.15s ease;
}

.fade-out {
  opacity: 0;
}

.fade-in {
  opacity: 1;
}

/* MOBILE NOTICE */
#mobile-notice {
  display: none;
  position: fixed;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  width: calc(100% - 2rem);
  max-width: 420px;
  background: var(--parchment);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 8px 32px var(--shadow);
  padding: 1rem 1.1rem;
  z-index: 9999;
  gap: 0.8rem;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#mobile-notice.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#mobile-notice-body strong {
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  color: var(--warm-brown);
  display: block;
  margin-bottom: 0.35rem;
}

#mobile-notice-body p {
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--text-light);
}

#mobile-notice-ok {
  align-self: flex-end;
  background: var(--terracotta);
  color: var(--cream);
  border: none;
  border-radius: 8px;
  padding: 0.45rem 1.1rem;
  font-family: 'Lora', serif;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s;
}

#mobile-notice-ok:hover { background: var(--terra-light); }

/* PHYSICS BOOK */
#physics-book {
  position: fixed;
  z-index: 50;
  transform-origin: center center;
  cursor: grab;
}

#physics-book.held {
  cursor: grabbing;
  filter: drop-shadow(0 12px 24px rgba(58,46,36,0.45));
}

.book-inner {
  position: relative;
  width: 100%;
  height: 100%;
}

.book-cover {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #5a3520 0%, #3a2010 60%, #2e1a0e 100%);
  border-radius: 2px 4px 4px 2px;
  box-shadow:
    inset -4px 0 10px rgba(0,0,0,0.4),
    inset 0 0 30px rgba(0,0,0,0.2),
    3px 4px 14px rgba(58,46,36,0.5);
}

.book-cover-decoration {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(196,157,90,0.45);
  border-radius: 1px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px;
}

.book-cover-border {
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(196,157,90,0.2);
  border-radius: 1px;
}

.book-cover-title {
  font-family: 'Playfair Display', serif;
  font-size: 11px;
  font-weight: 700;
  color: #c49d5a;
  letter-spacing: 0.08em;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  position: relative;
  z-index: 1;
}

.book-cover-subtitle {
  font-family: 'Lora', serif;
  font-size: 6.5px;
  color: rgba(196,157,90,0.65);
  letter-spacing: 0.12em;
  text-align: center;
  position: relative;
  z-index: 1;
}

.book-cover-ornament {
  font-size: 9px;
  color: rgba(196,157,90,0.5);
  margin-top: 2px;
  position: relative;
  z-index: 1;
}

.book-pages-side {
  position: absolute;
  top: 2px;
  right: -5px;
  width: 6px;
  height: calc(100% - 4px);
  background: repeating-linear-gradient(
    to bottom,
    #f0e8d8 0px,
    #e8dfc8 1px,
    #f0e8d8 2px
  );
  border-radius: 0 1px 1px 0;
  box-shadow: 2px 0 4px rgba(0,0,0,0.15);
}

.book-spine-side {
  position: absolute;
  top: 0;
  left: 0;
  width: 14px;
  height: 100%;
  background: linear-gradient(to right, #2a1508, #3d2010);
  border-radius: 2px 0 0 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset -2px 0 5px rgba(0,0,0,0.3);
}

.book-spine-side span {
  font-family: 'Playfair Display', serif;
  font-size: 7px;
  color: rgba(196,157,90,0.7);
  letter-spacing: 0.15em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}