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

/* ===== Custom Properties ===== */
:root {
  --color-dark: #1a2f3d;
  --color-mid: #2d6476;
  --color-light: #7fbcc8;
  --color-bg: #f3f8f8;
  --color-surface: #ffffff;
  --color-border: #cddfe3;
  --color-pill: #a8d4de;
  --font-stack: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-width: 1100px;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(26, 47, 61, 0.08);
}

/* ===== Typography ===== */
h1, h2, h3 {
  line-height: 1.25;
}

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--color-light) var(--color-bg);
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-light);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-mid);
}

/* ===== Page Load Animation ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

main {
  animation: fadeInUp 0.5s ease-out;
}

body {
  font-family: var(--font-stack);
  background: var(--color-bg);
  color: var(--color-dark);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

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

/* ===== Navigation ===== */
.nav {
  position: sticky;
  top: 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  z-index: 100;
  padding: 0 24px;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-dark);
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  color: var(--color-dark);
  font-size: 0.95rem;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-mid);
  border-bottom-color: var(--color-mid);
}

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-dark);
  margin: 5px 0;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ===== Footer ===== */
.footer {
  margin-top: auto;
  background: var(--color-dark);
  color: var(--color-border);
  text-align: center;
  padding: 24px;
  font-size: 0.85rem;
}

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

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

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 8px;
}

/* ===== Utility ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 60px 0;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  border: 2px solid transparent;
  text-align: center;
}

.btn-primary {
  background: var(--color-dark);
  color: var(--color-bg);
  border-color: var(--color-dark);
}

.btn-primary:hover {
  background: var(--color-mid);
  border-color: var(--color-mid);
  color: var(--color-surface);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(26, 47, 61, 0.2);
}

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

.btn-secondary:hover {
  background: rgba(26, 47, 61, 0.06);
  color: var(--color-mid);
  border-color: var(--color-mid);
}

.pill {
  display: inline-block;
  background: var(--color-pill);
  color: var(--color-dark);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid rgba(26, 47, 61, 0.08);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 64px;
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 16px 24px;
    gap: 16px;
    box-shadow: var(--shadow);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-hamburger {
    display: block;
  }

  .section {
    padding: 40px 0;
  }
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-dark);
  color: var(--color-bg);
  padding: 14px 24px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  box-shadow: 0 4px 20px rgba(26, 47, 61, 0.2);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 200;
  max-width: 500px;
  text-align: center;
}

.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== Hero (Landing Page) ===== */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  min-height: calc(100vh - 64px - 73px);
  position: relative;
  overflow: hidden;
}

.hero-name {
  font-size: clamp(2.2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--color-dark);
  margin-bottom: 12px;
}

.hero-tagline {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--color-mid);
  margin-bottom: 36px;
  max-width: 500px;
}

.hero-ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 300px;
  pointer-events: none;
}

/* hero font sizes handled by clamp() above */

/* ===== About Page ===== */
.about {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.about-photo-img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
}

.about-text h1 {
  font-size: 2rem;
  margin-bottom: 16px;
  color: var(--color-dark);
}

.about-text p {
  margin-bottom: 16px;
  font-size: 1.05rem;
  color: var(--color-dark);
  line-height: 1.7;
}

/* ===== Page Titles ===== */
.page-title {
  font-size: 2rem;
  margin-bottom: 8px;
  color: var(--color-dark);
}

.page-subtitle {
  color: var(--color-mid);
  margin-bottom: 40px;
  font-size: 1.05rem;
}

/* ===== Projects Page ===== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  color: var(--color-dark);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(26, 47, 61, 0.12);
  color: var(--color-dark);
}

.project-thumb {
  background: var(--color-border);
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--color-bg);
}

.project-thumb-placeholder {
  color: var(--color-mid);
  font-size: 0.9rem;
}

.project-info {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-info h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.project-info p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-mid);
  margin-bottom: 12px;
  flex: 1;
}

.project-note {
  font-size: 0.8rem;
  font-weight: normal;
  font-style: italic;
  color: var(--color-mid);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

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

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

/* ===== Resume Page ===== */
.resume-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 16px;
}

.resume {
  max-width: 800px;
}

.resume-section {
  margin-bottom: 48px;
}

.resume-section h2 {
  font-size: 1.4rem;
  color: var(--color-mid);
  margin-bottom: 24px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-border);
}

.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--color-border);
}

.timeline-item {
  position: relative;
  margin-bottom: 32px;
}

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

.timeline-marker {
  position: absolute;
  left: -28px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-light);
  border: 2px solid var(--color-surface);
  box-shadow: 0 0 0 2px var(--color-light);
}

.timeline-content h3 {
  font-size: 1.1rem;
  color: var(--color-dark);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.timeline-date {
  font-size: 0.85rem;
  color: var(--color-mid);
  white-space: nowrap;
}

.timeline-company {
  font-size: 0.9rem;
  color: var(--color-mid);
  margin-bottom: 8px;
}

.timeline-content p:last-child {
  font-size: 0.95rem;
  line-height: 1.6;
}

.timeline-bullets {
  margin: 4px 0 0 18px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.timeline-bullets li {
  margin-bottom: 4px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.skills-group h3 {
  font-size: 0.95rem;
  color: var(--color-dark);
  margin-bottom: 12px;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

  .timeline-header {
    flex-direction: column;
    gap: 2px;
  }
}

/* ===== Services — Style Picker ===== */
.style-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.style-card {
  width: 100%;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.style-card:hover {
  border-color: var(--color-mid);
}

.style-card[aria-pressed="true"] {
  border-color: var(--color-mid);
  box-shadow: 0 0 0 3px rgba(61, 122, 138, 0.2);
}

.style-card-preview {
  height: 120px;
  border-radius: 6px;
  margin-bottom: 8px;
  padding: 8px;
  overflow: hidden;
}

.style-card-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-dark);
}

/* Mini mockup building blocks */
.sp-nav {
  display: flex;
  justify-content: space-between;
  font-size: 6px;
  margin-bottom: 6px;
  padding: 2px 4px;
  border-radius: 2px;
}

.sp-hero {
  text-align: center;
  padding: 8px 0;
  margin-bottom: 6px;
}

.sp-hero-text {
  height: 4px;
  width: 60%;
  margin: 0 auto 4px;
  border-radius: 2px;
}

.sp-hero-btn {
  height: 6px;
  width: 30%;
  margin: 0 auto;
  border-radius: 3px;
}

.sp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}

.sp-grid div {
  height: 20px;
  border-radius: 2px;
}

.sp-cols {
  display: flex;
  gap: 3px;
}

.sp-sidebar {
  width: 30%;
  height: 30px;
  border-radius: 2px;
}

.sp-main {
  flex: 1;
  height: 30px;
  border-radius: 2px;
}

/* Modern style preview */
.style-preview-modern {
  background: #1a1a2e;
}

.style-preview-modern .sp-nav {
  color: #e0e0e0;
  background: rgba(255, 255, 255, 0.05);
}

.style-preview-modern .sp-hero-text {
  background: #e0e0e0;
}

.style-preview-modern .sp-hero-btn {
  background: #4a9ff5;
}

.style-preview-modern .sp-grid div {
  background: rgba(255, 255, 255, 0.08);
}

/* Classic style preview */
.style-preview-classic {
  background: #faf5ee;
}

.style-preview-classic .sp-nav {
  color: #5c4a32;
  background: rgba(92, 74, 50, 0.08);
}

.style-preview-classic .sp-hero-text {
  background: #5c4a32;
}

.style-preview-classic .sp-hero-btn {
  background: #8b6914;
}

.style-preview-classic .sp-sidebar {
  background: rgba(92, 74, 50, 0.1);
}

.style-preview-classic .sp-main {
  background: rgba(92, 74, 50, 0.05);
}

/* Bold style preview */
.style-preview-bold {
  background: #ff6b35;
}

.style-preview-bold .sp-nav {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

.style-preview-bold .sp-hero-full {
  text-align: center;
  padding: 12px 0;
  margin-bottom: 6px;
}

.style-preview-bold .sp-hero-full .sp-hero-text {
  background: #fff;
  height: 4px;
  width: 60%;
  margin: 0 auto 4px;
  border-radius: 2px;
}

.style-preview-bold .sp-hero-full .sp-hero-btn {
  background: #1a1a2e;
  height: 6px;
  width: 30%;
  margin: 0 auto;
  border-radius: 3px;
}

.style-preview-bold .sp-grid {
  grid-template-columns: repeat(2, 1fr);
}

.style-preview-bold .sp-grid div {
  background: rgba(255, 255, 255, 0.2);
}

/* Minimal style preview */
.style-preview-minimal {
  background: #ffffff;
  border: 1px solid #eee;
}

.sp-nav-minimal {
  font-size: 7px;
  color: #333;
  padding: 2px 4px;
  margin-bottom: 10px;
}

.sp-hero-minimal {
  text-align: center;
  padding: 14px 0;
  margin-bottom: 6px;
}

.sp-hero-minimal .sp-hero-text {
  background: #333;
  height: 3px;
  width: 40%;
  margin: 0 auto;
  border-radius: 2px;
}

.sp-content-minimal {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px;
}

.sp-content-minimal div {
  height: 3px;
  background: #ddd;
  border-radius: 2px;
}

.sp-content-minimal div:last-child {
  width: 70%;
}

/* Expanded preview */
.style-expanded {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 48px;
  box-shadow: var(--shadow);
}

.style-expanded-inner {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.style-expanded-name {
  font-size: 1.4rem;
  margin-bottom: 8px;
  color: var(--color-dark);
}

.style-expanded-desc {
  color: var(--color-mid);
  margin-bottom: 24px;
  line-height: 1.6;
}

.style-expanded-preview {
  height: 200px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  padding: 16px;
  overflow: hidden;
}

.style-expanded-cta {
  display: inline-block;
}

/* ===== Services — Contact Form ===== */
.contact-section {
  padding-top: 48px;
}

.contact-section h2 {
  font-size: 1.6rem;
  margin-bottom: 8px;
  color: var(--color-dark);
}

.contact-form {
  max-width: 700px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-family: var(--font-stack);
  font-size: 0.95rem;
  color: var(--color-dark);
  background: var(--color-bg);
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-mid);
  box-shadow: 0 0 0 3px rgba(45, 100, 118, 0.2);
  background: var(--color-surface);
}

.form-submit {
  width: 100%;
  margin-top: 8px;
}

.form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-success,
.form-error {
  max-width: 700px;
  text-align: center;
  padding: 40px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form-success h3 {
  color: var(--color-mid);
  margin-bottom: 8px;
}

.form-error p {
  margin-bottom: 16px;
}

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

  .style-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .style-expanded {
    padding: 20px;
  }
}
