/* =========================
   Yang Yang — One-page site
   Fixed header + green theme
   Continuous background
   ========================= */

:root{
  --bg: #f7fbf7;           /* soft greenish background */
  --card: rgba(255,255,255,.5);
  --text: #0f172a;
  --muted: #475569;
  --border: rgba(15,23,42,.10);
  --shadow: 0 10px 30px rgba(15,23,42,.08);
  --r: 20px;
  --max: 1020px;
  --bodyFontSize: 17px;
  --cardGap: 30px;

  /* Green-ish theme */
  --accent: #24924c;       /* green-600 */
  --accent2:#255a38;       /* green-500 */

  --navH: 74px;   /* Fixed navigation bar height */
  --topOffset: calc(var(--navH) + 50px); /* Fixed offset from the top */
}

*{box-sizing:border-box}

html{
  scroll-behavior: smooth; 
  scroll-padding-top: var(--topOffset); /* extra space hunder navigation bar to prevent covering sections */
}

body{
   margin:0px;
   font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial;
   /* font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial; */
   /* uncomment the above line to use the default font */
   
   font-size: var(--bodyFontSize);     /* increase base text size */
   line-height: 1.5;    /* improves readability */
   color: var(--text);
   background-color: #95c0a3; /* fallback color if gradients fail */

  /* Continuous “one wallpaper” background:
     use fixed background layers so it doesn’t look tiled vertically */
background:
  /* Lake green*/
  radial-gradient(1000px 1200px at 15% 0%, rgba(22, 163, 74, .18), transparent 66%),

  /* Warm amber*/
  radial-gradient(1000px 900px at 70% 10%, rgba(255, 196, 120, .20), transparent 62%),

  /* Forest green*/
  radial-gradient(1000px 600px at 32% 20%, rgba(20, 83, 45, .14), transparent 78%),

  /* Warm peach*/
  radial-gradient(900px 600px at 78% 30%, rgba(255, 156, 122, .18), transparent 60%),

  /* Lavender*/
  radial-gradient(800px 800px at 26% 40%, rgba(168, 85, 247, .11), transparent 72%),

  /* Mint green wash*/
  radial-gradient(800px 1300px at 65% 50%, rgba(52, 211, 153, .13), transparent 40%),

  /* Warm sand*/
  radial-gradient(800px 800px at 28% 60%, rgba(255, 214, 165, 0.20), transparent 40%),
   
  /* Soft blue tint*/
  radial-gradient(800px 1200px at 75% 70%, rgba(59, 130, 246, .16), transparent 70%),

  /* Bright green*/
  radial-gradient(1100px 1400px at 40% 80%, rgba(34, 197, 94, .12), transparent 68%),

   /* Emerald green*/
  radial-gradient(800px 900px at 70% 90%, rgba(16, 185, 129, .16), transparent 66%),

  /* Warm amber*/
  radial-gradient(900px 1200px at 36% 100%, rgba(255, 196, 120, .22), transparent 60%),

  /* Base greenish canvas — smooth background */
  linear-gradient(180deg, #f6fbf7 0%, #eef9f3 40%, #f6fbf7 100%);
   
  background-attachment: scroll, scroll, scroll;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}



a{color:inherit; text-decoration:none}
a:hover{ text-decoration: underline; }

/* Accent color only for text links inside cards */
.card a:not(.iconBtn):not(.pill):not(.btn){
  color: var(--accent);
}
.card a:not(.iconBtn):not(.pill):not(.btn):hover{
  color: var(--accent2);
}

/* Never underline icon & navigation buttons (normal and hover) */
a.iconBtn,
a.iconBtn:hover,
a.iconBtn:focus,
a.iconBtn:active{ text-decoration: none !important; }

nav.links.equal a.pill{ text-decoration: none !important; }


.container{
  max-width:var(--max);
  margin:0 auto;
  padding: var(--topOffset) 18px 64px; /* top padding prevents content hiding by navigation bar */
}








/* ===== Fixed top navigation (equal tabs) ===== */
.nav{
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(var(--max), calc(100% - 36px));
  z-index: 999;

  /* Make nav container just a shell */
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(15,23,42,.08);
}

.navToggle{
  display: none !important;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  pointer-events: none;
  appearance: none;
  -webkit-appearance: none;
}

/* The links become a 5-column grid */
.links.equal{
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* 5 equal tabs */
  gap: 8px;
  margin: 0;
}




/* The default style of each navigation item */
.links.equal .pill{
  display: inline-flex;
  justify-content: center;
  text-align: center;
  transform-origin: center;

  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial;
  font-size: 18px; /* text size */
  font-weight: 600; /* boldness (400 normal, 600 semi-bold, 700 bold) */

  padding: 9px 12px;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid transparent;

  /* For smooth hover */
  transition: transform .25s ease, color .25s ease, font-weight .25s ease, background-color .25s ease;
  transform-origin: center;
}

/* Hover state when the mouse is over it */
.links.equal .pill:hover{
  transform: scale(1.1);  /* visually bigger, bar height stays the same */
  font-weight: 700;     /* bold */
  color: var(--text);   /* slightly darker */
  background: transparent; /* keep no pill */
  border-color: transparent; /* keep no border */
}

/* Make each section land lower at klicking on navigation */
.section{
   padding-top: 6px; /* optional */
   margin-bottom: 300px;     /* adds space after each section */
}

/* Extra space after the last section */
#contact{ margin-bottom: 400px; }















/* ===== Typography ===== */
h1{
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial;
  font-size: clamp(30px, 3.4vw, 45px);
  line-height: 1.1;
  letter-spacing: 0.03em;
  margin: 0 0 10px 0;   /* 10px below */
}

h2{
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial;
  font-size: 20px;
  letter-spacing: 0.02em;
  margin: 0px 0 10px 0;  /* 8px below (and 8px above) */
}

p{margin:0; 
  color: var(--muted); 
  line-height:1.6}

.hr{margin: 30px 0 50px 0; /* top right bottom left */
    border:0; 
    height:1px; 
    background:rgba(15,23,42,.10)}













/* ===== Cards + layout ===== */
.grid{ display:grid; gap: var(--cardGap); }
.cards{grid-template-columns: repeat(12, 1fr)}
.card{
  grid-column: span 12;
  padding:18px;
  border:1px solid var(--border);
  border-radius: var(--r);
  background: var(--card);
  box-shadow: var(--shadow);
  position: relative;
  transition: transform .25s ease, box-shadow .25s ease;
}
.card p{
  text-align: justify;
  text-justify: inter-word; 
}
.card:hover{
  transform: translateY(-3px) scale(1.02); /* slightly bigger */
  z-index: 5; /* draw above nearby cards */
  background: rgba(255,255,255,.8);
  box-shadow: 0 16px 44px rgba(15,23,42,.14);
}
@media (min-width: 760px){
  .half{grid-column: span 6}
  .third{grid-column: span 4}
}














/* =====  Expandable Card ===== */
.expandableCard{ padding: 0;                 /* no padding outsid  */
}

/* Make the summary look like the top of a normal card */
.expandableTitle{
  cursor: pointer;
  padding: 18px;
  list-style: none;           /* remove default marker */
}

/* Remove the default triangle in Chrome/Safari */
.expandableTitle::-webkit-details-marker{ display:none; }

/* Firefox */
.expandableTitle::marker{
  content: "";
}

/* Keep the title style consistent */
.expandableTitle h2{
  margin: 0;
}

/* Add padding for the expanded content container */
.expandableBody{
  padding: 0 36px 36px;
  cursor: pointer;
}

/* Remove the default <details>/<summary> marker triangle (all browsers) */
details.expandableCard > summary{
  list-style: none;            /* older behavior */
}
details.expandableCard > summary::-webkit-details-marker{
  display: none;               /* Chrome/Safari */
}
details.expandableCard > summary::marker{
  content: "";                 /* Firefox */
}

/* ===== Reading list page ===== */
.readingPage .container{
  max-width: min(calc(var(--max) * 1.5), 96vw);
  padding-top: 44px;
}

.readingList{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--cardGap);
  align-items: start;
}

/* Fallback before JS wraps cards into .readingColumn containers */
.readingList > .readingCard{
  grid-column: span 1;
}

.readingColumn{
  display: flex;
  flex-direction: column;
  gap: var(--cardGap);
  min-width: 0;
}

.readingCard{
  display: block;
  margin: 0;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, background-color .25s ease;
  transform-origin: center top;
  will-change: transform;
}

.readingCard .expandableTitle{
  border-radius: var(--r) var(--r) 0 0;
}

.readingCard:not([open]) .expandableTitle{
  border-radius: var(--r);
}

.readingList .readingCard:hover,
.readingList .readingCard:focus-within{
  transform: translateY(-7px) scale(1.03);
  z-index: 6;
  background: rgba(255,255,255,.8);
  box-shadow: 0 18px 46px rgba(15,23,42,.16);
}

@media (max-width: 1100px){
  .readingList{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px){
  .readingList{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.bookSummary{
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.bookCover{
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: cover;
  align-self: center;
  border-radius: var(--r);
  border: none;
  background: transparent;
  display: block;
}

.bookTitle{
  margin: 0;
}

.bookAuthor{
  margin: 4px 0 0;
  color: var(--muted);
}













/* ===== Profile header + photo ===== */
.profile{
  display:grid;
  gap:16px;
}
@media (min-width: 760px){
  .profile{
    grid-template-columns: 200px 1fr;
    align-items: start;
  }
}

.avatarWrap{
  display:flex;
  justify-content:flex-start;
}
.avatar{
  width: 200px;
  height: 200px;
  border-radius: 999px;                 /* round */
  object-fit: cover;                   /* keep proportions */
  border: 2px solid rgba(50,50,50,.35);
  box-shadow: 0 12px 26px rgba(15,23,42,.12);
  background: #fff;
}














/* ===== Icon links (using image files like .png) ===== */
.iconRow{display:flex; flex-wrap:wrap; gap:20px; margin-top:20px}

.iconBtn{
  display:inline-flex;
  align-items:center;
  font-size: 13px;   /* text font size */
  gap:8px;
  padding:8px 14px;
  border-radius:999px;
  border:0px solid var(--border);
  box-shadow: var(--shadow);
  background:rgba(255,255,255,.5);

  /* Smooth hover animation */
  transition: transform .25s ease, background-color .25s ease, border-color .25s ease;
  transform-origin: center;
}

.iconBtn:hover{
  transform: scale(1.06);
  background: rgba(255,255,255,.85);
  box-shadow: 0 16px 44px rgba(15,23,42,.14);
}

.iconImg{
  width:22px;
  height:22px;
  object-fit: contain;
  display:inline-block;
}











/* ===== Lists ===== */
.list{margin:10px 0 0; padding-left:18px; color: var(--muted)}
.list li{margin:7px 0}







/* ===== Education: invisible 3-column table ===== */
.eduTable3{
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 1.1fr 72px; /* degree | inst | year */
  column-gap: 16px;
  row-gap: 10px;
  margin-top: 10px;
  align-items: start;
  position: relative;
  padding-left: 18px;   /* indent 18px before the first column */
}

.eduDegree{position: relative; color: var(--text);}
.eduTable3 .eduDegree::before{                /* add bullet point */
  content: "•";
  position: absolute;
  left: -18px;          
  top: 0.15em;          
  color: var(--muted);  
}
.eduInst{color: var(--muted);}
.eduYear{
  color: var(--muted);
  text-align: right;        /* year aligned */
  font-variant-numeric: tabular-nums; /* nicer number alignment */
}

/* Mobile: stack nicely */
@media (max-width: 720px){
  .eduTable3{
    grid-template-columns: 1fr; /* stack */
    row-gap: 6px;
  }
  .eduYear{
    text-align: left;
    padding-bottom: 12px; /* space between entries */
  }
}






/* ===== Buttons ===== */
.btn{
  font-size: var(--bodyFontSize);
  font-weight:700;
  display:inline-flex; align-items:center; justify-content:center;
  padding:10px 20px; border-radius:999px;
  border:1px solid var(--border);
  background: #fff;
}
.btn.primary{
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
}






/* ===== Form ===== */
label{display:block; margin:12px 0 8px; color: var(--muted); font-weight:700; font-size: var(--bodyFontSize);}
input, textarea{
  width:100%;
  padding:12px 12px;
  border-radius: 14px;
  border:1px solid var(--border);
  background: #fff;
  color: var(--text);
  outline:none;
  font-size: 16px;   /* bigger typing text */
  line-height: 1.4;  /* nicer for multi-line message */
}
textarea{min-height:140px; resize:vertical}













/* ===== Footer ===== */
.footer{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 120px;
  text-align: center;
}







/* ===== Floating navigation buttons ===== */
.toTopBtn,
.toHomeBtn{
  position: fixed;
  bottom: 24px;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: none;
  text-decoration: none !important;
  z-index: 1001;
  transition: transform .25s ease, box-shadow .25s ease;
}

.toTopBtn{
  right: 24px;
}

.toHomeBtn{
  left: 24px;
}

.toTopBtn:hover,
.toHomeBtn:hover{
  transform: translateY(-2px) scale(1.03);
  box-shadow: none;
}

.toTopBtn:active,
.toHomeBtn:active{
  transform: translateY(0) scale(.98);
}

.toTopBtn:focus-visible,
.toHomeBtn:focus-visible{
  outline: 3px solid rgba(34, 197, 94, .35);
  outline-offset: 2px;
}
















/* ===== Mobile layout (phones) ===== */
@media (max-width: 760px){
  :root{
    --topOffset: 86px;
  }

  body{
    font-size: 16px;
    /* Lighter stack for mobile browsers that may skip complex backgrounds */
    background:
      radial-gradient(900px 700px at 12% 0%, rgba(22, 163, 74, .20), transparent 65%),
      radial-gradient(700px 620px at 88% 12%, rgba(59, 130, 246, .16), transparent 65%),
      radial-gradient(900px 760px at 50% 100%, rgba(16, 185, 129, .14), transparent 70%),
      linear-gradient(180deg, #f1faef 0%, #e6f5ea 45%, #f1faef 100%);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-attachment: scroll;
  }

  .container{
    padding: var(--topOffset) 12px 40px;
  }

  .nav{
    top: 10px;
    width: calc(100% - 16px);
    padding: 8px;
    border-radius: 999px;
  }

  .nav.navOpen{
    border-radius: 28px;
  }

  .navToggle{
    display: flex !important;
    pointer-events: auto;
    width: 100%;
    height: auto;
    margin: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
  }

  .navToggle span{
    width: 24px;
    height: 2px;
    border-radius: 999px;
    background: var(--text);
    transition: transform .25s ease, opacity .25s ease;
  }

  .nav.navOpen .navToggle span:nth-child(1){
    transform: translateY(6px) rotate(45deg);
  }

  .nav.navOpen .navToggle span:nth-child(2){
    opacity: 0;
  }

  .nav.navOpen .navToggle span:nth-child(3){
    transform: translateY(-6px) rotate(-45deg);
  }

  .links.equal{
    display: none;
    grid-template-columns: 1fr;
    gap: 6px;
    margin-top: 8px;
  }

  .nav.navOpen .links.equal{
    display: grid;
  }

  .nav.navOpen + .container{
    padding-top: 320px;
  }

  .links.equal .pill{
    font-size: 14px;
    padding: 10px 8px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.8);
  }

  .section{
    margin-bottom: 120px;
  }

  .profile{
    text-align: center;
  }

  .avatarWrap{
    justify-content: center;
  }

  .avatar{
    width: 144px;
    height: 144px;
  }

  .iconRow{
    gap: 10px;
    justify-content: center;
  }

  .iconBtn{
    padding: 8px 10px;
    font-size: 12px;
  }

  h1{
    font-size: clamp(28px, 8vw, 36px);
  }

  h2{
    font-size: 18px;
  }

  .card{
    padding: 14px;
  }

  .readingPage .container{
    max-width: min(calc(var(--max) * 1.5), 96vw);
    padding-top: 24px;
  }

  .readingColumn{
    gap: 20px;
  }

  .readingList{
    grid-template-columns: 1fr;
  }

  .bookSummary{
    gap: 10px;
  }

  .expandableCard > :not(summary){
    padding: 0 16px 16px;
  }

  .footer{
    padding-bottom: 56px;
  }

  .toTopBtn,
  .toHomeBtn{
    bottom: 14px;
    width: 48px;
    height: 48px;
    font-size: 22px;
  }

  .toTopBtn{
    right: 14px;
  }

  .toHomeBtn{
    left: 14px;
  }
}

/* Avoid long links/terms causing horizontal overflow */
.card,
.card p,
.card h2,
.eduDegree,
.eduInst{
  overflow-wrap: anywhere;
}
