:root {
  --bg: #f5f4f2;
  --bg-spot: #e6e2dc;
  --panel: #ffffff;
  --panel-2: #f0eeea;
  --text: #1b1a19;
  --muted: #5c5854;
  --accent: #2f2d2a;
  --accent-2: #6b655f;
  --line: #d7d2cb;
  --chip: #f3f1ee;
  --btn-bg: #1b1a19;
  --btn-text: #f5f4f2;
}

body[data-theme="dark"] {
  --bg: #1f1c1d;
  --bg-spot: #3b3436;
  --panel: #2a2728;
  --panel-2: #1a1819;
  --text: #f3f1f2;
  --muted: #b1aeb0;
  --accent: #d4d1cc;
  --accent-2: #9a948e;
  --line: #4a4446;
  --chip: #2f2a2c;
  --btn-bg: #f3f1f2;
  --btn-text: #1f1c1d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(1200px 900px at 70% -20%, var(--bg-spot) 0%, var(--bg) 55%) fixed;
  color: var(--text);
  font-family: "Trebuchet MS", "Gill Sans", "Calibri", sans-serif;
  letter-spacing: 0.2px;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  width: 100%;
  max-width: 1120px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px clamp(12px, 4vw, 56px) 56px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.brand {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.6px;
}

.nav-links {
  display: flex;
  gap: 22px;
  font-size: 14px;
  color: var(--muted);
}

.nav-links a:hover {
  color: var(--text);
}

.nav-icons {
  display: flex;
  gap: 10px;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  background: var(--panel-2);
}

.icon-btn svg {
  width: 14px;
  height: 14px;
  fill: var(--text);
}

.theme-toggle {
  border: 1px solid var(--line);
  background: var(--btn-bg);
  color: var(--btn-text);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
  fill: var(--btn-text);
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  margin: 0 0 32px;
  padding: 18px 0 40px;
}

.hero h1 {
  font-size: 42px;
  margin: 10px 0 8px;
  color: var(--accent);
}

.hero h1 span {
  display: block;
  color: var(--text);
}

.hero p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  max-width: 420px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.portrait-card {
  background: linear-gradient(140deg, var(--panel), var(--panel-2));
  padding: 16px;
  border-radius: 24px;
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  min-height: 240px;
  max-width: 240px;
}

.portrait {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 22px;
  object-fit: cover;
  position: relative;
  overflow: hidden;
}

.portrait:before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(0, 0, 0, 0.4), transparent 45%),
    radial-gradient(circle at 60% 20%, rgba(0, 0, 0, 0.4), transparent 45%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.45));
  mix-blend-mode: multiply;
}

.section {
  margin-top: 28px;
  padding-top: 12px;
}

.section-title {
  font-size: 22px;
  text-transform: capitalize;
  color: var(--accent);
  margin: 0 0 10px;
}

.sub-title {
  margin: 8px 0 14px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
}

.sub-section {
  margin-top: 12px;
}

#projects .about-text {
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 12px;
}

#projects .work-title {
  font-size: 13px;
}

#projects .work-meta {
  font-size: 11px;
}

#projects .work-body {
  padding: 12px 14px 16px;
}

#projects .work-thumb {
  height: auto;
}

.divider {
  height: 1px;
  background: var(--line);
  margin-bottom: 16px;
}

.about-text {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 22px;
  max-width: 1120px;
}

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

.skill {
  background: var(--chip);
  border-radius: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
}

.skill h4 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--text);
}

.skill span {
  color: var(--muted);
  font-size: 12px;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 18px;
  max-width: 500px;
  margin: 0 auto;
}

.work-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.work-thumb {
  background: linear-gradient(120deg, var(--panel-2), var(--line));
  padding: 0;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
}

.work-thumb-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  transition: transform 0.3s ease;
  pointer-events: none;
  user-drag: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  display: block;
}

.work-thumb-inner {
  width: 80%;
  height: 100%;
  background: var(--panel);
  border-radius: 10px;
  position: relative;
}

.work-thumb-inner:after {
  content: "";
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: var(--panel-2);
  right: 12px;
  top: 12px;
}

.work-body {
  padding: 16px 18px 20px;
}

.work-title {
  margin: 0 0 6px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.work-meta {
  color: var(--muted);
  font-size: 12px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 26px;
  align-items: start;
}

.contact-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.contact-form {
  display: grid;
  gap: 14px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  padding: 10px 6px;
  font-size: 13px;
  font-family: inherit;
}

.contact-form textarea {
  min-height: 90px;
  resize: vertical;
}

.contact-card {
  display: grid;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--chip);
}

.contact-item {
  display: grid;
  gap: 4px;
}

.contact-label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.contact-value {
  font-size: 14px;
  color: var(--text);
}

.footer {
  margin-top: 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.footer-icons {
  display: flex;
  gap: 10px;
}

/* Hero subtitle */
.hero-subtitle {
  font-size: 18px;
  color: var(--accent-2);
  margin-bottom: 8px;
  font-weight: 500;
}

/* Experience */
.experience-item {
  margin-bottom: 24px;
}

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.exp-header h3 {
  margin: 0;
  font-size: 16px;
  color: var(--text);
}

.exp-date {
  font-size: 13px;
  color: var(--muted);
}

.exp-company {
  font-size: 14px;
  color: var(--accent-2);
  margin: 4px 0 12px;
}

/* Projects */
.project-item {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

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

.project-title {
  margin: 0 0 8px;
  font-size: 17px;
  color: var(--text);
}

.project-desc {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 12px;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tag {
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--muted);
}

/* Education */
.edu-item h3 {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--text);
}

/* Contact link */
.contact-link {
  color: var(--accent);
  transition: color 0.2s;
}

.contact-link:hover {
  color: var(--text);
}

@media (max-width: 900px) {
  .hero {
    flex-direction: column;
    text-align: center;
  }

  .skills {
    grid-template-columns: 1fr;
  }

  .work-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 24px 18px 48px;
  }

  .nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: 12px 16px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .portrait-card {
    padding: 16px;
  }

  .portrait {
    height: 220px;
  }
}