/* ============================================
   Portfolio Template
   Colors: #14213D (accent), #E5E5E5 (secondary),
           #FFFFFF (background), #FCA311 (highlight)
   ============================================ */

:root {
  --bg: #FFFFFF;
  --bg-secondary: #E5E5E5;
  --accent: #14213D;
  --accent-dark: #14213D;
  --accent-soft: #FCA311;
  --text: #14213D;
  --text-light: rgba(20, 33, 61, 0.78);
  --text-muted: rgba(20, 33, 61, 0.62);
  --border: #E5E5E5;
  --white: #FFFFFF;

  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', monospace;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  --space-2xl: 8rem;

  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1100px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.125rem, 2vw, 1.375rem); }

p {
  margin-bottom: var(--space-sm);
  color: var(--text-light);
}

p:last-child {
  margin-bottom: 0;
}

/* Utilities */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Page Transition */
.page-content {
  opacity: 0;
  transform: translateY(12px);
  animation: pageEnter 0.5s ease-out forwards;
}

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

/* Navigation */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: var(--transition);
}

.site-header.scrolled {
  border-bottom-color: var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: -0.03em;
}

.logo span {
  color: var(--accent-soft);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-link {
  position: relative;
  font-size: 0.9375rem;
  font-weight: 450;
  color: var(--text-light);
  padding: 0.25rem 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent-soft);
  transition: width 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-cta {
  padding: 0.5rem 1.25rem;
  border: 1.5px solid var(--accent-soft);
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  background: transparent;
  transition: var(--transition);
}

.nav-cta:hover {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  color: var(--text);
}

/* Mobile Menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text);
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .main-nav {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: var(--space-md);
    gap: var(--space-sm);
    border-bottom: 1px solid var(--border);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
  }

  .main-nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .nav-link {
    font-size: 1.125rem;
    padding: 0.5rem 0;
  }
}

/* Main Content */
main {
  min-height: 100vh;
  padding-top: 72px;
}

/* Sections */
section {
  padding: var(--space-2xl) 0;
}

section.alt {
  background: var(--bg-secondary);
}

.section-header {
  margin-bottom: var(--space-lg);
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: var(--space-xs);
}

.section-title {
  margin-bottom: var(--space-sm);
}

.section-desc {
  max-width: 600px;
  font-size: 1.125rem;
}

/* Hero */
.hero {
  padding: var(--space-2xl) 0;
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
}

.hero-content {
  max-width: 720px;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: var(--space-md);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-soft);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

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

.hero h1 {
  margin-bottom: var(--space-md);
  line-height: 1.1;
}

.hero h1 em {
  color: var(--accent);
  font-style: normal;
  text-decoration: underline;
  text-decoration-color: var(--accent-soft);
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.12em;
}

.hero p {
  font-size: 1.25rem;
  max-width: 540px;
  margin-bottom: var(--space-lg);
  color: var(--text-light);
}

.hero-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 100px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-soft);
  color: var(--text);
  border-color: var(--accent-soft);
}

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-soft);
  color: var(--text);
  transform: translateY(-2px);
}

/* Cards */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  transition: var(--transition);
}

.card:hover {
  border-color: var(--accent-soft);
  transform: translateY(-4px);
}

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.card-link:hover {
  color: inherit;
}

/* Project Cards */
.project-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.project-card .project-thumb {
  aspect-ratio: 16 / 10;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.project-card .project-thumb::after {
  content: attr(data-initial);
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-muted);
  opacity: 0.3;
}

.project-card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.25rem;
}

.project-card p {
  font-size: 0.9375rem;
  margin-bottom: var(--space-xs);
}

.project-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  background: var(--bg-secondary);
  color: var(--text-light);
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
}

.skill-category h3 {
  font-size: 1rem;
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border);
}

.skill-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.skill-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9375rem;
  color: var(--text-light);
}

.skill-list li::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent-soft);
  border-radius: 50%;
  opacity: 0.6;
}

/* Experience Timeline */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-lg);
}

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

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 0.35rem;
  width: 9px;
  height: 9px;
  background: var(--bg);
  border: 2px solid var(--accent-soft);
  border-radius: 50%;
  transform: translateX(-4px);
}

.timeline-item h3 {
  font-size: 1.125rem;
  margin-bottom: 0.25rem;
}

.timeline-item .role {
  font-size: 0.9375rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.timeline-item .period {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  font-family: var(--font-mono);
}

.timeline-item p {
  font-size: 0.9375rem;
}

/* Blog / Article List */
.article-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.article-item {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.article-item:first-child {
  padding-top: 0;
}

.article-item:last-child {
  border-bottom: none;
}

.article-item a {
  display: block;
  color: inherit;
}

.article-item a:hover h3 {
  color: var(--accent);
}

.article-item h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  transition: color 0.2s ease;
}

.article-item .article-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Article Page */
.article-header {
  padding: var(--space-xl) 0 var(--space-lg);
}

.article-header h1 {
  margin-bottom: var(--space-sm);
}

.article-body {
  max-width: 720px;
}

.article-body h2 {
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
  font-size: 1.5rem;
}

.article-body h3 {
  margin-top: var(--space-md);
  margin-bottom: var(--space-xs);
}

.article-body p {
  margin-bottom: var(--space-md);
  line-height: 1.75;
}

.article-body ul,
.article-body ol {
  margin-bottom: var(--space-md);
  padding-left: 1.5rem;
}

.article-body li {
  margin-bottom: 0.5rem;
  color: var(--text-light);
}

.article-body pre {
  background: var(--bg-secondary);
  padding: var(--space-md);
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  margin-bottom: var(--space-md);
}

.article-body code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-secondary);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}

.article-body pre code {
  background: none;
  padding: 0;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}

@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.contact-info h2 {
  margin-bottom: var(--space-sm);
}

.contact-info p {
  margin-bottom: var(--space-md);
}

.social-links {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-light);
  transition: var(--transition);
}

.social-links a:hover {
  border-color: var(--accent-soft);
  color: var(--text);
  transform: translateY(-2px);
}

/* Form */
.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 0.9375rem;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent-soft);
}

.form-group textarea {
  resize: vertical;
  min-height: 140px;
}

/* Footer */
.site-footer {
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--border);
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.site-footer p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

/* Breadcrumb */
.breadcrumb {
  padding: var(--space-md) 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-light);
}

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

.breadcrumb span {
  margin: 0 0.5rem;
  color: var(--text-muted);
}

/* Grids */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Link with arrow */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 500;
  font-size: 0.9375rem;
}

.link-arrow svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.link-arrow:hover svg {
  transform: translateX(3px);
}

/* Page Header */
.page-header {
  padding: var(--space-xl) 0 var(--space-lg);
}

.page-header h1 {
  margin-bottom: var(--space-xs);
}

.page-header p {
  font-size: 1.125rem;
  max-width: 600px;
}

/* Custom Cursor (desktop only) */
@media (pointer: fine) {
  .custom-cursor {
    position: fixed;
    width: 12px;
    height: 12px;
    background: var(--accent-soft);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.5;
    transition: transform 0.15s ease, opacity 0.15s ease;
    transform: translate(-50%, -50%);
    mix-blend-mode: multiply;
  }

  .custom-cursor.hover {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 0.25;
  }
}

/* Print */
@media print {
  .site-header,
  .site-footer,
  .menu-toggle,
  .custom-cursor {
    display: none !important;
  }

  main {
    padding-top: 0;
  }
}
