﻿
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@400;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Varela+Round&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500&display=swap');

/* slightly safer selector if you add the class to html instead of :root */
html.theme-transition,
html.theme-transition body,
html.theme-transition .site-header,
html.theme-transition .sidebar,
html.theme-transition main,
html.theme-transition .content,
html.theme-transition .project-card,
html.theme-transition .code-block,
html.theme-transition pre,
html.theme-transition .nav-btn,
html.theme-transition .site-btn,
html.theme-transition .site-footer,
html.theme-transition .sidebar-btn,
html.theme-transition .sidebar-header,
html.theme-transition .code-panel,
html.theme-transition .page-title {
  transition: background-color 420ms ease, color 420ms ease, border-color 420ms ease, box-shadow 420ms ease;
}

:root {
  --bg: #121212;
  --surface: #1c1c1c;
  --surface-active: #2a2a2a;
  --text: #e6e6e6;
  --text-subtle: #999;
  --accent: #f5a524;
  --accent-hover: #7F2CCB;
  --font: Poppins, sans-serif;

  --sidebar-width: 220px;
}

html[data-theme="light"] {
  --bg: #fdfdfd;
  --surface: #f0f0f0;
  --surface-active: #e0e0e0;
  --text: #111;
  --text-subtle: #666;
  --accent: #7F2CCB;
  --accent-hover: #b84700;
  --font: Poppins, sans-serif;
}

html[data-theme="retro"] {
  --bg: #0f1a20;
  --surface: #1e2a30;
  --surface-active: #2a363c;
  --text: #d5d9d9;
  --text-subtle: #999;
  --accent: #ff66cc;
  --accent-hover: #ffcc00;
  --font: "Tiny5", cursive;
}

html[data-theme="dracula"] {
  --bg: #282a36;              /* main background */
  --surface: #343746;         /* card / block background */
  --surface-active: #44475a;  /* hover/active surface */
  --text: #f8f8f2;            /* primary text */
  --text-subtle: #6272a4;     /* secondary text */
  --accent: #bd93f9;          /* purple accent */
  --accent-hover: #ff79c6;    /* pink hover accent */
  --font: Poppins, sans-serif;
}

html[data-theme="solarized"] {
  --bg: #002b36;              /* base03 */
  --surface: #073642;         /* base02 */
  --surface-active: #586e75;  /* base01 */
  --text: #93a1a1;            /* base0 */
  --text-subtle: #839496;     /* base00 */
  --accent: #b58900;          /* yellow accent */
  --accent-hover: #cb4b16;    /* orange hover accent */
  --font: Poppins, sans-serif;
}

html[data-theme="nier"] {
  --bg: #EDE8DA;
  --surface: #E6DFCC;
  --surface-active: #D8CFB6;
  --text: #222220;
  --text-subtle: #6B655B;
  --accent: #2C2C2C;
  --accent-hover: #B38A54;
  --font:  'Noto Sans JP', sans-serif
}

/* === Page transition container === */
main {
  position: relative;
  overflow-x: hidden;
}

.page-transition {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.page-transition.show {
  opacity: 1;
  transform: translateX(0);
}

/* ===== Selfie or Graphics ===== */
.selfie {
  border-radius: 50%;
  border: 2px solid var(--accent);
  width: 200px;
  height: 240px;
  float: right;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
  display: flex;
  transform: translateY(-80px);
}

@media (max-width: 768px) {
  .selfie {
    transform: translateY(-30px);
  }
}

/* ===== Main Content Layout ===== */
.content {
  max-width: 1100px; /* keep text/code from going too wide */
  margin: 0 auto; /* center horizontally */
  padding: 2rem;
  line-height: 1.6;
  animation: slideInContent 0.5s ease forwards;
}

.content.slide-in {
  animation: slideInContent 0.5s ease forwards;
}

@keyframes slideInContent {
  from {
    transform: translateX(30px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.content h2 {
  color: var(--accent);
  margin-top: 2rem;
}

.content p {
  margin-bottom: 1.2rem;
  font-size: 1.15rem;
  color: var(--text);
}

/* Theme toggle stays small next to buttons */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.3rem;
  display: flex;
  align-items: center;
}

.theme-toggle img {
  width: 32px;
  height: 32px;
  background-color: #E6E6E6;
  border-radius: 50%;
  padding: 2px;
  transition: transform 0.3s ease;
}

.theme-toggle:hover img {
  transform: rotate(20deg);
}

/* Adjust for room on wide screens */
@media (min-width: 1400px) {
  .content {
    max-width: 1200px;
    padding: 2rem 4rem;
  }
}

/* ===== Links in theme ===== */
a {
  color: var(--accent); /* Purple accent */
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-hover); /* Orange hover */
  text-decoration: underline;
}

/* Placeholder images */
.placeholder-img {
  display: block;
  margin: 1.5rem auto;
  max-width: 100%;
  border: 2px solid #2a2a2a;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
}

/* Gallery */
.gallery {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}

.gallery img {
  flex: 1 1 300px;
  max-width: 100%;
  border-radius: 6px;
  border: 1px solid #2a2a2a;
  transition: transform 0.2s ease;
}

.gallery img:hover {
  transform: scale(1.03);
  border-color: var(--accent);
}

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: var(--surface);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.75rem;
  border-bottom: 1px solid #2a2a2a;
  z-index: 1000;
  box-sizing: border-box;
}

.site-header-btn {
  width: 24px;
  overflow: hidden;
  height: auto;
  margin-right: .5rem;
  vertical-align: middle;
}

.site-header-icon {
  width: 24px;
  height: auto;
  fill: currentColor;
  vertical-align: middle;
  margin-right: .1rem;
}

.site-header-icon-inv {
  width: 24px;
  height: auto;
  fill: currentColor;
  vertical-align: middle;
  margin-right: .1rem;
}

/* Push body content down so it’s not hidden behind fixed header */
body {
  margin: 0;
  padding-top: 60px;
  font-family: var(--font), sans-serif;
  background: var(--bg);
  color: var(--text);
}

p .segment {
  font-size: 1.15rem;
  font-family: var(--font), sans-serif;
  color: #e6e6e6;
}

/* Left side */
.site-btn {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  color: var(--text);
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  padding: .4rem .8rem;
}

.site-btn:hover {
  color: var(--accent);
  background-color: var(--surface-active);
  transition: background-color, ease 0.3s;
}

.logo {
  width: 42px;
  border-radius: 50%;
  overflow: hidden;
  background-color: black;
  height: auto;
  margin-right: .5rem;
}

/* Group nav + theme toggle neatly */
.header-right-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Make nav buttons still look like buttons */
.nav-btn {
  background: var(--surface);
  border: none;
  color: var(--text);
  padding: .4rem .8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background .2s, color .2s;
  display: inline-block;
  text-align: center;
  vertical-align: middle;
}

.nav-btn:hover {
  background: var(--surface-active);
  color: var(--accent);
  fill: var(--accent);
}

.hire-btn {
  background: var(--accent);
  fill: var(--text);
  color: #fff;
  text-decoration: none;
}

.hire-btn:hover {
  background: var(--accent-hover);
  fill: #111;
  color: #111;
  transition: background-color ease .3s, fill ease .3s;
}

/* Hamburger (hidden on desktop) */
.hamburger {
  display: none;
  font-size: 1.5rem;
  background: none;
  border: none;
  color: #e6e6e6;
  cursor: pointer;
}

/* Hamburger */
.hamburger {
  display: none;
  font-size: 1.5rem;
  background: none;
  border: none;
  color: #e6e6e6;
  cursor: pointer;
  margin-left: auto;
}

/* Mobile nav dropdown */
.mobile-nav {
  display: none;
  position: absolute;
  top: 60px;
  right: 0;
  background: #1c1c1c;
  width: 100%;
  flex-direction: column;
  border-top: 1px solid #2a2a2a;
  border-bottom: 1px solid #2a2a2a;
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.mobile-nav .nav-btn {
  width: 100%;
  text-align: left;
  border-radius: 0;
  padding: 0.8rem 1rem;
}

.mobile-nav.open {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

/* Responsive rules */
@media (max-width: 768px) {
  .header-right {
    display: none; /* hide desktop nav */
  }

  .hamburger {
    display: block; /* show hamburger */
  }
}

.page-title {
  margin: 0;
  overflow: hidden; /* hides the slide overflow */
}

.title-slide {
  font-size: 2rem;
  font-weight: 700;
  opacity: 1;
}

.subtitle-slide {
  font-size: 1rem;
  color: #aaa;
  margin-top: .5rem;
  opacity: 1;
}

/* Custom Scrollbars */
.sidebar::-webkit-scrollbar,
main::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-thumb,
main::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

.sidebar::-webkit-scrollbar-track,
main::-webkit-scrollbar-track {
  background: var(--surface);
}

/* Sidebar scrollbar on LEFT side */
.sidebar {
  direction: rtl;
}

.sidebar > * {
  direction: ltr;
}

/* ===== Footer =====*/
.site-footer {
  background: var(--surface);
  border-top: 2px solid var(--surface);
  padding: 2rem 1rem;
  font-family: var(--font, 'Noto Sans JP', sans-serif), sans-serif;
  color: var(--text);
}

/* Footer grid layout */
.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  padding-left: var(--sidebar-width, 220px); /* accounts for sidebar */
  transition: padding-left 0.3s ease;
  list-style-type: none;
}

.footer-col h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid var(--text-subtle);
  padding-bottom: 0.3rem;
  list-style-type: none;
}

.footer-col ul {
  padding: 0;
  margin: 0;
  list-style-type: none;
}

.footer-col ul li {
  margin: 0.4rem 0;
  list-style-type: none;
}

.footer-col a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

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

.footer-col p {
  margin: 0.4rem 0;
  line-height: 1.4;
}

/* Footer responsive */
@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
    text-align: center;
    padding-left: 0;
  }

  .footer-col {
    min-width: 100%;
  }
}
