/* ==========================================================================
   Custom redesign — alpine background, centered hero, single-column, flat.
   Layered on top of main.css (Minimal Mistakes). Safe to remove this file
   and its <link> in _includes/head/custom.html to fully revert.
   ========================================================================== */

:root {
  --bg-image: url("../../images/bg/alpine_lake.jpg");
  --accent: #2d6a8e;          /* glacier blue */
  --accent-dark: #1f4d68;
  --ink: #2a2f36;             /* primary text */
  --ink-soft: #5b6470;        /* secondary text */
  --heading: #1c2530;
  --panel: rgba(255, 255, 255, 0.96);   /* near-solid backing so text is always legible */
  --hairline: rgba(28, 37, 48, 0.10);
  --radius: 18px;
}

/* ---- Fonts ---------------------------------------------------------------- */
html { font-size: 16px; }

body,
.page__content p,
.page__content li,
.page__content dl,
.sidebar p,
.sidebar li,
.author__urls a,
.greedy-nav a {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  line-height: 1.7;
  letter-spacing: 0.005em;
}

/* ---- Fixed alpine background ---------------------------------------------
   main.css sets html{background:#fff}, which would cover the fixed bg layer.
   Force the root transparent so the alpine photo shows through.            */
html { background: transparent !important; background-color: transparent !important; }
body { background: transparent !important; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-color: #e9eef2;   /* fallback before image loads */
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}
body::after {                  /* cool, airy wash for legibility */
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    rgba(225, 234, 240, 0.22) 0%,
    rgba(210, 222, 232, 0.38) 45%,
    rgba(198, 213, 226, 0.55) 100%
  );
}

/* ---- Masthead (top nav) — translucent frosted bar ------------------------ */
.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--hairline);
  box-shadow: 0 1px 12px rgba(28, 37, 48, 0.05);
  animation: none;
}
.greedy-nav { background: transparent; }
.greedy-nav a {
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink);
  transition: color 0.2s ease;
}
.greedy-nav a:hover { color: var(--accent); }
.greedy-nav .visible-links a:before { background: var(--accent); height: 2px; }
.masthead__menu-home-item a { font-weight: 600; }

/* ==========================================================================
   LAYOUT — single centered column (overrides the susy sidebar/float grid)
   ========================================================================== */
#main {
  display: block;
  max-width: 1080px;
  margin: 2.5em auto 3.5em;
  padding: 0 1.1em;
  animation: intro 0.5s both;
}

/* The profile that used to be a left block becomes a centered hero card */
.sidebar {
  display: flow-root !important;
  float: none !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto 1.6em !important;
  padding: 2.6em 2em 2.2em !important;
  position: static !important;        /* cancel .sticky */
  clear: both;
  opacity: 1 !important;
  background: var(--panel);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  backdrop-filter: saturate(160%) blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(28, 37, 48, 0.16), 0 2px 8px rgba(28, 37, 48, 0.08);
  text-align: center;
}

/* The main content as a frosted card below the hero.
   main.css floats .page__content (float:left), so the card would collapse
   to ~0 height and the text would spill onto the background. flow-root
   makes the card contain its floated content and grow to full height. */
.page {
  display: flow-root !important;
  float: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 2.6em 2.8em !important;
  clear: both;
  background: var(--panel);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  backdrop-filter: saturate(160%) blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(28, 37, 48, 0.16), 0 2px 8px rgba(28, 37, 48, 0.08);
}

@media (max-width: 768px) {
  #main { margin-top: 1.4em; }
  .sidebar { padding: 2em 1.3em 1.6em !important; }
  .page { padding: 1.7em 1.4em !important; }
}

/* ==========================================================================
   HERO — big centered avatar + name + role + horizontal links
   ========================================================================== */
.profile_box {
  display: block !important;
  text-align: center;
}

.author__avatar {
  display: block !important;
  width: auto !important;
  margin: 0 auto 0.9em !important;
  text-align: center;
}
.author__avatar img {
  width: 200px !important;
  height: 200px !important;
  max-width: 200px !important;
  min-width: 0 !important;
  object-fit: cover;
  border-radius: 50%;
  padding: 0 !important;
  border: 5px solid rgba(255, 255, 255, 0.92) !important;
  box-shadow: 0 10px 30px rgba(28, 37, 48, 0.28);
}

.author__content {
  display: block !important;
  width: 100% !important;
  padding: 0 !important;
  text-align: center;
  line-height: 1.4;
}
.sidebar .author__name,
.author__name {
  font-family: "Inter", sans-serif;
  font-size: 2.1em !important;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--heading);
  margin: 0.1em 0 0.05em !important;
}
.author__bio {
  margin: 0 0 0.4em !important;
  font-size: 1.05em;
  font-weight: 500;
  color: var(--accent);
}

.author__urls-wrapper {
  display: block !important;
  width: 100%;
  margin: 0;
  position: relative !important;
  z-index: 5 !important;
}
.author__urls-wrapper button { display: none !important; }   /* mobile toggle btn */

/* horizontal, centered link row.
   The base theme sets z-index:-1 here, which (inside the frosted card's
   stacking context) buries the links behind the card and makes them
   unclickable. Force them above with relative positioning + positive z. */
.author__urls {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.45em 1.4em;
  position: relative !important;
  z-index: 5 !important;
  margin: 0.6em 0 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.author__urls:before, .author__urls:after { display: none !important; }
.author__urls li {
  white-space: nowrap;
  margin: 0;
  position: relative;
  z-index: 5;
}
/* the first item is the site description sentence — give it its own row */
.author__urls li:first-child {
  flex-basis: 100%;
  white-space: normal;
  margin: 0 0 0.5em !important;
  color: var(--ink-soft);
  font-size: 1.02em;
}
.author__urls li:first-child div { margin: 0 !important; }
.author__urls a {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  color: var(--ink-soft);
  font-size: 0.98em;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  z-index: 5;
  pointer-events: auto !important;
}
.author__urls a:hover { color: var(--accent); text-decoration: none; }
.author__urls .fa, .author__urls .fab, .author__urls .fas, .author__urls .ai {
  color: var(--accent);
}
.author__urls_sm { display: none !important; }

/* ==========================================================================
   TYPOGRAPHY — flat, airy headings
   ========================================================================== */
.page__content h1,
.page__content h2,
.page__content h3 {
  color: var(--heading);
  font-weight: 700;
  letter-spacing: -0.015em;
}
.page__content h1 {
  font-size: 1.55em;
  margin-top: 1.7em;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--hairline);
}
.page__content h1:first-of-type { margin-top: 0.3em; }
.page__content p,
.page__content li { font-size: 1em; color: var(--ink); }

/* First-line indent for the intro paragraphs (direct children only), replacing
   the old "$~~~~$" MathJax indent hack that flashed raw text before rendering. */
.page__content > p { text-indent: 2em; }

/* ---- Links --------------------------------------------------------------- */
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
.page__content a { color: var(--accent); }

/* ---- Publication / paper boxes — clean flat cards ------------------------ */
.paper-box {
  border-bottom: none;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 1.6em;
  margin-bottom: 1.4em;
  box-shadow: 0 2px 10px rgba(28, 37, 48, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.paper-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(28, 37, 48, 0.12);
}
.paper-box .paper-box-image img {
  box-shadow: 0 4px 14px rgba(28, 37, 48, 0.18) !important;
  border-radius: 6px;
}
.badge {
  background: var(--accent) !important;
  color: #fff !important;
  border-radius: 6px;
  padding: 0.25em 0.7em;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ---- Fix overlapping anchor hack ----------------------------------------
   about.md has <span id="about-me">; the theme offsets it with a 10em-tall
   :before pseudo + negative margins, which bled upward and covered the hero
   social links (making them unclickable). Replace with scroll-margin-top.   */
.page__content #about-me {
  margin-top: 0 !important;
  scroll-margin-top: 80px;
}
.page__content #about-me:before { display: none !important; }

/* ---- Misc ---------------------------------------------------------------- */
hr { border-color: var(--hairline); }
::selection { background: rgba(45, 106, 142, 0.22); }
