/* =============================================
   MATEUSZ WILINSKI — Personal Website
   style.css — shared by all pages
   ============================================= */


/* --- 1. FONTS ---
   Loaded from Google Fonts (see <head> in each HTML file).
   EB Garamond: classical serif, used for headings
   DM Sans: clean sans-serif, used for body text
------------------------------------------------ */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;1,400&family=DM+Sans:wght@300;400&display=swap');


/* --- 2. CSS VARIABLES ---
   Define colors and sizes once here, reuse everywhere.
   To change the accent color across the whole site: edit one line.
------------------------------------------------ */

:root {
  --color-bg:        #f7f5f0;   /* warm off-white page background */
  --color-bg-alt:    #f0ede7;   /* slightly darker, used for header/footer */
  --color-border:    #d8d4cc;   /* subtle warm gray for dividers */
  --color-text:      #1a1a18;   /* near-black for body text */
  --color-muted:     #7a7568;   /* muted warm gray for secondary text */
  --color-faint:     #9a9488;   /* very muted, for labels and placeholders */
  --color-link:      #3a3830;   /* link color */

  --font-serif:      'EB Garamond', Georgia, serif;
  --font-sans:       'DM Sans', system-ui, sans-serif;

  --max-width:       700px;     /* maximum content width */
  --padding-page:    2rem;      /* horizontal padding on small screens */
}


/* --- 3. RESET & BASE ---
   Browsers apply their own default styles (margins, font sizes, etc.)
   We reset the most disruptive ones to start from a clean slate.
------------------------------------------------ */

*, *::before, *::after {
  box-sizing: border-box;  /* padding/border included in element width */
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth; /* animated jump when clicking anchor links */
}

body {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.8;
  color: var(--color-text);
  background: var(--color-bg);
}

a {
  color: var(--color-link);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
  transition: color 0.15s, border-color 0.15s;
}

a:hover {
  color: var(--color-text);
  border-color: var(--color-text);
}


/* --- 4. LAYOUT HELPERS ---
   .container: centers content and limits its width.
   Used inside <header>, <main>, <footer>.
------------------------------------------------ */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--padding-page);
}


/* --- 5. HEADER & NAVIGATION ---------------------------------------------------*/

header {
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem var(--padding-page);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.site-name {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--color-text);
  border-bottom: none;  /* override the global <a> underline */
}

.site-name:hover {
  color: var(--color-muted);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

nav a {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
  border-bottom: none;
}

nav a:hover,
nav a.active {      /* .active marks the current page */
  color: var(--color-text);
}


/* --- 6. MAIN CONTENT AREA ----------------------------------------------------- */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3.5rem var(--padding-page) 5rem;
}

/* Page title (h1) — used on inner pages like Publications, Projects, etc. */
h1.page-title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 400;
  margin-bottom: 2.5rem;
  color: var(--color-text);
}

/* Section headings (h2) — small, uppercase, acts as a label */
h2.section-label {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-faint);
  margin-bottom: 1.5rem;
}

p {
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}


/* --- 7. HOME PAGE — INTRO BLOCK ----------------------------------------------- */

.intro {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 2.5rem;
  align-items: start;
}

.intro-photo img {
  width: 110px;
  height: 140px;
  object-fit: cover;    /* crop to fit without distortion */
  object-position: top; /* crop from top so face is visible */
  display: block;
  filter: grayscale(15%); /* very slight desaturation for elegance */
}

.intro-bio h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  margin-bottom: 0.25rem;
  color: var(--color-text);
  letter-spacing: 0.01em;
}

.intro-bio .tagline {
  font-size: 13px;
  color: var(--color-muted);
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
}

.intro-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.intro-links a {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1px;
}

.intro-links a:hover {
  color: var(--color-text);
  border-color: var(--color-text);
}

/* Divider line between sections on the home page */
.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 3rem 0;
}


/* --- 8. PUBLICATIONS PAGE ----------------------------------------------------- */

/* Each publication is an <article class="pub"> */
article.pub {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

article.pub:first-of-type {
  padding-top: 0;  /* no extra space above the very first entry */
}

article.pub:last-of-type {
  border-bottom: none;
}

.pub-title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.4;
  margin-bottom: 0.4rem;
}

/* The link inside the title inherits the serif style;
   we remove the underline border here since the title itself
   is clearly clickable — cleaner without the line */
.pub-title a {
  border-bottom: none;
  color: var(--color-text);
}

.pub-title a:hover {
  color: var(--color-muted);
}

.pub-authors {
  font-size: 13px;
  color: var(--color-muted);
  margin-bottom: 0.2rem;
}

/* Your name bold in the author list */
.pub-authors strong {
  font-weight: 400;          /* DM Sans 300 is very light; 400 is enough contrast */
  color: var(--color-text);
}

.pub-venue {
  font-size: 13px;
  color: var(--color-faint);
  font-style: italic;
  font-family: var(--font-serif);
}


/* --- 9. FOOTER ---------------------------------------------------------------- */

footer {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding: 1.25rem var(--padding-page);
  font-size: 12px;
  color: var(--color-faint);
  text-align: center;
}

footer a {
  color: var(--color-faint);
  border-bottom: none;
}

footer a:hover {
  color: var(--color-text);
}


/* --- 9. RESPONSIVE — MOBILE ---
   @media rules apply styles only when a condition is met.
   Here: when screen is narrower than 540px, switch to single column.
------------------------------------------------ */

@media (max-width: 540px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  nav ul {
    gap: 1rem;
  }

  .intro {
    grid-template-columns: 1fr;  /* stack photo above bio */
  }

  .intro-photo img {
    width: 90px;
    height: 110px;
  }
}
