:root{
  --bg: #fefefe;
  --text: #333;
  --teal: #1aa6a6;
  --teal-2: #0e7f7f;
  --border: rgba(51,51,51,.12);
  --muted: rgba(51,51,51,.72);
  --shadow: 0 10px 30px rgba(0,0,0,.06);
  --radius: 16px;
  --max: 1080px;
  --pad: 20px;
}

*{ box-sizing: border-box; }
html{ height: 100%; }

body{
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "LINE Seed JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.6;
}

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

a:focus-visible{
  outline: 3px solid rgba(26,166,166,.35);
  outline-offset: 3px;
  border-radius: 10px;
}

.container{
  width: min(var(--max), calc(100% - var(--pad) * 2));
  margin: 0 auto;
}

/* Header */
header{
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  background: rgba(254,254,254,.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.header-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.header-actions{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.brand{
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-weight: 700;
  letter-spacing: .2px;
}

.brand .dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 0 0 6px rgba(26,166,166,.12);
  transform: translateY(-2px);
}

.brand small{
  font-weight: 600;
  color: var(--muted);
}

nav ul{
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link{
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted);
  transition: 160ms ease;
}

.nav-link:hover{
  color: var(--text);
  border-color: var(--border);
  background: rgba(26,166,166,.06);
}

.nav-link.active{
  color: var(--teal-2);
  border-color: rgba(26,166,166,.35);
  background: rgba(26,166,166,.08);
}

.lang-toggle{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: white;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  transition: 160ms ease;
  box-shadow: 0 6px 18px rgba(0,0,0,.04);
}

.lang-toggle:hover{
  transform: translateY(-1px);
  border-color: rgba(26,166,166,.35);
  background: rgba(26,166,166,.06);
}

.lang-toggle:focus-visible{
  outline: 3px solid rgba(26,166,166,.35);
  outline-offset: 3px;
}

/* Hero */
.hero{
  padding: 34px 0 18px;
  margin: 1rem 0;
}
.hero h1{
  margin: 0 0 8px;
  color: var(--teal);
  font-size: clamp(26px, 4vw, 40px);
  letter-spacing: -0.4px;
  line-height: 1.15;
}
.hero p{
  margin: 0;
  color: var(--muted);
  line-height: 2;
  max-width: 70ch;
}
.hero .cta-row{
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: white;
  box-shadow: 0 6px 18px rgba(0,0,0,.04);
  transition: 160ms ease;
  font-weight: 650;
}
.btn:hover{
  transform: translateY(-1px);
  border-color: rgba(26,166,166,.35);
  box-shadow: 0 10px 26px rgba(0,0,0,.06);
}
.btn.primary{
  background: var(--teal);
  color: #fefefe;
  border-color: rgba(0,0,0,.08);
}
.btn.primary:hover{
  background: var(--teal-2);
  border-color: rgba(0,0,0,.12);
}

/* Main */
main{
  padding: 10px 0 36px;
}

.section-title{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 42px 0 12px;
}
.section-title h2{
  margin: 0;
  font-size: 18px;
  letter-spacing: .1px;
}
.section-title span{
  color: var(--muted);
  font-size: 14px;
}

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

.card{
  grid-column: span 6;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: 180ms ease;
  display: flex;
  flex-direction: column;
}
.card:hover{
  transform: translateY(-2px);
  border-color: rgba(26,166,166,.30);
}

.thumb{
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, rgba(26,166,166,.10), rgba(26,166,166,.02));
  border-bottom: 1px solid var(--border);
  display: grid;
  place-items: center;
}

.thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-body{
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.meta{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.tag{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--teal-2);
  background: rgba(26,166,166,.10);
  border: 1px solid rgba(26,166,166,.18);
}

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

.card h3{
  margin: 0;
  font-size: 16px;
  letter-spacing: .1px;
}

.card p{
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.card-actions{
  margin-top: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.link{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(254,254,254,.7);
  transition: 160ms ease;
  font-weight: 650;
  font-size: 13px;
  color: var(--text);
}
.link:hover{
  border-color: rgba(26,166,166,.35);
  background: rgba(26,166,166,.06);
  transform: translateY(-1px);
}

/* Side projects */
.side-scroll{
  --visible-cards: 4;
  --side-gap: 16px;
  display: flex;
  gap: var(--side-gap);
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.side-card{
  flex: 0 0 calc((100% - (var(--side-gap) * (var(--visible-cards) - 1))) / var(--visible-cards));
  min-width: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: 180ms ease;
  scroll-snap-align: start;
}

.side-card:hover{
  transform: translateY(-2px);
  border-color: rgba(26,166,166,.30);
}

.side-thumb{
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2; /* 600 x 400 */
  background: linear-gradient(135deg, rgba(26,166,166,.10), rgba(26,166,166,.02));
  border-bottom: 1px solid var(--border);
}

div.side-thumb{ cursor: default; }

.side-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.side-card-body{
  gap: 8px;
}

.side-card h3{
  font-size: 16px;
  margin: 8px 0;
}

/* Footer */
footer{
  border-top: 1px solid var(--border);
  padding: 18px 0 30px;
}

.footer-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-inner p{
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.social{
  display: flex;     /* flexbox as requested */
  gap: 10px;
  flex-wrap: wrap;   /* easy to add more later */
  align-items: center;
}

.icon-btn{
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: white;
  transition: 160ms ease;
  box-shadow: 0 6px 18px rgba(0,0,0,.04);
}
.icon-btn:hover{
  border-color: rgba(26,166,166,.35);
  background: rgba(26,166,166,.06);
  transform: translateY(-1px);
}

/* hover-tip */
.hover-tip{
  position: fixed;
  pointer-events: none;
  z-index: 200;
  background: rgba(254,254,254,.75);
  backdrop-filter: blur(10px);
  border: 1px solid var(--teal);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--teal);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 140ms ease, transform 140ms ease;
}
.hover-tip.visible{
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 860px){
  .card{ grid-column: span 12; }
  .header-inner{
    padding: 12px 0;
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .header-actions{
    width: 100%;
    justify-content: space-between;
  }
  .side-scroll{ --visible-cards: 2.2; }
}

@media (max-width: 560px){
  .header-actions{
    justify-content: flex-end;
  }
  nav{
    width: 100%;
  }
  nav ul{
    justify-content: flex-start;
  }
  .side-scroll{ --visible-cards: 1.2; }
}
