/* Sebastian Sahli — sebastiansahli.com
   Plain CSS. No build step. Gradient lives in `body` below. */

:root {
  --grad-start: #FFD21E;   /* yellow — top    */
  --grad-mid:   #FF8A0A;   /* orange — middle */
  --grad-end:   #E11B1B;   /* red    — bottom */

  --ink:      #1b1b1b;
  --ink-soft: #6a6a6a;
  --rule:     #e3e3e0;
  --link:     #14507a;

  --win-w: 620px;
  --bar-h: 30px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  /* 180deg = top to bottom, so the band where yellow meets red runs
     horizontally across the screen. Use 90deg for a left-to-right blend. */
  background: linear-gradient(180deg,
              var(--grad-start) 0%,
              var(--grad-mid)  52%,
              var(--grad-end) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font: 400 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------------- desktop + icons ---------------- */

#desktop {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 1.25rem;
}

.icon-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.75rem 2.5rem;
  max-width: 760px;
}

.icon {
  appearance: none;
  background: none;
  border: 0;
  padding: 0.5rem 0.35rem;
  cursor: pointer;
  font: inherit;
  color: #fff;
  width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  border-radius: 8px;
  transition: transform .13s ease;
}
.icon:hover  { transform: translateY(-3px); }
.icon:active { transform: translateY(0) scale(.97); }
.icon:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.icon-art { display: block; height: 82px; }
.icon-art svg { height: 100%; width: auto; display: block; overflow: visible; }

.icon-label {
  font-size: 0.9rem;
  line-height: 1.25;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 3px rgba(0,0,0,.35);
}

/* ---------------- windows ---------------- */

.window {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(var(--win-w), calc(100vw - 2rem));
  max-height: min(76vh, 680px);
  display: flex;
  flex-direction: column;
  background: #fdfdfb;
  border-radius: 9px;
  box-shadow: 0 18px 60px rgba(0,0,0,.34), 0 2px 8px rgba(0,0,0,.18);
  overflow: hidden;
  z-index: 10;
}
.window[hidden] { display: none; }

.titlebar {
  flex: 0 0 var(--bar-h);
  height: var(--bar-h);
  display: flex;
  align-items: center;
  padding: 0 0.7rem;
  background: linear-gradient(#f7f7f5, #e9e9e6);
  border-bottom: 1px solid #d4d4d0;
  cursor: grab;
  user-select: none;
}
.titlebar:active { cursor: grabbing; }

.titlebar .close {
  appearance: none;
  width: 13px; height: 13px;
  border: 0; border-radius: 50%;
  background: #ff5f57;
  color: rgba(0,0,0,.5);
  font-size: 11px; line-height: 1;
  cursor: pointer;
  padding: 0;
  flex: 0 0 auto;
}
.titlebar .close:hover { background: #ff3b30; color: rgba(0,0,0,.75); }

.titlebar .title {
  flex: 1;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #545451;
  margin-right: 13px;   /* balance the close button */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.content {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.6rem 1.9rem 2rem;
}

/* ---------------- window typography ---------------- */

.content h2 {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 1.4rem;
  font-weight: 400;
  margin: 0 0 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--rule);
}

.content h3 {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 1.9rem 0 0.7rem;
}

.content h4 { font-size: 0.98rem; margin: 0 0 0.25rem; }

.content p { margin: 0 0 1rem; }
.lede { font-size: 1.04rem; color: #333; }

.portrait {
  float: right;
  width: 132px;
  height: auto;
  border-radius: 4px;
  margin: 0.2rem 0 0.9rem 1.4rem;
  shape-outside: inset(0 round 4px);
}

.content a { color: var(--link); text-decoration: none; border-bottom: 1px solid rgba(20,80,122,.32); }
.content a:hover { border-bottom-color: var(--link); }

.meta { font-size: 0.88rem; color: var(--ink-soft); }
.meta small { display: inline-block; margin-top: 0.2rem; }

code { font-size: 0.9em; background: #efeeeb; padding: 0.1em 0.35em; border-radius: 3px; }

/* CV timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: flex; gap: 1.25rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule);
}
.timeline li:last-child { border-bottom: none; }
.timeline .date {
  flex: 0 0 8rem;
  color: var(--ink-soft);
  font-size: 0.87rem;
  font-variant-numeric: tabular-nums;
  padding-top: 0.1rem;
}
.timeline .entry { flex: 1; }
.timeline .entry small { color: var(--ink-soft); line-height: 1.45; display: inline-block; margin-top: 0.2rem; }

/* plain bulleted lists inside windows */
.plain { margin: 0; padding-left: 1.2rem; }
.plain li { margin-bottom: 0.5rem; }

/* work list */
.work-list { list-style: none; margin: 0; padding: 0; }
.work-list li { padding: 0.9rem 0; border-bottom: 1px solid var(--rule); }
.work-list li:last-child { border-bottom: none; }
.work-list p { margin: 0; font-size: 0.94rem; color: #444; }

/* publications */
.pubs { padding-left: 1.4rem; margin: 0 0 1.25rem; }
.pubs li { margin-bottom: 1rem; }
.pubs .pub-title { font-weight: 600; }
.pubs .pub-authors { color: #444; }
.pubs .pub-venue { color: var(--ink-soft); font-size: 0.9rem; }
.pubs .me { color: #000; }
.cites {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05em 0.45em;
  border-radius: 10px;
  background: #efeeeb;
  color: var(--ink-soft);
  font-size: 0.76rem;
  vertical-align: 1px;
}
.pub-foot { border-top: 1px solid var(--rule); padding-top: 0.9rem; }

/* ---------------- taskbar ---------------- */

#taskbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.6rem;
  padding: 0.9rem 1.25rem;
  font-size: 0.83rem;
  color: rgba(255,255,255,.95);
  text-shadow: 0 1px 3px rgba(0,0,0,.3);
}
#taskbar a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
#taskbar a:hover { text-decoration-thickness: 2px; }
#clock { font-variant-numeric: tabular-nums; }

/* ---------------- small screens ---------------- */

@media (max-width: 640px) {
  .icon-row { gap: 1.25rem 1rem; }
  .icon { width: 94px; }
  .icon-art { height: 62px; }
  .icon-label { font-size: 0.8rem; }

  .window {
    top: auto; left: 0; bottom: 0;
    transform: none;
    width: 100vw;
    max-height: 86dvh;
    border-radius: 12px 12px 0 0;
  }
  .titlebar { cursor: default; }
  .content { padding: 1.25rem 1.25rem 2rem; }

  .timeline li { flex-direction: column; gap: 0.15rem; }
  .timeline .date { flex: none; }
}

@media (prefers-reduced-motion: reduce) {
  .icon { transition: none; }
}
