@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Inter:wght@400;500;600;700&display=swap');

/* ============================================================
   Google brand color tokens + minimal tech theme
   ============================================================ */
:root {
  --g-blue:   #4285F4;
  --g-red:    #EA4335;
  --g-yellow: #FBBC04;
  --g-green:  #34A853;

  --bg:        #ffffff;
  --bg-soft:   #f8f9fa;
  --bg-elev:   #ffffff;
  --border:   #e8eaed;
  --border-strong: #dadce0;

  --text:      #202124;
  --text-soft: #5f6368;
  --text-muted:#80868b;

  --accent:    var(--g-blue);

  --nav-bg:        rgba(255, 255, 255, 0.75);
  --nav-bg-mobile: rgba(255, 255, 255, 0.97);
  --grid-line:     rgba(66, 133, 244, 0.025);

  --font-mono: 'JetBrains Mono', 'Share Tech Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --radius:    8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 2px rgba(60, 64, 67, 0.06);
  --shadow:    0 1px 3px rgba(60, 64, 67, 0.08), 0 1px 2px rgba(60, 64, 67, 0.04);

  --nav-height: 64px;
  --transition: 200ms ease;
}

/* Dark palette — shared between system-preference and explicit toggle */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #0f1115;
    --bg-soft:   #1a1d23;
    --bg-elev:   #16191f;
    --border:        #2a2e36;
    --border-strong: #3a3f48;

    --text:      #e8eaed;
    --text-soft: #9aa0a6;
    --text-muted:#7a8089;

    --nav-bg:        rgba(15, 17, 21, 0.75);
    --nav-bg-mobile: rgba(15, 17, 21, 0.97);
    --grid-line:     rgba(66, 133, 244, 0.05);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow:    0 4px 12px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3);
  }
}

:root[data-theme="dark"] {
  --bg:        #0f1115;
  --bg-soft:   #1a1d23;
  --bg-elev:   #16191f;
  --border:        #2a2e36;
  --border-strong: #3a3f48;

  --text:      #e8eaed;
  --text-soft: #9aa0a6;
  --text-muted:#7a8089;

  --nav-bg:        rgba(15, 17, 21, 0.75);
  --nav-bg-mobile: rgba(15, 17, 21, 0.97);
  --grid-line:     rgba(66, 133, 244, 0.05);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow:    0 4px 12px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.3);
}

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

html {
  font-family: var(--font-sans);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: var(--nav-height);
  line-height: 1.6;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
}

/* ============================================================
   Navbar
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  z-index: 999;
}

.navbar-brand,
.navbar-brand:hover,
.navbar-brand:focus,
.navbar-brand:visited {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.navbar-brand::before {
  content: '>';
  color: var(--g-blue);
  font-weight: 700;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-soft);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 0;
  transition: color var(--transition), border-color var(--transition), background-color var(--transition);
}

.theme-toggle:hover {
  color: var(--g-blue);
  border-color: var(--g-blue);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--g-blue);
  outline-offset: 2px;
}

.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }

:root[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun  { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

.navbar-menu {
  list-style: none;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.navbar-menu li a {
  position: relative;
  display: inline-block;
  padding: 8px 14px;
  color: var(--text-soft);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: color var(--transition), background-color var(--transition);
}

.navbar-menu li a:hover {
  color: var(--text);
  background: var(--bg-soft);
}

.navbar-menu li a.active {
  color: var(--g-blue);
}

.navbar-menu li a.active::before {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2px;
  background: var(--g-blue);
  border-radius: 1px;
}

/* ============================================================
   Layout
   ============================================================ */
.main-content {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 4rem 1.5rem;
}

.container {
  max-width: 960px;
  width: 100%;
  text-align: center;
}

/* ============================================================
   Home / hero
   ============================================================ */
.profile-ring {
  display: inline-block;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(
    var(--g-blue)  0deg   120deg,
    var(--g-red)   120deg 240deg,
    var(--g-green) 240deg 360deg
  );
  box-shadow: 0 8px 24px rgba(66, 133, 244, 0.22);
}

.profile-img {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg);
  display: block;
}

.profile-caption {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-soft);
  letter-spacing: 0.02em;
}

.profile-caption::before { content: '// '; color: var(--g-yellow); }

.glitch {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 1.5rem;
  letter-spacing: -0.02em;
}

.glitch::after {
  content: '_';
  color: var(--g-blue);
  animation: blinkCursor 1s steps(2, end) infinite;
  margin-left: 4px;
}

h2 {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-soft);
  margin: 1.25rem 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.static-text {
  font-size: 1.05rem;
  line-height: 1.7;
  margin: 0.75rem auto 2rem;
  max-width: 640px;
  color: var(--text-soft);
}

.keywords {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--g-green);
  border-right: 2px solid var(--g-green);
  white-space: nowrap;
  overflow: hidden;
  display: inline-block;
  width: 12ch;
  min-height: 1.5em;
  vertical-align: bottom;
  animation: blinkCursor 0.8s steps(2, end) infinite;
}

@keyframes blinkCursor {
  0%, 50%   { border-right-color: var(--g-green); opacity: 1; }
  51%, 100% { border-right-color: transparent;    opacity: 0.5; }
}

/* ============================================================
   Buttons
   ============================================================ */
.buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  font-family: var(--font-mono);
  padding: 10px 20px;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  min-width: 120px;
  text-align: center;
  border: 1px solid transparent;
  transition: transform var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }

.btn.blue   { background-color: var(--g-blue);   color: #fff; }
.btn.green  { background-color: var(--g-green);  color: #fff; }
.btn.red    { background-color: var(--g-red);    color: #fff; }
.btn.yellow { background-color: var(--g-yellow); color: var(--text); }

.btn.blue:hover   { background-color: #3367d6; }
.btn.green:hover  { background-color: #2c8c46; }
.btn.red:hover    { background-color: #c5362c; }
.btn.yellow:hover { background-color: #e0a800; }

/* ============================================================
   Social icons
   ============================================================ */
.social-icons {
  margin-top: 2.5rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.social-icons a {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 16px;
  color: var(--text-soft);
  background: var(--bg-elev);
  transition: color var(--transition), border-color var(--transition), transform var(--transition);
}

.social-icons a:hover {
  color: var(--g-blue);
  border-color: var(--g-blue);
  transform: translateY(-2px);
}

/* ============================================================
   Footer
   ============================================================ */
footer {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  background-color: var(--bg);
  padding: 1.25rem 1rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* ============================================================
   Skills
   ============================================================ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
  text-align: left;
}

.skill-category {
  background: var(--bg-elev);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), transform var(--transition);
  position: relative;
  overflow: hidden;
}

.skill-category::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  background: var(--g-blue);
}

.skill-category:nth-child(4n+1)::before { background: var(--g-blue); }
.skill-category:nth-child(4n+2)::before { background: var(--g-red); }
.skill-category:nth-child(4n+3)::before { background: var(--g-yellow); }
.skill-category:nth-child(4n+4)::before { background: var(--g-green); }

.skill-category:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.skill-category h3 {
  font-family: var(--font-mono);
  font-weight: 600;
  margin-bottom: 0.75rem;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.skill-category ul { list-style: none; padding: 0; }

.skill-category ul li {
  padding: 0.35rem 0 0.35rem 1rem;
  color: var(--text-soft);
  font-size: 0.9rem;
  position: relative;
}

.skill-category ul li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

/* ============================================================
   Experience / timeline
   ============================================================ */
.experience-section { background: transparent; color: var(--text); }

.section-title {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  margin-bottom: 3rem;
  letter-spacing: -0.02em;
  display: block;
}

.section-title.blue   { color: var(--g-blue); }
.section-title.red    { color: var(--g-red); }
.section-title.yellow { color: var(--g-yellow); }
.section-title.green  { color: var(--g-green); }

.timeline {
  position: relative;
  max-width: 920px;
  margin: auto;
  padding: 0 20px;
}

.timeline::after {
  content: '';
  position: absolute;
  width: 2px;
  background-color: var(--border-strong);
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

.timeline-item {
  padding: 14px 36px;
  position: relative;
  width: 50%;
}

.timeline-item .content {
  background: var(--bg-elev);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  border-left: 3px solid currentColor;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.timeline-item.right .content { border-left: 1px solid var(--border); border-right: 3px solid currentColor; }

.timeline-item .content:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.timeline-item.left  { left: 0; }
.timeline-item.right { left: 50%; }

.timeline-item::before {
  content: '';
  position: absolute;
  top: 24px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid currentColor;
  z-index: 1;
}

.timeline-item.left::before  { right: -7px; }
.timeline-item.right::before { left: -7px; }

.timeline-item.blue   { color: var(--g-blue); }
.timeline-item.red    { color: var(--g-red); }
.timeline-item.yellow { color: var(--g-yellow); }
.timeline-item.green  { color: var(--g-green); }

.timeline-item h3 {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: currentColor;
  margin-bottom: 4px;
}

.timeline-item h4,
.timeline-item p {
  color: var(--text-soft);
}

.timeline-item h4 {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-soft);
  margin-bottom: 8px;
}

.timeline-item .date {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding: 2px 8px;
  background: var(--bg-soft);
  border-radius: 4px;
  border: 1px solid var(--border);
}

.timeline-item p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-soft);
}

/* ============================================================
   Blogs
   ============================================================ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  text-align: left;
}

.blog-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-3px);
  border-color: var(--g-blue);
  box-shadow: var(--shadow);
}

.blog-thumbnail {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

.blog-content {
  padding: 1.25rem 1.5rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-title {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: var(--text);
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.blog-excerpt {
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  flex: 1;
}

.blog-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-block;
  color: var(--g-blue);
  text-decoration: none;
  transition: color var(--transition);
}

.blog-link:hover { color: #3367d6; }

/* ============================================================
   Mobile nav toggle
   ============================================================ */
.navbar-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
}

.navbar-toggle .bar {
  width: 22px;
  height: 2px;
  background-color: var(--text);
  margin: 3px 0;
  transition: var(--transition);
  border-radius: 2px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (min-width: 768px) {
  .glitch       { font-size: 2.5rem; }
  .static-text  { font-size: 1.1rem; }
  .section-title { font-size: 2rem; }
}

@media screen and (max-width: 768px) {
  .timeline::after { left: 16px; }

  .timeline-item {
    width: 100%;
    padding-left: 40px;
    padding-right: 8px;
  }

  .timeline-item.right { left: 0; }

  .timeline-item.left::before,
  .timeline-item.right::before { left: 9px; right: auto; }

  .timeline-item.right .content {
    border-left: 3px solid currentColor;
    border-right: 1px solid var(--border);
  }
}

@media (max-width: 768px) {
  .navbar { padding: 0 1rem; }

  .navbar-toggle { display: flex; }

  .navbar-menu {
    display: flex;
    flex-direction: column;
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--nav-bg-mobile);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    gap: 0;
  }

  .navbar-menu.active {
    max-height: 320px;
    padding: 0.5rem 0 1rem;
  }

  .navbar-menu li { width: 100%; text-align: center; }

  .navbar-menu li a {
    display: block;
    font-size: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 0;
  }

  .navbar-menu li a.active::before {
    left: 50%;
    right: auto;
    bottom: 8px;
    width: 24px;
    transform: translateX(-50%);
  }
}

@media (max-width: 600px) {
  footer { font-size: 0.75rem; }
  .main-content { padding: 2rem 1rem; }
  .glitch { font-size: 1.6rem; }
}

/* ============================================================
   Selection
   ============================================================ */
::selection {
  background: rgba(66, 133, 244, 0.2);
  color: var(--text);
}
