/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
h1, h2, p { margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---------- Design tokens ---------- */
:root {
  --bg: #ffffff;
  --text-primary: #111111;
  --text-secondary: #555555;
  --text-date: #6c6c6c;
  --chip-bg: #f6f6f6;
  --border-lighter: #f2f2f2;
  --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;

  --gbg-bg1: rgb(108, 0, 162);
  --gbg-bg2: rgb(0, 17, 82);
  --gbg-c1: 18, 113, 255;
  --gbg-c2: 221, 74, 255;
  --gbg-c3: 100, 220, 255;
  --gbg-c4: 200, 50, 50;
  --gbg-c5: 180, 180, 50;
  --gbg-interactive: 140, 100, 255;
  --gbg-circle-size: 80%;
  --gbg-blending: hard-light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --text-primary: #f2f2f2;
    --text-secondary: #b0b0b0;
    --text-date: #8a8a8a;
    --chip-bg: #1c1c1c;
    --border-lighter: #232323;
  }
}

body {
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Fixed animated background ---------- */
.gradient-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(40deg, var(--gbg-bg1), var(--gbg-bg2));
}

.gradient-bg svg {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
}

.gradient-bg .gradients-container {
  filter: url(#goo) blur(40px);
  width: 100%;
  height: 100%;
}

.gradient-bg .g1,
.gradient-bg .g2,
.gradient-bg .g3,
.gradient-bg .g4,
.gradient-bg .g5,
.gradient-bg .interactive {
  position: absolute;
  width: var(--gbg-circle-size);
  height: var(--gbg-circle-size);
  top: calc(50% - var(--gbg-circle-size) / 2);
  left: calc(50% - var(--gbg-circle-size) / 2);
  mix-blend-mode: var(--gbg-blending);
  opacity: 1;
}

.gradient-bg .g1 {
  background: radial-gradient(circle at center, rgba(var(--gbg-c1), 0.8) 0, rgba(var(--gbg-c1), 0) 50%) no-repeat;
  transform-origin: center center;
  animation: gbgMoveVertical 30s ease infinite;
}

.gradient-bg .g2 {
  background: radial-gradient(circle at center, rgba(var(--gbg-c2), 0.8) 0, rgba(var(--gbg-c2), 0) 50%) no-repeat;
  transform-origin: calc(50% - 400px);
  animation: gbgMoveInCircle 20s reverse infinite;
}

.gradient-bg .g3 {
  top: calc(50% - var(--gbg-circle-size) / 2 + 200px);
  left: calc(50% - var(--gbg-circle-size) / 2 - 500px);
  background: radial-gradient(circle at center, rgba(var(--gbg-c3), 0.8) 0, rgba(var(--gbg-c3), 0) 50%) no-repeat;
  transform-origin: calc(50% + 400px);
  animation: gbgMoveInCircle 40s linear infinite;
}

.gradient-bg .g4 {
  background: radial-gradient(circle at center, rgba(var(--gbg-c4), 0.8) 0, rgba(var(--gbg-c4), 0) 50%) no-repeat;
  transform-origin: calc(50% - 200px);
  animation: gbgMoveHorizontal 40s ease infinite;
  opacity: 0.7;
}

.gradient-bg .g5 {
  width: calc(var(--gbg-circle-size) * 2);
  height: calc(var(--gbg-circle-size) * 2);
  top: calc(50% - var(--gbg-circle-size));
  left: calc(50% - var(--gbg-circle-size));
  background: radial-gradient(circle at center, rgba(var(--gbg-c5), 0.8) 0, rgba(var(--gbg-c5), 0) 50%) no-repeat;
  transform-origin: calc(50% - 800px) calc(50% + 200px);
  animation: gbgMoveInCircle 20s ease infinite;
}

.gradient-bg .interactive {
  width: 100%;
  height: 100%;
  top: -50%;
  left: -50%;
  background: radial-gradient(circle at center, rgba(var(--gbg-interactive), 0.8) 0, rgba(var(--gbg-interactive), 0) 50%) no-repeat;
  opacity: 0.7;
}

@keyframes gbgMoveInCircle {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(180deg); }
  100% { transform: rotate(360deg); }
}

@keyframes gbgMoveVertical {
  0% { transform: translateY(-50%); }
  50% { transform: translateY(50%); }
  100% { transform: translateY(-50%); }
}

@keyframes gbgMoveHorizontal {
  0% { transform: translateX(-50%) translateY(-10%); }
  50% { transform: translateX(50%) translateY(10%); }
  100% { transform: translateX(-50%) translateY(-10%); }
}

@media (prefers-reduced-motion: reduce) {
  .gradient-bg .g1,
  .gradient-bg .g2,
  .gradient-bg .g3,
  .gradient-bg .g4,
  .gradient-bg .g5 {
    animation: none;
  }
}

/* ---------- Layout ---------- */
.page {
  position: relative;
  z-index: 1;
  box-sizing: content-box;
  max-width: 600px;
  margin: 0 auto;
  padding: 48px 22px 24px;
  background: var(--bg);
  opacity: 0.9;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

@media (min-width: 730px) {
  .page {
    margin: 40px auto;
    padding: 64px 62px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  }
}

/* ---------- Header ---------- */
.header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.avatar {
  width: 92px;
  height: 92px;
  border-radius: 100px;
  object-fit: cover;
  flex-shrink: 0;
}

.header-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 6px;
  min-width: 0;
}

.name {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

.tagline {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--text-secondary);
}

.chip {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--chip-bg);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.6;
  white-space: nowrap;
}

/* ---------- Sections ---------- */
.section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-heading {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

.body-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* ---------- Rows (Work Experience / Writing / Speaking / Side Projects / Education / Contact) ---------- */
.row-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.row {
  display: grid;
  grid-template-columns: 115px 1fr;
}

@media (min-width: 730px) {
  .row { grid-template-columns: 130px 1fr; }
}

.row-date {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-date);
  white-space: nowrap;
}

.row-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.row-title {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
}

.row-icon {
  width: 12px;
  height: 12px;
  color: var(--text-date);
  flex-shrink: 0;
}

.row-meta {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.row-title-placeholder {
  font-style: italic;
  color: var(--text-date);
}

/* ---------- Image placeholder area ---------- */
.image-area {
  grid-column: 1 / -1;
  padding-left: 115px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.image-placeholder {
  width: 150px;
  height: 90px;
  flex: 0 0 auto;
  border: 1px dashed var(--border-lighter);
  border-radius: 8px;
  background: var(--chip-bg);
}

.image-thumb {
  width: 150px;
  height: 90px;
  flex: 0 0 auto;
  border-radius: 8px;
  object-fit: cover;
  background: var(--chip-bg);
}

@media (min-width: 730px) {
  .image-area { padding-left: 130px; flex-direction: row; flex-wrap: wrap; }
}

/* ---------- Article cards (Writing) ---------- */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.article-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: fit-content;
}

.article-image-placeholder {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 16 / 9;
  border: 1px dashed var(--border-lighter);
  border-radius: 8px;
  background: var(--chip-bg);
}

.article-image {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  object-fit: cover;
  background: var(--chip-bg);
}

.article-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.article-title {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
}

.article-date {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-date);
}
