/* ================================================
   MIGLE
   text-document / archival / indie web
   ================================================ */

:root {
  --bg:     #ffffff;
  --fg:     #111;
  --muted:  #666;
  --border: #ccc;
  --accent: #c4603a;

  --font: "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --size: 19px;
  --lh:   1.6;

  --col: 100%;
  --pad: 2.5rem;
}

/* ================================================
   CURSOR
   ================================================ */
*, *::before, *::after { cursor: none !important; }

.cursor {
  position: fixed;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  top: 0;
  left: 0;
  transform: translate(-100px, -100px);
  mix-blend-mode: difference;
  will-change: transform;
}

.trail-dot {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  top: 0;
  left: 0;
  transform: translate(-100px, -100px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* ---- RESET ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--size);
  line-height: var(--lh);
  overflow-x: hidden;
}

a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent);
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

/* ================================================
   GRAIN OVERLAY
   ================================================ */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 300px 300px;
}

/* ================================================
   HEADER
   ================================================ */
header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.9rem 2rem 0.9rem 3.5rem;
  border-bottom: 2px solid var(--fg);
  position: relative;
}

.back-btn {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  text-decoration: none;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  transition: color 0.15s;
  visibility: hidden;
}

.back-btn.visible {
  visibility: visible;
}

.back-btn:hover { color: var(--fg); }

.header-left {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.header-name {
  font-size: 0.82rem;
  font-weight: bold;
  letter-spacing: 0.02em;
}

.header-links {
  display: flex;
  gap: 1.25rem;
  font-size: 0.85rem;
}

.header-links a {
  text-decoration: none;
  color: var(--fg);
}

.header-links a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
  color: var(--accent);
}

/* ================================================
   TICKER
   ================================================ */
.ticker-wrap {
  display: block;
  overflow: hidden;
  border-bottom: 1px solid var(--fg);
  background: var(--fg);
  color: var(--bg);
  padding: 0.35rem 0;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
}

.ticker {
  display: flex;
  white-space: nowrap;
  animation: scroll-ticker 28s linear infinite;
}

@keyframes scroll-ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ================================================
   MAIN COLUMN
   ================================================ */
main {
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ================================================
   BIO
   ================================================ */
.section-bio {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
}

.section-bio p {
  margin-bottom: 0.65rem;
}

.section-bio p:last-child {
  margin-bottom: 0;
}

/* ================================================
   WORK SECTIONS
   ================================================ */
.section-works {
  padding: 0;
  border-bottom: 1px solid var(--border);
}

.section-label {
  font-size: 0.72rem;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding: 1.25rem 0 0.75rem;
  border-bottom: 1px solid var(--border);
}

/* ================================================
   WORK ENTRY
   ================================================ */
.work-entry {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.work-entry:last-child {
  border-bottom: none;
}

.work-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.2rem;
}

.work-title {
  font-weight: bold;
  font-size: 1rem;
}

.work-title-link {
  text-decoration: none;
  color: inherit;
}

.work-title-link:hover .work-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.work-year {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.work-medium {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.work-desc {
  font-size: 0.92rem;
  line-height: 1.55;
  color: #444;
}

.arrow-link {
  color: var(--fg);
  font-size: 0.82rem;
  text-decoration: none;
  border-bottom: 1px solid var(--fg);
  padding-bottom: 0;
}

.arrow-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ================================================
   IMAGE PLACEHOLDERS
   ================================================ */
.work-img-wrap {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.img-placeholder {
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: var(--muted);
  font-family: "Courier New", monospace;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(0,0,0,0.018) 10px,
    rgba(0,0,0,0.018) 11px
  );
  position: relative;
  overflow: hidden;

  /* default: square-ish thumbnail */
  width: 180px;
  height: 135px;
  flex-shrink: 0;
}

.img-placeholder.portrait {
  width: 140px;
  height: 185px;
}

.img-placeholder.landscape {
  width: 100%;
  height: 280px;
  flex-shrink: 1;
}

.img-placeholder.wide {
  width: 100%;
  height: 240px;
  flex-shrink: 1;
}

/* side-by-side thumbnails, Mindy Seu style */
.img-placeholder.thumb {
  width: 386px;
  height: 262px;
  flex-shrink: 0;
}

/* real images, when swapped in */
.img-placeholder img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ================================================
   FOOTER
   ================================================ */
footer {
  max-width: var(--col);
  margin: 0 auto;
  padding: 1.25rem var(--pad) 2rem;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

footer a {
  color: var(--muted);
}

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

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 600px) {
  :root {
    --pad: 1rem;
  }

  header {
    flex-direction: column;
    gap: 0.75rem;
  }

  .header-links {
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
  }

  .work-row {
    flex-direction: column;
    gap: 0.1rem;
  }

  .work-img-wrap {
    flex-direction: column;
  }

  .img-placeholder,
  .img-placeholder.portrait,
  .img-placeholder.thumb {
    width: 100%;
    height: 200px;
    flex-shrink: 1;
  }

  .img-placeholder.landscape,
  .img-placeholder.wide {
    height: 180px;
  }
}

/* ================================================
   DARK MODE
   ================================================ */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:     #111111;
    --fg:     #e8e8e8;
    --muted:  #666;
    --border: #2e2e2e;
  }

  .work-desc { color: #aaa; }

  .img-placeholder {
    background: repeating-linear-gradient(
      45deg,
      transparent,
      transparent 10px,
      rgba(255, 255, 255, 0.025) 10px,
      rgba(255, 255, 255, 0.025) 11px
    );
  }

  .grain { opacity: 0.06; }
}

/* Manual dark mode (toggle) */
html.dark {
  --bg:     #111111;
  --fg:     #e8e8e8;
  --muted:  #666;
  --border: #2e2e2e;
}

html.dark body { background: #111111; color: #e8e8e8; }
html.dark .work-desc { color: #aaa; }
html.dark .img-placeholder {
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(255, 255, 255, 0.025) 10px,
    rgba(255, 255, 255, 0.025) 11px
  );
}
html.dark .grain { opacity: 0.06; }

/* Dark toggle button */
.dark-toggle {
  background: none;
  border: none;
  font-family: "Courier New", monospace;
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0;
  white-space: nowrap;
  letter-spacing: 0.04em;
}
.dark-toggle:hover { color: var(--fg); }

/* ================================================
   BACK BUTTON
   ================================================ */
.back-btn {
  text-decoration: none;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.back-btn:hover {
  color: var(--fg);
}
