/* ==========================================================
   layout.css — styling for every page that uses layout: default
   Font: Noto Sans (variable, 100–900), loaded in _layouts/default.html
   ========================================================== */

:root {
  /* same palette as wlachtype (its dark theme) */
  --bg: #121620;          /* wlachtype page background */
  --text: #ffffff;
  --link-hover: rgba(255, 255, 255, 0.65);
  --selection: #7b5cc4;   /* wlachtype selection highlight */
  --panel: #1a1f2b;       /* wlachtype keyboard background */
  --bg-top: #181d2a;      /* page gradient: slightly lighter at the top … */
  --bg-bottom: #0f121a;   /* … fading to slightly darker at the bottom */

  --font: "Noto Sans", sans-serif;

  /* type scale: body < h2 < h1 */
  --size-body: 1rem;
  --size-h2: 1.25rem;
  --size-h1: 2.5rem;

  --column: 600px;        /* main text column */
  --side: 300px;          /* picture column (desktop) */
  --gap: 4.375rem;        /* space between the two columns (3.5rem × 1.25) */
  --radius: 18px;
}

/* animatable values for the photo fade (opacity: 1 = solid) */
@property --fade-top { syntax: "<number>"; inherits: false; initial-value: 0.4; }
@property --fade-mid { syntax: "<number>"; inherits: false; initial-value: 0.7; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html { color-scheme: dark; background: var(--bg-bottom); }

body {
  min-height: 100vh;
  background: linear-gradient(to bottom, var(--bg-top), var(--bg) 45%, var(--bg-bottom)) fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: var(--size-body);
  font-weight: 400;
  line-height: 1.7;
  padding: 4rem 1.5rem;
}

main {
  max-width: var(--column);
  margin: 0 auto;
}

/* # — your name: boldest weight, largest size */
h1 {
  font-size: var(--size-h1);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
}

/* ## — section headings (Projects, Publications) */
h2 {
  font-size: var(--size-h2);
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

/* ### — sub-headings: italic, only slightly heavier than body text */
h3 {
  font-size: var(--size-body);
  font-style: italic;
  font-weight: 500;
  line-height: 1.4;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

/* panel: everything from the first ## on (wrapped by _layouts/default.html).
   Styled like the wlachtype keyboard area. Its background reaches out past the
   text column by --panel-pad on each side, so the text inside lines up with the text above. */
.panel {
  --panel-pad: 1.5rem;
  background: var(--panel);
  border-radius: var(--radius);
  padding: var(--panel-pad);
  margin: 2.5rem calc(-1 * var(--panel-pad)) 0;
}
.panel > :first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }

/* ---------- side column: picture + last ## section ----------
   Narrow screens / portrait: it sits below the main column.
   Wide screens: it becomes a second column to the right (media query below). */
.col-side { margin-top: 2.5rem; }
.portrait {
  display: block;
  width: 100%;
  max-width: var(--side);
  height: auto;
  aspect-ratio: 3 / 4;       /* the photo's proportions (1201 × 1600) */
  object-fit: cover;
  /* fade toward transparency at the top; measured from the bottom of the photo:
     top edge 60% transparent, 2/3 up 30%, halfway and below 0% */
  -webkit-mask-image: linear-gradient(to bottom,
      rgba(0,0,0, var(--fade-top)) 0%, rgba(0,0,0, var(--fade-mid)) 33.333%, #000 50%);
          mask-image: linear-gradient(to bottom,
      rgba(0,0,0, var(--fade-top)) 0%, rgba(0,0,0, var(--fade-mid)) 33.333%, #000 50%);
  transition: --fade-top 0.4s ease, --fade-mid 0.4s ease;
  background: var(--panel);   /* shown while the picture loads */
}
/* last ## section: no panel, sits on the page background like the intro text */
.side-section { margin-top: 1.5rem; }
.side-section > :first-child { margin-top: 0; }
.side-section > :last-child { margin-bottom: 0; }

/* hovering the photo removes the fade */
.portrait:hover { --fade-top: 1; --fade-mid: 1; }

@media (min-width: 1040px) {
  main.has-side {
    max-width: calc(var(--column) + var(--gap) + var(--side));
    display: grid;
    grid-template-columns: minmax(0, var(--column)) var(--side);
    column-gap: var(--gap);
    align-items: start;
  }
  .col-side { margin-top: 0; }                 /* top of picture = top of the name */
}
/* full-size desktop: the right column stays in view while the page scrolls
   (only when the window is tall enough to show the whole column) */
@media (min-width: 1040px) and (min-height: 820px) {
  .col-side { position: sticky; top: 4rem; }   /* 4rem = the page's top padding */
}

p, li { color: var(--text); }
p { margin-bottom: 0.8rem; }

ul { padding-left: 1.25rem; margin-bottom: 0.8rem; }
li { margin-bottom: 0.35rem; }

strong { font-weight: 700; color: var(--text); }

a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
}
a:hover { color: var(--link-hover); }

/* Font Awesome icons (loaded in _layouts/default.html): white like the text,
   with a little space before the text that follows */
main i[class*="fa-"] { color: var(--text); margin-right: 0.35em; }
main a:hover i[class*="fa-"] { color: inherit; }

/* Icon bullets: a list item that STARTS with an icon (on its own, or as the
   start of a link) uses that icon as its bullet. The icon hangs in the bullet
   column and wrapped lines line up with the text, not under the icon.
   Works for tight lists and for lists with blank lines between items
   (where Markdown wraps each item's text in a paragraph). */
li:has(> i[class*="fa-"]:first-child),
li:has(> a:first-child > i[class*="fa-"]:first-child),
li:has(> p:first-child > i[class*="fa-"]:first-child),
li:has(> p:first-child > a:first-child > i[class*="fa-"]:first-child) {
  list-style: none;
  position: relative;
}
li > i[class*="fa-"]:first-child,
li > a:first-child > i[class*="fa-"]:first-child,
li > p:first-child > i[class*="fa-"]:first-child,
li > p:first-child > a:first-child > i[class*="fa-"]:first-child {
  position: absolute;
  left: -1.6em;
  width: 1.25em;
  margin-right: 0;
  text-align: center;
  line-height: inherit;
}
ul:has(> li > i[class*="fa-"]:first-child),
ul:has(> li > a:first-child > i[class*="fa-"]:first-child),
ul:has(> li > p:first-child > i[class*="fa-"]:first-child),
ul:has(> li > p:first-child > a:first-child > i[class*="fa-"]:first-child) {
  padding-left: 1.6em;
}
li > p:last-child { margin-bottom: 0; }   /* no extra gap inside paragraph-style list items */

::selection { background: var(--selection); color: #ffffff; }

@media (max-width: 480px) {
  body { padding: 2.5rem 1rem; }
  .panel { --panel-pad: 0.75rem; border-radius: 14px; }
  :root { --size-h1: 2rem; }
}