/* style.css */
:root {
  --bg: #f5f5f5;
  --surface: #fff;
  --grid-dot: #e0e0e0;
  --border: #e5e5e5;
  --border-hi: #d4d4d4;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-secondary: #6366f1;
  --txt: #666;
  --txt-br: #1a1a1a;
  --val: #0a0a0a;
  --dim: #999;
  --fp: "Share Tech Mono", "Courier New", monospace;
  --fm: "Share Tech Mono", "Courier New", monospace;
  --vs-top: 72px;
  --vs-left: 64px;
  --vs-right: 64px;
  --vs-bottom: 72px;
}

body.dark-mode {
  --bg: #0a0a0a;
  --surface: #1a1a1a;
  --grid-dot: #1f1f1f;
  --border: #262626;
  --border-hi: #404040;
  --accent: #60a5fa;
  --accent-hover: #3b82f6;
  --accent-secondary: #818cf8;
  --txt: #a3a3a3;
  --txt-br: #f5f5f5;
  --val: #fafafa;
  --dim: #737373;
}

body.dark-mode {
  background: radial-gradient(circle, var(--grid-dot) 1px, transparent 1px) 0 0 / 24px 24px, #0a0a0a !important;
}

body.dark-mode #loader {
  background: #0a0a0a;
}

body.dark-mode #theme-toggle, body.dark-mode #blog-btn {
  background: var(--surface);
}

body.dark-mode #theme-toggle:hover, body.dark-mode #blog-btn:hover {
  background: var(--border-hi);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  overflow: hidden;
  background: radial-gradient(circle, var(--grid-dot) 1px, transparent 1px) 0 0 / 24px 24px, var(--bg);
  width: 100%;
  height: 100%;
  font-family: Inter, -apple-system, sans-serif;
}

#three-canvas {
  position: fixed;
  display: block;
  z-index: 0;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}

#scanlines {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, #0000, #0000 3px, #00000004 3px 4px);
  inset: 0;
}

#dither {
  position: fixed;
  z-index: 99;
  pointer-events: none;
  mix-blend-mode: overlay;
  animation: dither-drift 10s linear infinite;
  background-image: repeating-conic-gradient(#80808003 0% 25%, #0000 0% 50%);
  background-size: 4px 4px;
  inset: 0;
}

@keyframes dither-drift {
  to {
    transform: translate(4px, 4px);
  }
}

#loader {
  position: fixed;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  justify-content: center;
  align-items:  center;
  transition: opacity .8s, visibility .8s;
  inset: 0;
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-inner {
  text-align: center;
}

.loader-title {
  font-family: var(--fp);
  color: var(--accent);
  letter-spacing: 4px;
  margin-bottom: 24px;
  font-size: 20px;
}

.loader-bar {
  background: var(--border);
  width: 200px;
  height: 4px;
  margin: 0 auto 14px;
}

.loader-fill {
  background: var(--accent);
  width: 0%;
  height: 100%;
  transition: width .3s;
}

.loader-text {
  font-family: var(--fp);
  color: var(--txt);
  letter-spacing: 3px;
  animation: blink 1.2s step-end infinite;
  font-size: 12px;
}

#overlay {
  position: fixed;
  z-index: 2;
  pointer-events: none;
  font-family: var(--fm);
  color: var(--txt-br);
  inset: 0;
}

#exp-header {
  position: fixed;
  top: 0;
  left: var(--vs-left);
  right: var(--vs-right);
  height: var(--vs-top);
  display: flex;
  font-family: var(--fp);
  pointer-events: none;
  z-index: 10;
  justify-content: space-between;
  align-items:  center;
  padding-top: 4px;
}

.exp-left {
  display: flex;
  align-items:  center;
  gap: 8px;
}

.exp-right {
  display: flex;
  pointer-events: auto;
  align-items:  center;
  gap: 12px;
}

.exp-label {
  color: var(--val);
  letter-spacing: 5px;
  text-decoration: none;
  pointer-events: auto;
  transition: color .2s ease-out;
  font-size: 36px;
}

.exp-sep {
  color: var(--txt);
  font-size: 20px;
}

.exp-type {
  color: var(--txt-br);
  letter-spacing: 3px;
  font-size: 20px;
}

#theme-toggle {
  font-family: var(--fm);
  color: var(--val);
  letter-spacing: 3px;
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--surface);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: auto;
  align-self:  center;
  padding: 10px 28px;
  transition: background .2s ease-out, color .2s ease-out, border-color .2s ease-out;
  font-size: 14px;
  line-height: 1;
}

#theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

#theme-toggle.active {
  background: var(--val);
  color: #fff;
  border-color: var(--val);
}

#blog-btn {
  font-family: var(--fm);
  color: var(--val);
  letter-spacing: 3px;
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--surface);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-decoration: none;
  display: inline-block;
  padding: 10px 28px;
  transition: background .2s ease-out, color .2s ease-out, border-color .2s ease-out;
  font-size: 14px;
  line-height: 1;
}

#blog-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

#virtual-screen {
  position: fixed;
  top: var(--vs-top);
  left: var(--vs-left);
  right: var(--vs-right);
  bottom: var(--vs-bottom);
  pointer-events: none;
  z-index: 2;
  border: 1px solid var(--border);
}

#exp-footer {
  position: fixed;
  bottom: 0;
  left: var(--vs-left);
  right: var(--vs-right);
  height: var(--vs-bottom);
  display: flex;
  font-family: var(--fp);
  pointer-events: none;
  z-index: 4;
  justify-content: space-between;
  align-items:  center;
}

.ef-credit {
  color: var(--dim);
  letter-spacing: .5px;
  font-family: Inter, -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 300;
}

.mobile-content {
  display: contents;
}

#sidebar-l, #sidebar-r {
  position: fixed;
  top: calc(var(--vs-top)  + 6px);
  bottom: calc(var(--vs-bottom)  + 6px);
  display: flex;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  pointer-events: auto;
  z-index: 5;
  flex-direction: column;
  gap: 3px;
  width: 210px;
}

#sidebar-l::-webkit-scrollbar {
  display: none;
}

#sidebar-r::-webkit-scrollbar {
  display: none;
}

#sidebar-l {
  left: calc(var(--vs-left)  + 6px);
}

#sidebar-r {
  right: calc(var(--vs-right)  + 6px);
}

.panel {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow: hidden;
  position: relative;
  display: flex;
  border: 1px solid var(--border);
  background: #fff9;
  flex-direction: column;
  flex-shrink: 0;
  padding: 6px 8px;
  transition: transform .2s ease-out, box-shadow .2s ease-out;
}

.panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px #0000000f;
}

body.dark-mode .panel {
  background: #1a1a1a99;
}

body.dark-mode .panel:hover {
  box-shadow: 0 4px 12px #0000004d;
}

.ph {
  font-family: var(--fp);
  color: var(--accent);
  letter-spacing: .5px;
  white-space: nowrap;
  overflow: hidden;
  display: flex;
  flex-shrink: 0;
  align-items:  center;
  gap: 4px;
  margin-bottom: 4px;
  padding-bottom: 3px;
  font-size: 24px;
}

.dot {
  animation: pulse 2.5s ease-in-out infinite;
  border-radius: 50%;
  flex-shrink: 0;
  width: 4px;
  height: 4px;
}

.dot.g {
  background: var(--accent-secondary);
}

.dot.b {
  background: var(--accent);
}

.dot.a {
  background: var(--accent-hover);
}

.dot.p {
  background: var(--accent-secondary);
}

.pc {
  overflow: hidden;
  color: var(--txt-br);
  flex: 1;
  font-size: 20px;
  line-height: 1.4;
}

.skill-row {
  display: flex;
  align-items:  center;
  gap: 6px;
  margin-bottom: 4px;
}

.skill-name {
  color: var(--txt);
  flex-shrink: 0;
  min-width: 72px;
  font-size: 16px;
}

.skill-bar {
  background: var(--dim);
  flex: 1;
  height: 4px;
}

.skill-fill {
  background: var(--accent-secondary);
  height: 100%;
  transition: width .8s;
}

.career-entry {
  border-left: 2px solid var(--accent);
  margin-bottom: 8px;
  padding-left: 8px;
}

.career-year {
  font-family: var(--fp);
  color: var(--accent);
  letter-spacing: 1px;
  margin-bottom: 1px;
  font-size: 16px;
}

.career-role {
  color: var(--val);
  font-size: 16px;
  font-weight: 400;
}

.career-company {
  color: var(--txt);
  font-size: 16px;
}

.project-entry {
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  padding-bottom: 6px;
}

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

.project-name {
  font-family: var(--fp);
  color: var(--accent);
  letter-spacing: 1px;
  text-decoration: none;
  pointer-events: auto;
  display: inline-flex;
  align-items:  center;
  gap: 4px;
  margin-bottom: 2px;
  transition: color .2s ease-out;
  font-size: 16px;
}

.project-name:after {
  content: "→";
  display: inline-block;
  transition: transform .2s ease-out;
  font-size: 14px;
}

.project-name:hover {
  color: var(--accent-hover);
}

.project-name:hover:after {
  transform: translateX(3px);
}

.project-desc {
  color: var(--txt);
  margin-bottom: 2px;
  font-size: 16px;
  line-height: 1.4;
}

.project-tech {
  font-family: var(--fp);
  color: var(--dim);
  letter-spacing: .5px;
  font-size: 12px;
}

.link-row {
  display: flex;
  text-decoration: none;
  pointer-events: auto;
  color: var(--txt-br);
  align-items:  center;
  gap: 6px;
  padding: 4px 0;
  transition: color .2s ease-out;
}

.link-row:hover {
  color: var(--accent);
}

.link-icon {
  color: var(--accent-secondary);
  flex-shrink: 0;
  font-size: 12px;
}

.link-label {
  letter-spacing: 1px;
  font-size: 16px;
}

.link-arrow {
  opacity: 0;
  margin-left: auto;
  transition: opacity .2s ease-out, transform .2s ease-out;
  font-size: 14px;
  transform: translateX(-4px);
}

.link-row:hover .link-arrow {
  opacity: 1;
  transform: translateX(0);
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }

  50% {
    opacity: .35;
  }
}

@media (max-width: 1000px) {
  :root {
    --vs-top: 40px;
    --vs-left: 16px;
    --vs-right: 16px;
    --vs-bottom: 40px;
  }

  #sidebar-l, #sidebar-r {
    width: 120px;
  }

  .ph {
    font-size: 16px;
  }

  .pc {
    font-size: 15px;
  }

  .exp-label {
    letter-spacing: 3px;
    font-size: 22px;
  }

  .exp-type {
    font-size: 14px;
  }

  .ef-credit {
    font-size: 13px;
  }

  .skill-name {
    min-width: 50px;
    font-size: 14px;
  }

  .career-year, .career-role {
    font-size: 14px;
  }

  .career-company {
    font-size: 13px;
  }

  .project-name {
    font-size: 14px;
  }

  .project-desc {
    font-size: 13px;
  }

  .project-tech {
    font-size: 11px;
  }

  .link-label {
    font-size: 14px;
  }

  #theme-toggle, #blog-btn {
    padding: 8px 18px;
    font-size: 12px;
  }
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  html, body {
    overflow-y: auto;
    height: auto;
  }

  #three-canvas {
    inset: auto;
    position: relative !important;
    width: 100% !important;
    height: 60vh !important;
  }

  #scanlines, #dither {
    position: absolute;
    height: 60vh;
  }

  #overlay {
    position: relative;
    inset: auto;
  }

  #exp-header {
    position: fixed;
    background: var(--bg);
    z-index: 100;
    height: 48px;
    top: 0;
    left: 16px;
    right: 16px;
  }

  #virtual-screen {
    display: none;
  }

  #sidebar-l, #sidebar-r {
    position: static;
    display: contents;
    width: 100%;
  }

  .mobile-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 8px;
  }

  #sidebar-l .panel:first-child, #sidebar-r .panel:last-child {
    position: relative;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: fadeSlideIn .4s ease-out backwards;
    background: #ffffffb3;
    padding: 10px;
    box-shadow: 0 4px 16px #00000014;
  }

  #sidebar-l .panel:first-child {
    order: 1;
  }

  #sidebar-r .panel:last-child {
    order: 2;
  }

  #sidebar-l .panel:last-child {
    order: 3;
  }

  #sidebar-r .panel:first-child {
    order: 4;
  }

  #sidebar-l .panel:first-child .ph {
    margin-bottom: 6px;
    font-size: 13px;
  }

  #sidebar-l .panel:first-child .skill-row {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin-bottom: 6px;
  }

  #sidebar-l .panel:first-child .skill-name {
    min-width: unset;
    padding: 0;
    font-size: 13px;
  }

  #sidebar-l .panel:first-child .skill-bar {
    display: block;
    flex: none;
    width: 100%;
  }

  #sidebar-l .panel:first-child .skill-row:nth-child(n+6) {
    display: none;
  }

  #sidebar-r .panel:last-child .ph {
    margin-bottom: 6px;
    font-size: 13px;
  }

  #sidebar-r .panel:last-child .link-arrow {
    display: none;
  }

  #sidebar-r .panel:last-child .link-icon {
    padding: 2px;
    font-size: 14px;
  }

  #sidebar-r .panel:last-child .link-label {
    font-size: 13px;
  }

  #sidebar-r .panel:last-child .link-row {
    min-height: 36px;
    padding: 2px 0;
  }

  #sidebar-l .panel:last-child, #sidebar-r .panel:first-child {
    padding: 12px 14px;
  }

  .ph {
    margin-bottom: 8px;
    font-size: 16px;
  }

  .pc {
    font-size: 15px;
  }

  .skill-name {
    min-width: 72px;
    font-size: 14px;
  }

  .career-year {
    font-size: 14px;
  }

  .career-role {
    font-size: 15px;
  }

  .career-company, .project-name, .project-desc {
    font-size: 14px;
  }

  .project-tech {
    font-size: 12px;
  }

  .link-label {
    font-size: 15px;
  }

  #exp-footer {
    position: static;
    justify-content: center;
    height: auto;
    padding: 16px;
  }

  .ef-credit {
    font-size: 12px;
  }

  #theme-toggle, #blog-btn {
    letter-spacing: 1px;
    padding: 6px 14px;
    font-size: 10px;
  }

  .exp-label {
    letter-spacing: 2px;
    font-size: 18px;
  }

  .exp-sep, .exp-type {
    display: none;
  }

  .exp-right {
    gap: 6px;
  }

  body.dark-mode #sidebar-l .panel:first-child, body.dark-mode #sidebar-r .panel:last-child {
    background: #1a1a1ab3;
    box-shadow: 0 4px 16px #0006;
  }
}

@media (max-width: 480px) {
  #sidebar-l .panel:first-child, #sidebar-r .panel:last-child {
    padding: 8px;
  }

  .mobile-content {
    grid-template-columns: 1fr 1fr;
  }

  #sidebar-l .panel:last-child, #sidebar-r .panel:first-child {
    grid-column: 1 / -1;
  }
}
