@import url('https://fonts.googleapis.com/css2?family=VT323&family=Share+Tech+Mono&display=swap');

/* ── Custom Properties ─────────────────────────────────── */
:root {
  --win-bg:      #c0c0c0;
  --win-face:    #dfdfdf;
  --win-dark:    #808080;
  --win-light:   #ffffff;
  --win-darkest: #000000;
  --title-bar:   #000080;
  --title-text:  #ffffff;
  --page-bg:     #ffffff;

  --accent-pink:   #ff71ce;
  --accent-cyan:   #01cdfe;
  --accent-purple: #b967ff;
  --accent-green:  #05ffa1;
  --accent-yellow: #fffb96;

  --font-header: 'VT323', monospace;
  --font-body:   'Share Tech Mono', monospace;

  --chrome-max-width: 960px;
}

/* ── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--win-bg);
  font-family: var(--font-body);
  font-size: 14px;
  color: #000;
  min-height: 100vh;
  padding: 20px 12px;
}

a { color: var(--title-bar); }
a:visited { color: #551a8b; }

h1, h2, h3, h4 { font-family: var(--font-header); font-weight: normal; }

img { max-width: 100%; }

/* ── Site Title ────────────────────────────────────────── */
.site-title {
  max-width: var(--chrome-max-width);
  margin: 0 auto 6px auto;
  text-align: center;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-title .site-logo {
  height: 48px;
  image-rendering: pixelated;
}

/* ── Splash Screen ─────────────────────────────────────── */
#splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--win-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}

.splash-window {
  border-top:    2px solid var(--win-light);
  border-left:   2px solid var(--win-light);
  border-right:  2px solid var(--win-darkest);
  border-bottom: 2px solid var(--win-darkest);
  background: var(--win-bg);
  box-shadow: inset 1px 1px 0 var(--win-face),
              inset -1px -1px 0 var(--win-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 24px;
}

.splash-window .title-bar {
  width: 100%;
  margin-bottom: 20px;
}

.splash-window .splash-icon {
  width: 96px;
  image-rendering: pixelated;
  margin-bottom: 16px;
}

.splash-window .splash-name {
  font-family: var(--font-header);
  font-size: 48px;
  color: #000;
  margin-bottom: 20px;
  padding: 0 40px;
  text-align: center;
}

.splash-window-lg {
  min-width: 420px;
  padding-bottom: 32px;
}

.splash-window .splash-subtitle {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--win-dark);
  animation: blink-text 1.2s step-end infinite;
}

@keyframes blink-text {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ── Window Chrome ─────────────────────────────────────── */
#site-chrome {
  max-width: var(--chrome-max-width);
  margin: 0 auto;
  border-top:    2px solid var(--win-light);
  border-left:   2px solid var(--win-light);
  border-right:  2px solid var(--win-darkest);
  border-bottom: 2px solid var(--win-darkest);
  background: var(--win-bg);
  box-shadow: inset 1px 1px 0 var(--win-face),
              inset -1px -1px 0 var(--win-dark);
}

/* ── Title Bar ─────────────────────────────────────────── */
.title-bar {
  background: linear-gradient(90deg, var(--title-bar), #1084d0);
  color: var(--title-text);
  font-family: var(--font-header);
  font-size: 18px;
  padding: 3px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.title-buttons { display: flex; gap: 2px; }

.title-btn {
  width: 16px;
  height: 14px;
  background: var(--win-bg);
  border-top:    1px solid var(--win-light);
  border-left:   1px solid var(--win-light);
  border-right:  1px solid var(--win-darkest);
  border-bottom: 1px solid var(--win-darkest);
  font-family: var(--font-body);
  font-size: 10px;
  line-height: 14px;
  text-align: center;
  cursor: default;
}

/* ── Tab Navigation ────────────────────────────────────── */
.tab-nav {
  display: flex;
  background: var(--win-bg);
  padding: 6px 4px 0 4px;
  gap: 0;
}

.tab-nav a {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 14px;
  font-family: var(--font-body);
  font-size: 13px;
  text-decoration: none;
  color: #000;
  background: var(--win-bg);
  border-top:    2px solid var(--win-light);
  border-left:   2px solid var(--win-light);
  border-right:  2px solid var(--win-darkest);
  border-bottom: none;
  margin-bottom: -2px;
  position: relative;
}

.tab-nav a:visited { color: #000; }

.tab-nav a.active {
  background: var(--page-bg);
  border-bottom: 2px solid var(--page-bg);
  z-index: 1;
}

.tab-nav a img {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

/* ── Content Area ──────────────────────────────────────── */
.content-area {
  background: var(--page-bg);
  border-top:    2px solid var(--win-dark);
  border-left:   2px solid var(--win-dark);
  border-right:  2px solid var(--win-light);
  border-bottom: 2px solid var(--win-light);
  margin: 0 4px 4px 4px;
  padding: 20px;
  min-height: 400px;
}

/* ── Status Bar ────────────────────────────────────────── */
.status-bar {
  display: flex;
  background: var(--win-bg);
  padding: 2px 4px 4px 4px;
  font-size: 11px;
}

.status-bar-field {
  border-top:    1px solid var(--win-dark);
  border-left:   1px solid var(--win-dark);
  border-right:  1px solid var(--win-light);
  border-bottom: 1px solid var(--win-light);
  padding: 1px 6px;
  flex: 1;
}

/* ── Social Media Links ────────────────────────────────── */
.social-links {
  position: fixed;
  bottom: 12px;
  left: 12px;
  display: flex;
  gap: 8px;
  z-index: 100;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--win-face);
  border: 2px outset var(--win-light);
  text-decoration: none;
  color: #000;
  font-weight: bold;
  font-size: 18px;
  transition: all 0.1s;
}

.social-links a:hover {
  border-style: solid;
  background: var(--win-light);
}

.social-links a:active {
  border-style: inset;
  background: var(--win-bg);
}

/* ── Box / GroupBox ────────────────────────────────────── */
.box {
  border: 2px groove var(--win-bg);
  padding: 16px;
  margin-bottom: 16px;
}

.box-title {
  font-size: 24px;
  margin-bottom: 8px;
}

/* ── Button ────────────────────────────────────────────── */
.btn {
  font-family: var(--font-body);
  padding: 4px 16px;
  background: var(--win-bg);
  border-top:    2px solid var(--win-light);
  border-left:   2px solid var(--win-light);
  border-right:  2px solid var(--win-darkest);
  border-bottom: 2px solid var(--win-darkest);
  cursor: pointer;
  font-size: 13px;
  color: #000;
  text-decoration: none;
  display: inline-block;
}

.btn:active,
.btn.btn-active {
  border-top:    2px solid var(--win-darkest);
  border-left:   2px solid var(--win-darkest);
  border-right:  2px solid var(--win-light);
  border-bottom: 2px solid var(--win-light);
}

.btn-green { color: #006b3f; }
.btn-cyan  { color: #006d8f; }
.btn-pink  { color: #a0005e; }

/* ── Box Header (title + right element) ───────────────────── */
.box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.box-header .box-title {
  margin-bottom: 0;
}

.btn-print {
  background: #ffffcc;
  font-weight: bold;
}

/* ── Timeline / CV Items ───────────────────────────────── */
.timeline-item {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px dotted var(--win-dark);
}

.timeline-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.timeline-item .gif-decoration {
  flex-shrink: 0;
  width: 60px;
}

.timeline-item .gif-decoration img {
  width: 60px;
  image-rendering: pixelated;
}

.timeline-item h3 {
  font-size: 20px;
  margin-bottom: 4px;
}

.timeline-item .meta {
  font-size: 12px;
  color: var(--win-dark);
  margin-bottom: 4px;
}

/* ── Skills Table ──────────────────────────────────────── */
.skills-table {
  width: 100%;
  border-collapse: collapse;
}

.skills-table td {
  padding: 4px 8px;
  border: 1px solid #ccc;
}

.skills-table td:first-child {
  font-family: var(--font-header);
  font-size: 16px;
  white-space: nowrap;
  width: 130px;
}

.skills-table tr:nth-child(even) {
  background: #f0f0f0;
}

/* ── CV list items ─────────────────────────────────────── */
.cv-list {
  list-style: square;
  padding-left: 20px;
}

.cv-list li {
  margin-bottom: 6px;
}

.cv-entry {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px dotted var(--win-dark);
}

.cv-entry:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.cv-entry h3 {
  font-size: 18px;
  margin-bottom: 2px;
}

.cv-entry .meta {
  font-size: 12px;
  color: var(--win-dark);
  margin-bottom: 6px;
}

/* ── Writing Card ──────────────────────────────────────── */
.writing-card {
  padding: 14px 0;
  border-bottom: 1px solid #ddd;
}

.writing-card:last-child { border-bottom: none; }

.writing-card h3 {
  font-size: 22px;
  margin-bottom: 2px;
}

.writing-card h3 a {
  color: var(--title-bar);
  text-decoration: underline;
}

.writing-card h3 a:hover {
  color: var(--accent-purple);
}

.writing-card .date {
  font-size: 12px;
  color: var(--win-dark);
}

.writing-card .category {
  font-size: 12px;
  color: var(--accent-purple);
}

.writing-card p {
  margin-top: 6px;
  line-height: 1.5;
}

/* ── Project Card ──────────────────────────────────────── */
.project-card {
  border: 2px groove var(--win-bg);
  padding: 16px;
  margin-bottom: 16px;
}

.project-card h3 {
  font-size: 20px;
  margin-bottom: 6px;
}

.project-card p {
  margin-bottom: 10px;
  line-height: 1.5;
}

/* ── Projects Layout ───────────────────────────────────── */
.projects-layout {
  display: flex;
  gap: 20px;
}

.projects-list {
  flex: 1;
  min-width: 0;
}

.viewer-panel {
  flex: 1;
  min-width: 0;
  position: sticky;
  top: 20px;
  align-self: flex-start;
}

.viewer-title {
  font-size: 14px;
  font-weight: bold;
  margin-left: auto;
}

/* ── 3D Viewer ─────────────────────────────────────────── */
.viewer-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  background: var(--win-bg);
  border: 2px groove var(--win-bg);
  margin-bottom: 0;
}

#viewer-container {
  width: 100%;
  height: 500px;
  border: 2px inset var(--win-bg);
  background: #1a1a2e;
  position: relative;
  overflow: hidden;
}

#viewer-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.viewer-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(26, 26, 46, 0.85);
  color: #fff;
  font-family: var(--font-header);
  font-size: 20px;
  z-index: 2;
}

.viewer-overlay img {
  width: 80px;
  margin-top: 12px;
  image-rendering: pixelated;
}

.viewer-overlay.hidden { display: none; }

/* Win98 Progress Bar */
.win98-progress {
  width: 200px;
  padding: 2px;
  background: var(--win-bg);
  border: 2px inset var(--win-bg);
}

.win98-progress-track {
  height: 16px;
  background: #fff;
  overflow: hidden;
  position: relative;
}

.win98-progress-blocks {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 200%;
  background: repeating-linear-gradient(
    90deg,
    var(--title-bar) 0px,
    var(--title-bar) 10px,
    transparent 10px,
    transparent 14px
  );
  animation: win98-progress-slide 1.5s linear infinite;
}

@keyframes win98-progress-slide {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

.viewer-progress-text {
  font-size: 14px;
  margin-top: 8px;
}

.viewer-label {
  padding: 4px 8px;
  background: var(--win-bg);
  font-size: 12px;
  border: 1px inset var(--win-bg);
}

/* ── Photo Grid ────────────────────────────────────────── */
.photo-grid {
  overflow: hidden;
  position: relative;
  border: 2px inset var(--win-bg);
  background: #1a1a2e;
}

.photo-track {
  display: flex;
  animation: conveyor 60s linear infinite;
  width: max-content;
}

.photo-track figure {
  position: relative;
  margin: 0;
  flex-shrink: 0;
  width: 200px;
  height: 200px;
}

.photo-track img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  display: block;
}

.photo-track figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 11px;
  padding: 4px 6px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.photo-track figure:hover figcaption {
  opacity: 1;
}

@keyframes conveyor {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.photo-grid:hover .photo-track {
  animation-play-state: paused;
}

/* ── Blog Post (individual) ────────────────────────────── */
.post-title {
  font-size: 36px;
  margin-bottom: 4px;
}

.post-meta {
  font-size: 12px;
  color: var(--win-dark);
  margin-bottom: 20px;
}

.post-body {
  line-height: 1.8;
  max-width: 65ch;
}

.post-body p {
  margin-bottom: 16px;
}

/* ── GIF Helpers ───────────────────────────────────────── */
.gif-float-left {
  float: left;
  margin: 0 12px 12px 0;
  width: 80px;
  image-rendering: pixelated;
}

.gif-float-right {
  float: right;
  margin: 0 0 12px 12px;
  width: 80px;
  image-rendering: pixelated;
}

.gif-inline {
  display: inline-block;
  width: 40px;
  vertical-align: middle;
  image-rendering: pixelated;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  body { padding: 0; }

  #site-chrome {
    margin: 0;
    border: none;
    box-shadow: none;
  }

  .content-area { padding: 12px; }

  .tab-nav a {
    padding: 4px 8px;
    font-size: 11px;
  }

  .tab-nav a img {
    width: 12px;
    height: 12px;
  }

  .projects-layout { flex-direction: column; }

  .viewer-panel {
    position: static;
  }

  #viewer-container { height: 350px; }
}

@media (max-width: 480px) {
  .tab-nav { flex-wrap: wrap; }

  .timeline-item { flex-direction: column; gap: 8px; }

  .timeline-item .gif-decoration { width: 40px; }
  .timeline-item .gif-decoration img { width: 40px; }
}
