@import url('https://fonts.googleapis.com/css2?family=Redaction+20:ital,wght@0,400;0,700;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,700;1,400&display=swap');

/* colors */

:root 
{
    --teal: #104A4A;
    --bg:   #0F2A2A; 
    --sand: #EDD3C4;
    --card: rgba(0, 0, 0, 0.3);
    --line: rgba(237, 211, 196, 0.4);
}

* 
{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* body */

body
{
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    background: var(--bg);
    color: var(--sand);
    font-size: 1.1rem;
    line-height: 1.5;
    font-family: "Lora", serif;
}

input, select, button 
{
    font: inherit;
}
img 
{
    display: block; 
    max-width: 100%;
}

a 
{
    color: var(--sand);
}

/* header + nav */

header 
{
    position: sticky;
    top: 0;
    padding: 20px;
    background: var(--teal);
}

.navigation 
{
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px 40px;
}

.navigation a 
{
    position: relative;
    font-size: 1.1em;
    color: var(--sand);
    padding: 8px 16px;
    text-decoration: none;
}

.navigation a::after 
{
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 100%;
    height: 3px;
    background: var(--sand);
    border-radius: 5px;
    transform: scaleX(0);
    transition: transform .5s ;
}

.navigation a:hover::after,
.navigation a.active::after 
{
    transform: scaleX(1);
}

/* page structure */

main 
{
    flex: 1;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
}

footer 
{
    padding: 20px;
    text-align: center;
    background: var(--teal);
}

.page-title 
{
    font-size: 2.4em;
    text-align: center;
    margin-bottom: 30px;
}

/* building blocks*/

.card 
{
    padding: 24px;
    background: var(--card);
    border: 2px solid var(--teal);
    border-radius: 10px;
}

.card p + p 
{
    margin-top: 10px;
}

.card h3:not(:first-child) 
{
    margin-top: 20px;
}

.card ul, .card ol 
{
    padding-left: 1.4em;
}

.card li 
{
    margin-bottom: 4px;
}
.two-col 
{
    display: flex;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}
.stack 
{
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* forms */

input, select 
{
    padding: 8px 10px;
    background: var(--bg);
    color: var(--sand);
    border: 1px solid var(--line);
    border-radius: 6px;
}

input:focus, select:focus, button:focus-visible 
{
    outline: 2px solid var(--sand);
    outline-offset: 2px;
}

input[type="radio"] 
{ 
    padding: 0; 
    accent-color: var(--sand); 
}
 
button
{
    padding: 8px 18px;
    background: var(--sand);
    color: var(--bg);
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    transition: background .3s, color .3s;
}

button:hover 
{ 
    background: var(--teal); 
    color: var(--sand); 
}
 
.error  
{ 
    color: #f2b3aa; 
}

.result 
{ 
    font-size: 1.6rem; 
}
 
.history 
{ 
    list-style: none; 
    margin-bottom: 15px; 
}
.card .history 
{ 
    list-style: none; 
    padding-left: 0; 
}

.history li 
{ 
    padding: 6px 0; 
    border-bottom: 1px solid var(--line); 
    margin-bottom: 0; 
}

/* calculator*/

.calc-form 
{ 
    display: flex; 
    flex-wrap: wrap; 
    gap: 10px; 
}

.calc-form input 
{ 
    flex: 1 1 130px; 
    min-width: 0; 
}

.actions 
{ 
    display: flex; 
    flex-wrap: wrap; 
    gap: 8px; 
    margin-top: 15px; 
}

/*converter*/

.choices 
{ 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: center;
    gap: 10px 40px; 
    margin-bottom: 30px; 
}

.choice  
{ 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    cursor: pointer; 
}
 
.field 
{ 
    display: flex; 
    flex-direction: column; 
    gap: 8px;
}

.field + .field 
{ 
    margin-top: 20px; 
}

.field button 
{ 
    align-self: flex-start; 
}

/* projects */

.tabs 
{ 
    position: relative; 
}

.tabs > input 
{ 
    position: absolute; 
    opacity: 0; 
    pointer-events: none; 
}
 
.tab-labels 
{
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}
 
.tab-labels label 
{
    position: relative;
    font-size: 1.8rem;
    padding: 8px 16px;
    cursor: pointer;
}
 

.tab-labels label::after 
{
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 100%;
    height: 3px;
    background: var(--sand);
    border-radius: 5px;
    transform: scaleX(0);
    transition: transform 1s;
}
 
.tab-labels label:hover::after,
#tab-appr:checked ~ .tab-labels label[for="tab-appr"]::after,
#tab-wede:checked ~ .tab-labels label[for="tab-wede"]::after,
#tab-ebsy:checked ~ .tab-labels label[for="tab-ebsy"]::after 
{ 
    transform: scaleX(1); 
}
 
#tab-appr:focus-visible ~ .tab-labels label[for="tab-appr"],
#tab-wede:focus-visible ~ .tab-labels label[for="tab-wede"],
#tab-ebsy:focus-visible ~ .tab-labels label[for="tab-ebsy"] 
{ 
    outline: 2px solid var(--sand); 
    outline-offset: 4px; 
}
 
.panels 
{ 
    display: grid; 
}
 
.panel 
{
    grid-area: 1 / 1;
    align-self: start;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 30px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity .5s, transform .5s, visibility .5s;
}
 
#tab-appr:checked ~ .panels #panel-appr,
#tab-wede:checked ~ .panels #panel-wede,
#tab-ebsy:checked ~ .panels #panel-ebsy 
{
    opacity: 1;
    visibility: visible;
    transform: none;
}
 
.panel-images 
{ 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
}

.panel-images img 
{
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 6px;
}

/* home */

.portrait img 
{ 
    width: 100%; 
    height: auto; 
    border-radius: 6px; 
}

/* small screen / reduce motion */

@media (max-width: 800px) 
{
    .two-col { grid-template-columns: 1fr; }
    .panel   { grid-template-columns: 1fr; }
}
 
@media (prefers-reduced-motion: reduce) 
{
    * { transition: none !important; }
}