/* ---------- Tokens ---------- */
:root {
  --sky:    #dbe8f1;   /* page background, top */
  --tide:   #bcd3e3;   /* page background, bottom */
  --ink:    #14344d;   /* main text */
  --muted:  #46657d;   /* secondary text */
  --line:   #9dbad0;   /* dividers, underlines */
  --accent: #1f6394;   /* links, focus */

  --serif: "Literata", Georgia, "Times New Roman", serif;
  --measure: 40rem;
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky) 0%, var(--tide) 100%) fixed;
  background-color: var(--sky);
}

main {
  max-width: 68rem;
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) 1.5rem 2rem;
}

h1, h2, h3 { font-weight: 600; line-height: 1.2; margin: 0; }

p { margin: 0 0 1.1em; max-width: var(--measure); }

a {
  color: var(--accent);
  text-decoration-color: var(--line);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.2s;
}
a:hover { text-decoration-color: var(--accent); }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(14rem, 22rem) 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.about-stage,
.projects {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.portrait {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 0.5rem;
  background: var(--tide);
}

.sidebar {
  display: grid;
  gap: 3rem;
}

.goals {
  padding: 1.1rem 1.25rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: rgb(255 255 255 / 0.25);
}

.goals h2 {
  font-size: 1.05rem;
  font-style: italic;
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.goals ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.goals li {
  padding: 0.55rem 0;
  line-height: 1.35;
}

.goals li + li { border-top: 1px solid var(--line); }

.goal { display: block; }

.goal-status {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.intro h1 {
  font-size: clamp(2.2rem, 4.5vw, 3rem);
  letter-spacing: -0.01em;
  margin-bottom: 1.25rem;
}

.intro h2 {
  font-size: 1.05rem;
  font-style: italic;
  font-weight: 400;
  color: var(--muted);
  margin: 1.75rem 0 0.35rem;
}

/* ---------- Links ---------- */
.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.75rem;
  margin: 3rem 0 0;
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.links a {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  text-decoration: none;
}

.links a:hover { color: var(--ink); }

.icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

/* ---------- Projects ---------- */
.projects {
  margin-top: clamp(3rem, 8vh, 5rem);
  max-width: 44rem;
}

.projects > h2 {
  font-size: 1.9rem;
  margin-bottom: 2rem;
}

.project {
  position: relative;
  isolation: isolate;
  padding: 1.75rem 0;
  border-top: 1px solid var(--line);
}

.project h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.project p { color: var(--muted); margin-bottom: 0.6rem; }

/* ---------- Project backgrounds ---------- */
/* Line art sits behind each entry, anchored right and masked away
   before it reaches the text column. */
.project::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 50%;
  right: -1.5rem;
  translate: 0 -50%;
  width: min(20rem, 56%);
  max-height: calc(100% - 2rem);
  aspect-ratio: 360 / 220;
  background-repeat: no-repeat;
  background-position: right center;
  background-size: contain;
  opacity: 0.14;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to left, #000 30%, transparent 92%);
  mask-image: linear-gradient(to left, #000 30%, transparent 92%);
}

.project--thesis::before    { background-image: url("bg/thesis.svg"); }
.project--audio::before     { background-image: url("bg/audio-coding.svg"); }
.project--evolution::before { background-image: url("bg/evolution.svg"); }
.project--ece::before       { background-image: url("bg/circuits.svg"); }

/* ---------- Footer ---------- */
footer {
  max-width: 68rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 2.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Mobile ---------- */
@media (max-width: 680px) {
  .about { grid-template-columns: 1fr; }
  .sidebar { display: contents; }
  .portrait { max-width: 15rem; justify-self: center; }
  .goals { order: 1; max-width: 22rem; }
  .project::before { width: min(13rem, 62%); opacity: 0.1; }
}

@media (prefers-contrast: more) {
  .project::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  a,
  .about-stage,
  .projects { transition: none; }
}
