/* ===========================
   Global + Theme
   =========================== */

:root {
  --bg-gray: #e7e7e7;
  --card-bg: #ffffff;
  --ink: #000000;
  --accent: #ff7a3c;   /* soft orange */
  --accent-2: #00a7b4; /* teal/turquoise */
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 3rem 1.5rem;
  background: var(--bg-gray);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #111;
}

/* Container for page content (optional, nice for wide screens) */
.page {
  max-width: 960px;
  margin: 0 auto;
}

/* Handwriting font (Mansalva) */
.handwritten {
  font-family: "Mansalva", system-ui, sans-serif;
}

/* Basic link style (can be overridden where needed) */
a {
  color: inherit;
  text-decoration: none;
}

/* ===========================
   Navigation
   =========================== */

.main-nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2.2rem;
}

.nav-link {
  position: relative;
  font-family: "Mansalva", system-ui, sans-serif;
  font-size: 1.3rem;
  color: #111;
  display: inline-block;
  text-align: center;
  min-width: 6ch; /* enough for longest word + !!!! */
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.15rem;
  width: 100%;
  height: 1px;
  background: var(--ink);
  opacity: 0.3;
}

.nav-link:hover::after {
  height: 2px;              /* little “ink” emphasis on hover */
  opacity: 0.8;
}

@media (min-width: 700px) {
  .nav-link[data-label="about"]     { min-width: 8ch; }
  .nav-link[data-label="research"]  { min-width: 11ch; }
  .nav-link[data-label="fun"]       { min-width: 6ch; }
  .nav-link[data-label="cv"]       { min-width: 6ch; }
}

@media (max-width: 699px) {
  .main-nav {
    gap: 1rem;         /* tighter horizontal spacing */
    flex-wrap: wrap;   /* allow wrapping if needed */
  }

  .nav-link {
    font-size: 1.3rem; /* slightly smaller font */
    min-width: 0;      /* no forced width on mobile */
  }
}

/* ===========================
   Hero Card
   =========================== */

/* center hero on the page */
.hero {
  display: flex;
  justify-content: center;
  margin-bottom: 3.5rem;
}

/* business-card hero */
.hero-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;

  background: var(--card-bg);
  padding: 1.8rem 2.2rem;
  border-radius: 16px;

  /* black outline */
  border: 2px solid var(--ink);

  /* hard shadow */
  box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.45);
}

/* left: square photo */
.hero-left {
  flex-shrink: 0;
}

.hero-photo {
  width: 200px;
  height: 200px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid var(--ink);
}

/* right side text */
.hero-right {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* hero text (all handwritten) */
.hero-name {
  margin: 0;
  font-size: 1.9rem;
  letter-spacing: 0.02em;
}

.hero-title {
  margin: 0;
  font-size: 1.3rem;
}

/* links row */
.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.4rem;
}
/* each link */
.hero-link {
  position: relative;
  text-decoration: none;
  color: var(--ink);
  display: inline-block;
  text-align: left;
}

/* width reservations so ! doesn't shift layout */
.hero-link[href*="linkedin"] { min-width: 11ch; }
.hero-link[href*="github"]   { min-width: 10ch; }
.hero-link[href*="mailto"]   { min-width: 9ch; }

/* label (handwritten text) */
.hero-link-label {
  position: relative;
  display: inline-block;  /* needed so underline fits just the text */
}

/* baseline underline under the LABEL only */
.hero-link-label::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--ink);
  opacity: 0.4;
  transition: height 0.15s ease-out, opacity 0.15s ease-out;
}

/* thicker underline on hover */
.hero-link:hover .hero-link-label::after {
  height: 2px;
  opacity: 0.9;
}

/* old circle icon style (no longer used if you're using PNGs, can delete) */
.hero-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  font-size: 0.75rem;
  line-height: 1;
}

/* ===========================
   Responsive tweaks
   =========================== */

@media (max-width: 600px) {
  body {
    padding: 2rem 1rem;
  }

  .hero-card {
    flex-direction: column;
    align-items: flex-start;
    max-width: 100%;
  }

  .hero {
    justify-content: center;
  }
}

/* ===========================
   Ink-Framed Sections
   =========================== */
/* ---------- SECTION CARDS ---------- */

.section {
  position: relative;
  max-width: 820px;
  margin: 1.7em auto;
  padding: 2rem 2.4rem;
  background: var(--card-bg);

  border: 2px solid var(--ink);

  /* allow ::before to sit under content */
  isolation: isolate;
}

/* Pseudo-element for shadow */
.section::before {
  content: "";
  position: absolute;
  inset: 0;                     /* match full box */
  border-radius: inherit;

  /* This creates the card-shadow box */
  box-shadow: 10px 10px 0 rgba(0,0,0,0.45);
  
  /* place behind the section */
  z-index: -1;
}

/* Disable hover wiggle, keep shadow unchanged */
.section:hover {
  transform: none;   /* no movement */
}

.section:hover::before {
  box-shadow: 10px 10px 0 rgba(0,0,0,0.45); /* same as static */
}

/* section title style */
.section-title {
  margin: 0 0 0.6rem;
  font-size: 1.35rem;
}


/* ===========================
   Section Link Styling
   =========================== */

.section a {
  color: #007c8c;                   /* your base teal */
  text-decoration: none;
  position: relative;
  font-weight: 400;
  padding-bottom: 0.05rem;          /* slight space for underline */
  transition: color 0.15s ease-out;
}

/* thin underline */
.section a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.02rem;
  width: 100%;
  height: 1px;                      /* thin line */
  background: #007c8c;
  opacity: 0.6;
  transition: height 0.15s ease-out,
              opacity 0.15s ease-out,
              background 0.15s ease-out;
}

/* hover: thicker & more saturated underline */
.section a:hover {
  color: #00a7b4;                   /* lighter teal on hover */
}

.section a:hover::after {
  height: 3px;                      /* bold underline */
  opacity: 0.9;
  background: #00a7b4;              /* match hover color */
}

/* ===========================
   Publications + OSS Notes
   =========================== */
/* ------ Publication list styling ------ */

.pub_list {
  margin: 1rem 0 2rem;
}

.pub_list p {
  margin: 0 0 1.2rem;
  line-height: 1.5;
  font-size: 1rem;
}

/* ------ Publication years ------ */
.pub-year {
  margin: 2.2rem 0 0.4rem;
  font-size: 1.25rem;
  font-family: "Mansalva", system-ui, sans-serif;
}


/* optional: make years look cleaner inside sections */
.section h2 {
  margin-top: 0;
  margin-bottom: 0.8rem;
}

/* ------ OSS note grid ------ */

.oss-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  row-gap: 1.2rem;      /* vertical spacing between rows */
  column-gap: 1.2rem;   /* horizontal spacing */
}

/* ------ OSS note cards ------ */

/* ------ OSS note grid ------ */

.oss-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  column-gap: 1.2rem;
  row-gap: 1.2rem;
}

/* On wider screens, force 3 columns → 2 rows for 6 notes */
@media (min-width: 900px) {
  .oss-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ------ OSS note cards ------ */

.oss-note {
  position: relative;
  background: #ffffff;
  border: 2px solid #000;
  border-radius: 12px;

  padding: 0.9rem 1.1rem;
  max-width: 100%;                 /* grid controls width now */

  box-shadow: 5px 5px 0 rgba(0,0,0,0.45);
  transform: rotate(var(--note-rotate, -1deg));
  transition: transform 0.1s ease-out, box-shadow 0.1s ease-out;
}

/* tape strips stay the same */
.oss-note::before,
.oss-note::after {
  content: "";
  position: absolute;
  top: -9px;
  width: 50px;
  height: 16px;
  background: #fdf3c4;
  border: 1px solid rgba(0,0,0,0.4);
  box-shadow: 0 2px 0 rgba(0,0,0,0.25);
  opacity: 0.95;
}

.oss-note::before {
  left: 20px;
  transform: rotate(-5deg);
}

.oss-note::after {
  right: 20px;
  transform: rotate(3deg);
}

/* ------ CV Items ------ */
.cv-item {
  margin-bottom: 1.8rem;
}

.cv-item h3 {
  margin: 0;
  font-size: 1.1rem;
}

.cv-item p {
  margin: 0.3rem 0;
  line-height: 1.45;
}

/* ===========================
   Koda Taped Photo Style
   =========================== */

.koda-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.1rem;
  margin-top: 1.4rem;
}

.koda-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;

  border: 2px solid var(--ink);
  border-radius: 8px;
  display: block;

  /* Slight friendly rotation */
  transform: rotate(var(--tilt, -1.5deg));
  box-shadow: 6px 6px 0 rgba(0,0,0,0.45);

  position: relative;
}

/* ===========================
   Tape strips (pseudo-elements)
   =========================== */

.koda-photo::before,
.koda-photo::after {
  content: "";
  position: absolute;
  top: -10px;
  width: 55px;
  height: 18px;

  background: #fdf3c4; /* soft paper-tape yellow */
  border: 1px solid rgba(0,0,0,0.4);
  opacity: 0.9;

  box-shadow: 0 2px 0 rgba(0,0,0,0.25);
}

/* left tape */
.koda-photo::before {
  left: 10px;
  transform: rotate(-6deg);
}

/* right tape */
.koda-photo::after {
  right: 10px;
  transform: rotate(4deg);
}

/* ===========================
   Research intro + stats note
   =========================== */

/* Make the first research section split into text + stats note */
.section-research-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.5rem;
}

/* main text column */
.section-research-intro .section-main {
  flex: 1 1 260px;
  min-width: 0;
}

/* sticky stats note */
.stats-note {
  position: relative;
  flex: 0 0 190px;

  background: #f4f4f4;
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 0.8rem 1rem;

  box-shadow: 5px 5px 0 rgba(0,0,0,0.4);
  transform: rotate(-1.5deg);
}

/* little “tape” at top */
.stats-note::before,
.stats-note::after {
  content: "";
  position: absolute;
  top: -8px;
  width: 40px;
  height: 14px;

  background: #fdf3c4;
  border: 1px solid rgba(0,0,0,0.4);
  box-shadow: 0 2px 0 rgba(0,0,0,0.25);
  opacity: 0.95;
}

.stats-note::before {
  left: 14px;
  transform: rotate(-6deg);
}

.stats-note::after {
  right: 14px;
  transform: rotate(4deg);
}

/* typography inside the note */
.stats-note h3 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.stats-line {
  margin: 0.15rem 0;
  font-size: 0.9rem;
}

.stats-updated {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  opacity: 0.7;
}

/* Mobile layout: stack text + stats note nicely */
@media (max-width: 700px) {
  .section-research-intro {
    display: block;        /* turn OFF flex on small screens */
  }

  .stats-note {
    margin-top: 1rem;
    margin-left: auto;     /* push it to the right edge */
    max-width: 240px;      /* keep it compact */
    transform: rotate(-1deg);
  }
}


.hero-icon {
  width: 22px;         /* perfect size in your layout */
  height: 22px;
  object-fit: contain;
  display: inline-block;
}

/* -------------------------
   Hero brand stamp (bottom right)
   ------------------------- */

.hero-stamp {
  position: absolute;
  right: 18px;
  bottom: 18px;
  pointer-events: none;   /* stamp is decorative */
}

.hero-stamp img {
  width: 46px;            /* tweak if needed */
  height: 46px;
  object-fit: contain;

  transform: rotate(-3deg);
  filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.45));
}

.hero-card {
  position: relative;     /* needed for absolute positioning inside */
}

@media (max-width: 600px) {
  .hero-stamp img {
    width: 34px;
    height: 34px;
    transform: rotate(-2deg);
  }

  .hero-stamp {
    right: 12px;
    bottom: 12px;
  }
}
