:root{
  /* how much left margin desktop-window popups reserve on narrow screens
     so they open beside the icon column instead of covering it -- read by
     desktop.js too, so the CSS cap and the JS placement clamp stay in sync */
  --icon-col-reserve:150px;
  --sky-top:#bfe9ff;
  --sky-bottom:#eaf9ff;
  --glass-blue:#3fa7dd;
  --glass-deep:#0f5d86;
  --ink-strong:#0c3a4d;
  --ink-soft:#3d6b7d;
  --card-bg:rgba(255,255,255,0.55);
  --glass-gold:#dda73f;
  --glass-gold-deep:#865d0f;
}
*{box-sizing:border-box;}
button, input, textarea, select{ font-family:inherit; }
body{
  margin:0;
  min-height:100vh;
  font-family:'Quicksand', sans-serif;
  color:var(--ink-strong);
  background:linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 40%, #ffffff 100%);
  background-repeat:no-repeat;
  overflow-x:hidden;
}

.bubble{
  position:absolute; top:0; left:0; border-radius:50%;
  background:radial-gradient(circle at 30% 25%, rgba(255,255,255,0.95), rgba(255,255,255,0.15) 40%, rgba(120,200,240,0.25) 100%);
  box-shadow: inset 0 0 12px rgba(255,255,255,0.6), 0 8px 20px rgba(20,90,130,0.15);
  pointer-events:none;
  will-change:transform;
  opacity:1;
}
.bubble.popping{ opacity:0; transition:opacity 200ms ease-out, filter 200ms ease-out; filter:brightness(1.4); }

.click-fx{ position:absolute; width:0; height:0; pointer-events:none; z-index:50; }
.click-fx i{ position:absolute; top:0; left:0; display:block; }
.click-fx i b{
  position:absolute; left:-1.5px; top:5px; width:3px; height:10px;
  background:var(--glass-deep); border-radius:2px; display:block;
  transform-origin:1.5px 0;
  animation: click-fx-burst 650ms ease-out forwards;
}
@keyframes click-fx-burst{
  0%{ transform:translateY(0) scaleY(1); opacity:0.9; }
  100%{ transform:translateY(24px) scaleY(0.35); opacity:0; }
}
.sparkle{ position:absolute; width:20px; height:20px; pointer-events:none; opacity:0.85; animation: twinkle 3.6s ease-in-out infinite; }
.sparkle::before{
  content:""; position:absolute; inset:0;
  clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%);
  background-color:#ffffff;
  filter:drop-shadow(0 0 6px rgba(255,255,255,0.9));
}
.sparkle.small{ width:11px; height:11px; }
@keyframes twinkle{
  0%,100%{ opacity:0.85; transform:scale(1) rotate(0deg); }
  50%{ opacity:0.35; transform:scale(0.8) rotate(8deg); }
}

nav{
  position:sticky; top:0; z-index:20;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 40px;
  background:linear-gradient(180deg, rgba(255,255,255,0.75), rgba(255,255,255,0.35));
  backdrop-filter: blur(10px);
  border-bottom:1px solid rgba(255,255,255,0.6);
}
.logo{
  font-family:'Baloo 2', sans-serif; font-weight:700; font-size:22px;
  background:linear-gradient(180deg, #ffffff, var(--glass-blue) 60%, var(--glass-deep));
  -webkit-background-clip:text; background-clip:text; color:transparent;
  text-shadow:0 1px 0 rgba(255,255,255,0.4);
  text-decoration:none;
}
.nav-links{ display:flex; gap:28px; }
.nav-links a{
  text-decoration:none; color:var(--ink-strong); font-weight:600; font-size:14px;
  padding:8px 16px; border-radius:999px;
  background:rgba(255,255,255,0.5);
  border:1px solid rgba(255,255,255,0.8);
  box-shadow:inset 0 1px 2px rgba(255,255,255,0.9), 0 2px 6px rgba(20,90,130,0.08);
}

.glass-btn{
  display:inline-block;
  padding:14px 34px;
  border-radius:999px;
  font-weight:600;
  font-size:15px;
  color:var(--ink-strong);
  text-decoration:none;
  background:linear-gradient(180deg, rgba(255,255,255,0.95), rgba(190,235,255,0.55));
  border:1px solid rgba(255,255,255,0.9);
  box-shadow:
    inset 0 2px 3px rgba(255,255,255,0.95),
    inset 0 -6px 10px rgba(63,167,221,0.25),
    0 10px 24px rgba(15,93,134,0.25);
}
.orb-btn{
  width:52px; height:52px;
  border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  text-decoration:none;
  color:#0f5d86;
  font-size:15px;
  font-weight:700;
  background:radial-gradient(circle at 32% 26%, #ffffff 0%, #d3f0ff 30%, #6fc0ec 65%, #2f8fc4 100%);
  border:1px solid rgba(255,255,255,0.85);
  box-shadow:
    inset 0 2px 3px rgba(255,255,255,0.9),
    inset 0 -8px 12px rgba(15,93,134,0.35),
    0 10px 22px rgba(15,93,134,0.3);
}

.page-head{ position:relative; padding:70px 40px 30px; text-align:center; }
.page-head h1{
  font-family:'Baloo 2', sans-serif;
  font-size:clamp(34px, 6vw, 54px);
  font-weight:700; margin:0 0 8px;
  background:linear-gradient(180deg, #ffffff 10%, #bfe9ff 35%, var(--glass-blue) 65%, var(--glass-deep) 100%);
  -webkit-background-clip:text; background-clip:text; color:transparent;
  text-shadow:0 1px 0 rgba(255,255,255,0.8), 0 6px 18px rgba(15,93,134,0.25);
}
.page-head p{ color:var(--ink-soft); font-size:16px; max-width:460px; margin:0 auto; }

section{ position:relative; padding:60px 40px 90px; max-width:1100px; margin:0 auto; }
.section-heading{
  font-family:'Baloo 2', sans-serif;
  font-size:30px;
  font-weight:700;
  color:var(--glass-deep);
  margin-bottom:6px;
}
.section-sub{
  color:var(--ink-soft);
  font-size:15px;
  margin-bottom:36px;
  max-width:480px;
}

/* window-chrome, used on gallery tiles and writing cards */
.win-bar{
  display:flex; align-items:center; justify-content:space-between; height:26px; padding:0 8px;
  border-radius:8px 8px 0 0;
  background:linear-gradient(180deg, #eaf6ff 0%, #bfe3fb 45%, #8fc7ec 55%, #cfeaf9 100%);
  border:1px solid rgba(255,255,255,0.8); border-bottom:none;
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.9);
}
.win-bar span{ font-size:11px; font-weight:600; color:var(--glass-deep); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.win-bar .dots{ display:flex; align-items:center; gap:4px; }
.win-bar .dots i{
  width:9px; height:9px; border-radius:50%; display:block;
  background:radial-gradient(circle at 30% 30%, #fff, #cfeaf9 60%, #8fc7ec);
  border:1px solid rgba(255,255,255,0.9);
}

/* writing list */
.writing-list{ display:flex; flex-direction:column; gap:18px; max-width:720px; margin:0 auto; }
.write-card{
  border-radius:16px;
  background:linear-gradient(180deg, rgba(255,255,255,0.7), rgba(220,245,255,0.4));
  border:1px solid rgba(255,255,255,0.85); border-top:none;
  box-shadow:0 6px 18px rgba(20,90,130,0.1);
  overflow:hidden;
}
.write-card .write-body{ padding:18px 22px 20px; }
.write-card h3{
  font-family:'Baloo 2', sans-serif;
  font-size:19px;
  margin:0 0 6px;
}
.write-card h3 a{ color:var(--glass-deep); text-decoration:none; }
.write-card .meta{ font-size:12px; color:var(--ink-soft); margin:0 0 8px; font-weight:600; }
.write-card p{ font-size:14px; color:var(--ink-soft); margin:0; line-height:1.6; }

/* single post */
.post-article{ max-width:680px; margin:0 auto; padding:50px 40px 100px; }
.post-back{
  display:inline-block; margin:0 0 18px; font-size:13px; font-weight:700;
  color:var(--glass-blue); text-decoration:none;
}
.post-back:hover{ color:var(--glass-deep); }
.post-article h1{
  font-family:'Baloo 2', sans-serif;
  font-size:clamp(28px, 5vw, 40px);
  color:var(--glass-deep);
  margin:10px 0 6px;
}
.post-article .meta{ color:var(--ink-soft); font-size:13px; font-weight:600; margin-bottom:30px; }
.post-article .post-body{ font-size:16px; line-height:1.8; color:var(--ink-strong); }
.post-article .post-body p{ margin:0 0 1.2em; }
.post-article .post-body a{ color:var(--glass-blue); }

footer{
  text-align:center;
  padding:40px 20px 60px;
  color:var(--ink-soft);
  font-size:13px;
}

/* ---- homepage desktop ---- */
.desktop-viewport{
  position:relative; overflow:hidden;
  height:calc(100vh - 65px); min-height:520px;
  /* iOS Safari's 100vh includes space the address bar can hide/show,
     which can leave a sliver of extra page height (and a scrollbar) on
     mobile -- 100dvh tracks the actual visible viewport instead. Browsers
     that don't support dvh just ignore this line and keep the vh value
     above. */
  height:calc(100dvh - 65px);
  background:linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 40%, #ffffff 100%);
  touch-action:none; user-select:none;
}
.desktop-canvas{ position:absolute; inset:0; }

.desktop-window{
  position:absolute;
  border-radius:14px;
  background:linear-gradient(180deg, rgba(255,255,255,0.88), rgba(222,245,255,0.6));
  border:1px solid rgba(255,255,255,0.9); border-top:none;
  box-shadow:0 10px 30px rgba(20,90,130,0.2);
  overflow:hidden;
  z-index:10;
}
.desktop-window .win-bar{ cursor:grab; user-select:none; touch-action:none; }
.desktop-window .win-body{ padding:20px 22px 24px; }
.desktop-window.popup{ display:none; }
.desktop-window.popup.is-open{ display:block; }
.desktop-window .glass-btn:not(.icon-btn){ padding:9px 20px; font-size:13px; }
.open-btn{ font-weight:500; color:var(--ink-soft); }
.win-close{
  width:22px; height:22px; border-radius:50%; padding:0; margin-left:6px;
  display:flex; align-items:center; justify-content:center;
  background:radial-gradient(circle at 30% 30%, #ffe3ea, #e0679c 70%);
  border:1px solid rgba(255,255,255,0.9); cursor:pointer;
}
.win-close svg{ width:11px; height:11px; stroke:#7a1f3d; }

.field{
  width:100%; padding:11px 14px; border-radius:10px; user-select:text;
  border:1px solid rgba(255,255,255,0.9); background:rgba(255,255,255,0.75);
  font-family:'Quicksand',sans-serif; font-size:13px; color:var(--ink-strong);
  margin-bottom:12px; resize:none;
}
.field:focus{ outline:2px solid var(--glass-blue); outline-offset:1px; }
.status-msg{ font-size:12px; color:var(--glass-deep); font-weight:600; opacity:0; transition:opacity .3s; }

.doodle-canvas{ width:100%; height:150px; border-radius:10px; border:1px solid rgba(255,255,255,0.9); background:#fff; display:block; cursor:crosshair; touch-action:none; }

.desktop-icon{ position:absolute; width:78px; z-index:10; }
.icon-link{
  display:flex; flex-direction:column; align-items:center; gap:6px;
  text-decoration:none; padding:8px 6px 6px; border-radius:10px;
}
.icon-link:hover{ background:rgba(255,255,255,0.35); }
.icon-link:focus-visible{ outline:2px solid var(--glass-blue); outline-offset:2px; }
.icon-glyph{ width:44px; height:44px; filter:drop-shadow(0 3px 4px rgba(15,93,134,0.25)); }
.icon-glyph img{ width:100%; height:100%; object-fit:contain; display:block; }
.icon-label{
  font-size:11.5px; font-weight:700; color:var(--ink-strong);
  background:rgba(255,255,255,0.55); padding:2px 9px; border-radius:6px; white-space:nowrap;
}

.hint{
  position:absolute; z-index:40; left:50%; bottom:14px; transform:translateX(-50%);
  font-size:12px; color:var(--ink-soft); background:rgba(255,255,255,0.6);
  padding:6px 14px; border-radius:999px; white-space:nowrap; pointer-events:none;
}

/* visitor doodles: approved via the CMS, never shown until then */
.doodle-bg{
  position:absolute; width:170px; opacity:0.16; pointer-events:none;
  filter:grayscale(0.15); z-index:0;
}
.doodle-bg img{ width:100%; display:block; border-radius:8px; }

.doodle-sticky{
  position:absolute; width:130px; z-index:8;
  background:#fffdf3; padding:8px 8px 26px;
  box-shadow:0 10px 20px rgba(20,90,130,0.22), 0 2px 5px rgba(0,0,0,0.18);
  border-radius:2px;
}
.doodle-sticky::before{
  content:""; position:absolute; top:-8px; left:50%; transform:translateX(-50%);
  width:14px; height:14px; border-radius:50%;
  background:radial-gradient(circle at 30% 30%, #ff9a9a, #d64545);
  box-shadow:0 2px 3px rgba(0,0,0,0.3);
}
.doodle-sticky img{ width:100%; display:block; border:1px solid rgba(12,58,77,0.1); }
.doodle-sticky .doodle-caption{
  position:absolute; left:8px; right:8px; bottom:6px;
  font-size:10.5px; color:#6b5d3f; text-align:center;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}

.gallery-preview{
  display:block; width:100%; aspect-ratio:1/1; object-fit:cover;
  border-radius:10px; border:1px solid rgba(255,255,255,0.9);
}
.gallery-thumbs{ scrollbar-width:thin; }
.gallery-thumb{
  display:block; width:44px; height:44px; flex:none; border-radius:6px; cursor:pointer;
  border:2px solid transparent; opacity:0.75; object-fit:cover;
}
.gallery-thumb.active{ border-color:var(--glass-deep); opacity:1; }
.icon-btn{ display:flex; align-items:center; justify-content:center; width:30px; height:30px; padding:0; flex:none; }
.icon-btn svg{ width:14px; height:14px; }

.exp-row{ padding:9px 0; border-bottom:1px solid rgba(255,255,255,0.6); font-size:13px; color:var(--ink-strong); }
.exp-row:last-of-type{ border-bottom:none; }
.exp-meta{ font-size:11.5px; color:var(--ink-soft); font-weight:600; }
.popup-link{ font-size:12px; font-weight:700; color:var(--glass-deep); text-decoration:none; }
.popup-link:hover{ text-decoration:underline; }

/* ---- experience page ---- */
.role-list{ display:flex; flex-direction:column; gap:18px; }
.role-card{
  border-radius:16px;
  background:linear-gradient(180deg, rgba(255,255,255,0.7), rgba(220,245,255,0.4));
  border:1px solid rgba(255,255,255,0.85); border-top:none;
  box-shadow:0 6px 18px rgba(20,90,130,0.1);
  overflow:hidden;
}
.role-body{ padding:18px 22px 22px; }
.role-head{ display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:8px 16px; margin-bottom:2px; }
.role-title-wrap{ display:flex; flex-direction:column; gap:2px; }
.role-title{ font-family:'Baloo 2', sans-serif; font-size:18px; color:var(--glass-deep); margin:0; }
.role-company{ font-size:13px; font-weight:700; color:var(--ink-soft); }
.role-meta{ font-size:12px; color:var(--ink-soft); font-weight:600; white-space:nowrap; }
.role-bullets{ margin:10px 0 0; padding-left:18px; font-size:14px; color:var(--ink-strong); line-height:1.65; }
.role-bullets li{ margin-bottom:4px; }

.badge-row{ display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.badge-award{
  display:inline-flex; align-items:center; gap:6px;
  padding:4px 12px 4px 10px; border-radius:999px; font-size:11.5px; font-weight:700;
  color:var(--glass-gold-deep);
  background:linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,224,168,0.55));
  border:1px solid rgba(255,255,255,0.9);
  box-shadow:inset 0 1px 2px rgba(255,255,255,0.9), 0 2px 6px rgba(134,93,15,0.18);
}
.badge-award svg{ width:13px; height:13px; flex:none; }

.projects-grid{ display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:20px; }
.project-tile{
  border-radius:14px;
  background:var(--card-bg);
  border:1px solid rgba(255,255,255,0.8); border-top:none;
  backdrop-filter: blur(6px);
  box-shadow:0 8px 24px rgba(20,90,130,0.12), inset 0 1px 0 rgba(255,255,255,0.7);
  overflow:hidden;
  display:flex; flex-direction:column;
}
.project-tile.featured{ box-shadow:0 8px 24px rgba(134,93,15,0.16), inset 0 1px 0 rgba(255,255,255,0.7), 0 0 0 2px rgba(221,167,63,0.35); }
.project-body{ padding:16px 18px 20px; display:flex; flex-direction:column; gap:10px; flex-grow:1; }
.project-title{ font-family:'Baloo 2', sans-serif; font-size:17px; color:var(--glass-deep); margin:0; }
.project-flag{ font-size:11px; font-weight:700; color:var(--glass-gold-deep); text-transform:uppercase; letter-spacing:0.04em; }
.project-desc{ font-size:13.5px; color:var(--ink-strong); line-height:1.6; margin:0; flex-grow:1; }
.project-tags{ display:flex; flex-wrap:wrap; gap:6px; }
.tag{
  display:inline-block; padding:3px 10px; border-radius:999px; font-size:11px; font-weight:600;
  color:var(--ink-soft); background:rgba(255,255,255,0.6); border:1px solid rgba(255,255,255,0.85);
}
.project-links{ display:flex; flex-wrap:wrap; gap:14px; font-size:12.5px; font-weight:700; }
.project-links a{ text-decoration:none; }

/* ---- class projects (wip) page ---- */
.project-course{ font-size:11.5px; color:var(--ink-soft); font-weight:600; margin-top:-4px; }
.status-tag{
  display:inline-block; align-self:flex-start;
  font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:0.04em;
  padding:3px 10px; border-radius:999px;
}
.status-tag.in-progress{ color:#8a5b00; background:rgba(255,200,80,0.28); }
.status-tag.done{ color:#1f7a4d; background:rgba(90,200,140,0.28); }
.status-tag.on-hold{ color:#5c5c5c; background:rgba(160,160,160,0.25); }
.project-links a:hover{ text-decoration:underline; }

.edu-row{ display:flex; flex-wrap:wrap; gap:10px; }
.edu-chip{
  padding:9px 16px; border-radius:14px;
  background:rgba(255,255,255,0.55); border:1px solid rgba(255,255,255,0.8);
  font-size:12.5px; color:var(--ink-soft); font-weight:600;
  box-shadow:0 2px 6px rgba(20,90,130,0.08);
}
.edu-chip b{ color:var(--ink-strong); }

/* nav-links used to just be hidden under 680px with nothing standing in
   for them, which left no way to get to other pages once off the
   homepage -- and between 681-900px it stayed on the same row as the
   logo (nav's own space-between), sitting skewed off to the right of
   "lily's portfolio" instead of wrapping. Wrap it onto its own centered
   row for the whole phone/tablet range instead of just the narrow end. */
@media (max-width:900px){
  nav{ padding:12px 16px; flex-wrap:wrap; row-gap:10px; }
  .nav-links{ width:100%; justify-content:center; flex-wrap:wrap; gap:8px; }
  .nav-links a{ padding:6px 12px; font-size:12.5px; }
}
@media (max-width:680px){
  .projects-grid{ grid-template-columns:1fr; }
  /* popup/anchor windows carry desktop-width inline px widths (e.g. 380px)
     that would overflow a narrow phone screen -- cap them so they always
     fit, regardless of the inline width set in the markup, and leave the
     icon column (running down the left edge) clear beside them */
  .desktop-window{ max-width:calc(100vw - var(--icon-col-reserve)); }
}
@media (max-width:900px) and (min-width:681px){
  .projects-grid{ grid-template-columns:repeat(2, minmax(0,1fr)); }
}
