.profile-pic{
  width:130px;
  height:130px;
  overflow:hidden;
  margin:-31px auto;
  margin-left:-7px;
  border:6px solid rgba(0,77,64,.4);
  border-radius:50%;
}

.profile-pic img {
  width: 100%;
  height: auto;
}

.theme-toggle .icon-sun-and-moon{
  position: absolute;
  top: 50%;
  left: -18px;                    
  transform: translateY(-50%);     
  width: 32px;
  height: 32px;
  pointer-events: none;            
}

.theme-toggle .icon-sun-and-moon img{
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.tracker {
  /* visibility: hidden; */
  position: fixed;
  /* margin-inline-end: auto;  */
  bottom: 0; 
  right: 0;
}
.theme-toggle .switch,
.theme-toggle .switch::before,
.theme-toggle .switch::after{
  all: unset !important; 
}

.icon-btn {
  margin-left: auto;
  width: 50px;
  height: 50px;
  border: 0;
  color: #FFFFFF;
  cursor: pointer;
  font-size: 30px;
  line-height: 70px;
  border-radius: 45px;
  display: inline-block;
  margin: 4px;
}

.github {
  color: rgb(0, 0, 0);
}

.angellist {
  color: rgb(128, 128, 128);
}

.icon-btn:hover {
  transform: scale(1.10);
  color: #FFFFFF;
}

:root { color-scheme: light dark; }

/* light-mode */
:root{
  --bg: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --card: #f8fafc;
  --brand: #0d9488;   
  --border: #e2e8f0;
}

/* dark-mode */
:root[data-theme="dark"]{
  --bg: #0b1220;
  --text: #ffffff;
  --muted: #ffffff;
  --card: #0f172a;
  --brand: #14b8a6;
  --border: #1f2937;
}

/* Dark mode text overrides (only)*/
:root[data-theme="dark"] {
  --text: #ffffff;
  --muted: #e5e7eb;   
}

:root[data-theme="dark"] body,
:root[data-theme="dark"] .section,
:root[data-theme="dark"] .card-content, 
:root[data-theme="dark"] p,
:root[data-theme="dark"] li,

:root[data-theme="dark"] h1,
:root[data-theme="dark"] h2,
:root[data-theme="dark"] h3,
:root[data-theme="dark"] h4,
:root[data-theme="dark"] h5,
:root[data-theme="dark"] h6 {
  color: #c7b9b9 !important;
}

:root[data-theme="dark"] .grey-text,
:root[data-theme="dark"] ul.side-nav.fixed.table-of-contents li:not(.logo) a span,
:root[data-theme="dark"] .card li a,
:root[data-theme="dark"] .card li a:hover,
:root[data-theme="dark"] .card-action span,
:root[data-theme="dark"] .card ul li li {
  color: #284e5f !important;
}

:root[data-theme="dark"] a { color: #7dd3fc !important; }
:root[data-theme="dark"] a:hover,
:root[data-theme="dark"] a:focus { color: #ffffff !important; }

body{ background: var(--bg); color: var(--text); }
.card{ background: var(--card); border:1px solid var(--border); }
a{ color: var(--brand); }
.nav, header, footer{ background: var(--card); }

.theme-toggle{
  position: fixed;
  top: 16px;                 
  right: 16px;            
  z-index: 1000;             
}

/* (iOS notch) */
@supports (padding: max(0px)) {
  .theme-toggle{
    top: max(16px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
  }
}

/* for small monitor */
@media (max-width: 480px){
  .theme-toggle{ top: 12px; right: 12px; }
}

.angellist:hover {
  background-color: grey;
}

.github:hover {
  background-color: black;
}

/* Buttons - Read Me, Contact Us */
.readme {
  position: relative;
  padding: 11px 35px;
  background: #fff;
  color: #00796b;
  border: 2px solid #fff;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 1px;
  display: inline-block;
  border-radius: 5px;
  -webkit-border-radius: 5px;
}

.contactme {
  position: relative;
  padding: 11px 35px;
  background: none;
  color: #fff;
  border: 2px solid #fff;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 1px;
  display: inline-block;
  margin-top: 1.5em;
  border-radius: 5px;
  -webkit-border-radius: 5px;
}

.contactme:hover{
  color: #00796b;
  background-color: white;
}
/* main body */

/* body-color */

body {
  color: #333;
  font-size: 18px;
}

a {
  color: #004d40;
}

blockquote {
  border-left: 5px solid #795548;
  color: #795548;
  font-size: 125%;
  font-weight: 400;
  margin: 20px 0;
  padding-left: 1.5rem;
}

blockquote * {
  font-size: inherit;
  line-height: inherit;
}

.text-center {
  text-align: center;
}

/* main nav */

nav {
  background: white;
  box-shadow: none;
  height: 0;
}

nav i {
  padding: 0 15px;
  position: relative;
  top: 5px;
}

main {
  padding-left: 190px;
}

dl {
  margin-top: 0.5rem;
}

dd {
  display: inline-block;
  font-weight: 500;
  margin-left: 0;
}

dt {
  display: inline-block;
  margin-left: 0.5rem;
}

ul.side-nav {
  width: 190px;
}

ul.side-nav li {
  padding: 0;
}

ul.side-nav.fixed a {
  box-sizing: content-box;
  color: rgb(16, 202, 56);
  display: block;
  line-height: 100%;
  padding: 10px 0 12px;
}

ul.table-of-contents li.logo a.active, ul.table-of-contents li.logo a:hover {
  border: none;
  font-weight: 200;
}

ul.side-nav.fixed li.logo {
  background-color: #fafafa;
  border-bottom: 1px solid #ddd;
  box-sizing: content-box;
  min-height: 90px;
  padding: 30px 30px 40px;
}

ul.side-nav.fixed li.logo a {
  font-weight: 200;
  line-height: 100%;
}

ul.table-of-contents li:not(.logo) a.active, ul.table-of-contents li:not(.logo) a:hover {
  background-color: #fafafa;
  border-left: 3px solid;
}

ul.side-nav.fixed.table-of-contents li:not(.logo) a span, ul#slide-out li:not(.logo) a span {
  color: #333 !important;
}

li.logo span {
  display: block;
  font-size: 14px;
}

.brand-logo h1 {
  font-size: inherit;
  line-height: inherit;
  margin: inherit;
  font-weight: inherit;
}

.container {
  width: 95%;
}

h3 {
  font-weight: 200;
  margin-bottom: 60px;
  margin-top: 0;
  padding: 30px 40px;
  text-transform: uppercase;
}

.section {
  padding-bottom: 30px;
  padding-top: 0;
  position: relative;
}

.full-height {
  height: 100vh;
}

#intro.section {
  background: #a7ffeb repeat;
  position: relative;
}

#intro.section .container {
  color: white;
  font-weight: 200;
  left: 0;
  position: absolute;
  top: 0;
}

#intro.section .container *:not(span) {
  font-weight: 300;
  line-height: 150%;
  text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);
}

#intro.section .underline {
  border-bottom: 5px solid #24305e;
}

#intro.section .teal {
  padding: 0 10px;
}

.overlay {
  background-color: rgba(0, 0, 0, 0.4);
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
}

.waves-effect.waves-blue .waves-ripple {
  background-color: rgba(33, 150, 243, 0.2);
}

.card {
  margin-bottom: 60px;
}

.card .role {
  font-size: 1.25rem;
  position: absolute;
  right: 38px;
  top: 35px;
}

.card li a {
  margin-right: 0;
  color: #333;
  border-bottom: 2px solid #ffab40;
}

.card li a:hover {
  color: #333;
  font-weight: 500;
}

.card .card-content {
  padding-bottom: 30px;
}

.card .card-content p {
  padding: 5px 0 0;
}

.card h5 {
  font-size: 1.5rem;
  margin-bottom: -0.5rem;
  margin-top: 2rem;
}

.card h6 {
  font-weight: 300;
  letter-spacing: 1px;
  margin-top: 2rem;
  text-transform: uppercase;
}

#experience .card-action {
  background-color: rgba(0, 0, 0, 0.02);
  border: none;
}

#experience .card .col.s12.m2 a {
  display: block;
}

#experience .card .col.s12.m2 a img {
  max-height: 60px;
}

.card-action span {
  font-size: 85%;
  color: #666;
}

.card ul {
  margin-bottom: 0;
}

.card ul li {
  line-height: 200%;
  list-style-type: disc;
  margin-left: 24px;
}

.card ul li li {
  color: #666;
  font-size: 13px;
}

.card .card-title {
  font-size: 24px;
  color: #004d40;
}

.card .card-content .card-title {
  line-height: 2.5rem;
}

.card i.right {
  margin-left: 10px;
}

a.hoverline {
  border-bottom: 3px solid transparent !important;
  padding: 3px 3px 0 3px;
  transition: 0.25s all;
  -moz-transition: 0.25s all;
  -webkit-transition: 0.25s all;
}

a.hoverline:hover {
  border-bottom: 3px solid #004d40 !important;
}

#skills .card.large {
  height: 360px;
}

#skills h4 {
  border-bottom: 1px solid #ddd;
  margin-bottom: 30px;
  padding-bottom: 20px;
}

#skills .col img.responsive-img {
  margin: 0 auto;
  max-height: 100px;
  padding-bottom: 10px;
  text-align: center;
  vertical-align: middle;
  display: table-cell;
}

.card.large .card-content p {
  color: inherit;
  margin: 0;
  padding: 30px 0;
}

#experience .card-content .row {
  border-bottom: 1px solid #ddd;
  padding-bottom: 10px;
}

.card.large .card-image {
  height: 230px;
}

.card.large .card-content {
  height: auto;
}

.card.medium .card-image {
  height: 240px;
}

.card-action a.btn-floating {
  margin-bottom: 0;
}

#contact a:not(.btn-floating) {
  bottom: 6px;
  left: 20px;
  position: relative;
}

#experience .col.s12.m2 {
  text-align: center;
}

.fa-external-link:before {
  left: 3px;
  position: relative;
  top: 2px;
}

small {
  display: none;
}

.grey-text {
  color: #666 !important;
}

.teal-text {
  color: #008073 !important;
}

.teal {
  background-color: #008073 !important;
}

@media (min-width: 1200px) {
  #experience .container {
    width: 860px;
  }
}

@media (max-width: 1360px) {
  .card ul li {
    font-size: 14px;
    line-height: 200%;
    margin-left: 20px;
  }
}

@media (max-width: 1160px) {
  .card ul li {
    line-height: 150%;
  }
}

@media (max-width: 992px) {
  main {
    padding-left: 0px;
    padding-top: 64px;
  }
  ul.side-nav a {
    line-height: 100%;
    padding: 0;
    width: 100%;
  }
  nav {
    background: #fff;
    height: 64px;
    position: absolute;
  }
  nav a.button-collapse, nav a.button-collapse i {
    color: #009688;
    height: 56px;
    line-height: 56px;
  }
  h3 {
    padding: 20px 30px;
    margin-bottom: 40px;
  }
  .container {
    margin: 0 auto;
  }
  nav.hide-on-large.only.trigger {
    display: block;
    position: fixed;
    top: 0;
    z-index: 2;
  }
  .name-title {
    display: block;
    height: 100%;
    padding-top: 15px;
    text-align: center;
    width: 100%;
    position: absolute;
  }
  .name-title>span, .name-title>a {
    position: relative;
    line-height: 20px;
  }
  .name-title a {
    font-size: 22px;
    display: block;
  }
  .name-title span {
    display: block;
    font-size: 14px;
  }
  h3, .container {
    position: relative;
    top: 64px;
  }
  section#intro {
    margin-bottom: -64px;
  }
  .card .role {
    position: relative;
    right: initial;
    top: initial;
  }
}

@media (max-width: 600px) {
  h2 {
    font-size: 22px;
    line-height: 200%;
    margin: 30px 0 0;
  }
  #intro.section .container *:not(span) {
    padding: 0;
  }
  .card .card-content .card-title {
    font-size: 20px;
    line-height: 24px;
  }
  #experience span.card-title {
    text-align: center;
    display: block;
  }
  #experience span.card-title a {
    margin: 0;
  }
  i.mdi-navigation-close.right {
    position: relative;
    bottom: 15px;
  }
  #contact a:not(.btn-floating) {
    text-align: center;
    display: block;
    left: initial;
    bottom: initial;
  }
  #contact a.btn-floating.btn-large {
    display: block;
    text-align: center;
    margin: 0 auto;
  }
  #intro.section {
    background-position-x: 30%;
  }
}

.card.medium .card-image.swap-container.fit{
  position: relative;
  height: 240px;                 
  background: #f5f7f9;          
  overflow: hidden;
}

.card.medium .card-image.swap-container.fit img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 240px;
  object-fit: contain;          
  object-position: center;      
  display: block;
}

@keyframes swapOut { 0%,49%{opacity:1} 50%,100%{opacity:0} }
@keyframes swapIn  { 0%,49%{opacity:0} 50%,100%{opacity:1} }

.card.medium.hover-swap:hover .img1,
.card.medium .card-image.swap-container.fit:hover .img1 { animation: swapOut 0s infinite linear; }
.card.medium.hover-swap:hover .img2,
.card.medium .card-image.swap-container.fit:hover .img2 { animation: swapIn  2s infinite linear; }
.card.medium.hover-swap:hover .img3,
.card.medium .card-image.swap-container.fit:hover .img3 { animation: swapOut 0s infinite linear; }
.card.medium.hover-swap:hover .img4,
.card.medium .card-image.swap-container.fit:hover .img4 { animation: swapIn  2s infinite linear; }
.card.medium.hover-swap:hover .img5,
.card.medium .card-image.swap-container.fit:hover .img5 { animation: swapOut 0s infinite linear; }
.card.medium.hover-swap:hover .img6,
.card.medium .card-image.swap-container.fit:hover .img6 { animation: swapIn  2s infinite linear; }

@media (prefers-reduced-motion: reduce){
  .card.medium .card-image.swap-container.fit:hover .img1,
  .card.medium .card-image.swap-container.fit:hover .img2 { animation: none; }
  .card.medium .card-image.swap-container.fit:hover .img3,
  .card.medium .card-image.swap-container.fit:hover .img4 { animation: none; }
  .card.medium .card-image.swap-container.fit:hover .img5,
  .card.medium .card-image.swap-container.fit:hover .img6 { animation: none; }
}

.theme-toggle input{
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%);  
  overflow: hidden; white-space: nowrap;
  opacity: 0;
  appearance: none; -webkit-appearance: none;
  pointer-events: none;
}

.theme-toggle .theme-switch{
  position: relative;
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 999px;
  background: transparent; border: 0; box-shadow: none;
  cursor: pointer;
}

.theme-toggle .theme-switch::before,
.theme-toggle .theme-switch::after{ content: none !important; }
.theme-toggle .switch,
.theme-toggle .switch::before,
.theme-toggle .switch::after{ all: unset !important; }

.theme-toggle .icon-sun-and-moon{
  position: absolute; top: 50%; left: -18px; transform: translateY(-50%);
  width: 32px; height: 32px; pointer-events: none;
}
.theme-toggle .icon-sun-and-moon img{ 
  width:100%; 
  height:100%; 
  margin-left: 37px;
  display:block; 
}

.theme-toggle{ 
  position: fixed; 
  top:16px; right:16px; 
  z-index:1000; 
}

.theme-toggle{
  top: max(12px, env(safe-area-inset-top) + 8px);
  right: max(12px, env(safe-area-inset-right) + 8px);
  z-index: 9999;
}

@media (max-width: 600px){
  .theme-toggle .theme-switch{
    width: 48px;
    height: 48px;
  }

  .theme-toggle .icon-sun-and-moon{
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 26px !important;
    height: 26px !important;
  }

  .theme-toggle .icon-sun-and-moon img{
    margin-left: 0 !important;
  }
}

.theme-toggle { 
  transform: translateZ(0); 
}

.social .icon-btn.github{
  background-color: #14b8a6;   
  line-height: 50px;          
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.social .icon-btn.github i{
  color: #000;               
}

.social .icon-btn.github:hover{
  background-color: #000;     
}
.social .icon-btn.github:hover i{
  color: #fff;              
}

/* Contact card look */
.contact-card {
  border-radius: 14px;
  overflow: hidden;
}

/* label/materialize */
.input-field input[type=text],
.input-field input[type=email],
.input-field textarea {
  color: var(--text, #263238);
}

[data-theme="dark"] .input-field input[type=text],
[data-theme="dark"] .input-field input[type=email],
[data-theme="dark"] .input-field textarea {
  color: #fff;
}

.input-field input:focus,
.input-field textarea:focus {
  border-bottom: 2px solid #00897b !important; /* teal-ish */
  box-shadow: 0 1px 0 0 #00897b !important;
}

/* label focus */
.input-field input:focus + label,
.input-field textarea:focus + label {
  color: #00897b !important;
}

/* button */
#sendBtn {
  border-radius: 999px;
  padding: 0 22px;
}

/* status */
.status-msg {
  margin-left: 12px;
  font-size: 0.95rem;
  vertical-align: middle;
}

/* === Theme-aware Sidebar & Nav === */
nav,
ul.side-nav,
ul.side-nav.fixed,
ul.table-of-contents,
ul.side-nav.fixed li.logo,
ul.table-of-contents li.logo {
  background: var(--card) !important; 
}

ul.side-nav.fixed li.logo {
  border-bottom: 1px solid var(--border) !important;
}

ul.table-of-contents li:not(.logo) a.active,
ul.table-of-contents li:not(.logo) a:hover {
  border-left: 3px solid var(--brand) !important;
  background: transparent !important;
}

nav { background: var(--card) !important; }

/* ให้หัวข้อ h5 ในการ์ดของส่วน Skills มีช่องไฟเพิ่ม */
#skills .card h5{
  margin-bottom:16px !important;  /* จากเดิมที่ชิด/ติดลบ */
}

/* ถ้ายังอยากให้รูปห่างลงอีกนิด */
#skills .card .row{
  margin-top:20px;
}
