:root {
  --bg: #f4f1ea;
  --paper: #fffdf8;
  --ink: #1f2a2c;
  --muted: #586467;
  --line: #d7d0c3;
  --accent: #c6452d;
  --accent-soft: #f5d8cf;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 0% 0%, #ebe6da 0%, transparent 36%),
    radial-gradient(circle at 100% 100%, #e5ede5 0%, transparent 34%),
    var(--bg);
  line-height: 1.6;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image: radial-gradient(#000 0.45px, transparent 0.45px);
  background-size: 4px 4px;
}

.lang-switch {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 3;
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem;
  background: color-mix(in srgb, #ffffff 85%, #f1e8d8 15%);
  backdrop-filter: blur(8px);
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: "Manrope", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.45rem 0.68rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease;
}

.lang-btn:hover {
  color: var(--ink);
}

.lang-btn.is-active {
  color: #fff;
  background: var(--accent);
}

.layout {
  position: relative;
  z-index: 1;
  width: min(1160px, calc(100% - 2rem));
  margin: 2rem auto;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.25rem;
}

.sidebar {
  position: sticky;
  top: 1.4rem;
  align-self: start;
  background: color-mix(in srgb, var(--paper) 90%, #f1e8d8 10%);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.4rem;
}

.eyebrow {
  margin: 0;
  font-size: 0.77rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

h1,
h2,
h3,
h4 {
  font-family: "Fraunces", serif;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.2;
}

h1 {
  margin-top: 0.4rem;
  font-size: clamp(2rem, 4vw, 2.4rem);
}

.intro {
  margin: 1rem 0 1.15rem;
  color: var(--muted);
}

.sidebar nav {
  display: grid;
  gap: 0.55rem;
}

.sidebar nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  padding: 0.35rem 0;
  border-bottom: 1px dashed transparent;
  transition: border-color 180ms ease, color 180ms ease;
}

.sidebar nav a:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent 50%);
}

.status {
  margin: 1rem 0 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 18%, transparent 82%);
}

.profile-link {
  margin: 0.85rem 0 0;
}

.profile-link a {
  color: var(--accent);
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.content {
  display: grid;
  gap: 1rem;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.45rem;
}

.hero {
  background: linear-gradient(140deg, #fff9ee 0%, #fffdf8 68%);
}

.hero h2 {
  font-size: clamp(1.4rem, 3.2vw, 2rem);
}

.hero p {
  margin: 0.75rem 0 0;
  color: var(--muted);
}

.hero-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.detail-actions {
  align-items: center;
}

.button,
.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.95rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
}

.button {
  color: #fff;
  background: var(--accent);
}

.ghost {
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
}

.section-head p {
  margin: 0.45rem 0 0;
  color: var(--muted);
}

.grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.project-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  background: #fff;
  transition: transform 180ms ease, border-color 180ms ease,
    box-shadow 180ms ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line) 50%);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 12%, transparent 88%);
}

.card h4 {
  font-size: 1.06rem;
}

.card p {
  margin: 0.3rem 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.project-tag {
  margin-top: 0.45rem;
  color: var(--accent) !important;
  font-weight: 700;
}

.project-note {
  margin-top: 0.55rem !important;
}

.card-actions {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.button-sm {
  padding: 0.42rem 0.72rem;
  border-radius: 8px;
  font-size: 0.88rem;
}

.detail-layout {
  width: min(860px, calc(100% - 2rem));
  grid-template-columns: 1fr;
}

.detail-header h2 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
}

.detail-sub {
  margin: 0.5rem 0 0;
  color: var(--accent);
  font-weight: 700;
}

.key-list {
  margin: 0.7rem 0 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.38rem;
}

.tech-line {
  margin: 0.6rem 0 0;
  color: var(--ink);
  font-weight: 600;
}

.video-wrap {
  margin-top: 0.75rem;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.video-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.video-link {
  margin: 0.6rem 0 0;
}

.video-link a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.quick-jump {
  margin-top: 0.95rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0.9rem;
}

.quick-jump-title {
  margin: 0;
  font-weight: 700;
  color: var(--ink);
}

.quick-jump-sub {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.updates {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.updates li {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  background: #fff;
}

.date {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.updates p {
  margin: 0.25rem 0 0;
}

.contact a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

@media (max-width: 920px) {
  .layout {
    grid-template-columns: 1fr;
    width: min(860px, calc(100% - 1.4rem));
  }

  .sidebar {
    position: relative;
    top: 0;
  }
}

@media (max-width: 640px) {
  .lang-switch {
    top: 0.7rem;
    right: 0.7rem;
  }

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

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

  .panel,
  .sidebar {
    border-radius: 16px;
    padding: 1rem;
  }

  .home-actions {
    flex-direction: column;
  }

  .home-actions .button,
  .home-actions .ghost {
    width: 100%;
  }

  .card-actions .button,
  .card-actions .ghost {
    width: auto;
  }
}
